Showing the changes to interface/src/avatar/SkeletonModel.cpp (1 of 231 files). Show all
Unified · Split
| @@ -780,7 +780,7 @@ void SkeletonModel::resetShapePositionsToDefaultPose() { · 779 unmodified lines | |||
| 780 | _boundingShape.setRotation(_rotation); | 780 | _boundingShape.setRotation(_rotation); |
| 781 | } | 781 | } |
| 782 | 782 | ||
| 783 | void SkeletonModel::renderBoundingCollisionShapes(float alpha) { | 783 | void SkeletonModel::renderBoundingCollisionShapes(gpu::Batch& batch, float alpha) { |
| 784 | const int BALL_SUBDIVISIONS = 10; | 784 | const int BALL_SUBDIVISIONS = 10; |
| 785 | #if 0 | 785 | #if 0 |
| 786 | if (_shapes.isEmpty()) { | 786 | if (_shapes.isEmpty()) { |
| @@ -788,17 +788,17 @@ void SkeletonModel::renderBoundingCollisionShapes(float alpha) { · 1 unmodified line | |||
| 788 | // so no need to render it | 788 | // so no need to render it |
| 789 | return; | 789 | return; |
| 790 | } | 790 | } |
| 791 | glPushMatrix(); | ||
| 792 | |||
| 793 | Application::getInstance()->loadTranslatedViewMatrix(_translation); | 791 | Application::getInstance()->loadTranslatedViewMatrix(_translation); |
| 794 | 792 | ||
| 795 | // draw a blue sphere at the capsule endpoint | 793 | // draw a blue sphere at the capsule endpoint |
| 796 | glm::vec3 endPoint; | 794 | glm::vec3 endPoint; |
| 797 | _boundingShape.getEndPoint(endPoint); | 795 | _boundingShape.getEndPoint(endPoint); |
| 798 | endPoint = endPoint - _translation; | 796 | endPoint = endPoint - _translation; |
| 799 | glTranslatef(endPoint.x, endPoint.y, endPoint.z); | 797 | Transform transform = Transform(); |
| 798 | transform.setTranslation(endPoint); | ||
| 799 | batch.setModelTransform(transform); | ||
| 800 | auto geometryCache = DependencyManager::get<GeometryCache>(); | 800 | auto geometryCache = DependencyManager::get<GeometryCache>(); |
| 801 | geometryCache->renderSphere(_boundingShape.getRadius(), BALL_SUBDIVISIONS, BALL_SUBDIVISIONS, glm::vec4(0.6f, 0.6f, 0.8f, alpha)); | 801 | geometryCache->renderSphere(batch, _boundingShape.getRadius(), BALL_SUBDIVISIONS, BALL_SUBDIVISIONS, glm::vec4(0.6f, 0.6f, 0.8f, alpha)); |
| 802 | 802 | ||
| 803 | // draw a yellow sphere at the capsule startpoint | 803 | // draw a yellow sphere at the capsule startpoint |
| 804 | glm::vec3 startPoint; | 804 | glm::vec3 startPoint; |
| @@ -810,9 +810,7 @@ void SkeletonModel::renderBoundingCollisionShapes(float alpha) { · 5 unmodified lines | |||
| 810 | 810 | ||
| 811 | // draw a green cylinder between the two points | 811 | // draw a green cylinder between the two points |
| 812 | glm::vec3 origin(0.0f); | 812 | glm::vec3 origin(0.0f); |
| 813 | Avatar::renderJointConnectingCone( origin, axis, _boundingShape.getRadius(), _boundingShape.getRadius(), glm::vec4(0.6f, 0.8f, 0.6f, alpha)); | 813 | Avatar::renderJointConnectingCone(batch, origin, axis, _boundingShape.getRadius(), _boundingShape.getRadius(), glm::vec4(0.6f, 0.8f, 0.6f, alpha)); |
| 814 | |||
| 815 | glPopMatrix(); | ||
| 816 | #endif | 814 | #endif |
| 817 | } | 815 | } |
| 818 | 816 | ||