aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Nils Ferner <contact@jnferner.com>2023-01-24 03:13:24 +0100
committerJan Nils Ferner <contact@jnferner.com>2023-01-24 03:13:24 +0100
commite7122195226fc9fc5a4a942b4b12713345b34666 (patch)
treeff417a53381a7af0a308e293c5a84161bb813a99
parent1a4183cc94acc3210e4ae467abbea7d68e51c5ff (diff)
downloadrapier-e7122195226fc9fc5a4a942b4b12713345b34666.tar.gz
rapier-e7122195226fc9fc5a4a942b4b12713345b34666.tar.bz2
rapier-e7122195226fc9fc5a4a942b4b12713345b34666.zip
Add wall to test #426
-rw-r--r--examples2d/character_controller2.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/examples2d/character_controller2.rs b/examples2d/character_controller2.rs
index ff500e9..4df9f51 100644
--- a/examples2d/character_controller2.rs
+++ b/examples2d/character_controller2.rs
@@ -89,6 +89,19 @@ pub fn init_world(testbed: &mut Testbed) {
colliders.insert(collider);
/*
+ * Create a wall we can’t climb.
+ */
+ let wall_angle = PI / 2.;
+ let wall_size = 2.0;
+ let collider = ColliderBuilder::cuboid(wall_size, ground_height)
+ .translation(vector![
+ ground_size + slope_size * 2.0 + impossible_slope_size + 0.35,
+ -ground_height + 2.5 * 2.3
+ ])
+ .rotation(wall_angle);
+ colliders.insert(collider);
+
+ /*
* Create a moving platform.
*/
let body = RigidBodyBuilder::kinematic_velocity_based().translation(vector![-8.0, 1.5]);