Skip to main content

Interface: MapCollider

Defined in: src/sdk/components/map/colliders/MapCollider.ts:6

A map element that supports collision detection against simple shapes.

Extended by

Properties

isMapCollider

readonly isMapCollider: true

Defined in: src/sdk/components/map/colliders/MapCollider.ts:8

Flags this object as a MapCollider.

Methods

destroy()

destroy(): void

Defined in: src/sdk/components/map/colliders/MapCollider.ts:40

Destroys this collider.

Returns

void


getPriority()

getPriority(): number

Defined in: src/sdk/components/map/colliders/MapCollider.ts:14

Gets this collider's priority.

Returns

number

This collider's priority.


intersectsBox()

intersectsBox(cx, cy, axisX, axisY, halfWidth, halfHeight, mapProjection): boolean

Defined in: src/sdk/components/map/colliders/MapCollider.ts:26

Tests whether this collider intersects an oriented rectangular box.

Parameters

ParameterTypeDescription
cxnumberThe x coordinate of the center of the box.
cynumberThe y coordinate of the center of the box.
axisXnumberThe x component of the unit vector parallel to the axis that defines the box's width.
axisYnumberThe y component of the unit vector parallel to the axis that defines the box's width.
halfWidthnumberThe half width of the box.
halfHeightnumberThe half height of the box.
mapProjectionMapProjection-

Returns

boolean

Whether this collider intersects the specified oriented rectangular box.


intersectsCircle()

intersectsCircle(cx, cy, radius, mapProjection): boolean

Defined in: src/sdk/components/map/colliders/MapCollider.ts:35

Tests whether this collider intersects a circle.

Parameters

ParameterTypeDescription
cxnumberThe x coordinate of the center of the circle.
cynumberThe y coordinate of the center of the circle.
radiusnumberThe radius of the circle.
mapProjectionMapProjection-

Returns

boolean

Whether this collider intersects the specified circle.