mirror of
https://github.com/overte-org/overte.git
synced 2025-04-23 19:53:30 +02:00
Fixing mohawk orientation
This commit is contained in:
parent
8b5901d904
commit
dc9b2e33b5
2 changed files with 5 additions and 6 deletions
|
@ -55,7 +55,6 @@ Head::Head() :
|
|||
_audioAttack(0.0f),
|
||||
_returnSpringScale(1.0f),
|
||||
_bodyRotation(0.0f, 0.0f, 0.0f),
|
||||
_headRotation(0.0f, 0.0f, 0.0f),
|
||||
_renderLookatVectors(false),
|
||||
_mohawkTriangleFan(NULL),
|
||||
_mohawkColors(NULL)
|
||||
|
@ -180,7 +179,7 @@ void Head::render(bool lookingInMirror) {
|
|||
glEnable(GL_DEPTH_TEST);
|
||||
glEnable(GL_RESCALE_NORMAL);
|
||||
|
||||
renderMohawk();
|
||||
renderMohawk(lookingInMirror);
|
||||
renderHeadSphere();
|
||||
renderEyeBalls();
|
||||
renderEars();
|
||||
|
@ -213,13 +212,15 @@ void Head::createMohawk() {
|
|||
}
|
||||
}
|
||||
|
||||
void Head::renderMohawk() {
|
||||
void Head::renderMohawk(bool lookingInMirror) {
|
||||
if (!_mohawkTriangleFan) {
|
||||
createMohawk();
|
||||
} else {
|
||||
glPushMatrix();
|
||||
glTranslatef(_position.x, _position.y, _position.z);
|
||||
glRotatef(_bodyRotation.y, 0, 1, 0);
|
||||
glRotatef(-(_bodyRotation.y + _yaw) - 90, 0, 1, 0);
|
||||
//glRotatef((lookingInMirror ? _roll: -roll), 0, 0, 1);
|
||||
glRotatef(-_pitch, 1, 0, 0);
|
||||
glBegin(GL_TRIANGLE_FAN);
|
||||
for (int i = 0; i < MOHAWK_TRIANGLES; i++) {
|
||||
glColor3f(_mohawkColors[i].x, _mohawkColors[i].y, _mohawkColors[i].z);
|
||||
|
|
|
@ -36,7 +36,6 @@ public:
|
|||
void setScale (float scale ) { _scale = scale; }
|
||||
void setPosition (glm::vec3 position ) { _position = position; }
|
||||
void setBodyRotation (glm::vec3 bodyRotation ) { _bodyRotation = bodyRotation; }
|
||||
void setRotationOffBody(glm::vec3 headRotation ) { _headRotation = headRotation; }
|
||||
void setGravity (glm::vec3 gravity ) { _gravity = gravity; }
|
||||
void setSkinColor (glm::vec3 skinColor ) { _skinColor = skinColor; }
|
||||
void setSpringScale (float returnSpringScale ) { _returnSpringScale = returnSpringScale; }
|
||||
|
@ -79,7 +78,6 @@ private:
|
|||
float _returnSpringScale; //strength of return springs
|
||||
Orientation _orientation;
|
||||
glm::vec3 _bodyRotation;
|
||||
glm::vec3 _headRotation;
|
||||
bool _renderLookatVectors;
|
||||
glm::vec3* _mohawkTriangleFan;
|
||||
glm::vec3* _mohawkColors;
|
||||
|
|
Loading…
Reference in a new issue