mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-25 17:14:59 +02:00
bunch of const changes for glm::vec3 in Avatar and Orientation
This commit is contained in:
parent
8370fd2d19
commit
215efe3b78
4 changed files with 18 additions and 57 deletions
|
@ -557,11 +557,6 @@ float Avatar::getHeight() {
|
|||
return COLLISION_HEIGHT;
|
||||
}
|
||||
|
||||
|
||||
glm::vec3 Avatar::getBodyUpDirection() {
|
||||
return _orientation.getUp();
|
||||
}
|
||||
|
||||
// This is a workspace for testing avatar body collision detection and response
|
||||
void Avatar::updateAvatarCollisionDetectionAndResponse(glm::vec3 collisionPosition,
|
||||
float collisionGirth,
|
||||
|
@ -1028,49 +1023,15 @@ void Avatar::updateBodySprings( float deltaTime ) {
|
|||
}
|
||||
}
|
||||
|
||||
glm::vec3 Avatar::getHeadLookatDirection() {
|
||||
return glm::vec3
|
||||
(
|
||||
_orientation.getFront().x,
|
||||
_orientation.getFront().y,
|
||||
_orientation.getFront().z
|
||||
);
|
||||
}
|
||||
|
||||
glm::vec3 Avatar::getHeadLookatDirectionUp() {
|
||||
return glm::vec3
|
||||
(
|
||||
_orientation.getUp().x,
|
||||
_orientation.getUp().y,
|
||||
_orientation.getUp().z
|
||||
);
|
||||
}
|
||||
|
||||
glm::vec3 Avatar::getHeadLookatDirectionRight() {
|
||||
return glm::vec3
|
||||
(
|
||||
_orientation.getRight().x,
|
||||
_orientation.getRight().y,
|
||||
_orientation.getRight().z
|
||||
);
|
||||
}
|
||||
|
||||
glm::vec3 Avatar::getHeadPosition() {
|
||||
const glm::vec3& Avatar::getHeadPosition() const {
|
||||
|
||||
if ( _usingBodySprings ) {
|
||||
if (_usingBodySprings) {
|
||||
return _bone[ AVATAR_BONE_HEAD ].springyPosition;
|
||||
}
|
||||
|
||||
return _bone[ AVATAR_BONE_HEAD ].position;
|
||||
}
|
||||
|
||||
|
||||
glm::vec3 Avatar::getBonePosition( AvatarBoneID b ) {
|
||||
return _bone[b].position;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Avatar::updateHandMovement( float deltaTime ) {
|
||||
glm::vec3 transformedHandMovement;
|
||||
|
||||
|
|
|
@ -178,12 +178,12 @@ class Avatar : public AvatarData {
|
|||
float getBodyYaw() {return _bodyYaw;};
|
||||
void addBodyYaw(float y) {_bodyYaw += y;};
|
||||
|
||||
glm::vec3 getHeadLookatDirection();
|
||||
glm::vec3 getHeadLookatDirectionUp();
|
||||
glm::vec3 getHeadLookatDirectionRight();
|
||||
glm::vec3 getHeadPosition();
|
||||
glm::vec3 getBonePosition( AvatarBoneID b );
|
||||
glm::vec3 getBodyUpDirection();
|
||||
const glm::vec3& getHeadLookatDirection() const { return _orientation.getFront(); };
|
||||
const glm::vec3& getHeadLookatDirectionUp() const { return _orientation.getUp(); };
|
||||
const glm::vec3& getHeadLookatDirectionRight() const { return _orientation.getRight(); };
|
||||
const glm::vec3& getHeadPosition() const ;
|
||||
const glm::vec3& getBonePosition(AvatarBoneID b) const { return _bone[b].position; };
|
||||
const glm::vec3& getBodyUpDirection() const { return _orientation.getUp(); };
|
||||
float getGirth();
|
||||
float getHeight();
|
||||
|
||||
|
|
|
@ -278,9 +278,9 @@ void drawGroundPlaneGrid( float size, int resolution )
|
|||
|
||||
|
||||
void renderOrientationDirections( glm::vec3 position, Orientation orientation, float size ) {
|
||||
glm::vec3 pRight = position + orientation.right * size;
|
||||
glm::vec3 pUp = position + orientation.up * size;
|
||||
glm::vec3 pFront = position + orientation.front * size;
|
||||
glm::vec3 pRight = position + orientation.getRight() * size;
|
||||
glm::vec3 pUp = position + orientation.getUp() * size;
|
||||
glm::vec3 pFront = position + orientation.getFront() * size;
|
||||
|
||||
glColor3f( 1.0f, 0.0f, 0.0f );
|
||||
glBegin( GL_LINE_STRIP );
|
||||
|
|
|
@ -25,6 +25,10 @@ private:
|
|||
float _pitch;
|
||||
float _roll;
|
||||
|
||||
glm::vec3 right;
|
||||
glm::vec3 up;
|
||||
glm::vec3 front;
|
||||
|
||||
void update(); // actually updates the vectors from yaw, pitch, roll
|
||||
|
||||
public:
|
||||
|
@ -41,13 +45,9 @@ public:
|
|||
void set( Orientation );
|
||||
void setToIdentity();
|
||||
|
||||
glm::vec3 right;
|
||||
glm::vec3 up;
|
||||
glm::vec3 front;
|
||||
|
||||
glm::vec3 getRight() { return right; }
|
||||
glm::vec3 getUp() { return up; }
|
||||
glm::vec3 getFront() { return front; }
|
||||
const glm::vec3& getRight() const { return right; }
|
||||
const glm::vec3& getUp() const { return up; }
|
||||
const glm::vec3& getFront() const { return front; }
|
||||
|
||||
void setRightUpFront( const glm::vec3 &, const glm::vec3 &, const glm::vec3 & );
|
||||
|
||||
|
|
Loading…
Reference in a new issue