mirror of
https://github.com/lubosz/overte.git
synced 2025-04-10 04:28:59 +02:00
Merge pull request #15859 from AndrewMeadows/fix-safe-landing
BUGZ-787: fix SafeLanding to load correct set of objects before enabling physics simulation
This commit is contained in:
commit
043aee4f78
4 changed files with 14 additions and 8 deletions
|
@ -1376,6 +1376,13 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
|
|||
connect(myAvatar.get(), &MyAvatar::positionGoneTo,
|
||||
DependencyManager::get<AddressManager>().data(), &AddressManager::storeCurrentAddress);
|
||||
|
||||
connect(myAvatar.get(), &MyAvatar::positionGoneTo, this, [this] {
|
||||
if (!_physicsEnabled) {
|
||||
// when we arrive somewhere without physics enabled --> startSafeLanding
|
||||
_octreeProcessor.startSafeLanding();
|
||||
}
|
||||
}, Qt::QueuedConnection);
|
||||
|
||||
connect(myAvatar.get(), &MyAvatar::skeletonModelURLChanged, [](){
|
||||
QUrl avatarURL = qApp->getMyAvatar()->getSkeletonModelURL();
|
||||
setCrashAnnotation("avatar", avatarURL.toString().toStdString());
|
||||
|
@ -5931,10 +5938,8 @@ void Application::resetPhysicsReadyInformation() {
|
|||
_gpuTextureMemSizeStabilityCount = 0;
|
||||
_gpuTextureMemSizeAtLastCheck = 0;
|
||||
_physicsEnabled = false;
|
||||
_octreeProcessor.startSafeLanding();
|
||||
}
|
||||
|
||||
|
||||
void Application::reloadResourceCaches() {
|
||||
resetPhysicsReadyInformation();
|
||||
|
||||
|
@ -6932,7 +6937,9 @@ void Application::queryOctree(NodeType_t serverType, PacketType packetType) {
|
|||
bool interstitialModeEnabled = DependencyManager::get<NodeList>()->getDomainHandler().getInterstitialModeEnabled();
|
||||
|
||||
ConicalViewFrustum sphericalView;
|
||||
sphericalView.setSimpleRadius(INITIAL_QUERY_RADIUS);
|
||||
AABox box = getMyAvatar()->getGlobalBoundingBox();
|
||||
float radius = glm::max(INITIAL_QUERY_RADIUS, 0.5f * glm::length(box.getDimensions()));
|
||||
sphericalView.setPositionAndSimpleRadius(box.calcCenter(), radius);
|
||||
|
||||
if (interstitialModeEnabled) {
|
||||
ConicalViewFrustum farView;
|
||||
|
|
|
@ -91,9 +91,7 @@ void SafeLanding::finishSequence(int first, int last) {
|
|||
|
||||
void SafeLanding::addToSequence(int sequenceNumber) {
|
||||
Locker lock(_lock);
|
||||
if (_trackingEntities) {
|
||||
_sequenceNumbers.insert(sequenceNumber);
|
||||
}
|
||||
_sequenceNumbers.insert(sequenceNumber);
|
||||
}
|
||||
|
||||
void SafeLanding::updateTracking() {
|
||||
|
|
|
@ -145,7 +145,8 @@ int ConicalViewFrustum::deserialize(const unsigned char* sourceBuffer) {
|
|||
return sourceBuffer - startPosition;
|
||||
}
|
||||
|
||||
void ConicalViewFrustum::setSimpleRadius(float radius) {
|
||||
void ConicalViewFrustum::setPositionAndSimpleRadius(const glm::vec3& position, float radius) {
|
||||
_position = position;
|
||||
_radius = radius;
|
||||
_farClip = radius / 2.0f;
|
||||
}
|
||||
|
|
|
@ -55,7 +55,7 @@ public:
|
|||
int deserialize(const unsigned char* sourceBuffer);
|
||||
|
||||
// Just test for within radius.
|
||||
void setSimpleRadius(float radius);
|
||||
void setPositionAndSimpleRadius(const glm::vec3& position, float radius);
|
||||
|
||||
private:
|
||||
glm::vec3 _position { 0.0f, 0.0f, 0.0f };
|
||||
|
|
Loading…
Reference in a new issue