AbstractColliderComponent

AbstractColliderComponent

Adds a physics collider to the entity. If the entity or any of its ancestors have a {RigidBodyComponent}, the collider is added to the physics world.

Constructor

new AbstractColliderComponent(settingsopt)

Parameters:
Name Type Attributes Description
settings Object <optional>
Properties
Name Type Attributes Default Description
collider Collider <optional>
isTrigger boolean <optional>
false

Members

bodyEntity :Entity

The entity with a rigid body component that instantiated the collider, or null if it wasn't instantiated.

collider :Collider

isTrigger :boolean

If the collider is a Trigger, it does not interact with other objects, but it does emit contact events.

material :PhysicsMaterial

The collider material.

worldCollider :Collider

The world-scaled version of the collider. Use .updateWorldCollider() to update it.

Methods

getBodyEntity() → {Entity}

Get the closest parent (or self) entity that has a RigidBodyComponent. Returns undefined if none was found.

updateWorldCollider()

Updates the .worldCollider