Showing the changes to interface/src/avatar/SkeletonModel.cpp (1 of 33 files). Show all
Unified · Split
| @@ -639,27 +639,25 @@ void SkeletonModel::renderBoundingCollisionShapes(gpu::Batch& batch, float alpha · 638 unmodified lines | ||
| 639 | 639 | |
| 640 | 640 | auto geometryCache = DependencyManager::get<GeometryCache>(); |
| 641 | 641 | auto deferredLighting = DependencyManager::get<DeferredLightingEffect>(); |
| 642 | − Transform transform; // = Transform(); | |
| 643 | − | |
| 644 | 642 | // draw a blue sphere at the capsule top point |
| 645 | 643 | glm::vec3 topPoint = _translation + _boundingCapsuleLocalOffset + (0.5f * _boundingCapsuleHeight) * glm::vec3(0.0f, 1.0f, 0.0f); |
| 646 | − transform.setTranslation(topPoint); | |
| 647 | − batch.setModelTransform(transform); | |
| 648 | − deferredLighting->bindSimpleProgram(batch); | |
| 649 | − geometryCache->renderSphere(batch, _boundingCapsuleRadius, BALL_SUBDIVISIONS, BALL_SUBDIVISIONS, | |
| 650 | − glm::vec4(0.6f, 0.6f, 0.8f, alpha)); | |
| 644 | + | |
| 645 | + deferredLighting->renderSolidSphereInstance(batch, | |
| 646 | + Transform().setTranslation(topPoint).postScale(_boundingCapsuleRadius * 2.0), | |
| 647 | + glm::vec4(0.6f, 0.6f, 0.8f, alpha)); | |
| 651 | 648 | |
| 652 | 649 | // draw a yellow sphere at the capsule bottom point |
| 653 | 650 | glm::vec3 bottomPoint = topPoint - glm::vec3(0.0f, _boundingCapsuleHeight, 0.0f); |
| 654 | 651 | glm::vec3 axis = topPoint - bottomPoint; |
| 655 | − transform.setTranslation(bottomPoint); | |
| 656 | − batch.setModelTransform(transform); | |
| 657 | − deferredLighting->bindSimpleProgram(batch); | |
| 658 | − geometryCache->renderSphere(batch, _boundingCapsuleRadius, BALL_SUBDIVISIONS, BALL_SUBDIVISIONS, | |
| 659 | − glm::vec4(0.8f, 0.8f, 0.6f, alpha)); | |
| 652 | + | |
| 653 | + deferredLighting->renderSolidSphereInstance(batch, | |
| 654 | + Transform().setTranslation(bottomPoint).postScale(_boundingCapsuleRadius * 2.0), | |
| 655 | + glm::vec4(0.8f, 0.8f, 0.6f, alpha)); | |
| 660 | 656 | |
| 661 | 657 | // draw a green cylinder between the two points |
| 662 | 658 | glm::vec3 origin(0.0f); |
| 659 | + batch.setModelTransform(Transform().setTranslation(bottomPoint)); | |
| 660 | + deferredLighting->bindSimpleProgram(batch); | |
| 663 | 661 | Avatar::renderJointConnectingCone(batch, origin, axis, _boundingCapsuleRadius, _boundingCapsuleRadius, |
| 664 | 662 | glm::vec4(0.6f, 0.8f, 0.6f, alpha)); |
| 665 | 663 | } |