Physics Friction
App: apps/physics_friction/
Shows how Jolt’s friction coefficient affects dynamic rigid bodies on an inclined ramp. Boxes with different friction settings are placed at the top; R resets them to their starting positions.
Run from root
Section titled “Run from root”% ./plume3d physics_frictionWhat it does
Section titled “What it does”- Loads
Models/FrictionDemo.blendand instantiates GameCamera, GameLight, Environment (inclined ramp, static), and boxes with varying friction values (e.g.Box_Low,Box_Med,Box_High). - Tracks each box node and its initial position for resetting.
- R — resets all boxes:
node.setPosition,Physics.setLinearVelocity(..., 0,0,0),Physics.setAngularVelocity(..., 0,0,0),Physics.activate. - Shadow mapping enabled:
light.castsShadows = true,Graphics.setShadowMappingEnabled(true).
Reset pattern
Section titled “Reset pattern”if (Input.keyJustPressed("r")) { for (i in 0..._boxes.count) { var box = _boxes[i] var pos = _initialPositions[i] box.setPosition(pos[0], pos[1], pos[2]) Physics.setLinearVelocity(box, 0, 0, 0) Physics.setAngularVelocity(box, 0, 0, 0) Physics.activate(box) }}Blend setup
Section titled “Blend setup”Create Models/FrictionDemo.blend in Blender with the Plume3D addon:
| Object | Description | Rigid Body |
|---|---|---|
| Ramp plane | Inclined static surface | Passive, Box, layer Ramp |
| Box_Low | Low friction (e.g. 0.1) | Active, Box, layer Boxes |
| Box_Med | Medium friction (e.g. 0.5) | Active, Box, layer Boxes |
| Box_High | High friction (e.g. 0.9) | Active, Box, layer Boxes |
| Camera | GameCamera | — |
| Light | GameLight | — |
Set friction on each box via Blender’s Rigid Body > Surface Response panel.