A lang for https://itch.io/jam/langjamgamejam
- Rust 66.6%
- C 31.7%
- Shell 1.2%
- GLSL 0.5%
| error_test/parser | ||
| libsuicmez | ||
| src | ||
| tests | ||
| .gitignore | ||
| Cargo.lock | ||
| Cargo.toml | ||
| compile.sh | ||
| compile_and_run.sh | ||
| GAMEDEV_GUIDE.md | ||
| README.md | ||
ODE Physics Engine Integration
✅ ODE Integration Complete
Full Open Dynamics Engine (ODE) support has been integrated into suicmez for 3D physics simulation, perfect for voxel games!
Available ODE Functions
Initialization and Cleanup
ode_init()- Initialize the ODE libraryode_close()- Clean up ODE resources
World Management
ode_world_create()- Create a new physics worldode_world_destroy(world)- Destroy a physics worldode_world_set_gravity(world, x, y, z)- Set world gravityode_world_step(world, stepsize)- Advance physics simulation
Rigid Bodies
ode_body_create(world)- Create a new rigid bodyode_body_destroy(body)- Destroy a rigid bodyode_body_set_position(body, x, y, z)- Set body positionode_body_set_linear_vel(body, x, y, z)- Set linear velocity
Mass and Geometry
ode_body_set_box_mass(body, density, lx, ly, lz)- Set box-shaped massode_create_box_geom(space, lx, ly, lz)- Create box collision geometryode_geom_set_body(geom, body)- Attach geometry to bodyode_geom_destroy(geom)- Destroy geometry
Collision Spaces
ode_simple_space_create(parent)- Create collision spaceode_space_destroy(space)- Destroy collision space
Example Usage
# Initialize physics
ode_init()
# Create world with gravity
let world = ode_world_create()
let space = ode_simple_space_create(0 as *()) # null parent
ode_world_set_gravity(world, 0.0, -9.81, 0.0)
# Create a falling voxel/box
let body = ode_body_create(world)
ode_body_set_box_mass(body, 1.0, 1.0, 1.0, 1.0) # 1x1x1 meter box
ode_body_set_position(body, 0.0, 5.0, 0.0) # Start 5 units up
let geom = ode_create_box_geom(space, 1.0, 1.0, 1.0)
ode_geom_set_body(geom, body)
# Simulate physics
let mut i = 0
while i < 100 do
ode_world_step(world, 0.016) # 60 FPS
i = i + 1
end
# Cleanup
ode_geom_destroy(geom)
ode_body_destroy(body)
ode_space_destroy(space)
ode_world_destroy(world)
ode_close()
Compilation
Use the updated compile scripts which now include ODE:
./compile.sh tests/your_ode_program.sui
./compile_and_run.sh tests/your_ode_program.sui
ODE Version
Currently using: ODE 0.16.6
- Real-time rigid body dynamics
- Collision detection
- Joint constraints
- Stable simulation for games
All ODE features are now available through suicmez for building physics-based voxel games! ODE_INTEGRATION.md