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 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 );

View file

@ -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<Agent>::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;