From 711a1b8c7d4c7a5c4ab47f229ae4a517e45f2ebc Mon Sep 17 00:00:00 2001 From: "Anthony J. Thibault" Date: Fri, 8 Apr 2016 13:14:50 -0700 Subject: [PATCH] Avatar: update renderItems when avatar position or render mesh is in the frustum. Previously, when render mesh was visible the renderItems they were not updated with the latest avatar mixer joints rotations and position. This would result in a frozen avatar being visible. Now the renderItems are updated when the render mesh is in the frustum or the bounding sphere around the avatar position is visible. --- interface/src/avatar/Avatar.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/interface/src/avatar/Avatar.cpp b/interface/src/avatar/Avatar.cpp index 64a2388a42..e31a874ba3 100644 --- a/interface/src/avatar/Avatar.cpp +++ b/interface/src/avatar/Avatar.cpp @@ -187,9 +187,10 @@ void Avatar::simulate(float deltaTime) { // simple frustum check float boundingRadius = getBoundingRadius(); - bool inView = qApp->getDisplayViewFrustum()->sphereIntersectsFrustum(getPosition(), boundingRadius); + bool avatarPositionInView = qApp->getDisplayViewFrustum()->sphereIntersectsFrustum(getPosition(), boundingRadius); + bool avatarMeshInView = qApp->getDisplayViewFrustum()->boxIntersectsFrustum(_skeletonModel->getRenderableMeshBound()); - if (_shouldAnimate && !_shouldSkipRender && inView) { + if (_shouldAnimate && !_shouldSkipRender && (avatarPositionInView || avatarMeshInView)) { { PerformanceTimer perfTimer("skeleton"); _skeletonModel->getRig()->copyJointsFromJointData(_jointData);