cleaned up some stuff

This commit is contained in:
Jeffrey Ventrella 2013-05-22 15:50:36 -07:00
parent 7cae808d29
commit 0b014c5635
5 changed files with 11 additions and 42 deletions

View file

@ -1702,11 +1702,7 @@ void Application::displaySide(Camera& whichCamera) {
// Render my own Avatar // Render my own Avatar
_myAvatar.render(_lookingInMirror->isChecked(), _myCamera.getPosition()); _myAvatar.render(_lookingInMirror->isChecked(), _myCamera.getPosition());
if (_renderLookatOn->isChecked()) { _myAvatar.setDisplayingLookatVectors(_renderLookatOn->isChecked());
_myAvatar.setDisplayingLookatVectors(true);
} else {
_myAvatar.setDisplayingLookatVectors(false);
}
} }
// Render the world box // Render the world box

View file

@ -400,7 +400,7 @@ void Avatar::simulate(float deltaTime, Transmitter* transmitter) {
// set head lookat position // set head lookat position
if (_isMine) { if (_isMine) {
if (_interactingOther) { if (_interactingOther) {
_head.setLookAtPosition(_interactingOther->getAverageEyePosition()); _head.setLookAtPosition(_interactingOther->caclulateAverageEyePosition());
} else { } else {
_head.setLookAtPosition(glm::vec3(0.0f, 0.0f, 0.0f)); // 0,0,0 represents NOT looking at anything _head.setLookAtPosition(glm::vec3(0.0f, 0.0f, 0.0f)); // 0,0,0 represents NOT looking at anything
} }
@ -421,11 +421,6 @@ void Avatar::simulate(float deltaTime, Transmitter* transmitter) {
} }
} }
glm::vec3 Avatar::getAverageEyePosition() {
return _head.getAverageEyePosition();
}
void Avatar::checkForMouseRayTouching() { void Avatar::checkForMouseRayTouching() {
for (int b = 0; b < NUM_AVATAR_JOINTS; b++) { for (int b = 0; b < NUM_AVATAR_JOINTS; b++) {
@ -587,15 +582,6 @@ void Avatar::updateCollisionWithSphere(glm::vec3 position, float radius, float d
} }
} }
} }
/*
if (jointCollision) {
if (!_usingBodySprings) {
_usingBodySprings = true;
initializeBodySprings();
}
}
*/
} }
} }
@ -716,13 +702,6 @@ void Avatar::applyCollisionWithOtherAvatar(Avatar * otherAvatar, float deltaTime
otherAvatar->_velocity *= bodyMomentum; otherAvatar->_velocity *= bodyMomentum;
} }
void Avatar::setDisplayingHead(bool displayingHead) {
_displayingHead = displayingHead;
}
void Avatar::setDisplayingLookatVectors(bool displayingLookatVectors) {
_head.setRenderLookatVectors(displayingLookatVectors);
}
static TextRenderer* textRenderer() { static TextRenderer* textRenderer() {
static TextRenderer* renderer = new TextRenderer(SANS_FONT_FAMILY, 24, -1, false, TextRenderer::SHADOW_EFFECT); static TextRenderer* renderer = new TextRenderer(SANS_FONT_FAMILY, 24, -1, false, TextRenderer::SHADOW_EFFECT);

View file

@ -94,7 +94,7 @@ public:
float getAbsoluteHeadYaw() const; float getAbsoluteHeadYaw() const;
float getAbsoluteHeadPitch() const; float getAbsoluteHeadPitch() const;
glm::vec3 getAverageEyePosition(); // get the position smack-dab between the eyes (for lookat) glm::vec3 caclulateAverageEyePosition() { return _head.caclulateAverageEyePosition(); } // get the position smack-dab between the eyes (for lookat)
const glm::vec3& getHeadPosition() const ; // get the position of the avatar's rigid body head const glm::vec3& getHeadPosition() const ; // get the position of the avatar's rigid body head
const glm::vec3& getSpringyHeadPosition() const ; // get the springy position of the avatar's head const glm::vec3& getSpringyHeadPosition() const ; // get the springy position of the avatar's head
const glm::vec3& getJointPosition(AvatarJointID j) const { return _joint[j].springyPosition; }; const glm::vec3& getJointPosition(AvatarJointID j) const { return _joint[j].springyPosition; };
@ -113,9 +113,9 @@ public:
void simulate(float deltaTime, Transmitter* transmitter); void simulate(float deltaTime, Transmitter* transmitter);
void setMovedHandOffset(glm::vec3 movedHandOffset) { _movedHandOffset = movedHandOffset; } void setMovedHandOffset(glm::vec3 movedHandOffset) { _movedHandOffset = movedHandOffset; }
void updateArmIKAndConstraints( float deltaTime ); void updateArmIKAndConstraints( float deltaTime );
void setDisplayingHead( bool displayingHead ); void setDisplayingHead( bool displayingHead ) { _displayingHead = displayingHead; }
void setDisplayingLookatVectors(bool displayingLookatVectors); void setDisplayingLookatVectors(bool displayingLookatVectors) { _head.setRenderLookatVectors(displayingLookatVectors); }
// Set what driving keys are being pressed to control thrust levels // Set what driving keys are being pressed to control thrust levels
void setDriveKeys(int key, bool val) { _driveKeys[key] = val; }; void setDriveKeys(int key, bool val) { _driveKeys[key] = val; };
bool getDriveKeys(int key) { return _driveKeys[key]; }; bool getDriveKeys(int key) { return _driveKeys[key]; };

View file

@ -7,7 +7,6 @@
#include "Head.h" #include "Head.h"
#include "Util.h" #include "Util.h"
#include <vector> #include <vector>
#include <SharedUtil.h>
#include <lodepng.h> #include <lodepng.h>
using namespace std; using namespace std;
@ -118,7 +117,7 @@ void Head::determineIfLookingAtSomething() {
if ( fabs(_lookAtPosition.x + _lookAtPosition.y + _lookAtPosition.z) == 0.0 ) { // a lookatPosition of 0,0,0 signifies NOT looking if ( fabs(_lookAtPosition.x + _lookAtPosition.y + _lookAtPosition.z) == 0.0 ) { // a lookatPosition of 0,0,0 signifies NOT looking
_lookingAtSomething = false; _lookingAtSomething = false;
} else { } else {
glm::vec3 targetLookatAxis = glm::normalize(_lookAtPosition - getAverageEyePosition()); glm::vec3 targetLookatAxis = glm::normalize(_lookAtPosition - caclulateAverageEyePosition());
float dot = glm::dot(targetLookatAxis, _orientation.getFront()); float dot = glm::dot(targetLookatAxis, _orientation.getFront());
if (dot < MINIMUM_EYE_ROTATION_DOT) { // too far off from center for the eyes to rotate if (dot < MINIMUM_EYE_ROTATION_DOT) { // too far off from center for the eyes to rotate
_lookingAtSomething = false; _lookingAtSomething = false;
@ -128,10 +127,6 @@ void Head::determineIfLookingAtSomething() {
} }
} }
glm::vec3 Head::getAverageEyePosition() {
return _leftEyePosition + (_rightEyePosition - _leftEyePosition ) * ONE_HALF;
}
void Head::calculateGeometry(bool lookingInMirror) { void Head::calculateGeometry(bool lookingInMirror) {
//generate orientation directions based on Euler angles... //generate orientation directions based on Euler angles...
@ -188,10 +183,8 @@ void Head::render(bool lookingInMirror) {
renderMouth(); renderMouth();
renderEyeBrows(); renderEyeBrows();
if (_renderLookatVectors) { if (_renderLookatVectors && _lookingAtSomething) {
if (_lookingAtSomething) { renderLookatVectors(_leftEyePosition, _rightEyePosition, _lookAtPosition);
renderLookatVectors(_leftEyePosition, _rightEyePosition, _lookAtPosition);
}
} }
} }

View file

@ -15,6 +15,7 @@
#include "InterfaceConfig.h" #include "InterfaceConfig.h"
#include "SerialInterface.h" #include "SerialInterface.h"
#include "Orientation.h" #include "Orientation.h"
#include <SharedUtil.h>
enum eyeContactTargets enum eyeContactTargets
{ {
@ -45,7 +46,7 @@ public:
const bool getReturnToCenter() const { return _returnHeadToCenter; } // Do you want head to try to return to center (depends on interface detected) const bool getReturnToCenter() const { return _returnHeadToCenter; } // Do you want head to try to return to center (depends on interface detected)
float getAverageLoudness() {return _averageLoudness;}; float getAverageLoudness() {return _averageLoudness;};
glm::vec3 getAverageEyePosition(); glm::vec3 caclulateAverageEyePosition() { return _leftEyePosition + (_rightEyePosition - _leftEyePosition ) * ONE_HALF; }
float yawRate; float yawRate;
float noise; float noise;