@relu-interactives/spatial-ecs
@relu-interactives/spatial-ecs / components / ColliderState
Type Alias: ColliderState
ts
type ColliderState = {
enabled: boolean;
shape: ColliderShape;
offsetPosition: {
x: number;
y: number;
z: number;
};
offsetRotation: {
x: number;
y: number;
z: number;
};
size: {
x: number;
y: number;
z: number;
};
radius: number;
height: number;
restitution: number;
friction: number;
isSensor: boolean;
};Defined in: components/Physics.ts:91
Authoring state for the collider half of PhysicsComponent. Only the size fields relevant to ColliderState.shape are read at simulation time.
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
enabled | boolean | When false, the collider is removed from physics simulation but kept in state. | components/Physics.ts:93 |
shape | ColliderShape | Collider primitive shape. | components/Physics.ts:95 |
offsetPosition | { x: number; y: number; z: number; } | Local offset of the collider relative to the entity's transform, in world units. | components/Physics.ts:97 |
offsetPosition.x | number | Offset along local X. | components/Physics.ts:99 |
offsetPosition.y | number | Offset along local Y. | components/Physics.ts:101 |
offsetPosition.z | number | Offset along local Z. | components/Physics.ts:103 |
offsetRotation | { x: number; y: number; z: number; } | Local rotation offset in radians (Euler XYZ). | components/Physics.ts:106 |
offsetRotation.x | number | Rotation around local X (radians). | components/Physics.ts:108 |
offsetRotation.y | number | Rotation around local Y (radians). | components/Physics.ts:110 |
offsetRotation.z | number | Rotation around local Z (radians). | components/Physics.ts:112 |
size | { x: number; y: number; z: number; } | Half-extents for cuboid shape, in world units. | components/Physics.ts:115 |
size.x | number | Half-extent along X. | components/Physics.ts:117 |
size.y | number | Half-extent along Y. | components/Physics.ts:119 |
size.z | number | Half-extent along Z. | components/Physics.ts:121 |
radius | number | Radius for ball, capsule, and cylinder shapes. | components/Physics.ts:124 |
height | number | Height for capsule (segment length between caps) and cylinder. | components/Physics.ts:126 |
restitution | number | Bounciness in [0, 1]. 0 is no bounce; 1 is perfectly elastic. | components/Physics.ts:128 |
friction | number | Surface friction coefficient. 0 is frictionless. | components/Physics.ts:130 |
isSensor | boolean | When true, the collider reports overlaps but does not generate contact responses. | components/Physics.ts:132 |

