rapier
This commit is contained in:
11
src/main.rs
11
src/main.rs
@@ -1,11 +1,11 @@
|
||||
use asset_loading::ImageAssets;
|
||||
use bevy::prelude::*;
|
||||
use bevy_rapier3d::prelude::*;
|
||||
|
||||
mod asset_loading;
|
||||
mod bevy_plugin;
|
||||
mod level_instantiation;
|
||||
mod main_menu;
|
||||
mod physics;
|
||||
mod player;
|
||||
|
||||
fn main() {
|
||||
@@ -13,10 +13,11 @@ fn main() {
|
||||
.add_plugins((
|
||||
bevy_plugin::plugin,
|
||||
asset_loading::plugin,
|
||||
physics::plugin,
|
||||
level_instantiation::map_plugin,
|
||||
player::plugin,
|
||||
main_menu::plugin,
|
||||
RapierPhysicsPlugin::<NoUserData>::default(),
|
||||
RapierDebugRenderPlugin::default(),
|
||||
))
|
||||
.init_state::<GameState>()
|
||||
.add_systems(OnEnter(GameState::Playing), setup)
|
||||
@@ -49,11 +50,17 @@ fn setup(
|
||||
MeshMaterial3d(materials.add(Color::WHITE)),
|
||||
Transform::from_rotation(Quat::from_rotation_x(-std::f32::consts::FRAC_PI_2)),
|
||||
));
|
||||
commands.spawn((
|
||||
RigidBody::Fixed,
|
||||
Collider::cylinder(0.1, 4.0)
|
||||
));
|
||||
// cube
|
||||
commands.spawn((
|
||||
Mesh3d(meshes.add(Cuboid::new(1.0, 1.0, 1.0))),
|
||||
MeshMaterial3d(materials.add(Color::srgb_u8(124, 144, 255))),
|
||||
Transform::from_xyz(3.0, 0.5, 0.0),
|
||||
RigidBody::Fixed,
|
||||
Collider::cuboid(0.5, 0.5, 0.5),
|
||||
));
|
||||
// light
|
||||
commands.spawn((
|
||||
|
||||
Reference in New Issue
Block a user