From 9ce1683c50efe75aa1dcf33ffdba56e74e3d0fd4 Mon Sep 17 00:00:00 2001 From: Jeffrey Ventrella Date: Thu, 18 Apr 2013 14:45:54 -0700 Subject: [PATCH] reversed strafe left right, and commented-out updateAvatarHand --- interface/src/Head.cpp | 6 +++--- interface/src/main.cpp | 21 +++++++++++++-------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/interface/src/Head.cpp b/interface/src/Head.cpp index 91a227a72a..6f77ee66dc 100644 --- a/interface/src/Head.cpp +++ b/interface/src/Head.cpp @@ -33,7 +33,7 @@ float MouthWidthChoices[3] = {0.5, 0.77, 0.3}; float browWidth = 0.8; float browThickness = 0.16; -bool usingBigSphereCollisionTest = true; +bool usingBigSphereCollisionTest = false; const float DECAY = 0.1; const float THRUST_MAG = 10.0; @@ -381,11 +381,11 @@ void Head::simulate(float deltaTime) { } if (_driveKeys[RIGHT]) { glm::vec3 right( _avatar.orientation.getRight().x, _avatar.orientation.getRight().y, _avatar.orientation.getRight().z ); - _avatar.thrust -= right * THRUST_MAG; + _avatar.thrust += right * THRUST_MAG; } if (_driveKeys[LEFT]) { glm::vec3 right( _avatar.orientation.getRight().x, _avatar.orientation.getRight().y, _avatar.orientation.getRight().z ); - _avatar.thrust += right * THRUST_MAG; + _avatar.thrust -= right * THRUST_MAG; } if (_driveKeys[UP]) { glm::vec3 up( _avatar.orientation.getUp().x, _avatar.orientation.getUp().y, _avatar.orientation.getUp().z ); diff --git a/interface/src/main.cpp b/interface/src/main.cpp index d81838287e..82bc1d0bbd 100644 --- a/interface/src/main.cpp +++ b/interface/src/main.cpp @@ -363,6 +363,7 @@ void reset_sensors() } } +/* void updateAvatarHand(float deltaTime) { // If mouse is being dragged, send current force to the hand controller if (mousePressed == 1) @@ -376,6 +377,7 @@ void updateAvatarHand(float deltaTime) { //myAvatar.hand->addVelocity(vel*deltaTime); } } +*/ // // Using gyro data, update both view frustum and avatar head position @@ -1357,30 +1359,33 @@ void idle(void) { else { myAvatar.setTriggeringAction( false ); } + + float deltaTime = 1.f/FPS; // // Sample hardware, update view frustum if needed, Lsend avatar data to mixer/agents // updateAvatar( 1.f/FPS ); + //loop through all the other avatars and simulate them. AgentList * agentList = AgentList::getInstance(); for(std::vector::iterator agent = agentList->getAgents().begin(); agent != agentList->getAgents().end(); agent++) { if (agent->getLinkedData() != NULL) { - Head *agentHead = (Head *)agent->getLinkedData(); - agentHead->simulate(1.f/FPS); + Head *avatar = (Head *)agent->getLinkedData(); + avatar->simulate(deltaTime); } } + - - updateAvatarHand(1.f/FPS); + //updateAvatarHand(1.f/FPS); - field.simulate(1.f/FPS); - myAvatar.simulate(1.f/FPS); - balls.simulate(1.f/FPS); - cloud.simulate(1.f/FPS); + field.simulate (deltaTime); + myAvatar.simulate(deltaTime); + balls.simulate (deltaTime); + cloud.simulate (deltaTime); glutPostRedisplay(); lastTimeIdle = check;