Coldwave Read the docs

joints#

Part of the scripting reference, written by the engine so it matches your frost. Start with your first game if you are new.

Use when connecting bodies with joints, building wheels, vehicles, ropes, hinges or 3D constraints.

In a scriptDoes
physics.wheels(car)A Vehicle's four wheels, front left, front right, back left, back right, each { x, y, z, qx, qy, qz, qw, touching } (its axle is its own x), or nil for no car
ComponentFieldTypeDefaultMeaning
Jointkindtext"revolute""distance": a rod, or a spring or a rope, between two points. "revolute": a hinge. "prismatic": a slider along a line, which does not turn. "weld": stuck together. "wheel": a wheel that spins freely on an axle that slides along a line
Jointfromtext""The name of the entity the joint holds. Empty: the entity the Joint is on. An entity can be nothing but a joint between two others, which is how one body gets several
Jointtotext""The name of the entity it is joined to. Empty: the world
Jointxnumber0Where the joint holds the from entity, from its Transform, turning with it
Jointynumber0The same upwards
Jointto_xnumber0A distance joint only: where it holds the to entity, from that entity's Transform (from 0, 0 of the world when to is empty). The other kinds hold the to entity where the from entity's point is when the joint is made
Jointto_ynumber0The same upwards
Jointanglenumber0The direction of a slider's or a wheel axle's line, in degrees, turning with the to entity: 0 to the right, 90 up
Jointlengthnumber0A distance joint's length. 0: as far apart as its two points are when it is made
Jointlimittrue or falsefalseWhether min and max hold
Jointminnumber0The least a hinge turns (degrees), a slider or an axle moves along its line, or a distance joint's length is (units). Turning and moving count from how the two were when the joint was made
Jointmaxnumber0The most
Jointspeednumber0The speed its motor drives at: degrees a second for a hinge or a wheel, units a second for a slider or a distance joint
Jointpowernumber0The most the motor can do to get there. 0: no motor. A force (a mass times units a second squared) for a slider or a distance joint, a turning force (that times units) for a hinge or a wheel; a body's mass is its area in square metres times its density. A motor far stronger than its load pushes a little past limit (500 N·m on a door of 0.2 kg: 7.5° in 3D, 11.6° in 2D)
Jointspringnumber0Springiness, in swings a second. 0: rigid (a slider and a hinge then have no spring; a weld and a rod do not give). For a wheel it is the axle's suspension: at 0 the axle is rigid, held where it was made, unless limit gives it a range to slide in. For a hinge it is a spring towards how it was made
Jointdampingnumber0How quickly the spring stops swinging: 0 never, 1 without a swing
Jointcollidetrue or falsefalseWhether the two joined bodies still collide with each other
Vehicleforwardnumber0The throttle, -1 (backwards) to 1. Asked the other way while it rolls, it brakes first
Vehiclerightnumber0Steering, -1 (left) to 1: that share of steer
Vehiclebrakenumber0The brakes on all four wheels, 0 to 1
Vehiclehandbrakenumber0The handbrake, on the back wheels, 0 to 1
Vehiclespeednumber0Written by the engine: units a second along its front, negative backwards
Vehiclerevsnumber0Written: the engine's revolutions a minute
Vehiclegearwhole number0Written: -1 reverse, 0 none, 1 to 5
Vehicletouchingwhole number0Written: how many wheels are on something
Vehiclewheel, width, track, front, back, hang, travel, spring, damping, steer, drive, torque, rpm, brakes, handbrakesnumber, drive text0.3, 0.2, 1.6, 1.25, -1.25, -0.2, 0.2, 1.5, 0.5, 35, "front", 500, 6000, 1500, 4000What it is made of, in its own frame, never scaled with the thing (changing one makes it again): a wheel's radius and width; from the left wheels to the right; the front and back axles' z; a wheel's middle y with its spring in, and how far it hangs below that; the springs' swings a second and damping; the most it steers, in degrees; the driven wheels, "front", "back" or "all"; the engine's most turning force (a mass times units squared a second squared) and revolutions a minute; the most the brakes and the handbrake do
  • Joints. A Joint joins from to to: put it on the entity it holds and name the other, or, for a second joint on the same body (a chain, a bridge fixed at both ends), on an entity of its own that names both. Both ends need a Collider, and neither is a Mover. It is made where the two are when both have bodies, and made again from where they are then when a Collider, a Body.kind or any of its own fields but speed and power changes: those two a script writes freely, to drive a motor, without its limits moving. When either end is despawned the joint goes with it: the Joint is taken off its entity and the game is told once, as a warning (W1112).

  • A car. In a 3D game a Vehicle beside a Collider and a dynamic Body is a car, its front its own +z: its wheels are the physics' own, on springs, with an engine and gears. The defaults fit a Collider of 1.8 by 0.6 by 4 at density 280, in metres. A script drives it by forward, right, brake and handbrake, and draws its wheels where physics.wheels(car) says. Anything else stops the load or the step with what to do: a 2D game (E0459), a body that is not dynamic (E0460), no Collider (E0461), a field no car has (E0462).

Generated from Coldwave 0.0.1 r289, 2026-11-30 by the binary itself: do not edit by hand.