mirror of
https://github.com/overte-org/overte.git
synced 2025-07-29 16:20:00 +02:00
Don't render body if looking in mirror, don't render test sphere over and over again for everyone.
This commit is contained in:
parent
803c41d636
commit
5bee5f07e3
1 changed files with 43 additions and 50 deletions
|
@ -729,7 +729,7 @@ void Avatar::render(bool lookingInMirror, glm::vec3 cameraPosition) {
|
||||||
|
|
||||||
_cameraPosition = cameraPosition; // store this for use in various parts of the code
|
_cameraPosition = cameraPosition; // store this for use in various parts of the code
|
||||||
|
|
||||||
if (usingBigSphereCollisionTest) {
|
if (_isMine && usingBigSphereCollisionTest) {
|
||||||
// show TEST big sphere
|
// show TEST big sphere
|
||||||
glColor4f(0.5f, 0.6f, 0.8f, 0.7);
|
glColor4f(0.5f, 0.6f, 0.8f, 0.7);
|
||||||
glPushMatrix();
|
glPushMatrix();
|
||||||
|
@ -1127,15 +1127,17 @@ void Avatar::updateArmIKAndConstraints(float deltaTime) {
|
||||||
|
|
||||||
void Avatar::renderBody(bool lookingInMirror) {
|
void Avatar::renderBody(bool lookingInMirror) {
|
||||||
|
|
||||||
// Render joint positions as spheres
|
// Render Head
|
||||||
for (int b = 0; b < NUM_AVATAR_JOINTS; b++) {
|
|
||||||
|
|
||||||
if (b == AVATAR_JOINT_HEAD_BASE) { // the head is rendered as a special case
|
|
||||||
if (_displayingHead) {
|
if (_displayingHead) {
|
||||||
_head.render(lookingInMirror);
|
_head.render(lookingInMirror);
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
|
|
||||||
|
// Render reset of body if not in mirror mode
|
||||||
|
if (!lookingInMirror) {
|
||||||
|
// Render joint positions as spheres
|
||||||
|
for (int b = 0; b < NUM_AVATAR_JOINTS; b++) {
|
||||||
|
|
||||||
|
if (b != AVATAR_JOINT_HEAD_BASE) {
|
||||||
glColor3f(
|
glColor3f(
|
||||||
skinColor[0] + _joint[b].touchForce * 0.3f,
|
skinColor[0] + _joint[b].touchForce * 0.3f,
|
||||||
skinColor[1] - _joint[b].touchForce * 0.2f,
|
skinColor[1] - _joint[b].touchForce * 0.2f,
|
||||||
|
@ -1169,16 +1171,7 @@ void Avatar::renderBody(bool lookingInMirror) {
|
||||||
_joint[_joint[j].parent ].radius * 0.8,
|
_joint[_joint[j].parent ].radius * 0.8,
|
||||||
_joint[j ].radius * 0.8
|
_joint[j ].radius * 0.8
|
||||||
);
|
);
|
||||||
|
}
|
||||||
/*
|
|
||||||
// Render lines connecting the joint positions
|
|
||||||
glColor3f(0.4f, 0.5f, 0.6f);
|
|
||||||
glLineWidth(3.0);
|
|
||||||
glBegin(GL_LINE_STRIP);
|
|
||||||
glVertex3fv(&_joint[ _joint[ b ].parent ].springyPosition.x);
|
|
||||||
glVertex3fv(&_joint[ b ].springyPosition.x);
|
|
||||||
glEnd();
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue