| Crates.io | chsl |
| lib.rs | chsl |
| version | 0.1.1 |
| created_at | 2024-08-18 22:53:25.183461+00 |
| updated_at | 2024-08-18 23:19:13.378024+00 |
| description | 2D Game Physics Engine supporting Joints/Constraints |
| homepage | |
| repository | |
| max_upload_size | |
| id | 1343145 |
| size | 42,642 |
prounced (chisel) https://crates.io/crates/chsl
2D Game Physics Engine supporting Joints/Constraints
let mut physics_world = PhysicsWorld::new(BoundingBox {
x: 0.0,
y: 0.0,
width: 1240.0,
height: 880.0,
});
let steps = 1;
loop {
physics_world.update(delta_time, steps);
}
let circle = RigidBody::new_circle(position, rotation, radius, is_static);
//adding
physics_world.add_body("circle ID", circle);
//removing
physics_world.remove_body("circle ID");
//body is an id
let slide = Constraint::SlideJoint { body, position, angle, strength };
//adding
physics_world.add_constraint("constraint ID", slide);
//removing
physics_world.add_constraint("constraint ID");
this is a shoddily made engine made for fun so use at your own discretion