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.
This commit is contained in:
Anthony J. Thibault 2016-04-08 13:14:50 -07:00
parent 7ba08dd137
commit 711a1b8c7d

View file

@ -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);