mirror of
https://github.com/overte-org/overte.git
synced 2025-08-04 04:03:35 +02:00
fix broken build from merge in Skeleton
This commit is contained in:
parent
4db3d9606f
commit
ddcaa513a1
1 changed files with 30 additions and 17 deletions
|
@ -42,24 +42,37 @@ bool SkeletonModel::render(float alpha) {
|
||||||
glm::vec3 skinColor, darkSkinColor;
|
glm::vec3 skinColor, darkSkinColor;
|
||||||
_owningAvatar->getSkinColors(skinColor, darkSkinColor);
|
_owningAvatar->getSkinColors(skinColor, darkSkinColor);
|
||||||
|
|
||||||
glColor4f(skinColor.r, skinColor.g, skinColor.b, alpha);
|
for (int i = 0; i < _jointStates.size(); i++) {
|
||||||
const float BALL_RADIUS = 0.005f;
|
glPushMatrix();
|
||||||
const int BALL_SUBDIVISIONS = 10;
|
|
||||||
glutSolidSphere(BALL_RADIUS * _owningAvatar->getScale(), BALL_SUBDIVISIONS, BALL_SUBDIVISIONS);
|
glm::vec3 position;
|
||||||
|
getJointPosition(i, position);
|
||||||
glPopMatrix();
|
glTranslatef(position.x, position.y, position.z);
|
||||||
|
|
||||||
int parentIndex = geometry.joints[i].parentIndex;
|
glm::quat rotation;
|
||||||
if (parentIndex == -1) {
|
getJointRotation(i, rotation);
|
||||||
continue;
|
glm::vec3 axis = glm::axis(rotation);
|
||||||
|
glRotatef(glm::angle(rotation), axis.x, axis.y, axis.z);
|
||||||
|
|
||||||
|
glColor4f(skinColor.r, skinColor.g, skinColor.b, alpha);
|
||||||
|
const float BALL_RADIUS = 0.005f;
|
||||||
|
const int BALL_SUBDIVISIONS = 10;
|
||||||
|
glutSolidSphere(BALL_RADIUS * _owningAvatar->getScale(), BALL_SUBDIVISIONS, BALL_SUBDIVISIONS);
|
||||||
|
|
||||||
|
glPopMatrix();
|
||||||
|
|
||||||
|
int parentIndex = geometry.joints[i].parentIndex;
|
||||||
|
if (parentIndex == -1) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
glColor4f(darkSkinColor.r, darkSkinColor.g, darkSkinColor.b, alpha);
|
||||||
|
|
||||||
|
glm::vec3 parentPosition;
|
||||||
|
getJointPosition(parentIndex, parentPosition);
|
||||||
|
const float STICK_RADIUS = BALL_RADIUS * 0.1f;
|
||||||
|
Avatar::renderJointConnectingCone(parentPosition, position, STICK_RADIUS * _owningAvatar->getScale(),
|
||||||
|
STICK_RADIUS * _owningAvatar->getScale());
|
||||||
}
|
}
|
||||||
glColor4f(darkSkinColor.r, darkSkinColor.g, darkSkinColor.b, alpha);
|
|
||||||
|
|
||||||
glm::vec3 parentPosition;
|
|
||||||
getJointPosition(parentIndex, parentPosition);
|
|
||||||
const float STICK_RADIUS = BALL_RADIUS * 0.1f;
|
|
||||||
Avatar::renderJointConnectingCone(parentPosition, position, STICK_RADIUS * _owningAvatar->getScale(),
|
|
||||||
STICK_RADIUS * _owningAvatar->getScale());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Model::render(alpha);
|
Model::render(alpha);
|
||||||
|
|
Loading…
Reference in a new issue