collider3d
The node's 3D collision shape, chosen by kind. It belongs to the node's body3d or the nearest body above it; without one it is static geometry.
On this page
3d · physics · 24 properties · 3D
The node's 3D collision shape, chosen by kind. It belongs to the node's body3d or the nearest body above it; without one it is static geometry.
In a scene, collider3d is the node key that applies it. A script reaches each property below as a field on node.collider3d: reading one asks the running component, and assigning one leaves the rest alone. The whole table is node.collider3d.get() and node.collider3d.set(table).
Properties
| property | type | default | description |
|---|---|---|---|
center_of_mass |
vec3 | [0,0,0] |
Where this collider's mass sits, in its own space; read with inertia, and both 0 keep the shape's own |
collision_layer |
flags | ["1"] |
The layers this collider is on One of 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32. |
collision_margin |
float | 0 |
A margin the solver treats as already touching; stops thin shapes tunnelling and jittering At least 0. |
collision_mask |
flags | [] |
The layers it collides with; empty means every layer One of 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32. |
collision_test |
enum | both |
Whether a pair is tested when both colliders' layers accept the other, or when either does; two colliders that differ use both One of both, either. |
contact_force_threshold |
float | 0 |
How hard a contact must be before on_contact_force is called At least 0. |
contact_pairs |
flags | ["dynamic_dynamic","dynamic_kinematic","dynamic_static"] |
Which pairs of body kinds this collider is tested against; a sensor is tested against every kind whatever this says One of dynamic_dynamic, dynamic_kinematic, dynamic_static, kinematic_kinematic, kinematic_static, static_static. |
density |
float | 1 |
Mass per volume, so the shape's size sets its mass; 0 makes a collider that adds no mass to its body At least 0. |
enabled |
bool | true |
Collide at all; a disabled collider keeps its shape and costs nothing |
inertia |
vec3 | [0,0,0] |
This collider's resistance to spin about each axis; 0 with a center_of_mass takes the shape's own about that centre |
inertia_rotation |
vec3 | [0,0,0] |
Turns the axes inertia is measured about, x first; read with a non-zero inertia. Euler radians in the file |
mass |
float | 0 |
Mass in kilograms, overriding what density works out to; 0 keeps the density At least 0. |
offset |
vec3 | [0,0,0] |
Where the shape sits relative to the node |
offset_rotation |
vec3 | [0,0,0] |
How the shape is turned relative to the node, x first; Euler radians in the file |
one_way |
bool | false |
A platform bodies land on from the side one_way_axis names and pass through from the other |
one_way_angle |
float | 0.1 |
How far a contact's normal may lean from one_way_axis and still hold the body; radians in the file Range 0–180. |
one_way_axis |
vec3 | [0,1,0] |
The side a one-way platform holds bodies on, in the collider's own axes: [0, 1, 0] lands them from above and lets them up through from below |
physics_material |
asset · physics_material |
— | What the surface is made of: friction, bounce and how each combines; empty takes a physics_material at its defaults |
sensor |
bool | false |
Detects overlaps without colliding: bodies pass through and are reported |
shape |
variant | {"edge_radius":0,"kind":"box","size":[1,1,1]} |
The collision shape, and the dimensions or the source that kind reads |
solver_layer |
flags | ["1"] |
Layers for the solver alone: a pair can be detected but not resolved One of 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32. |
solver_mask |
flags | [] |
Which solver layers this one pushes against; empty means all of them One of 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32. |
solver_test |
enum | both |
The same choice for the solver layers One of both, either. |
surface_velocity |
vec3 | [0,0,0] |
How fast the surface slides along itself, in the collider's own axes: a conveyor belt carries what rests on it |
Asset types this component references: physics_material.
Script functions
Methods of node.collider3d, the handle a node carrying this component exposes. Every handle also has get(), set(table), patch(table), has() and remove().
From physics3d:
| method | what it does |
|---|---|
aabb() -> [float] |
The world-space box the collider currently occupies, as its two opposite corners. |
broad_phase_aabb() -> [float] |
The box the broad phase files the collider under, which also reaches ahead by its body's speculative_distance. |
collider_mass() -> float |
What this collider weighs, density and size together. |
collider_mass_properties() -> physics3d::MassProperties |
What this collider adds to its body, in its own space. |
collider_mesh() -> physics3d::ColliderMesh |
The collider's shape as points and triangles, including a voxel grid's, for drawing it or for spawning the pieces it broke into. |
collider_volume() -> float |
How much space the shape encloses. |
collision_aabb() -> [float] |
The box the narrow phase tests the collider in: its shape's box grown by its collision_margin and the world's prediction distance. |
combine_voxels(Node) |
Tell two voxel colliders on one lattice about each other's cells, so a body sliding from one onto the other does not catch on the seam. Both must share a cell size and a rotation. |
contacts() -> [physics3d::Contact] |
Every contact point on this node's collider this step. Empty for a sensor, which has no contacts by definition. |
crop_voxels(int, int, int, int, int, int) |
Empty every cell outside the cells from (min_x, min_y, min_z) to (max_x, max_y, max_z), both included. A range holding no filled cell leaves the grid as it was. |
handles() -> physics3d::Handles |
The rapier handles behind this node, its body and its colliders. For matching a log line against rapier's own output. |
heightfield_hole(int, int) -> bool |
Whether a heightfield cell has no ground. |
max_contact_impulse() -> float |
The hardest contact this node took in the last step, zero when nothing touched it: a damage threshold in one number. |
overlaps() -> [Node] |
The nodes this one currently intersects; rapier reports a pair only when one of the two colliders is a sensor. |
pose_in_body() -> physics3d::Pose? |
Where the collider sits in its body's frame; nothing for a collider with no body. |
set_heightfield_hole(int, int, bool) |
Remove or restore the ground of one heightfield cell, named by the row and column of its first corner. |
set_voxel(int, int, int, bool) |
Fill or empty one cell of a voxel collider: digging a hole, or building a wall, while the game runs. |
set_voxel_size(float, float, float) |
Resize every cell of a voxel collider, keeping which cells are filled. |
swept_aabb() -> [float] |
The box the collider covers over the next fixed step, from where it is to where its body's velocity and forces carry it. |
voxel(int, int, int) -> bool |
Whether one cell of a voxel collider is filled. |
voxel_at(float, float, float) -> [int] |
The cell a world position falls in, as three whole numbers. |
voxel_size() -> Vec3 |
How big one cell of a voxel collider is, along each axis. |