From e7122195226fc9fc5a4a942b4b12713345b34666 Mon Sep 17 00:00:00 2001 From: Jan Nils Ferner Date: Tue, 24 Jan 2023 03:13:24 +0100 Subject: Add wall to test #426 --- examples2d/character_controller2.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'examples2d/character_controller2.rs') 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 @@ -88,6 +88,19 @@ pub fn init_world(testbed: &mut Testbed) { .rotation(impossible_slope_angle); 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. */ -- cgit From cfb922d8110fc3404162ea63eaf6d9917b7b7a99 Mon Sep 17 00:00:00 2001 From: Jan Nils Ferner Date: Thu, 26 Jan 2023 16:51:28 +0100 Subject: Import PI --- examples2d/character_controller2.rs | 1 + 1 file changed, 1 insertion(+) (limited to 'examples2d/character_controller2.rs') diff --git a/examples2d/character_controller2.rs b/examples2d/character_controller2.rs index 4df9f51..e964a02 100644 --- a/examples2d/character_controller2.rs +++ b/examples2d/character_controller2.rs @@ -1,3 +1,4 @@ +use std::f32::consts::PI; use rapier2d::prelude::*; use rapier_testbed2d::Testbed; -- cgit From da671fd99a737efb754139120a112e5532ab85ed Mon Sep 17 00:00:00 2001 From: Jan Nils Ferner Date: Sat, 4 Feb 2023 18:12:15 +0100 Subject: Fix formatting --- examples2d/character_controller2.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'examples2d/character_controller2.rs') diff --git a/examples2d/character_controller2.rs b/examples2d/character_controller2.rs index e964a02..8ecd23c 100644 --- a/examples2d/character_controller2.rs +++ b/examples2d/character_controller2.rs @@ -1,6 +1,6 @@ -use std::f32::consts::PI; use rapier2d::prelude::*; use rapier_testbed2d::Testbed; +use std::f32::consts::PI; pub fn init_world(testbed: &mut Testbed) { /* -- cgit