From e0e7a6e3906b8bcf3a551d6c45aad4649b129b7b Mon Sep 17 00:00:00 2001 From: timokoesters Date: Sat, 28 Sep 2019 22:23:54 +0200 Subject: [PATCH] fix(render): figures without vel don't render --- voxygen/src/scene/figure/mod.rs | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/voxygen/src/scene/figure/mod.rs b/voxygen/src/scene/figure/mod.rs index b1c8b94d6c..aec533c3cf 100644 --- a/voxygen/src/scene/figure/mod.rs +++ b/voxygen/src/scene/figure/mod.rs @@ -62,10 +62,9 @@ impl FigureMgr { .get(client.entity()) .map_or(Vec3::zero(), |pos| pos.0); - for (entity, pos, vel, ori, scale, body, character, last_character, stats) in ( + for (entity, pos, ori, scale, body, character, last_character, stats) in ( &ecs.entities(), &ecs.read_storage::(), - &ecs.read_storage::(), &ecs.read_storage::(), ecs.read_storage::().maybe(), &ecs.read_storage::(), @@ -130,6 +129,12 @@ impl FigureMgr { let mut movement_animation_rate = 1.0; let mut action_animation_rate = 1.0; + let vel = ecs + .read_storage::() + .get(entity) + .cloned() + .unwrap_or_default(); + match body { Body::Humanoid(_) => { let state = self @@ -421,10 +426,9 @@ impl FigureMgr { .read_storage::(); let character_state = character_state_storage.get(client.entity()); - for (entity, _, _, _, body, stats, _) in ( + for (entity, _, _, body, stats, _) in ( &ecs.entities(), &ecs.read_storage::(), - &ecs.read_storage::(), &ecs.read_storage::(), &ecs.read_storage::(), ecs.read_storage::().maybe(), @@ -432,7 +436,7 @@ impl FigureMgr { ) .join() // Don't render figures outside of frustum (camera viewport, max draw distance is farplane) - .filter(|(_, pos, _, _, _, _, scale)| { + .filter(|(_, pos, _, _, _, scale)| { frustum.sphere_intersecting( &pos.0.x, &pos.0.y, @@ -441,7 +445,7 @@ impl FigureMgr { ) }) // Don't render dead entities - .filter(|(_, _, _, _, _, stats, _)| stats.map_or(true, |s| !s.is_dead)) + .filter(|(_, _, _, _, stats, _)| stats.map_or(true, |s| !s.is_dead)) { if let Some((locals, bone_consts)) = match body { Body::Humanoid(_) => self