vehicle3d component
Makes the node's body3d a raycast vehicle chassis, driven by the wheel3d children under it. forward_axis and up_axis orient it.
Σε αυτή τη σελίδα
3d · physics · 4 properties · 3D
Makes the node's body3d a raycast vehicle chassis, driven by the wheel3d children under it. forward_axis and up_axis orient it.
In a scene, vehicle3d is the node key that applies it. A script reaches each property below as a field on node.vehicle3d: reading one asks the running component, and assigning one leaves the rest alone. The whole table is node.vehicle3d.get() and node.vehicle3d.set(table).
Properties
| property | type | default | description |
|---|---|---|---|
collision_mask |
flags | [] |
The collision layers the wheels' rays hit; empty hits 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. |
forward_axis |
enum | z |
Which of the chassis's own axes points forward, either way along it: a negative axis drives and steers the other way round, and reads speed the other way One of x, y, z, -x, -y, -z. |
ignore |
flags | ["sensors"] |
What the wheels' rays pass through: static takes colliders with no body too. The chassis's own body is never hit One of static, kinematic, dynamic, sensors, solids. |
up_axis |
enum | y |
Which of the chassis's own axes points up, either way along it One of x, y, z, -x, -y, -z. |
Script functions
Methods of node.vehicle3d, 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 |
|---|---|
speed() -> float |
The chassis's whole speed at the last step, negative while it moves against its forward axis: rapier's own reading, where vehicle_speed is the part along the forward axis alone. |
vehicle_speed() -> float |
How fast the chassis is going along its forward axis, in units per second. |