Collider
ecs.Collider
Description
The Collider component defines the physics collision behavior of an entity.
Functions
See component schema.
Schema
Property | Type | Default | Description |
---|---|---|---|
shape | Number | See ColliderShape | |
width | Number | X Size, used by Box and Plane | |
height | Number | Y Size, used by Box, Plane, Capsule, Cone, and Cylinder | |
depth | Number | Z Size, used by Box | |
radius | Number | Used by Sphere, Capsule, Cone, Cylinder | |
mass | Number | 0 | Leave 0 to make static. |
eventOnly | Boolean | false | When enabled, the object will pass through other objects but still dispatch collision events. |
lockXAxis | Boolean | false | Disables rotation on the X axis. |
lockYAxis | Boolean | false | Disables rotation on the Y axis. |
lockZAxis | Boolean | false | Disables rotation on the Z axis. |
friction | Number | 0.5 | Simulate contact friction. |
restitution | Number | 0 | Controls the bounciness of the object. |
linearDamping | Number | 0 | Simulate air friction while moving. |
angularDamping | Number | 0 | Simulate air friction while rotating. |
rollingFriction | Number | 0 | Simulate friction on rolling surfaces. |
spinningFriction | Number | 0 | Simulate friction on surfaces twisting against each other. |
gravityFactor | Number | 1.0 | A factor of world gravity |