mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-13 08:36:50 +02:00
exposing physics progress
This commit is contained in:
parent
a2717e2efa
commit
2377626203
4 changed files with 27 additions and 0 deletions
|
@ -5301,6 +5301,7 @@ void Application::resetPhysicsReadyInformation() {
|
|||
_fullSceneCounterAtLastPhysicsCheck = 0;
|
||||
_nearbyEntitiesCountAtLastPhysicsCheck = 0;
|
||||
_nearbyEntitiesStabilityCount = 0;
|
||||
_nearbyEntitiesReadyCount = 0;
|
||||
_physicsEnabled = false;
|
||||
}
|
||||
|
||||
|
@ -6546,6 +6547,7 @@ bool Application::nearbyEntitiesAreReadyForPhysics() {
|
|||
_nearbyEntitiesCountAtLastPhysicsCheck = nearbyCount;
|
||||
|
||||
const uint32_t MINIMUM_NEARBY_ENTITIES_STABILITY_COUNT = 3;
|
||||
uint32_t readyNearbyEntities = 0;
|
||||
if (_nearbyEntitiesStabilityCount >= MINIMUM_NEARBY_ENTITIES_STABILITY_COUNT) {
|
||||
// We've seen the same number of nearby entities for several stats packets in a row. assume we've got all
|
||||
// the local entities.
|
||||
|
@ -6555,8 +6557,11 @@ bool Application::nearbyEntitiesAreReadyForPhysics() {
|
|||
HIFI_FCDEBUG(interfaceapp(), "Physics disabled until entity loads: " << entity->getID() << entity->getName());
|
||||
// don't break here because we want all the relevant entities to start their downloads
|
||||
result = false;
|
||||
} else {
|
||||
readyNearbyEntities++;
|
||||
}
|
||||
}
|
||||
_nearbyEntitiesReadyCount = readyNearbyEntities;
|
||||
return result;
|
||||
}
|
||||
return false;
|
||||
|
|
|
@ -224,6 +224,10 @@ public:
|
|||
void setHmdTabletBecomesToolbarSetting(bool value);
|
||||
bool getPreferStylusOverLaser() { return _preferStylusOverLaserSetting.get(); }
|
||||
void setPreferStylusOverLaser(bool value);
|
||||
|
||||
uint32_t getEntitiesStabilityCount() { return _nearbyEntitiesStabilityCount; }
|
||||
uint32_t getNearbyEntitiesReadyCount() { return _nearbyEntitiesReadyCount; }
|
||||
uint32_t getNearbyEntitiesCount() { return _nearbyEntitiesCountAtLastPhysicsCheck; }
|
||||
// FIXME: Remove setting completely or make available through JavaScript API?
|
||||
//bool getPreferAvatarFingerOverStylus() { return _preferAvatarFingerOverStylusSetting.get(); }
|
||||
bool getPreferAvatarFingerOverStylus() { return false; }
|
||||
|
@ -723,6 +727,7 @@ private:
|
|||
uint32_t _fullSceneCounterAtLastPhysicsCheck { 0 }; // _fullSceneReceivedCounter last time we checked physics ready
|
||||
uint32_t _nearbyEntitiesCountAtLastPhysicsCheck { 0 }; // how many in-range entities last time we checked physics ready
|
||||
uint32_t _nearbyEntitiesStabilityCount { 0 }; // how many times has _nearbyEntitiesCountAtLastPhysicsCheck been the same
|
||||
uint32_t _nearbyEntitiesReadyCount { 0 };
|
||||
quint64 _lastPhysicsCheckTime { usecTimestampNow() }; // when did we last check to see if physics was ready
|
||||
|
||||
bool _keyboardDeviceHasFocus { true };
|
||||
|
|
|
@ -584,3 +584,16 @@ void WindowScriptingInterface::onMessageBoxSelected(int button) {
|
|||
_messageBoxes.remove(id);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int WindowScriptingInterface::getPhysicsNearbyEntitiesReadyCount() {
|
||||
return qApp->getNearbyEntitiesReadyCount();
|
||||
}
|
||||
|
||||
int WindowScriptingInterface::getPhysicsNearbyEntitiesStabilityCount() {
|
||||
return qApp->getEntitiesStabilityCount();
|
||||
}
|
||||
|
||||
int WindowScriptingInterface::getPhysicsNearbyEntitiesCount() {
|
||||
return qApp->getNearbyEntitiesCount();
|
||||
}
|
||||
|
|
|
@ -561,6 +561,10 @@ public slots:
|
|||
*/
|
||||
void closeMessageBox(int id);
|
||||
|
||||
int getPhysicsNearbyEntitiesReadyCount();
|
||||
int getPhysicsNearbyEntitiesStabilityCount();
|
||||
int getPhysicsNearbyEntitiesCount();
|
||||
|
||||
private slots:
|
||||
void onWindowGeometryChanged(const QRect& geometry);
|
||||
void onMessageBoxSelected(int button);
|
||||
|
|
Loading…
Reference in a new issue