# Class ColliderDesc

- Defined in geometry/collider.d.ts:533

#####
Index

### Constructors

constructor

### Properties

activeCollisionTypes
activeEvents
activeHooks
centerOfMass
collisionGroups
contactForceEventThreshold
contactSkin
density
enabled
friction
frictionCombineRule
isSensor
mass
massPropsMode
principalAngularInertia
restitution
restitutionCombineRule
rotation
rotationsEnabled
shape
solverGroups
translation

### Methods

setActiveCollisionTypes
setActiveEvents
setActiveHooks
setCollisionGroups
setContactForceEventThreshold
setContactSkin
setDensity
setEnabled
setFriction
setFrictionCombineRule
setMass
setMassProperties
setRestitution
setRestitutionCombineRule
setRotation
setSensor
setSolverGroups
setTranslation
ball
capsule
convexHull
convexPolyline
cuboid
halfspace
heightfield
polyline
roundConvexHull
roundConvexPolyline
roundCuboid
roundTriangle
segment
triangle
trimesh
voxels

## Constructors

### constructor

- new ColliderDesc(shape): ColliderDesc

- Initializes a collider descriptor from the collision shape.

  #### Parameters

  - shape: Shape

    The shape of the collider being built.

  #### Returns ColliderDesc

  - Defined in geometry/collider.d.ts:561

## Properties

### activeCollisionTypes

activeCollisionTypes: ActiveCollisionTypes

- Defined in geometry/collider.d.ts:553

### activeEvents

activeEvents: ActiveEvents

- Defined in geometry/collider.d.ts:551

### activeHooks

activeHooks: ActiveHooks

- Defined in geometry/collider.d.ts:552

### centerOfMass

centerOfMass: Vector

- Defined in geometry/collider.d.ts:538

### collisionGroups

collisionGroups: number

- Defined in geometry/collider.d.ts:547

### contactForceEventThreshold

contactForceEventThreshold: number

- Defined in geometry/collider.d.ts:554

### contactSkin

contactSkin: number

- Defined in geometry/collider.d.ts:555

### density

density: number

- Defined in geometry/collider.d.ts:541

### enabled

enabled: boolean

- Defined in geometry/collider.d.ts:534

### friction

friction: number

- Defined in geometry/collider.d.ts:542

### frictionCombineRule

frictionCombineRule: CoefficientCombineRule

- Defined in geometry/collider.d.ts:549

### isSensor

isSensor: boolean

- Defined in geometry/collider.d.ts:546

### mass

mass: number

- Defined in geometry/collider.d.ts:537

### massPropsMode

massPropsMode: MassPropsMode

- Defined in geometry/collider.d.ts:536

### principalAngularInertia

principalAngularInertia: number

- Defined in geometry/collider.d.ts:539

### restitution

restitution: number

- Defined in geometry/collider.d.ts:543

### restitutionCombineRule

restitutionCombineRule: CoefficientCombineRule

- Defined in geometry/collider.d.ts:550

### rotation

rotation: number

- Defined in geometry/collider.d.ts:544

### rotationsEnabled

rotationsEnabled: boolean

- Defined in geometry/collider.d.ts:540

### shape

shape: Shape

- Defined in geometry/collider.d.ts:535

### solverGroups

solverGroups: number

- Defined in geometry/collider.d.ts:548

### translation

translation: Vector

- Defined in geometry/collider.d.ts:545

## Methods

### setActiveCollisionTypes

- setActiveCollisionTypes(activeCollisionTypes): ColliderDesc

- Set the collision types active for this collider.

  #### Parameters

  - activeCollisionTypes: ActiveCollisionTypes

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

  #### Returns ColliderDesc

  - Defined in geometry/collider.d.ts:821

### setActiveEvents

- setActiveEvents(activeEvents): ColliderDesc

- 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 ColliderDesc

  - Defined in geometry/collider.d.ts:815

### setActiveHooks

- setActiveHooks(activeHooks): ColliderDesc

- 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 ColliderDesc

  - Defined in geometry/collider.d.ts:807

### setCollisionGroups

- setCollisionGroups(groups): ColliderDesc

- 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

  - groups: number

    The collision groups used for the collider being built.

  #### Returns ColliderDesc

  - Defined in geometry/collider.d.ts:789

### setContactForceEventThreshold

- setContactForceEventThreshold(threshold): ColliderDesc

- Sets the total force magnitude beyond which a contact force event can be emitted.

  #### Parameters

  - threshold: number

    The force threshold to set.

  #### Returns ColliderDesc

  - Defined in geometry/collider.d.ts:827

### setContactSkin

- setContactSkin(thickness): ColliderDesc

- Sets the contact skin of the collider.

  The contact skin acts as if the collider was enlarged with a skin of width `skin_thickness` around it, keeping objects further apart when colliding.

  A non-zero contact skin can increase performance, and in some cases, stability. However it creates a small gap between colliding object (equal to the sum of their skin). If the skin is sufficiently small, this might not be visually significant or can be hidden by the rendering assets.

  #### Parameters

  - thickness: number

  #### Returns ColliderDesc

  - Defined in geometry/collider.d.ts:722

### setDensity

- setDensity(density): ColliderDesc

- Sets the density of the collider being built.

  The mass and angular inertia tensor will be computed automatically based on this density and the collider’s shape.

  #### Parameters

  - density: number

    The density to set, must be greater or equal to 0. A density of 0 means that this collider will not affect the mass or angular inertia of the rigid-body it is attached to.

  #### Returns ColliderDesc

  - Defined in geometry/collider.d.ts:731

### setEnabled

- setEnabled(enabled): ColliderDesc

- Sets whether the created collider will be enabled or disabled.

  #### Parameters

  - enabled: boolean

    − If set to `false` the collider will be disabled at creation.

  #### Returns ColliderDesc

  - Defined in geometry/collider.d.ts:710

### setFriction

- setFriction(friction): ColliderDesc

- 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 ColliderDesc

  - Defined in geometry/collider.d.ts:766

### setFrictionCombineRule

- setFrictionCombineRule(rule): ColliderDesc

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

  #### Parameters

  - rule: CoefficientCombineRule

    − The combine rule to apply.

  #### Returns ColliderDesc

  - Defined in geometry/collider.d.ts:773

### setMass

- setMass(mass): ColliderDesc

- Sets the mass of the collider being built.

  The angular inertia tensor will be computed automatically based on this mass and the collider’s shape.

  #### Parameters

  - mass: number

    The mass to set, must be greater or equal to 0.

  #### Returns ColliderDesc

  - Defined in geometry/collider.d.ts:739

### setMassProperties

- setMassProperties(mass, centerOfMass, principalAngularInertia): ColliderDesc

- Sets the mass properties of the collider being built.

  This replaces the mass-properties automatically computed from the collider's density and shape. These mass-properties will be added to the mass-properties of the rigid-body this collider will be attached to.

  #### Parameters

  - mass: number

    − The mass of the collider to create.

  - centerOfMass: Vector

    − The center-of-mass of the collider to create.

  - principalAngularInertia: number

    − The principal angular inertia of the collider to create.

  #### Returns ColliderDesc

  - Defined in geometry/collider.d.ts:750

### setRestitution

- setRestitution(restitution): ColliderDesc

- 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 ColliderDesc

  - Defined in geometry/collider.d.ts:758

### setRestitutionCombineRule

- setRestitutionCombineRule(rule): ColliderDesc

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

  #### Parameters

  - rule: CoefficientCombineRule

    − The combine rule to apply.

  #### Returns ColliderDesc

  - Defined in geometry/collider.d.ts:780

### setRotation

- setRotation(rot): ColliderDesc

- Sets the rotation of the collider to be created relative to the rigid-body it is attached to.

  #### Parameters

  - rot: number

    The rotation of the collider to be created relative to the rigid-body it is attached to.

  #### Returns ColliderDesc

  - Defined in geometry/collider.d.ts:696

### setSensor

- setSensor(sensor): ColliderDesc

- Sets whether or not the collider being created is a sensor.

  A sensor collider does not take part of the physics simulation, but generates proximity events.

  #### Parameters

  - sensor: boolean

    Set to `true` of the collider built is to be a sensor.

  #### Returns ColliderDesc

  - Defined in geometry/collider.d.ts:705

### setSolverGroups

- setSolverGroups(groups): ColliderDesc

- 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

  - groups: number

    The solver groups used for the collider being built.

  #### Returns ColliderDesc

  - Defined in geometry/collider.d.ts:799

### setTranslation

- setTranslation(x, y): ColliderDesc

- Sets the position of the collider to be created relative to the rigid-body it is attached to.

  #### Parameters

  - x: number
  - y: number

  #### Returns ColliderDesc

  - Defined in geometry/collider.d.ts:690

### `Static` ball

- ball(radius): ColliderDesc

- Create a new collider descriptor with a ball shape.

  #### Parameters

  - radius: number

    The radius of the ball.

  #### Returns ColliderDesc

  - Defined in geometry/collider.d.ts:567

### `Static` capsule

- capsule(halfHeight, radius): ColliderDesc

- Create a new collider descriptor with a capsule shape.

  #### Parameters

  - halfHeight: number

    The half-height of the capsule, along the `y` axis.

  - radius: number

    The radius of the capsule basis.

  #### Returns ColliderDesc

  - Defined in geometry/collider.d.ts:574

### `Static` convexHull

- convexHull(points): ColliderDesc

- Computes the convex-hull of the given points and use the resulting convex polygon as the shape for this new collider descriptor.

  #### Parameters

  - points: Float32Array

    The point that will be used to compute the convex-hull.

  #### Returns ColliderDesc

  - Defined in geometry/collider.d.ts:662

### `Static` convexPolyline

- convexPolyline(vertices): ColliderDesc

- Creates a new collider descriptor that uses the given set of points assumed to form a convex polyline (no convex-hull computation will be done).

  #### Parameters

  - vertices: Float32Array

    The vertices of the convex polyline.

  #### Returns ColliderDesc

  - Defined in geometry/collider.d.ts:669

### `Static` cuboid

- cuboid(hx, hy): ColliderDesc

- Creates a new collider descriptor with a rectangular shape.

  #### Parameters

  - hx: number

    The half-width of the rectangle along its local `x` axis.

  - hy: number

    The half-width of the rectangle along its local `y` axis.

  #### Returns ColliderDesc

  - Defined in geometry/collider.d.ts:634

### `Static` halfspace

- halfspace(normal): ColliderDesc

- Creates a new collider description with a halfspace (infinite plane) shape.

  #### Parameters

  - normal: Vector

    The outward normal of the plane.

  #### Returns ColliderDesc

  - Defined in geometry/collider.d.ts:648

### `Static` heightfield

- heightfield(heights, scale): ColliderDesc

- Creates a new collider descriptor with a heightfield shape.

  #### Parameters

  - heights: Float32Array

    The heights of the heightfield, along its local `y` axis.

  - scale: Vector

    The scale factor applied to the heightfield.

  #### Returns ColliderDesc

  - Defined in geometry/collider.d.ts:655

### `Static` polyline

- polyline(vertices, indices?): ColliderDesc

- Creates a new collider descriptor with a polyline shape.

  #### Parameters

  - vertices: Float32Array

    The coordinates of the polyline's vertices.

  - `Optional` indices: Uint32Array

    The indices of the polyline's segments. If this is `undefined` or `null`, the vertices are assumed to describe a line strip.

  #### Returns ColliderDesc

  - Defined in geometry/collider.d.ts:607

### `Static` roundConvexHull

- roundConvexHull(points, borderRadius): ColliderDesc

- Computes the convex-hull of the given points and use the resulting convex polygon as the shape for this new collider descriptor. A border is added to that convex polygon to give it round corners.

  #### Parameters

  - points: Float32Array

    The point that will be used to compute the convex-hull.

  - borderRadius: number

    The radius of the round border added to the convex polygon.

  #### Returns ColliderDesc

  - Defined in geometry/collider.d.ts:678

### `Static` roundConvexPolyline

- roundConvexPolyline(vertices, borderRadius): ColliderDesc

- Creates a new collider descriptor that uses the given set of points assumed to form a round convex polyline (no convex-hull computation will be done).

  #### Parameters

  - vertices: Float32Array

    The vertices of the convex polyline.

  - borderRadius: number

    The radius of the round border added to the convex polyline.

  #### Returns ColliderDesc

  - Defined in geometry/collider.d.ts:686

### `Static` roundCuboid

- roundCuboid(hx, hy, borderRadius): ColliderDesc

- Creates a new collider descriptor with a rectangular shape with round borders.

  #### Parameters

  - hx: number

    The half-width of the rectangle along its local `x` axis.

  - hy: number

    The half-width of the rectangle along its local `y` axis.

  - borderRadius: number

    The radius of the cuboid's borders.

  #### Returns ColliderDesc

  - Defined in geometry/collider.d.ts:642

### `Static` roundTriangle

- roundTriangle(a, b, c, borderRadius): ColliderDesc

- Creates a new triangle shape with round corners.

  #### Parameters

  - a: Vector

    The first point of the triangle.

  - b: Vector

    The second point of the triangle.

  - c: Vector

    The third point of the triangle.

  - borderRadius: number

    The radius of the borders of this triangle. In 3D, this is also equal to half the thickness of the triangle.

  #### Returns ColliderDesc

  - Defined in geometry/collider.d.ts:599

### `Static` segment

- segment(a, b): ColliderDesc

- Creates a new segment shape.

  #### Parameters

  - a: Vector

    The first point of the segment.

  - b: Vector

    The second point of the segment.

  #### Returns ColliderDesc

  - Defined in geometry/collider.d.ts:581

### `Static` triangle

- triangle(a, b, c): ColliderDesc

- Creates a new triangle shape.

  #### Parameters

  - a: Vector

    The first point of the triangle.

  - b: Vector

    The second point of the triangle.

  - c: Vector

    The third point of the triangle.

  #### Returns ColliderDesc

  - Defined in geometry/collider.d.ts:589

### `Static` trimesh

- trimesh(vertices, indices, flags?): ColliderDesc

- Creates a new collider descriptor with a triangle mesh shape.

  #### Parameters

  - vertices: Float32Array

    The coordinates of the triangle mesh's vertices.

  - indices: Uint32Array

    The indices of the triangle mesh's triangles.

  - `Optional` flags: TriMeshFlags

  #### Returns ColliderDesc

  - Defined in geometry/collider.d.ts:627

### `Static` voxels

- voxels(voxels, voxelSize): ColliderDesc

- Creates a new collider descriptor with a shape made of voxels.

  #### Parameters

  - voxels: Int32Array | Float32Array
  - voxelSize: Vector

    The size of each voxel.

  #### Returns ColliderDesc

  - Defined in geometry/collider.d.ts:620