Class: MapColliderUtils
Defined in: src/sdk/components/map/colliders/MapColliderUtils.ts:9
A utility class for working with map colliders.
Constructors
Constructor
new MapColliderUtils():
MapColliderUtils
Returns
MapColliderUtils
Methods
aabb2Intersection()
staticaabb2Intersection(b1x1,b1y1,b1x2,b1y2,b2x1,b2y1,b2x2,b2y2):boolean
Defined in: src/sdk/components/map/colliders/MapColliderUtils.ts:55
Tests whether two axis-aligned bounding boxes (AABB) intersect. AABBs are rectangles whose horizontal and vertical axes are aligned with the x and y axes, respectively.
Parameters
| Parameter | Type | Description |
|---|---|---|
b1x1 | number | The x coordinate of the first box's minimum-x edge. |
b1y1 | number | The y coordinate of the first box's minimum-y edge. |
b1x2 | number | The x coordinate of the first box's maximum-x edge. |
b1y2 | number | The y coordinate of the first box's maximum-y edge. |
b2x1 | number | The x coordinate of the second box's minimum-x edge. |
b2y1 | number | The y coordinate of the second box's minimum-y edge. |
b2x2 | number | The x coordinate of the second box's maximum-x edge. |
b2y2 | number | The y coordinate of the second box's maximum-y edge. |
Returns
boolean
Whether the two axis-aligned bounding boxes (AABB) intersect.
aabbCircleIntersection()
staticaabbCircleIntersection(bx1,by1,bx2,by2,cx,cy,cRadius):boolean
Defined in: src/sdk/components/map/colliders/MapColliderUtils.ts:70
Tests whether an axis-aligned bounding box (AABB) intersects a circle.
Parameters
| Parameter | Type | Description |
|---|---|---|
bx1 | number | The x coordinate of the box's minimum-x edge. |
by1 | number | The y coordinate of the box's minimum-y edge. |
bx2 | number | The x coordinate of the box's maximum-x edge. |
by2 | number | The y coordinate of the box's maximum-y edge. |
cx | number | The x coordinate of the center of the circle. |
cy | number | The y coordinate of the center of the circle. |
cRadius | number | The radius of the circle. |
Returns
boolean
Whether the specified axis-aligned bounding box (AABB) and circle intersect.
circle2Intersection()
staticcircle2Intersection(c1x,c1y,c1Radius,c2x,c2y,c2Radius):boolean
Defined in: src/sdk/components/map/colliders/MapColliderUtils.ts:38
Tests whether two circles intersect.
Parameters
| Parameter | Type | Description |
|---|---|---|
c1x | number | The x coordinate of the center of the first circle. |
c1y | number | The y coordinate of the center of the first circle. |
c1Radius | number | The radius of the first circle. |
c2x | number | The x coordinate of the center of the second circle. |
c2y | number | The x coordinate of the center of the second circle. |
c2Radius | number | The radius of the second circle. |
Returns
boolean
Whether the two specified circles intersect.
isCollider()
staticisCollider(query):query is MapCollider
Defined in: src/sdk/components/map/colliders/MapColliderUtils.ts:15
Checks whether a query value is a MapCollider.
Parameters
| Parameter | Type | Description |
|---|---|---|
query | unknown | The query value to check. |
Returns
query is MapCollider
Whether the specified query value is a MapCollider.
isIndexedCollider()
staticisIndexedCollider(query):query is MapIndexedCollider
Defined in: src/sdk/components/map/colliders/MapColliderUtils.ts:24
Checks whether a query value is a MapIndexedCollider.
Parameters
| Parameter | Type | Description |
|---|---|---|
query | unknown | The query value to check. |
Returns
query is MapIndexedCollider
Whether the specified query value is a MapCollider.
obb2Intersection()
staticobb2Intersection(b1x,b1y,b1AxisX,b1AxisY,b1HalfWidth,b1HalfHeight,b2x,b2y,b2AxisX,b2AxisY,b2HalfWidth,b2HalfHeight):boolean
Defined in: src/sdk/components/map/colliders/MapColliderUtils.ts:125
Tests whether two oriented bounding boxes (OBB) intersect. OBBs are rectangles whose horizontal and vertical axes have arbitrary orientations relative to the x and y axes.
Parameters
| Parameter | Type | Description |
|---|---|---|
b1x | number | The x coordinate of the center of the first box. |
b1y | number | The y coordinate of the center of the first box. |
b1AxisX | number | The x component of the unit vector parallel to the axis that defines the first box's width. |
b1AxisY | number | The y component of the unit vector parallel to the axis that defines the first box's width. |
b1HalfWidth | number | The half width of the first box. |
b1HalfHeight | number | The half height of the first box. |
b2x | number | The x coordinate of the center of the second box. |
b2y | number | The y coordinate of the center of the second box. |
b2AxisX | number | The x component of the unit vector parallel to the axis that defines the second box's width. |
b2AxisY | number | The y component of the unit vector parallel to the axis that defines the second box's width. |
b2HalfWidth | number | The half width of the second box. |
b2HalfHeight | number | The half height of the second box. |
Returns
boolean
Whether the two oriented bounding boxes (OBB) intersect.
obbCircleIntersection()
staticobbCircleIntersection(bx,by,bAxisX,bAxisY,bHalfWidth,bHalfHeight,cx,cy,cRadius):boolean
Defined in: src/sdk/components/map/colliders/MapColliderUtils.ts:212
Tests whether an oriented bounding box (OBB) intersects a circle.
Parameters
| Parameter | Type | Description |
|---|---|---|
bx | number | The x coordinate of the center of the box. |
by | number | The y coordinate of the center of the box. |
bAxisX | number | The x component of the unit vector parallel to the axis that defines the box's width. |
bAxisY | number | The y component of the unit vector parallel to the axis that defines the box's width. |
bHalfWidth | number | The half width of the box. |
bHalfHeight | number | The half height of the box. |
cx | number | The x coordinate of the center of the circle. |
cy | number | The y coordinate of the center of the circle. |
cRadius | number | The radius of the circle. |
Returns
boolean
Whether the specified oriented bounding box (OBB) and circle intersect.