commit 99f9ab36d1b2c0933a8275a94407eb75804e3e98
parent a496f4ab8027cda16e1c2134d817b94b1cd79a41
Author: Tom Leys <tom@gridspy.com>
Date: Sat, 28 Dec 2019 13:44:43 +1300
Avoid overlapping collide example bodies (#25)
Diffstat:
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/examples/collision.rs b/examples/collision.rs
@@ -38,8 +38,9 @@ fn main() {
)
.with(
PhysicsColliderBuilder::<f32>::from(Shape::Cuboid {
- half_extents: Vector3::new(2.0, 2.0, 1.0),
+ half_extents: Vector3::new(1.9, 2.0, 1.0),
})
+ .margin(0.1)
.build(),
)
.build();
@@ -49,13 +50,14 @@ fn main() {
world
.create_entity()
.with(SimplePosition::<f32>(Isometry3::<f32>::translation(
- 3.0, 1.0, 1.0,
+ 5.0, 1.0, 1.0,
)))
.with(PhysicsBodyBuilder::<f32>::from(BodyStatus::Static).build())
.with(
PhysicsColliderBuilder::<f32>::from(Shape::Cuboid {
- half_extents: Vector3::new(2.0, 2.0, 1.0),
+ half_extents: Vector3::new(1.9, 2.0, 1.0),
})
+ .margin(0.1)
.build(),
)
.build();