mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 11:45:36 +02:00
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:
parent
7ba08dd137
commit
711a1b8c7d
1 changed files with 3 additions and 2 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue