Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- extern crate newton_dynamics as newton;
- use newton::NewtonWorld;
- use newton::collision::NewtonBox;
- trait NewtonCollision {
- fn body(&self) -> NewtonBody;
- }
- trait NewtonData {
- type Vector3;
- type Vector4;
- type Quaternion;
- type Matrix4;
- }
- fn main() {
- // create a new world
- let world: NewtonWorld<Q> = NewtonWorld::new();
- // Api that
- let floor = NewtonBox::new(&world, 16.0, 0.2, 16.0, None);
- let cube = NewtonBox::new(&world, 1.0, 1.0, 1.0, None);
- // Create new bodies from the cuboid shape
- let floor_body: NewtonBody<_> = cube.body(Matrix::identity());
- let cube_body: NewtonBody<_> = cube.body(1.0, Matrix::translate(0.0, 4.0, 0.0));
- cube_a.compute_mass(&cube);
- // compute mass matrix
- cube.compute_mass(&cube);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement