Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Collider

A geometric entity that can be attached to a body so it can be affected by contacts and proximity queries. A geometric entity that can be attached to a body so it can be affected by contacts and proximity queries.

Hierarchy

  • Collider

Index

Constructors

constructor

  • Parameters

    Returns Collider

  • Parameters

    Returns Collider

Properties

Readonly handle

Private rawSet

rawSet: any

Methods

activeCollisionTypes

  • Gets the collision types active for this collider.

    Returns ActiveCollisionTypes

  • Gets the collision types active for this collider.

    Returns ActiveCollisionTypes

activeEvents

  • The events active for this collider.

    Returns ActiveEvents

  • The events active for this collider.

    Returns ActiveEvents

activeHooks

  • activeHooks(): void
  • activeHooks(): void
  • Get the physics hooks active for this collider.

    Returns void

  • Get the physics hooks active for this collider.

    Returns void

collisionGroups

  • The collision groups of this collider.

    Returns InteractionGroups

  • The collision groups of this collider.

    Returns InteractionGroups

density

  • density(): number
  • density(): number
  • The density of this collider.

    Returns number

  • The density of this collider.

    Returns number

friction

  • friction(): number
  • friction(): number
  • The friction coefficient of this collider.

    Returns number

  • The friction coefficient of this collider.

    Returns number

frictionCombineRule

  • Gets the rule used to combine the friction coefficients of two colliders colliders involved in a contact.

    Returns CoefficientCombineRule

  • Gets the rule used to combine the friction coefficients of two colliders colliders involved in a contact.

    Returns CoefficientCombineRule

halfExtents

  • The half-extents of this collider if it is a cuboid shape.

    Returns Vector

  • The half-extents of this collider if it is a cuboid shape.

    Returns Vector

halfHeight

  • halfHeight(): number
  • halfHeight(): number
  • The half height of this collider if it is a cylinder, capsule, or cone shape.

    Returns number

  • The half height of this collider if it is a cylinder, capsule, or cone shape.

    Returns number

heightfieldHeights

  • heightfieldHeights(): Float32Array
  • heightfieldHeights(): Float32Array
  • If this collider has a heightfield shape, this returns the heights buffer of the heightfield. In 3D, the returned height matrix is provided in column-major order.

    Returns Float32Array

  • If this collider has a heightfield shape, this returns the heights buffer of the heightfield. In 3D, the returned height matrix is provided in column-major order.

    Returns Float32Array

heightfieldNCols

  • heightfieldNCols(): number
  • heightfieldNCols(): number
  • If this collider has a heightfield shape, this returns the number of columns of its height matrix.

    Returns number

  • If this collider has a heightfield shape, this returns the number of columns of its height matrix.

    Returns number

heightfieldNRows

  • heightfieldNRows(): number
  • heightfieldNRows(): number
  • If this collider has a heightfield shape, this returns the number of rows of its height matrix.

    Returns number

  • If this collider has a heightfield shape, this returns the number of rows of its height matrix.

    Returns number

heightfieldScale

  • If this collider has a heightfield shape, this returns the scale applied to it.

    Returns Vector

  • If this collider has a heightfield shape, this returns the scale applied to it.

    Returns Vector

indices

  • indices(): Uint32Array
  • indices(): Uint32Array
  • If this collider has a triangle mesh, polyline, or convex polyhedron shape, this returns the index buffer of said shape.

    Returns Uint32Array

  • If this collider has a triangle mesh, polyline, or convex polyhedron shape, this returns the index buffer of said shape.

    Returns Uint32Array

isSensor

  • isSensor(): boolean
  • isSensor(): boolean
  • Is this collider a sensor?

    Returns boolean

  • Is this collider a sensor?

    Returns boolean

isValid

  • isValid(): boolean
  • isValid(): boolean
  • Checks if this collider is still valid (i.e. that it has not been deleted from the collider set yet.

    Returns boolean

  • Checks if this collider is still valid (i.e. that it has not been deleted from the collider set yet.

    Returns boolean

parent

  • The unique integer identifier of the rigid-body this collider is attached to.

    Returns RigidBodyHandle

  • The unique integer identifier of the rigid-body this collider is attached to.

    Returns RigidBodyHandle

radius

  • radius(): number
  • radius(): number
  • The radius of this collider if it is a ball, cylinder, capsule, or cone shape.

    Returns number

  • The radius of this collider if it is a ball, cylinder, capsule, or cone shape.

    Returns number

restitutionCombineRule

  • Gets the rule used to combine the restitution coefficients of two colliders colliders involved in a contact.

    Returns CoefficientCombineRule

  • Gets the rule used to combine the restitution coefficients of two colliders colliders involved in a contact.

    Returns CoefficientCombineRule

rotation

  • The world-space orientation of this rigid-body.

    Returns Rotation

  • The world-space orientation of this rigid-body.

    Returns Rotation

roundRadius

  • roundRadius(): number
  • roundRadius(): number
  • The radius of the round edges of this collider if it is a round cylinder.

    Returns number

  • The radius of the round edges of this collider if it is a round cylinder.

    Returns number

setActiveCollisionTypes

  • Set the collision types active for this collider.

    Parameters

    • activeCollisionTypes: ActiveCollisionTypes

      The hooks active for contact/intersection pairs involving this collider.

    Returns void

  • Set the collision types active for this collider.

    Parameters

    • activeCollisionTypes: ActiveCollisionTypes

      The hooks active for contact/intersection pairs involving this collider.

    Returns void

setActiveEvents

  • Set the events active for this collider.

    Use this to enable contact and/or intersection event reporting for this collider.

    Parameters

    • activeEvents: ActiveEvents

      The events active for contact/intersection pairs involving this collider.

    Returns void

  • Set the events active for this collider.

    Use this to enable contact and/or intersection event reporting for this collider.

    Parameters

    • activeEvents: ActiveEvents

      The events active for contact/intersection pairs involving this collider.

    Returns void

setActiveHooks

  • Set the physics hooks active for this collider.

    Use this to enable custom filtering rules for contact/intersecstion pairs involving this collider.

    Parameters

    • activeHooks: ActiveHooks

      The hooks active for contact/intersection pairs involving this collider.

    Returns void

  • Set the physics hooks active for this collider.

    Use this to enable custom filtering rules for contact/intersecstion pairs involving this collider.

    Parameters

    • activeHooks: ActiveHooks

      The hooks active for contact/intersection pairs involving this collider.

    Returns void

setCollisionGroups

  • Sets the collision groups used by this collider.

    Two colliders will interact iff. their collision groups are compatible. See the documentation of InteractionGroups for details on teh used bit pattern.

    Parameters

    Returns void

  • Sets the collision groups used by this collider.

    Two colliders will interact iff. their collision groups are compatible. See the documentation of InteractionGroups for details on teh used bit pattern.

    Parameters

    Returns void

setFriction

  • setFriction(friction: number): void
  • setFriction(friction: number): void
  • Sets the friction coefficient of the collider to be created.

    Parameters

    • friction: number

      The friction coefficient. Must be greater or equal to 0. This is generally smaller than 1. The higher the coefficient, the stronger friction forces will be for contacts with the collider being built.

    Returns void

  • Sets the friction coefficient of the collider to be created.

    Parameters

    • friction: number

      The friction coefficient. Must be greater or equal to 0. This is generally smaller than 1. The higher the coefficient, the stronger friction forces will be for contacts with the collider being built.

    Returns void

setFrictionCombineRule

  • Sets the rule used to combine the friction coefficients of two colliders colliders involved in a contact.

    Parameters

    Returns void

  • Sets the rule used to combine the friction coefficients of two colliders colliders involved in a contact.

    Parameters

    Returns void

setRestitution

  • setRestitution(restitution: number): void
  • setRestitution(restitution: number): void
  • Sets the restitution coefficient of the collider to be created.

    Parameters

    • restitution: number

      The restitution coefficient in [0, 1]. A value of 0 (the default) means no bouncing behavior while 1 means perfect bouncing (though energy may still be lost due to numerical errors of the constraints solver).

    Returns void

  • Sets the restitution coefficient of the collider to be created.

    Parameters

    • restitution: number

      The restitution coefficient in [0, 1]. A value of 0 (the default) means no bouncing behavior while 1 means perfect bouncing (though energy may still be lost due to numerical errors of the constraints solver).

    Returns void

setRestitutionCombineRule

  • Sets the rule used to combine the restitution coefficients of two colliders colliders involved in a contact.

    Parameters

    Returns void

  • Sets the rule used to combine the restitution coefficients of two colliders colliders involved in a contact.

    Parameters

    Returns void

setRotation

  • Sets the rotation quaternion of this collider.

    This does nothing if a zero quaternion is provided.

    Parameters

    Returns void

  • Sets the rotation quaternion of this collider.

    This does nothing if a zero quaternion is provided.

    Parameters

    Returns void

setRotationWrtParent

  • setRotationWrtParent(rot: Rotation): void
  • setRotationWrtParent(rot: Rotation): void
  • Sets the rotation quaternion of this collider relative to its parent rigid-body.

    This does nothing if a zero quaternion is provided or if this collider isn't attached to a rigid-body.

    Parameters

    Returns void

  • Sets the rotation quaternion of this collider relative to its parent rigid-body.

    This does nothing if a zero quaternion is provided or if this collider isn't attached to a rigid-body.

    Parameters

    Returns void

setSensor

  • setSensor(isSensor: boolean): void
  • setSensor(isSensor: boolean): void
  • Parameters

    • isSensor: boolean

    Returns void

  • Parameters

    • isSensor: boolean

    Returns void

setShape

  • setShape(shape: Shape): void
  • setShape(shape: Shape): void
  • Parameters

    Returns void

  • Parameters

    Returns void

setSolverGroups

  • Sets the solver groups used by this collider.

    Forces between two colliders in contact will be computed iff their solver groups are compatible. See the documentation of InteractionGroups for details on the used bit pattern.

    Parameters

    Returns void

  • Sets the solver groups used by this collider.

    Forces between two colliders in contact will be computed iff their solver groups are compatible. See the documentation of InteractionGroups for details on the used bit pattern.

    Parameters

    Returns void

setTranslation

  • setTranslation(tra: Vector): void
  • setTranslation(tra: Vector): void
  • Sets the translation of this collider.

    Parameters

    • tra: Vector

      The world-space position of the collider.

    Returns void

  • Sets the translation of this collider.

    Parameters

    • tra: Vector

      The world-space position of the collider.

    Returns void

setTranslationWrtParent

  • setTranslationWrtParent(tra: Vector): void
  • setTranslationWrtParent(tra: Vector): void
  • Sets the translation of this collider relative to its parent rigid-body.

    Does nothing if this collider isn't attached to a rigid-body.

    Parameters

    • tra: Vector

      The new translation of the collider relative to its parent.

    Returns void

  • Sets the translation of this collider relative to its parent rigid-body.

    Does nothing if this collider isn't attached to a rigid-body.

    Parameters

    • tra: Vector

      The new translation of the collider relative to its parent.

    Returns void

shapeType

  • The type of the shape of this collider.

    Returns ShapeType

  • The type of the shape of this collider.

    Returns ShapeType

solverGroups

  • The solver groups of this collider.

    Returns InteractionGroups

  • The solver groups of this collider.

    Returns InteractionGroups

translation

  • The world-space translation of this rigid-body.

    Returns Vector

  • The world-space translation of this rigid-body.

    Returns Vector

vertices

  • vertices(): Float32Array
  • vertices(): Float32Array
  • If this collider has a triangle mesh, polyline, convex polygon, or convex polyhedron shape, this returns the vertex buffer of said shape.

    Returns Float32Array

  • If this collider has a triangle mesh, polyline, convex polygon, or convex polyhedron shape, this returns the vertex buffer of said shape.

    Returns Float32Array

Generated using TypeDoc