|
|
|
@ -118,8 +118,8 @@ pub fn render_test(world: &mut SubWorld, #[resource] renderer: &mut Renderer) {
|
|
|
|
|
|
|
|
|
|
// Update the entity uniforms
|
|
|
|
|
for (pos, mesh, color) in query.iter_mut(world) {
|
|
|
|
|
// let rotation = cgmath::Matrix4::from_angle_x(cgmath::Deg(1.0));
|
|
|
|
|
// pos.mx = pos.mx * rotation;
|
|
|
|
|
let rotation = cgmath::Matrix4::from_angle_x(cgmath::Deg(2.0));
|
|
|
|
|
pos.mx = pos.mx * rotation;
|
|
|
|
|
|
|
|
|
|
let data = EntityUniforms {
|
|
|
|
|
model: pos.mx.into(),
|
|
|
|
@ -139,7 +139,7 @@ pub fn render_test(world: &mut SubWorld, #[resource] renderer: &mut Renderer) {
|
|
|
|
|
|
|
|
|
|
if renderer.lights_are_dirty {
|
|
|
|
|
//renderer.lights_are_dirty = false;
|
|
|
|
|
let mut query = <(&mut DirectionalLight, &mut Position)>::query();
|
|
|
|
|
let mut query = <(&mut DirectionalLight, &mut Point3<f32>)>::query();
|
|
|
|
|
for (i, (light, pos)) in query.iter_mut(world).enumerate() {
|
|
|
|
|
renderer.queue.write_buffer(
|
|
|
|
|
&renderer.light_uniform_buf,
|
|
|
|
|