mirror of
https://github.com/overte-org/overte.git
synced 2025-08-07 16:30:39 +02:00
Merge pull request #3155 from AndrewMeadows/bispinor
fix bad FPS for crowds of avatars
This commit is contained in:
commit
fb357ae04c
2 changed files with 11 additions and 11 deletions
|
@ -145,20 +145,20 @@ void Avatar::simulate(float deltaTime) {
|
||||||
_skeletonModel.setLODDistance(getLODDistance());
|
_skeletonModel.setLODDistance(getLODDistance());
|
||||||
|
|
||||||
if (!_shouldRenderBillboard && inViewFrustum) {
|
if (!_shouldRenderBillboard && inViewFrustum) {
|
||||||
if (_hasNewJointRotations) {
|
|
||||||
PerformanceTimer perfTimer("skeleton");
|
|
||||||
for (int i = 0; i < _jointData.size(); i++) {
|
|
||||||
const JointData& data = _jointData.at(i);
|
|
||||||
_skeletonModel.setJointState(i, data.valid, data.rotation);
|
|
||||||
}
|
|
||||||
_skeletonModel.simulate(deltaTime);
|
|
||||||
}
|
|
||||||
{
|
{
|
||||||
PerformanceTimer perfTimer("head");
|
PerformanceTimer perfTimer("skeleton");
|
||||||
|
if (_hasNewJointRotations) {
|
||||||
|
for (int i = 0; i < _jointData.size(); i++) {
|
||||||
|
const JointData& data = _jointData.at(i);
|
||||||
|
_skeletonModel.setJointState(i, data.valid, data.rotation);
|
||||||
|
}
|
||||||
|
}
|
||||||
_skeletonModel.simulate(deltaTime, _hasNewJointRotations);
|
_skeletonModel.simulate(deltaTime, _hasNewJointRotations);
|
||||||
simulateAttachments(deltaTime);
|
simulateAttachments(deltaTime);
|
||||||
_hasNewJointRotations = false;
|
_hasNewJointRotations = false;
|
||||||
|
}
|
||||||
|
{
|
||||||
|
PerformanceTimer perfTimer("head");
|
||||||
glm::vec3 headPosition = _position;
|
glm::vec3 headPosition = _position;
|
||||||
_skeletonModel.getHeadPosition(headPosition);
|
_skeletonModel.getHeadPosition(headPosition);
|
||||||
Head* head = getHead();
|
Head* head = getHead();
|
||||||
|
|
|
@ -490,11 +490,11 @@ int AvatarData::parseDataAtOffset(const QByteArray& packet, int offset) {
|
||||||
for (int i = 0; i < numJoints; i++) {
|
for (int i = 0; i < numJoints; i++) {
|
||||||
JointData& data = _jointData[i];
|
JointData& data = _jointData[i];
|
||||||
if (data.valid) {
|
if (data.valid) {
|
||||||
|
_hasNewJointRotations = true;
|
||||||
sourceBuffer += unpackOrientationQuatFromBytes(sourceBuffer, data.rotation);
|
sourceBuffer += unpackOrientationQuatFromBytes(sourceBuffer, data.rotation);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} // numJoints * 8 bytes
|
} // numJoints * 8 bytes
|
||||||
_hasNewJointRotations = true;
|
|
||||||
|
|
||||||
return sourceBuffer - startPosition;
|
return sourceBuffer - startPosition;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue