2d-rendering
mitchellhansen 3 years ago
parent 7527694fd2
commit a77c6d76f0

@ -3,6 +3,29 @@ name = "terrain.1"
type = "StaticMesh"
mesh = "test-textured.obj"
[[entities]]
name = "ball.1"
type = "PhysicsEntity"
mesh = "ball.obj"
[entities.position]
x = 15.0
y = 15.0
z = 15.0
[entities.position.rotation]
x = 0.0
y = 0.0
z = 0.0
[entities.physics]
body_status = "static"
[entities.physics.cuboid]
x = 1.0
y = 1.0
z = 1.0
[[entities]]
name = "tile.1"
type = "Sprite"

@ -99,10 +99,9 @@ ECS
entities & behaviours (got the entities!)
scripting!
Todo:
Load scene imgui interface w/ toml files
FPS graph port from voxel raycaster
This means a scene graph
better imgui interface with components & systems
Figure out eventing, GameInput, passing all events, etc.
+ texturing
@ -158,7 +157,7 @@ fn main() {
let mut render_schedule = Schedule::builder()
.add_system(render::system::render_imgui_system())
//.add_system(render::system::render_test_system())
.add_system(render::system::render_function_system())
.add_system(render::system::render_performance_flag_system())
.build();

@ -38,10 +38,10 @@ pub fn run_physics(
Some(handle) => handle,
};
if collider.collider_handle == None {
let handle = physics_state.colliders.insert(
let handle = physics_state.colliders.insert_with_parent(
collider.collider.clone(),
//rigid_body_handle,
//&mut physics_state.bodies,
rigid_body_handle,
&mut physics_state.bodies,
);
collider.collider_handle = Some(handle);
}
@ -106,6 +106,8 @@ pub fn update_models(
) {
// Make sure all the entities we care about are added to the system
// TODO add scenegraph component to compare against
// allows per node rotation, better logging
let mut query = <(&mut Collider, &mut Physics, &mut Mesh, &mut Position)>::query();
for (collider, physics, mesh, position) in query.iter_mut(world) {
let pos = physics_state

@ -114,7 +114,7 @@ impl RuntimeState {
self.mesh_cache.get(mesh)
}
pub fn get_entities(&mut self) -> Vec<TomlEntityDescription> {
pub fn p(&mut self) -> Vec<TomlEntityDescription> {
self.config_db.entities.clone()
}
@ -132,7 +132,5 @@ impl RuntimeState {
self.mesh_cache.insert(filename, mesh);
}
}
//panic!("nah");
}
}

Loading…
Cancel
Save