# Skate 3 physics engine for Zero
`skate_physics` integrates a reconstructed Skate 3 physics engine into Zero. Use this package for Skate 3-style skateboard and rider physics, or use its custom rigid-body solver components independently. It exposes a reconstructed Skate 3-derived Rust solver through editable entities, components and assets: physical bodies, collision volumes, joints, constraints, motors, forces and simulation state. It is a reusable simulation system, not just a skateboarding controller or a park scene.
## Why use it?
Build and tune connected physical assemblies without first writing the integration between a custom solver and Zero. Inspect velocities and forces, change mass and inertia, configure joint limits, and drive mechanisms with spring/damper or hard motors. Motors apply impulses through the solver rather than teleporting bodies. The general body/joint/drive layer does not require a rider or animation clips.
The package connects physics authoring, fixed-step simulation and entity presentation. Use it to experiment with constrained bodies, motor-driven mechanisms and vehicle assemblies; the skateboard and rider are included applications of the system, not its definition.
## What it provides
- `World`: authority-gated fixed-step simulation and publication of solved entity state.
- `Body` and `CollisionVolume`: editable mass, inertia, forces, velocities, primitive/compound collision geometry and bounded static-mesh collision.
- `Joint` and `Drive`: body references, local frames, linear/angular limits and independently configurable motors.
- `API`: in-engine authoring helpers and an explicit-state solver interface.
- Input and actuator components for device-driven or scripted physical assemblies.
- An integrated skateboard/rider system with control maps, rig mapping, visual bindings and animation-slot overrides.
- Example scenes, a modular park, an authored skateboard, and the `GettingStarted` guide.
## Where to start
Read **GettingStarted** for the distinction between the general physics components and the specialized rider integration. The low-level **Demo** workbench illustrates bodies, joints and a vehicle assembly. **SampleScenes** exposes rider, vehicle-only, self-propelled, scripted-control and physics-tuning examples. The world's default **RiderFidelity** scene demonstrates the coupled rider/board system with Zero's avatar and the authored park.
## Integration boundaries
Static mesh collision has documented size limits; see `Body`. The specialized native rider/board integration requires a fixed body layout; that restriction is distinct from authoring assemblies with the general body/joint/drive API.
The rider demo retains converted reference animations for testing, replaceable through normal Zero assets and animation bindings. These are not required by the general motor component. The default showcase uses the authored skateboard and Zero avatar; unused reference character and board models are excluded from publication. See the component documentation for supported shapes, units and solver-specific conventions.
# Vehicle-only sample
Seven editable board bodies, native Skate controller/tricks and no simulated rider bodies. W/X push through the native control mechanism, A/D steer, S brake, hold/release Space for an ollie, arrow keys/right stick for tricks. F has no offboard character to switch to. R recovers.
The Blender skateboard is a replaceable visual assembly; it does not define the controller. Inspect NativeRiderDriver.vehicleOnly, physicsRoot, boardVisualRoot and NativeConstraints. Self propulsion is demonstrated separately. Reference controller content is retained. Use this configuration for Skate 3-derived board mechanics without simulated rider bodies.
# Self-propelled native vehicle
Vehicle-only Skate simulation with selfPropulsion enabled and propulsionSpeed=8 m/s. W requests propulsion; S brakes, A/D steer, and the normal stick/Space trick controls remain available. Inspect throttle (0..1) to drive it from another script or control source. This supplies native push demand without needing a rider's foot animation; it does not replace the Skate controller with a car controller.
The same seven bodies, constraints, motors, terrain, rails and replaceable visual assembly are editable in Zero. Use this configuration to supply propulsion demand without rider foot animation.
# Physics tuning
This vehicle-only scene exposes the native board assembly as ordinary Zero entities. It uses a 4 m/s propulsion target and 19,800 maximum angular strength for each truck motor (half the default strength). Select FrontTruckMotor or RearTruckMotor under the player's NativeConstraints, edit NativeTruckMotor, and drive with W/A/D. The native solver receives these editable definitions; no plugin build is required.
BoardJoint0–5 expose the constraints. RiderPhysicsEntities holds the seven board bodies with NativeActorPart components. Body dynamics overrides require valid mass and inertia; consult GettingStarted before enabling them. Changes made to the player prototype in Edit persist after scene save; changes made to a spawned player in Play are runtime experiments unless explicitly retained.
Compare with SelfPropelled for default truck strengths and an 8 m/s propulsion target. This is a tuning example, not a new fidelity baseline.
# Script controls
This scene runs the native vehicle-only assembly through the driver's public command interface. Device input is deliberately disconnected (`controlSource = script`, `inputMap = nil`). Select your spawned ZeroVehicle during Play and edit NativeRiderDriver's `throttle`, `commandLeftX`, `commandRightX/Y`, triggers and button mask. These are the same command channels used by the native skating controller.
From an in-engine script:
```lua
local player = layers.active.players.localPlayer
local driver = player.avatar.component.get(asset.resolve('skate_physics.NativeRiderDriver','component'))
driver.throttle = 1
driver:setCommand({left={0.25,0},right={0,0},triggers={0,0},buttons=0})
-- Release all controls when your input source stops.
driver.throttle = 0
driver:clearCommand()
```
The normalized command interface accepts any controller source. No plugin rebuild or host filesystem is needed. Only drive the local player's avatar. Right-stick gestures and button masks retain the native skating interpretation; see GettingStarted for the control reference. Return to the Rider or SelfPropelled scene for keyboard/gamepad controls.
# Rider sample
Integrated Zero avatar, converted reference animations, native Skate physics, editable body/constraint/motor entities, Blender skateboard and Foundry park. This is a package-contained snapshot of RiderFidelity. Start here when integrating the Skate 3-derived rider and board system into a world. RiderFidelity is the demonstrated source configuration.