mirror of
https://github.com/overte-org/overte.git
synced 2025-04-22 17:53:32 +02:00
cleaned up some stuff
This commit is contained in:
parent
7cae808d29
commit
0b014c5635
5 changed files with 11 additions and 42 deletions
|
@ -1702,11 +1702,7 @@ void Application::displaySide(Camera& whichCamera) {
|
|||
// Render my own Avatar
|
||||
_myAvatar.render(_lookingInMirror->isChecked(), _myCamera.getPosition());
|
||||
|
||||
if (_renderLookatOn->isChecked()) {
|
||||
_myAvatar.setDisplayingLookatVectors(true);
|
||||
} else {
|
||||
_myAvatar.setDisplayingLookatVectors(false);
|
||||
}
|
||||
_myAvatar.setDisplayingLookatVectors(_renderLookatOn->isChecked());
|
||||
}
|
||||
|
||||
// Render the world box
|
||||
|
|
|
@ -400,7 +400,7 @@ void Avatar::simulate(float deltaTime, Transmitter* transmitter) {
|
|||
// set head lookat position
|
||||
if (_isMine) {
|
||||
if (_interactingOther) {
|
||||
_head.setLookAtPosition(_interactingOther->getAverageEyePosition());
|
||||
_head.setLookAtPosition(_interactingOther->caclulateAverageEyePosition());
|
||||
} else {
|
||||
_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() {
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
void Avatar::setDisplayingHead(bool displayingHead) {
|
||||
_displayingHead = displayingHead;
|
||||
}
|
||||
|
||||
void Avatar::setDisplayingLookatVectors(bool displayingLookatVectors) {
|
||||
_head.setRenderLookatVectors(displayingLookatVectors);
|
||||
}
|
||||
|
||||
static TextRenderer* textRenderer() {
|
||||
static TextRenderer* renderer = new TextRenderer(SANS_FONT_FAMILY, 24, -1, false, TextRenderer::SHADOW_EFFECT);
|
||||
|
|
|
@ -94,7 +94,7 @@ public:
|
|||
|
||||
float getAbsoluteHeadYaw() 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& getSpringyHeadPosition() const ; // get the springy position of the avatar's head
|
||||
const glm::vec3& getJointPosition(AvatarJointID j) const { return _joint[j].springyPosition; };
|
||||
|
@ -113,9 +113,9 @@ public:
|
|||
void simulate(float deltaTime, Transmitter* transmitter);
|
||||
void setMovedHandOffset(glm::vec3 movedHandOffset) { _movedHandOffset = movedHandOffset; }
|
||||
void updateArmIKAndConstraints( float deltaTime );
|
||||
void setDisplayingHead( bool displayingHead );
|
||||
void setDisplayingLookatVectors(bool displayingLookatVectors);
|
||||
|
||||
void setDisplayingHead( bool displayingHead ) { _displayingHead = displayingHead; }
|
||||
void setDisplayingLookatVectors(bool displayingLookatVectors) { _head.setRenderLookatVectors(displayingLookatVectors); }
|
||||
|
||||
// Set what driving keys are being pressed to control thrust levels
|
||||
void setDriveKeys(int key, bool val) { _driveKeys[key] = val; };
|
||||
bool getDriveKeys(int key) { return _driveKeys[key]; };
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
#include "Head.h"
|
||||
#include "Util.h"
|
||||
#include <vector>
|
||||
#include <SharedUtil.h>
|
||||
#include <lodepng.h>
|
||||
|
||||
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
|
||||
_lookingAtSomething = false;
|
||||
} else {
|
||||
glm::vec3 targetLookatAxis = glm::normalize(_lookAtPosition - getAverageEyePosition());
|
||||
glm::vec3 targetLookatAxis = glm::normalize(_lookAtPosition - caclulateAverageEyePosition());
|
||||
float dot = glm::dot(targetLookatAxis, _orientation.getFront());
|
||||
if (dot < MINIMUM_EYE_ROTATION_DOT) { // too far off from center for the eyes to rotate
|
||||
_lookingAtSomething = false;
|
||||
|
@ -128,10 +127,6 @@ void Head::determineIfLookingAtSomething() {
|
|||
}
|
||||
}
|
||||
|
||||
glm::vec3 Head::getAverageEyePosition() {
|
||||
return _leftEyePosition + (_rightEyePosition - _leftEyePosition ) * ONE_HALF;
|
||||
}
|
||||
|
||||
void Head::calculateGeometry(bool lookingInMirror) {
|
||||
//generate orientation directions based on Euler angles...
|
||||
|
||||
|
@ -188,10 +183,8 @@ void Head::render(bool lookingInMirror) {
|
|||
renderMouth();
|
||||
renderEyeBrows();
|
||||
|
||||
if (_renderLookatVectors) {
|
||||
if (_lookingAtSomething) {
|
||||
renderLookatVectors(_leftEyePosition, _rightEyePosition, _lookAtPosition);
|
||||
}
|
||||
if (_renderLookatVectors && _lookingAtSomething) {
|
||||
renderLookatVectors(_leftEyePosition, _rightEyePosition, _lookAtPosition);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
#include "InterfaceConfig.h"
|
||||
#include "SerialInterface.h"
|
||||
#include "Orientation.h"
|
||||
#include <SharedUtil.h>
|
||||
|
||||
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)
|
||||
float getAverageLoudness() {return _averageLoudness;};
|
||||
glm::vec3 getAverageEyePosition();
|
||||
glm::vec3 caclulateAverageEyePosition() { return _leftEyePosition + (_rightEyePosition - _leftEyePosition ) * ONE_HALF; }
|
||||
|
||||
float yawRate;
|
||||
float noise;
|
||||
|
|
Loading…
Reference in a new issue