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 | transform.setTranslation(endPoint); | 791 | transform.setTranslation(endPoint); |
| 792 | batch.setModelTransform(transform); | 792 | batch.setModelTransform(transform); |
| 793 | auto geometryCache = DependencyManager::get<GeometryCache>(); | 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 | // draw a yellow sphere at the capsule startpoint | 797 | // draw a yellow sphere at the capsule startpoint |
| 797 | glm::vec3 startPoint; | 798 | glm::vec3 startPoint; |
| 798 | _boundingShape.getStartPoint(startPoint); | 799 | _boundingShape.getStartPoint(startPoint); |
| 799 | startPoint = startPoint - _translation; | 800 | startPoint = startPoint - _translation; |
| 800 | glm::vec3 axis = endPoint - startPoint; | 801 | glm::vec3 axis = endPoint - startPoint; |
| 801 | glTranslatef(-axis.x, -axis.y, -axis.z); | 802 | Transform axisTransform = Transform(); |
| 802 | geometryCache->renderSphere(_boundingShape.getRadius(), BALL_SUBDIVISIONS, BALL_SUBDIVISIONS, glm::vec4(0.8f, 0.8f, 0.6f, alpha)); | 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 | // draw a green cylinder between the two points | 808 | // draw a green cylinder between the two points |
| 805 | glm::vec3 origin(0.0f); | 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 | bool SkeletonModel::hasSkeleton() { | 814 | bool SkeletonModel::hasSkeleton() { |