This commit is contained in:
Zynh0722 2024-02-17 02:29:06 -08:00
parent 8cde3ba399
commit 4c36162aa5

View file

@ -79,9 +79,27 @@ fn model(app: &App) -> Model {
..Default::default()
};
let boundary = app.window_rect();
/* Create the ground. */
let collider = ColliderBuilder::cuboid(100., 10.)
.translation(vector![0., -200.])
let collider = ColliderBuilder::cuboid(boundary.w(), 4.)
.translation(vector![0., boundary.bottom()])
.build();
engine.state.colliders.insert(collider);
/* Create the walls. */
let collider = ColliderBuilder::cuboid(4., boundary.h())
.translation(vector![boundary.left(), 0.])
.build();
engine.state.colliders.insert(collider);
let collider = ColliderBuilder::cuboid(4., boundary.h())
.translation(vector![boundary.right(), 0.])
.build();
engine.state.colliders.insert(collider);
/* Create the ceiling. */
let collider = ColliderBuilder::cuboid(boundary.w(), 4.)
.translation(vector![0., boundary.top()])
.build();
engine.state.colliders.insert(collider);