walls!
This commit is contained in:
parent
8cde3ba399
commit
4c36162aa5
1 changed files with 20 additions and 2 deletions
22
src/main.rs
22
src/main.rs
|
@ -79,9 +79,27 @@ fn model(app: &App) -> Model {
|
||||||
..Default::default()
|
..Default::default()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let boundary = app.window_rect();
|
||||||
|
|
||||||
/* Create the ground. */
|
/* Create the ground. */
|
||||||
let collider = ColliderBuilder::cuboid(100., 10.)
|
let collider = ColliderBuilder::cuboid(boundary.w(), 4.)
|
||||||
.translation(vector![0., -200.])
|
.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();
|
.build();
|
||||||
engine.state.colliders.insert(collider);
|
engine.state.colliders.insert(collider);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue