Interface BoxColliderOptions

Configuration object for BoxCollider creation

const boxCollider = new BoxCollider({
width: 16,
height: 16,
rotation: 0,
offset: new Vector2(),
layer: "CollisionLayer",
physics: true,
ignoreCollisionsWithLayer: ["IgnoredLayer"]
});
interface BoxColliderOptions {
    height: number;
    ignoreCollisionsWithLayers: string[];
    layer: string;
    offset: Vector2;
    physics: boolean;
    rotation: number;
    width: number;
}

Properties

height: number

Height of the rectangle

ignoreCollisionsWithLayers: string[]

Ignores collisions with layers in the array

layer: string

Collision layer

offset: Vector2

X-Y axis offset

physics: boolean

TRUE if this collider interact with rigid bodies

rotation: number

Rectangle rotation in radians

width: number

Width of the rectangle