Showing the changes to interface/src/avatar/SkeletonModel.cpp (1 of 3 files). Show all
Unified · Split
| @@ -554,6 +554,7 @@ void SkeletonModel::renderRagdoll() { · 553 unmodified lines | ||
| 554 | 554 | float radius1 = 0.008f; |
| 555 | 555 | float radius2 = 0.01f; |
| 556 | 556 | glm::vec3 simulationTranslation = _ragdoll->getTranslationInSimulationFrame(); |
| 557 | + GeometryCache* geometryCache = DependencyManager::get<GeometryCache>(); | |
| 557 | 558 | for (int i = 0; i < numPoints; ++i) { |
| 558 | 559 | glPushMatrix(); |
| 559 | 560 | // NOTE: ragdollPoints are in simulation-frame but we want them to be model-relative |
| @@ -561,9 +562,9 @@ void SkeletonModel::renderRagdoll() { · 1 unmodified line | ||
| 561 | 562 | glTranslatef(position.x, position.y, position.z); |
| 562 | 563 | // draw each point as a yellow hexagon with black border |
| 563 | 564 | glColor4f(0.0f, 0.0f, 0.0f, alpha); |
| 564 | − DependencyManager::get<GeometryCache>()->renderSphere(radius2, BALL_SUBDIVISIONS, BALL_SUBDIVISIONS); | |
| 565 | + geometryCache->renderSphere(radius2, BALL_SUBDIVISIONS, BALL_SUBDIVISIONS); | |
| 565 | 566 | glColor4f(1.0f, 1.0f, 0.0f, alpha); |
| 566 | − DependencyManager::get<GeometryCache>()->renderSphere(radius1, BALL_SUBDIVISIONS, BALL_SUBDIVISIONS); | |
| 567 | + geometryCache->renderSphere(radius1, BALL_SUBDIVISIONS, BALL_SUBDIVISIONS); | |
| 567 | 568 | glPopMatrix(); |
| 568 | 569 | } |
| 569 | 570 | glPopMatrix(); |
| @@ -913,7 +914,8 @@ void SkeletonModel::renderBoundingCollisionShapes(float alpha) { · 343 unmodified lines | ||
| 913 | 914 | endPoint = endPoint - _translation; |
| 914 | 915 | glTranslatef(endPoint.x, endPoint.y, endPoint.z); |
| 915 | 916 | glColor4f(0.6f, 0.6f, 0.8f, alpha); |
| 916 | − DependencyManager::get<GeometryCache>()->renderSphere(_boundingShape.getRadius(), BALL_SUBDIVISIONS, BALL_SUBDIVISIONS); | |
| 917 | + GeometryCache* geometryCache = DependencyManager::get<GeometryCache>(); | |
| 918 | + geometryCache->renderSphere(_boundingShape.getRadius(), BALL_SUBDIVISIONS, BALL_SUBDIVISIONS); | |
| 917 | 919 | |
| 918 | 920 | // draw a yellow sphere at the capsule startpoint |
| 919 | 921 | glm::vec3 startPoint; |
| @@ -922,7 +924,7 @@ void SkeletonModel::renderBoundingCollisionShapes(float alpha) { · 2 unmodified lines | ||
| 922 | 924 | glm::vec3 axis = endPoint - startPoint; |
| 923 | 925 | glTranslatef(-axis.x, -axis.y, -axis.z); |
| 924 | 926 | glColor4f(0.8f, 0.8f, 0.6f, alpha); |
| 925 | − DependencyManager::get<GeometryCache>()->renderSphere(_boundingShape.getRadius(), BALL_SUBDIVISIONS, BALL_SUBDIVISIONS); | |
| 927 | + geometryCache->renderSphere(_boundingShape.getRadius(), BALL_SUBDIVISIONS, BALL_SUBDIVISIONS); | |
| 926 | 928 | |
| 927 | 929 | // draw a green cylinder between the two points |
| 928 | 930 | glm::vec3 origin(0.0f); |
| @@ -948,6 +950,8 @@ void SkeletonModel::renderJointCollisionShapes(float alpha) { · 19 unmodified lines | ||
| 948 | 950 | continue; |
| 949 | 951 | } |
| 950 | 952 | |
| 953 | + GeometryCache* geometryCache = DependencyManager::get<GeometryCache>(); | |
| 954 | + | |
| 951 | 955 | glPushMatrix(); |
| 952 | 956 | // shapes are stored in simulation-frame but we want position to be model-relative |
| 953 | 957 | if (shape->getType() == SPHERE_SHAPE) { |
| @@ -955,7 +959,7 @@ void SkeletonModel::renderJointCollisionShapes(float alpha) { · 1 unmodified line | ||
| 955 | 959 | glTranslatef(position.x, position.y, position.z); |
| 956 | 960 | // draw a grey sphere at shape position |
| 957 | 961 | glColor4f(0.75f, 0.75f, 0.75f, alpha); |
| 958 | − DependencyManager::get<GeometryCache>()->renderSphere(shape->getBoundingRadius(), BALL_SUBDIVISIONS, BALL_SUBDIVISIONS); | |
| 962 | + geometryCache->renderSphere(shape->getBoundingRadius(), BALL_SUBDIVISIONS, BALL_SUBDIVISIONS); | |
| 959 | 963 | } else if (shape->getType() == CAPSULE_SHAPE) { |
| 960 | 964 | CapsuleShape* capsule = static_cast<CapsuleShape*>(shape); |
| 961 | 965 | |
| @@ -965,7 +969,7 @@ void SkeletonModel::renderJointCollisionShapes(float alpha) { · 3 unmodified lines | ||
| 965 | 969 | endPoint = endPoint - simulationTranslation; |
| 966 | 970 | glTranslatef(endPoint.x, endPoint.y, endPoint.z); |
| 967 | 971 | glColor4f(0.6f, 0.6f, 0.8f, alpha); |
| 968 | − DependencyManager::get<GeometryCache>()->renderSphere(capsule->getRadius(), BALL_SUBDIVISIONS, BALL_SUBDIVISIONS); | |
| 972 | + geometryCache->renderSphere(capsule->getRadius(), BALL_SUBDIVISIONS, BALL_SUBDIVISIONS); | |
| 969 | 973 | |
| 970 | 974 | // draw a yellow sphere at the capsule startpoint |
| 971 | 975 | glm::vec3 startPoint; |
| @@ -974,7 +978,7 @@ void SkeletonModel::renderJointCollisionShapes(float alpha) { · 2 unmodified lines | ||
| 974 | 978 | glm::vec3 axis = endPoint - startPoint; |
| 975 | 979 | glTranslatef(-axis.x, -axis.y, -axis.z); |
| 976 | 980 | glColor4f(0.8f, 0.8f, 0.6f, alpha); |
| 977 | − DependencyManager::get<GeometryCache>()->renderSphere(capsule->getRadius(), BALL_SUBDIVISIONS, BALL_SUBDIVISIONS); | |
| 981 | + geometryCache->renderSphere(capsule->getRadius(), BALL_SUBDIVISIONS, BALL_SUBDIVISIONS); | |
| 978 | 982 | |
| 979 | 983 | // draw a green cylinder between the two points |
| 980 | 984 | glm::vec3 origin(0.0f); |