Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions docs/kit-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ dynamic/static where a handler takes an optional `dyn` flag.
| `b2kSetGravityScale ctrl, s` | Per-body gravity multiplier. |
| `b2kSetDamping ctrl, lin [,ang]` | Linear (and optional angular) damping. |
| `b2kWake ctrl` | Wake a sleeping body. |
| `b2kSleep ctrl` | Send a body to sleep until something wakes it. |
| `b2kSetSleepThreshold ctrl, pxPerSec` | Speed below which a body may fall asleep. |
| `b2kSetStatic ctrl` / `b2kSetDynamic ctrl` / `b2kSetKinematic ctrl` | Change body type at runtime (freeze/unfreeze, moving platforms). |
| `b2kSetType ctrl, "static"\|"kinematic"\|"dynamic"` | Set body type by name. |
| `b2kDisable ctrl` / `b2kEnable ctrl` | Take a body out of / put it back into the simulation. |
Expand All @@ -133,6 +135,8 @@ dynamic/static where a handler takes an optional `dyn` flag.
|---------|---------|
| `b2kPush ctrl, dvx, dvy` | Add a one-shot impulse (change in velocity, px/s). |
| `b2kForce ctrl, fx, fy` | Apply a continuous force (call each frame for thrust/wind). |
| `b2kImpulse ctrl, ix, iy` | One-shot impulse, mass-aware (heavier bodies move less). |
| `b2kTorque ctrl, torque` | Continuous turning force (call each frame); +/- sets direction. |
| `b2kSetVelocity ctrl, vx, vy` | Set linear velocity (px/s). |
| `b2kSpin ctrl, degPerSec` | Set angular velocity. |
| `b2kSpinBy ctrl, degPerSec` | Add to the current angular velocity. |
Expand All @@ -153,6 +157,9 @@ dynamic/static where a handler takes an optional `dyn` flag.
| `b2kBodyCount()` | How many bodies the Kit is tracking. |
| `b2kAwakeCount()` | How many dynamic bodies are currently awake (active). |
| `b2kIsAwake(ctrl)` | Whether the body is awake. |
| `b2kSpinRate(ctrl)` | Rotation speed in degrees/sec (getter for `b2kSpin`). |
| `b2kIsBullet(ctrl)` | Whether continuous (CCD) collision is on. |
| `b2kIsEnabled(ctrl)` | Whether the body is in the simulation. |
| `b2kControlAt(x, y)` | The control whose body covers a screen point. |
| `b2kRayHit(x1, y1, x2, y2)` | True if a ray hits; then read the result functions below. |
| `b2kRayHitX()` / `b2kRayHitY()` | Hit point in screen pixels. |
Expand Down Expand Up @@ -187,6 +194,7 @@ helpers or to `b2kRemoveJoint`.
| `b2kWheelSpring joint, hertz [,damping]` | Tune wheel suspension. |
| `b2kRopeRange joint, minPx, maxPx` | Set a distance joint's min/max length. |
| `b2kRopeLength(joint)` → pixels | Current distance-joint length. |
| `b2kRopeSetLength joint, px` | Set a distance joint's exact rest length. |
| `b2kSpring joint, hertz [,damping]` | Make a rope (distance) joint springy. |
| `b2kWeldSpring joint, hertz [,damping]` | Make a weld springy (0 hertz = rigid). |
| `b2kMotorOff joint` | Turn a hinge motor off (free swing). |
Expand Down
Loading
Loading