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 | 780 | _boundingShape.setRotation(_rotation); |
| 781 | 781 | } |
| 782 | 782 | |
| 783 | −void SkeletonModel::renderBoundingCollisionShapes(float alpha) { | |
| 783 | +void SkeletonModel::renderBoundingCollisionShapes(gpu::Batch& batch, float alpha) { | |
| 784 | 784 | const int BALL_SUBDIVISIONS = 10; |
| 785 | 785 | #if 0 |
| 786 | 786 | if (_shapes.isEmpty()) { |
| @@ -788,17 +788,17 @@ void SkeletonModel::renderBoundingCollisionShapes(float alpha) { · 1 unmodified line | ||
| 788 | 788 | // so no need to render it |
| 789 | 789 | return; |
| 790 | 790 | } |
| 791 | − glPushMatrix(); | |
| 792 | − | |
| 793 | 791 | Application::getInstance()->loadTranslatedViewMatrix(_translation); |
| 794 | 792 | |
| 795 | 793 | // draw a blue sphere at the capsule endpoint |
| 796 | 794 | glm::vec3 endPoint; |
| 797 | 795 | _boundingShape.getEndPoint(endPoint); |
| 798 | 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 | 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 | 803 | // draw a yellow sphere at the capsule startpoint |
| 804 | 804 | glm::vec3 startPoint; |
| @@ -810,9 +810,7 @@ void SkeletonModel::renderBoundingCollisionShapes(float alpha) { · 5 unmodified lines | ||
| 810 | 810 | |
| 811 | 811 | // draw a green cylinder between the two points |
| 812 | 812 | glm::vec3 origin(0.0f); |
| 813 | − Avatar::renderJointConnectingCone( origin, axis, _boundingShape.getRadius(), _boundingShape.getRadius(), glm::vec4(0.6f, 0.8f, 0.6f, alpha)); | |
| 814 | − | |
| 815 | − glPopMatrix(); | |
| 813 | + Avatar::renderJointConnectingCone(batch, origin, axis, _boundingShape.getRadius(), _boundingShape.getRadius(), glm::vec4(0.6f, 0.8f, 0.6f, alpha)); | |
| 816 | 814 | #endif |
| 817 | 815 | } |
| 818 | 816 | |