mirror of
https://github.com/overte-org/overte.git
synced 2025-04-19 06:17:38 +02:00
don't build AvatarMotionStates until physics enabled
This commit is contained in:
parent
5e2a08b3c2
commit
756f34761f
3 changed files with 7 additions and 1 deletions
|
@ -186,6 +186,7 @@ void AvatarManager::updateOtherAvatars(float deltaTime) {
|
|||
uint64_t updateExpiry = startTime + UPDATE_BUDGET;
|
||||
int numAvatarsUpdated = 0;
|
||||
int numAVatarsNotUpdated = 0;
|
||||
bool physicsEnabled = qApp->isPhysicsEnabled();
|
||||
|
||||
render::Transaction transaction;
|
||||
while (!sortedAvatars.empty()) {
|
||||
|
@ -202,7 +203,7 @@ void AvatarManager::updateOtherAvatars(float deltaTime) {
|
|||
if (_shouldRender) {
|
||||
avatar->ensureInScene(avatar, qApp->getMain3DScene());
|
||||
}
|
||||
if (!avatar->isInPhysicsSimulation()) {
|
||||
if (physicsEnabled && !avatar->isInPhysicsSimulation()) {
|
||||
ShapeInfo shapeInfo;
|
||||
avatar->computeShapeInfo(shapeInfo);
|
||||
btCollisionShape* shape = const_cast<btCollisionShape*>(ObjectMotionState::getShapeManager()->getShape(shapeInfo));
|
||||
|
|
|
@ -154,6 +154,10 @@ const QUuid AvatarMotionState::getObjectID() const {
|
|||
return _avatar->getSessionUUID();
|
||||
}
|
||||
|
||||
QString AvatarMotionState::getName() const {
|
||||
return _avatar->getName();
|
||||
}
|
||||
|
||||
// virtual
|
||||
QUuid AvatarMotionState::getSimulatorID() const {
|
||||
return _avatar->getSessionUUID();
|
||||
|
|
|
@ -59,6 +59,7 @@ public:
|
|||
|
||||
virtual const QUuid getObjectID() const override;
|
||||
|
||||
virtual QString getName() const override;
|
||||
virtual QUuid getSimulatorID() const override;
|
||||
|
||||
void setBoundingBox(const glm::vec3& corner, const glm::vec3& diagonal);
|
||||
|
|
Loading…
Reference in a new issue