rotation from physics
This commit is contained in:
26
src/main.rs
26
src/main.rs
@@ -124,7 +124,7 @@ fn main() {
|
||||
resources.insert(renderer);
|
||||
|
||||
let (physics_state, physics_pipeline) =
|
||||
PhysicsState::build(rapier3d::math::Vector::new(0.0, -9.81, 0.0));
|
||||
PhysicsState::build(rapier3d::math::Vector::new(0.0, -9.81, 0.05));
|
||||
resources.insert(physics_state);
|
||||
resources.insert(physics_pipeline);
|
||||
|
||||
@@ -289,11 +289,11 @@ pub fn entity_loading(world: &mut World, renderer: &mut Renderer) {
|
||||
x: 1.0,
|
||||
y: 5.0,
|
||||
z: 2.0,
|
||||
rot: Quaternion::from(Euler {
|
||||
rot: Euler {
|
||||
x: Deg(90.0),
|
||||
y: Deg(45.0),
|
||||
z: Deg(15.0),
|
||||
}), //mx: cgmath::Matrix4::from(transform),
|
||||
}, //mx: cgmath::Matrix4::from(transform),
|
||||
},
|
||||
monkey_mesh,
|
||||
Color {
|
||||
@@ -306,15 +306,15 @@ pub fn entity_loading(world: &mut World, renderer: &mut Renderer) {
|
||||
|
||||
let mut dynamic_ball_body = RigidBodyBuilder::new_dynamic()
|
||||
.position(Isometry3::new(
|
||||
Vector3::new(0.0, 0.0, 5.0),
|
||||
Vector::y() * PI,
|
||||
Vector3::new(0.0, 0.0, 0.0),
|
||||
Vector::y(),
|
||||
))
|
||||
.build();
|
||||
|
||||
let mut static_floor_body = RigidBodyBuilder::new_static()
|
||||
.position(Isometry3::new(
|
||||
Vector3::new(0.0, -8.0, 0.0),
|
||||
Vector::y() * PI,
|
||||
Vector::y(),
|
||||
))
|
||||
.build();
|
||||
|
||||
@@ -328,11 +328,11 @@ pub fn entity_loading(world: &mut World, renderer: &mut Renderer) {
|
||||
x: 0.0,
|
||||
y: -8.0,
|
||||
z: 0.0,
|
||||
rot: Quaternion::from(Euler {
|
||||
rot: Euler {
|
||||
x: Deg(0.0),
|
||||
y: Deg(0.0),
|
||||
z: Deg(0.0),
|
||||
}),
|
||||
},
|
||||
},
|
||||
plane_mesh,
|
||||
Color {
|
||||
@@ -355,14 +355,14 @@ pub fn entity_loading(world: &mut World, renderer: &mut Renderer) {
|
||||
|
||||
let ball_mesh: Entity = world.push((
|
||||
Position {
|
||||
x: 2.0,
|
||||
y: 2.0,
|
||||
z: 3.0,
|
||||
rot: Quaternion::from(Euler {
|
||||
x: 0.0,
|
||||
y: 0.0,
|
||||
z: 0.0,
|
||||
rot: Euler {
|
||||
x: Deg(25.0),
|
||||
y: Deg(45.0),
|
||||
z: Deg(15.0),
|
||||
}),
|
||||
},
|
||||
},
|
||||
ball_mesh,
|
||||
Color {
|
||||
|
||||
Reference in New Issue
Block a user