parent
d0a2893056
commit
a1305bed2d
@ -0,0 +1,13 @@
|
|||||||
|
|
||||||
|
[[entities]]
|
||||||
|
[entities.entity1]
|
||||||
|
name = "terrain.1"
|
||||||
|
type = "Mesh"
|
||||||
|
mesh = "test-textured.obj"
|
||||||
|
|
||||||
|
[[entities]]
|
||||||
|
[entities.entity2]
|
||||||
|
name = "ball.1"
|
||||||
|
type = ""
|
||||||
|
mesh = "test-textured.obj"
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,2 @@
|
|||||||
|
pub mod state;
|
||||||
|
pub mod system;
|
@ -0,0 +1,22 @@
|
|||||||
|
use std::time::Instant;
|
||||||
|
|
||||||
|
use cgmath::{Euler, Quaternion};
|
||||||
|
use legion::world::SubWorld;
|
||||||
|
use legion::IntoQuery;
|
||||||
|
use legion::*;
|
||||||
|
use nalgebra::Quaternion as naQuaternion;
|
||||||
|
use rapier3d::dynamics::{IntegrationParameters, JointSet, RigidBodySet};
|
||||||
|
use rapier3d::geometry::{BroadPhase, ColliderSet, NarrowPhase};
|
||||||
|
use rapier3d::pipeline::PhysicsPipeline;
|
||||||
|
use crate::camera::{Camera, CameraController};
|
||||||
|
use crate::components::{Collider, LoopState, Mesh, Physics, Position};
|
||||||
|
|
||||||
|
|
||||||
|
pub struct RuntimeState {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
impl RuntimeState {
|
||||||
|
pub fn build() {
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,33 @@
|
|||||||
|
use std::time::Instant;
|
||||||
|
|
||||||
|
use cgmath::{Euler, Quaternion};
|
||||||
|
use legion::world::SubWorld;
|
||||||
|
use legion::IntoQuery;
|
||||||
|
use legion::*;
|
||||||
|
use nalgebra::Quaternion as naQuaternion;
|
||||||
|
use rapier3d::dynamics::{IntegrationParameters, JointSet, RigidBodySet};
|
||||||
|
use rapier3d::geometry::{BroadPhase, ColliderSet, NarrowPhase};
|
||||||
|
use rapier3d::pipeline::{PhysicsPipeline, ChannelEventCollector};
|
||||||
|
|
||||||
|
use crate::camera::{Camera, CameraController};
|
||||||
|
use crate::components::{Collider, LoopState, Mesh, Physics, Position};
|
||||||
|
use imgui::FontSource;
|
||||||
|
use crate::physics::state::PhysicsState;
|
||||||
|
|
||||||
|
|
||||||
|
#[system]
|
||||||
|
#[write_component(Collider)]
|
||||||
|
#[write_component(Physics)]
|
||||||
|
#[write_component(Mesh)]
|
||||||
|
pub fn runtime_load(
|
||||||
|
world: &mut SubWorld,
|
||||||
|
#[resource] physics_state: &mut PhysicsState,
|
||||||
|
#[resource] physics_pipeline: &mut PhysicsPipeline,
|
||||||
|
) {
|
||||||
|
// Make sure all the entities we care about are added to the system
|
||||||
|
let mut query = <(&mut Collider, &mut Physics, &mut Mesh)>::query();
|
||||||
|
for (collider, physics, mesh) in query.iter_mut(world) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in new issue