mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-04 04:13:11 +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;
|
uint64_t updateExpiry = startTime + UPDATE_BUDGET;
|
||||||
int numAvatarsUpdated = 0;
|
int numAvatarsUpdated = 0;
|
||||||
int numAVatarsNotUpdated = 0;
|
int numAVatarsNotUpdated = 0;
|
||||||
|
bool physicsEnabled = qApp->isPhysicsEnabled();
|
||||||
|
|
||||||
render::Transaction transaction;
|
render::Transaction transaction;
|
||||||
while (!sortedAvatars.empty()) {
|
while (!sortedAvatars.empty()) {
|
||||||
|
@ -202,7 +203,7 @@ void AvatarManager::updateOtherAvatars(float deltaTime) {
|
||||||
if (_shouldRender) {
|
if (_shouldRender) {
|
||||||
avatar->ensureInScene(avatar, qApp->getMain3DScene());
|
avatar->ensureInScene(avatar, qApp->getMain3DScene());
|
||||||
}
|
}
|
||||||
if (!avatar->isInPhysicsSimulation()) {
|
if (physicsEnabled && !avatar->isInPhysicsSimulation()) {
|
||||||
ShapeInfo shapeInfo;
|
ShapeInfo shapeInfo;
|
||||||
avatar->computeShapeInfo(shapeInfo);
|
avatar->computeShapeInfo(shapeInfo);
|
||||||
btCollisionShape* shape = const_cast<btCollisionShape*>(ObjectMotionState::getShapeManager()->getShape(shapeInfo));
|
btCollisionShape* shape = const_cast<btCollisionShape*>(ObjectMotionState::getShapeManager()->getShape(shapeInfo));
|
||||||
|
|
|
@ -154,6 +154,10 @@ const QUuid AvatarMotionState::getObjectID() const {
|
||||||
return _avatar->getSessionUUID();
|
return _avatar->getSessionUUID();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString AvatarMotionState::getName() const {
|
||||||
|
return _avatar->getName();
|
||||||
|
}
|
||||||
|
|
||||||
// virtual
|
// virtual
|
||||||
QUuid AvatarMotionState::getSimulatorID() const {
|
QUuid AvatarMotionState::getSimulatorID() const {
|
||||||
return _avatar->getSessionUUID();
|
return _avatar->getSessionUUID();
|
||||||
|
|
|
@ -59,6 +59,7 @@ public:
|
||||||
|
|
||||||
virtual const QUuid getObjectID() const override;
|
virtual const QUuid getObjectID() const override;
|
||||||
|
|
||||||
|
virtual QString getName() const override;
|
||||||
virtual QUuid getSimulatorID() const override;
|
virtual QUuid getSimulatorID() const override;
|
||||||
|
|
||||||
void setBoundingBox(const glm::vec3& corner, const glm::vec3& diagonal);
|
void setBoundingBox(const glm::vec3& corner, const glm::vec3& diagonal);
|
||||||
|
|
Loading…
Reference in a new issue