History

Merge branch 'master' of https://github.com/highfidelity/hifi into scriptEngineCleanup

Brad Hefta-Gaub committed 11 years ago

Commit 54a45f32 parents 94b273a 096a6cb158 files · +3655 −2709Browse files

Showing the changes to interface/src/Application.cpp (1 of 158 files). Show all

Unified · Split

interface/src/Application.cpp+154−139
@@ -335,10 +335,10 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 334 unmodified lines
335335 _frameCount(0),
336336 _fps(60.0f),
337337 _justStarted(true),
338− _physicsEngine(glm::vec3(0.0f)),
338+ _physicsEngine(new PhysicsEngine(Vectors::ZERO)),
339339 _entities(true, this, this),
340340 _entityClipboardRenderer(false, this, this),
341− _entityClipboard(),
341+ _entityClipboard(new EntityTree()),
342342 _viewFrustum(),
343343 _lastQueriedViewFrustum(),
344344 _lastQueriedTime(usecTimestampNow()),
@@ -372,6 +372,8 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 27 unmodified lines
372372 {
373373 setInstance(this);
374374
375+ _entityClipboard->createRootElement();
376+
375377 _pluginContainer = new PluginContainerProxy();
376378 Plugin::setContainer(_pluginContainer);
377379 #ifdef Q_OS_WIN
@@ -861,17 +863,15 @@ void Application::emptyLocalCache() { · 483 unmodified lines
861863 }
862864
863865 Application::~Application() {
864− EntityTree* tree = _entities.getTree();
865− tree->lockForWrite();
866− _entities.getTree()->setSimulation(NULL);
867− tree->unlock();
866+ EntityTreePointer tree = _entities.getTree();
867+ tree->setSimulation(NULL);
868868
869869 _octreeProcessor.terminate();
870870 _entityEditSender.terminate();
871871
872872 Menu::getInstance()->deleteLater();
873873
874− _physicsEngine.setCharacterController(NULL);
874+ _physicsEngine->setCharacterController(NULL);
875875 _myAvatar = NULL;
876876
877877 ModelEntityItem::cleanupLoadedAnimations();
@@ -886,7 +886,9 @@ Application::~Application() { · 8 unmodified lines
886886
887887 // remove avatars from physics engine
888888 DependencyManager::get<AvatarManager>()->clearOtherAvatars();
889− _physicsEngine.deleteObjects(DependencyManager::get<AvatarManager>()->getObjectsToDelete());
889+ VectorOfMotionStates motionStates;
890+ DependencyManager::get<AvatarManager>()->getObjectsToDelete(motionStates);
891+ _physicsEngine->deleteObjects(motionStates);
890892
891893 DependencyManager::destroy<OffscreenUi>();
892894 DependencyManager::destroy<AvatarManager>();
@@ -1513,7 +1515,7 @@ void Application::keyPressEvent(QKeyEvent* event) { · 620 unmodified lines
15131515 break;
15141516
15151517 case Qt::Key_F: {
1516− _physicsEngine.dumpNextStats();
1518+ _physicsEngine->dumpNextStats();
15171519 break;
15181520 }
15191521
@@ -2395,7 +2397,7 @@ void Application::saveSettings() { · 875 unmodified lines
23952397 }
23962398
23972399 bool Application::importEntities(const QString& urlOrFilename) {
2398− _entityClipboard.eraseAllOctreeElements();
2400+ _entityClipboard->eraseAllOctreeElements();
23992401
24002402 QUrl url(urlOrFilename);
24012403
@@ -2404,15 +2406,15 @@ bool Application::importEntities(const QString& urlOrFilename) { · 2 unmodified lines
24042406 url = QUrl::fromLocalFile(urlOrFilename);
24052407 }
24062408
2407− bool success = _entityClipboard.readFromURL(url.toString());
2409+ bool success = _entityClipboard->readFromURL(url.toString());
24082410 if (success) {
2409− _entityClipboard.reaverageOctreeElements();
2411+ _entityClipboard->reaverageOctreeElements();
24102412 }
24112413 return success;
24122414 }
24132415
24142416 QVector<EntityItemID> Application::pasteEntities(float x, float y, float z) {
2415− return _entityClipboard.sendEntities(&_entityEditSender, _entities.getTree(), x, y, z);
2417+ return _entityClipboard->sendEntities(&_entityEditSender, _entities.getTree(), x, y, z);
24162418 }
24172419
24182420 void Application::initDisplay() {
@@ -2457,10 +2459,10 @@ void Application::init() { · 38 unmodified lines
24572459 _entities.setViewFrustum(getViewFrustum());
24582460
24592461 ObjectMotionState::setShapeManager(&_shapeManager);
2460− _physicsEngine.init();
2462+ _physicsEngine->init();
24612463
2462− EntityTree* tree = _entities.getTree();
2463− _entitySimulation.init(tree, &_physicsEngine, &_entityEditSender);
2464+ EntityTreePointer tree = _entities.getTree();
2465+ _entitySimulation.init(tree, _physicsEngine, &_entityEditSender);
24642466 tree->setSimulation(&_entitySimulation);
24652467
24662468 auto entityScriptingInterface = DependencyManager::get<EntityScriptingInterface>();
@@ -2475,23 +2477,47 @@ void Application::init() { · 8 unmodified lines
24752477
24762478 _entityClipboardRenderer.init();
24772479 _entityClipboardRenderer.setViewFrustum(getViewFrustum());
2478− _entityClipboardRenderer.setTree(&_entityClipboard);
2480+ _entityClipboardRenderer.setTree(_entityClipboard);
24792481
24802482 // Make sure any new sounds are loaded as soon as know about them.
2481− connect(tree, &EntityTree::newCollisionSoundURL, DependencyManager::get<SoundCache>().data(), &SoundCache::getSound);
2483+ connect(tree.get(), &EntityTree::newCollisionSoundURL, DependencyManager::get<SoundCache>().data(), &SoundCache::getSound);
24822484 connect(_myAvatar, &MyAvatar::newCollisionSoundURL, DependencyManager::get<SoundCache>().data(), &SoundCache::getSound);
24832485
2484− setAvatarUpdateThreading(Menu::getInstance()->isOptionChecked(MenuOption::EnableAvatarUpdateThreading));
2486+ setAvatarUpdateThreading();
24852487 }
24862488
2487−void Application::setAvatarUpdateThreading(bool isThreaded) {
2489+void Application::setAvatarUpdateThreading() {
2490+ setAvatarUpdateThreading(Menu::getInstance()->isOptionChecked(MenuOption::EnableAvatarUpdateThreading));
2491+}
2492+void Application::setRawAvatarUpdateThreading() {
2493+ setRawAvatarUpdateThreading(Menu::getInstance()->isOptionChecked(MenuOption::EnableAvatarUpdateThreading));
2494+}
2495+void Application::setRawAvatarUpdateThreading(bool isThreaded) {
24882496 if (_avatarUpdate) {
2489− getMyAvatar()->destroyAnimGraph();
2497+ if (_avatarUpdate->isThreaded() == isThreaded) {
2498+ return;
2499+ }
24902500 _avatarUpdate->terminate();
24912501 }
24922502 _avatarUpdate = new AvatarUpdate();
24932503 _avatarUpdate->initialize(isThreaded);
24942504 }
2505+void Application::setAvatarUpdateThreading(bool isThreaded) {
2506+ if (_avatarUpdate && (_avatarUpdate->isThreaded() == isThreaded)) {
2507+ return;
2508+ }
2509+ bool isRigEnabled = getMyAvatar()->getEnableRigAnimations();
2510+ bool isGraphEnabled = getMyAvatar()->getEnableAnimGraph();
2511+ if (_avatarUpdate) {
2512+ _avatarUpdate->terminate(); // Must be before we shutdown anim graph.
2513+ }
2514+ getMyAvatar()->setEnableRigAnimations(false);
2515+ getMyAvatar()->setEnableAnimGraph(false);
2516+ _avatarUpdate = new AvatarUpdate();
2517+ _avatarUpdate->initialize(isThreaded);
2518+ getMyAvatar()->setEnableRigAnimations(isRigEnabled);
2519+ getMyAvatar()->setEnableAnimGraph(isGraphEnabled);
2520+}
24952521
24962522
24972523 void Application::closeMirrorView() {
@@ -2861,51 +2887,45 @@ void Application::update(float deltaTime) { · 363 unmodified lines
28612887 PerformanceTimer perfTimer("physics");
28622888 _myAvatar->relayDriveKeysToCharacterController();
28632889
2864− _entitySimulation.lock();
2865− _physicsEngine.deleteObjects(_entitySimulation.getObjectsToDelete());
2866− _entitySimulation.unlock();
2890+ static VectorOfMotionStates motionStates;
2891+ _entitySimulation.getObjectsToDelete(motionStates);
2892+ _physicsEngine->deleteObjects(motionStates);
28672893
2868− _entities.getTree()->lockForWrite();
2869− _entitySimulation.lock();
2870− _physicsEngine.addObjects(_entitySimulation.getObjectsToAdd());
2871− _entitySimulation.unlock();
2872− _entities.getTree()->unlock();
2894+ _entities.getTree()->withWriteLock([&] {
2895+ _entitySimulation.getObjectsToAdd(motionStates);
2896+ _physicsEngine->addObjects(motionStates);
28732897
2874− _entities.getTree()->lockForWrite();
2875− _entitySimulation.lock();
2876− VectorOfMotionStates stillNeedChange = _physicsEngine.changeObjects(_entitySimulation.getObjectsToChange());
2877− _entitySimulation.setObjectsToChange(stillNeedChange);
2878− _entitySimulation.unlock();
2879− _entities.getTree()->unlock();
2898+ });
2899+ _entities.getTree()->withWriteLock([&] {
2900+ _entitySimulation.getObjectsToChange(motionStates);
2901+ VectorOfMotionStates stillNeedChange = _physicsEngine->changeObjects(motionStates);
2902+ _entitySimulation.setObjectsToChange(stillNeedChange);
2903+ });
28802904
2881− _entitySimulation.lock();
28822905 _entitySimulation.applyActionChanges();
2883− _entitySimulation.unlock();
28842906
28852907 AvatarManager* avatarManager = DependencyManager::get<AvatarManager>().data();
2886− _physicsEngine.deleteObjects(avatarManager->getObjectsToDelete());
2887− _physicsEngine.addObjects(avatarManager->getObjectsToAdd());
2888− _physicsEngine.changeObjects(avatarManager->getObjectsToChange());
2889−
2890− _entities.getTree()->lockForWrite();
2891− _physicsEngine.stepSimulation();
2892− _entities.getTree()->unlock();
2893−
2894− if (_physicsEngine.hasOutgoingChanges()) {
2895− _entities.getTree()->lockForWrite();
2896− _entitySimulation.lock();
2897− _entitySimulation.handleOutgoingChanges(_physicsEngine.getOutgoingChanges(), _physicsEngine.getSessionID());
2898− _entitySimulation.unlock();
2899− _entities.getTree()->unlock();
2900−
2901− _entities.getTree()->lockForWrite();
2902− avatarManager->handleOutgoingChanges(_physicsEngine.getOutgoingChanges());
2903− _entities.getTree()->unlock();
2904−
2905− auto collisionEvents = _physicsEngine.getCollisionEvents();
2908+ avatarManager->getObjectsToDelete(motionStates);
2909+ _physicsEngine->deleteObjects(motionStates);
2910+ avatarManager->getObjectsToAdd(motionStates);
2911+ _physicsEngine->addObjects(motionStates);
2912+ avatarManager->getObjectsToChange(motionStates);
2913+ _physicsEngine->changeObjects(motionStates);
2914+
2915+ _entities.getTree()->withWriteLock([&] {
2916+ _physicsEngine->stepSimulation();
2917+ });
2918+
2919+ if (_physicsEngine->hasOutgoingChanges()) {
2920+ _entities.getTree()->withWriteLock([&] {
2921+ _entitySimulation.handleOutgoingChanges(_physicsEngine->getOutgoingChanges(), _physicsEngine->getSessionID());
2922+ avatarManager->handleOutgoingChanges(_physicsEngine->getOutgoingChanges());
2923+ });
2924+
2925+ auto collisionEvents = _physicsEngine->getCollisionEvents();
29062926 avatarManager->handleCollisionEvents(collisionEvents);
29072927
2908− _physicsEngine.dumpStatsIfNecessary();
2928+ _physicsEngine->dumpStatsIfNecessary();
29092929
29102930 if (!_aboutToQuit) {
29112931 PerformanceTimer perfTimer("entities");
@@ -3019,27 +3039,21 @@ int Application::sendNackPackets() { · 107 unmodified lines
30193039 return;
30203040 }
30213041
3022− _octreeSceneStatsLock.lockForRead();
3042+ QSet<OCTREE_PACKET_SEQUENCE> missingSequenceNumbers;
3043+ _octreeServerSceneStats.withReadLock([&] {
3044+ // retreive octree scene stats of this node
3045+ if (_octreeServerSceneStats.find(nodeUUID) == _octreeServerSceneStats.end()) {
3046+ return;
3047+ }
3048+ // get sequence number stats of node, prune its missing set, and make a copy of the missing set
3049+ SequenceNumberStats& sequenceNumberStats = _octreeServerSceneStats[nodeUUID].getIncomingOctreeSequenceNumberStats();
3050+ sequenceNumberStats.pruneMissingSet();
3051+ missingSequenceNumbers = sequenceNumberStats.getMissingSet();
3052+ });
30233053
3024− // retreive octree scene stats of this node
3025− if (_octreeServerSceneStats.find(nodeUUID) == _octreeServerSceneStats.end()) {
3026− _octreeSceneStatsLock.unlock();
3027− return;
3028− }
3029−
3030− // get sequence number stats of node, prune its missing set, and make a copy of the missing set
3031− SequenceNumberStats& sequenceNumberStats = _octreeServerSceneStats[nodeUUID].getIncomingOctreeSequenceNumberStats();
3032− sequenceNumberStats.pruneMissingSet();
3033− const QSet<OCTREE_PACKET_SEQUENCE> missingSequenceNumbers = sequenceNumberStats.getMissingSet();
3034−
3035− _octreeSceneStatsLock.unlock();
3036−
30373054 // construct nack packet(s) for this node
3038− auto it = missingSequenceNumbers.constBegin();
3039− while (it != missingSequenceNumbers.constEnd()) {
3040− OCTREE_PACKET_SEQUENCE missingNumber = *it;
3055+ foreach(const OCTREE_PACKET_SEQUENCE& missingNumber, missingSequenceNumbers) {
30413056 nackPacketList->writePrimitive(missingNumber);
3042− ++it;
30433057 }
30443058
30453059 if (nackPacketList->getNumPackets()) {
@@ -3772,13 +3786,13 @@ void Application::clearDomainOctreeDetails() { · 726 unmodified lines
37723786 // reset the environment so that we don't erroneously end up with multiple
37733787
37743788 // reset our node to stats and node to jurisdiction maps... since these must be changing...
3775− _entityServerJurisdictions.lockForWrite();
3776− _entityServerJurisdictions.clear();
3777− _entityServerJurisdictions.unlock();
3789+ _entityServerJurisdictions.withWriteLock([&] {
3790+ _entityServerJurisdictions.clear();
3791+ });
37783792
3779− _octreeSceneStatsLock.lockForWrite();
3780− _octreeServerSceneStats.clear();
3781− _octreeSceneStatsLock.unlock();
3793+ _octreeServerSceneStats.withWriteLock([&] {
3794+ _octreeServerSceneStats.clear();
3795+ });
37823796
37833797 // reset the model renderer
37843798 _entities.clear();
@@ -3848,29 +3862,31 @@ void Application::nodeKilled(SharedNodePointer node) { · 63 unmodified lines
38483862
38493863 QUuid nodeUUID = node->getUUID();
38503864 // see if this is the first we've heard of this node...
3851− _entityServerJurisdictions.lockForRead();
3852− if (_entityServerJurisdictions.find(nodeUUID) != _entityServerJurisdictions.end()) {
3865+ _entityServerJurisdictions.withReadLock([&] {
3866+ if (_entityServerJurisdictions.find(nodeUUID) == _entityServerJurisdictions.end()) {
3867+ return;
3868+ }
3869+
38533870 unsigned char* rootCode = _entityServerJurisdictions[nodeUUID].getRootOctalCode();
38543871 VoxelPositionSize rootDetails;
38553872 voxelDetailsForCode(rootCode, rootDetails);
3856− _entityServerJurisdictions.unlock();
38573873
38583874 qCDebug(interfaceapp, "model server going away...... v[%f, %f, %f, %f]",
3859− (double)rootDetails.x, (double)rootDetails.y, (double)rootDetails.z, (double)rootDetails.s);
3875+ (double)rootDetails.x, (double)rootDetails.y, (double)rootDetails.z, (double)rootDetails.s);
3876+
3877+ });
38603878
3861− // If the model server is going away, remove it from our jurisdiction map so we don't send voxels to a dead server
3862− _entityServerJurisdictions.lockForWrite();
3879+ // If the model server is going away, remove it from our jurisdiction map so we don't send voxels to a dead server
3880+ _entityServerJurisdictions.withWriteLock([&] {
38633881 _entityServerJurisdictions.erase(_entityServerJurisdictions.find(nodeUUID));
3864− }
3865− _entityServerJurisdictions.unlock();
3882+ });
38663883
38673884 // also clean up scene stats for that server
3868− _octreeSceneStatsLock.lockForWrite();
3869− if (_octreeServerSceneStats.find(nodeUUID) != _octreeServerSceneStats.end()) {
3870− _octreeServerSceneStats.erase(nodeUUID);
3871− }
3872− _octreeSceneStatsLock.unlock();
3873−
3885+ _octreeServerSceneStats.withWriteLock([&] {
3886+ if (_octreeServerSceneStats.find(nodeUUID) != _octreeServerSceneStats.end()) {
3887+ _octreeServerSceneStats.erase(nodeUUID);
3888+ }
3889+ });
38743890 } else if (node->getType() == NodeType::AvatarMixer) {
38753891 // our avatar mixer has gone away - clear the hash of avatars
38763892 DependencyManager::get<AvatarManager>()->clearOtherAvatars();
@@ -3888,12 +3904,12 @@ void Application::trackIncomingOctreePacket(NLPacket& packet, SharedNodePointer · 11 unmodified lines
38883904 const QUuid& nodeUUID = sendingNode->getUUID();
38893905
38903906 // now that we know the node ID, let's add these stats to the stats for that node...
3891− _octreeSceneStatsLock.lockForWrite();
3892− if (_octreeServerSceneStats.find(nodeUUID) != _octreeServerSceneStats.end()) {
3893− OctreeSceneStats& stats = _octreeServerSceneStats[nodeUUID];
3894− stats.trackIncomingOctreePacket(packet, wasStatsPacket, sendingNode->getClockSkewUsec());
3895− }
3896− _octreeSceneStatsLock.unlock();
3907+ _octreeServerSceneStats.withWriteLock([&] {
3908+ if (_octreeServerSceneStats.find(nodeUUID) != _octreeServerSceneStats.end()) {
3909+ OctreeSceneStats& stats = _octreeServerSceneStats[nodeUUID];
3910+ stats.trackIncomingOctreePacket(packet, wasStatsPacket, sendingNode->getClockSkewUsec());
3911+ }
3912+ });
38973913 }
38983914 }
38993915
@@ -3907,43 +3923,42 @@ int Application::processOctreeStats(NLPacket& packet, SharedNodePointer sendingN · 7 unmodified lines
39073923 const QUuid& nodeUUID = sendingNode->getUUID();
39083924
39093925 // now that we know the node ID, let's add these stats to the stats for that node...
3910− _octreeSceneStatsLock.lockForWrite();
3911−
3912− OctreeSceneStats& octreeStats = _octreeServerSceneStats[nodeUUID];
3913− statsMessageLength = octreeStats.unpackFromPacket(packet);
3914−
3915− _octreeSceneStatsLock.unlock();
3926+ _octreeServerSceneStats.withWriteLock([&] {
3927+ OctreeSceneStats& octreeStats = _octreeServerSceneStats[nodeUUID];
3928+ statsMessageLength = octreeStats.unpackFromPacket(packet);
39163929
3917− // see if this is the first we've heard of this node...
3918− NodeToJurisdictionMap* jurisdiction = NULL;
3919− QString serverType;
3920− if (sendingNode->getType() == NodeType::EntityServer) {
3921− jurisdiction = &_entityServerJurisdictions;
3922− serverType = "Entity";
3923− }
3930+ // see if this is the first we've heard of this node...
3931+ NodeToJurisdictionMap* jurisdiction = NULL;
3932+ QString serverType;
3933+ if (sendingNode->getType() == NodeType::EntityServer) {
3934+ jurisdiction = &_entityServerJurisdictions;
3935+ serverType = "Entity";
3936+ }
39243937
3925− jurisdiction->lockForRead();
3926− if (jurisdiction->find(nodeUUID) == jurisdiction->end()) {
3927− jurisdiction->unlock();
3928−
3929− VoxelPositionSize rootDetails;
3930− voxelDetailsForCode(octreeStats.getJurisdictionRoot(), rootDetails);
3938+ jurisdiction->withReadLock([&] {
3939+ if (jurisdiction->find(nodeUUID) != jurisdiction->end()) {
3940+ return;
3941+ }
39313942
3932− qCDebug(interfaceapp, "stats from new %s server... [%f, %f, %f, %f]",
3943+ VoxelPositionSize rootDetails;
3944+ voxelDetailsForCode(octreeStats.getJurisdictionRoot(), rootDetails);
3945+
3946+ qCDebug(interfaceapp, "stats from new %s server... [%f, %f, %f, %f]",
39333947 qPrintable(serverType),
39343948 (double)rootDetails.x, (double)rootDetails.y, (double)rootDetails.z, (double)rootDetails.s);
3935− } else {
3936− jurisdiction->unlock();
3937− }
3938− // store jurisdiction details for later use
3939− // This is bit of fiddling is because JurisdictionMap assumes it is the owner of the values used to construct it
3940− // but OctreeSceneStats thinks it's just returning a reference to its contents. So we need to make a copy of the
3941− // details from the OctreeSceneStats to construct the JurisdictionMap
3942− JurisdictionMap jurisdictionMap;
3943− jurisdictionMap.copyContents(octreeStats.getJurisdictionRoot(), octreeStats.getJurisdictionEndNodes());
3944− jurisdiction->lockForWrite();
3945− (*jurisdiction)[nodeUUID] = jurisdictionMap;
3946− jurisdiction->unlock();
3949+ });
3950+ // store jurisdiction details for later use
3951+ // This is bit of fiddling is because JurisdictionMap assumes it is the owner of the values used to construct it
3952+ // but OctreeSceneStats thinks it's just returning a reference to its contents. So we need to make a copy of the
3953+ // details from the OctreeSceneStats to construct the JurisdictionMap
3954+ JurisdictionMap jurisdictionMap;
3955+ jurisdictionMap.copyContents(octreeStats.getJurisdictionRoot(), octreeStats.getJurisdictionEndNodes());
3956+ jurisdiction->withWriteLock([&] {
3957+ (*jurisdiction)[nodeUUID] = jurisdictionMap;
3958+ });
3959+ });
3960+
3961+
39473962
39483963 return statsMessageLength;
39493964 }
@@ -4134,7 +4149,7 @@ bool Application::acceptURL(const QString& urlString) { · 184 unmodified lines
41344149 }
41354150
41364151 void Application::setSessionUUID(const QUuid& sessionUUID) {
4137− _physicsEngine.setSessionUUID(sessionUUID);
4152+ _physicsEngine->setSessionUUID(sessionUUID);
41384153 }
41394154
41404155 bool Application::askToSetAvatarUrl(const QString& url) {
@@ -4389,7 +4404,7 @@ void Application::openUrl(const QUrl& url) { · 248 unmodified lines
43894404 void Application::updateMyAvatarTransform() {
43904405 const float SIMULATION_OFFSET_QUANTIZATION = 16.0f; // meters
43914406 glm::vec3 avatarPosition = _myAvatar->getPosition();
4392− glm::vec3 physicsWorldOffset = _physicsEngine.getOriginOffset();
4407+ glm::vec3 physicsWorldOffset = _physicsEngine->getOriginOffset();
43934408 if (glm::distance(avatarPosition, physicsWorldOffset) > SIMULATION_OFFSET_QUANTIZATION) {
43944409 glm::vec3 newOriginOffset = avatarPosition;
43954410 int halfExtent = (int)HALF_SIMULATION_EXTENT;
@@ -4398,7 +4413,7 @@ void Application::updateMyAvatarTransform() { · 2 unmodified lines
43984413 ((int)(avatarPosition[i] / SIMULATION_OFFSET_QUANTIZATION)) * (int)SIMULATION_OFFSET_QUANTIZATION));
43994414 }
44004415 // TODO: Andrew to replace this with method that actually moves existing object positions in PhysicsEngine
4401− _physicsEngine.setOriginOffset(newOriginOffset);
4416+ _physicsEngine->setOriginOffset(newOriginOffset);
44024417 }
44034418 }
44044419
@@ -4596,7 +4611,7 @@ void Application::checkSkeleton() { · 191 unmodified lines
45964611
45974612 _myAvatar->useFullAvatarURL(AvatarData::defaultFullAvatarModelUrl(), DEFAULT_FULL_AVATAR_MODEL_NAME);
45984613 } else {
4599− _physicsEngine.setCharacterController(_myAvatar->getCharacterController());
4614+ _physicsEngine->setCharacterController(_myAvatar->getCharacterController());
46004615 }
46014616 }
46024617
@@ -5036,7 +5051,7 @@ void Application::emulateMouse(Hand* hand, float click, float shift, int index) · 433 unmodified lines
50365051 glm::vec3 direction = glm::inverse(_myAvatar->getOrientation()) * palm->getFingerDirection();
50375052
50385053 // Get the angles, scaled between (-0.5,0.5)
5039− float xAngle = (atan2(direction.z, direction.x) + M_PI_2);
5054+ float xAngle = (atan2f(direction.z, direction.x) + (float)M_PI_2);
50405055 float yAngle = 0.5f - ((atan2f(direction.z, direction.y) + (float)M_PI_2));
50415056 auto canvasSize = qApp->getCanvasSize();
50425057 // Get the pixel range over which the xAngle and yAngle are scaled