reversed strafe left right, and commented-out updateAvatarHand

This commit is contained in:
Jeffrey Ventrella 2013-04-18 14:45:54 -07:00
parent 449e05fd2a
commit 9ce1683c50
2 changed files with 16 additions and 11 deletions

View file

@ -33,7 +33,7 @@ float MouthWidthChoices[3] = {0.5, 0.77, 0.3};
float browWidth = 0.8; float browWidth = 0.8;
float browThickness = 0.16; float browThickness = 0.16;
bool usingBigSphereCollisionTest = true; bool usingBigSphereCollisionTest = false;
const float DECAY = 0.1; const float DECAY = 0.1;
const float THRUST_MAG = 10.0; const float THRUST_MAG = 10.0;
@ -381,11 +381,11 @@ void Head::simulate(float deltaTime) {
} }
if (_driveKeys[RIGHT]) { if (_driveKeys[RIGHT]) {
glm::vec3 right( _avatar.orientation.getRight().x, _avatar.orientation.getRight().y, _avatar.orientation.getRight().z ); 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]) { if (_driveKeys[LEFT]) {
glm::vec3 right( _avatar.orientation.getRight().x, _avatar.orientation.getRight().y, _avatar.orientation.getRight().z ); 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]) { if (_driveKeys[UP]) {
glm::vec3 up( _avatar.orientation.getUp().x, _avatar.orientation.getUp().y, _avatar.orientation.getUp().z ); glm::vec3 up( _avatar.orientation.getUp().x, _avatar.orientation.getUp().y, _avatar.orientation.getUp().z );

View file

@ -363,6 +363,7 @@ void reset_sensors()
} }
} }
/*
void updateAvatarHand(float deltaTime) { void updateAvatarHand(float deltaTime) {
// If mouse is being dragged, send current force to the hand controller // If mouse is being dragged, send current force to the hand controller
if (mousePressed == 1) if (mousePressed == 1)
@ -376,6 +377,7 @@ void updateAvatarHand(float deltaTime) {
//myAvatar.hand->addVelocity(vel*deltaTime); //myAvatar.hand->addVelocity(vel*deltaTime);
} }
} }
*/
// //
// Using gyro data, update both view frustum and avatar head position // Using gyro data, update both view frustum and avatar head position
@ -1357,30 +1359,33 @@ void idle(void) {
else { else {
myAvatar.setTriggeringAction( false ); myAvatar.setTriggeringAction( false );
} }
float deltaTime = 1.f/FPS;
// //
// Sample hardware, update view frustum if needed, Lsend avatar data to mixer/agents // Sample hardware, update view frustum if needed, Lsend avatar data to mixer/agents
// //
updateAvatar( 1.f/FPS ); updateAvatar( 1.f/FPS );
//loop through all the other avatars and simulate them. //loop through all the other avatars and simulate them.
AgentList * agentList = AgentList::getInstance(); AgentList * agentList = AgentList::getInstance();
for(std::vector<Agent>::iterator agent = agentList->getAgents().begin(); agent != agentList->getAgents().end(); agent++) for(std::vector<Agent>::iterator agent = agentList->getAgents().begin(); agent != agentList->getAgents().end(); agent++)
{ {
if (agent->getLinkedData() != NULL) if (agent->getLinkedData() != NULL)
{ {
Head *agentHead = (Head *)agent->getLinkedData(); Head *avatar = (Head *)agent->getLinkedData();
agentHead->simulate(1.f/FPS); avatar->simulate(deltaTime);
} }
} }
//updateAvatarHand(1.f/FPS);
updateAvatarHand(1.f/FPS);
field.simulate(1.f/FPS); field.simulate (deltaTime);
myAvatar.simulate(1.f/FPS); myAvatar.simulate(deltaTime);
balls.simulate(1.f/FPS); balls.simulate (deltaTime);
cloud.simulate(1.f/FPS); cloud.simulate (deltaTime);
glutPostRedisplay(); glutPostRedisplay();
lastTimeIdle = check; lastTimeIdle = check;