Showing the changes to interface/src/avatar/SkeletonModel.cpp (1 of 1 file). Show all
Unified · Split
| @@ -791,19 +791,24 @@ void SkeletonModel::renderBoundingCollisionShapes(gpu::Batch& batch, float alpha · 790 unmodified lines | ||
| 791 | 791 | transform.setTranslation(endPoint); |
| 792 | 792 | batch.setModelTransform(transform); |
| 793 | 793 | auto geometryCache = DependencyManager::get<GeometryCache>(); |
| 794 | − geometryCache->renderSphere(batch, _boundingShape.getRadius(), BALL_SUBDIVISIONS, BALL_SUBDIVISIONS, glm::vec4(0.6f, 0.6f, 0.8f, alpha)); | |
| 794 | + geometryCache->renderSphere(batch, _boundingShape.getRadius(), BALL_SUBDIVISIONS, BALL_SUBDIVISIONS, | |
| 795 | + glm::vec4(0.6f, 0.6f, 0.8f, alpha)); | |
| 795 | 796 | |
| 796 | 797 | // draw a yellow sphere at the capsule startpoint |
| 797 | 798 | glm::vec3 startPoint; |
| 798 | 799 | _boundingShape.getStartPoint(startPoint); |
| 799 | 800 | startPoint = startPoint - _translation; |
| 800 | 801 | glm::vec3 axis = endPoint - startPoint; |
| 801 | − glTranslatef(-axis.x, -axis.y, -axis.z); | |
| 802 | − geometryCache->renderSphere(_boundingShape.getRadius(), BALL_SUBDIVISIONS, BALL_SUBDIVISIONS, glm::vec4(0.8f, 0.8f, 0.6f, alpha)); | |
| 802 | + Transform axisTransform = Transform(); | |
| 803 | + axisTransform.setTranslation(-axis); | |
| 804 | + batch.setModelTransform(axisTransform); | |
| 805 | + geometryCache->renderSphere(batch, _boundingShape.getRadius(), BALL_SUBDIVISIONS, BALL_SUBDIVISIONS, | |
| 806 | + glm::vec4(0.8f, 0.8f, 0.6f, alpha)); | |
| 803 | 807 | |
| 804 | 808 | // draw a green cylinder between the two points |
| 805 | 809 | glm::vec3 origin(0.0f); |
| 806 | − Avatar::renderJointConnectingCone(batch, origin, axis, _boundingShape.getRadius(), _boundingShape.getRadius(), glm::vec4(0.6f, 0.8f, 0.6f, alpha)); | |
| 810 | + Avatar::renderJointConnectingCone(batch, origin, axis, _boundingShape.getRadius(), _boundingShape.getRadius(), | |
| 811 | + glm::vec4(0.6f, 0.8f, 0.6f, alpha)); | |
| 807 | 812 | } |
| 808 | 813 | |
| 809 | 814 | bool SkeletonModel::hasSkeleton() { |