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 | auto geometryCache = DependencyManager::get<GeometryCache>(); | 640 | auto geometryCache = DependencyManager::get<GeometryCache>(); |
| 641 | auto deferredLighting = DependencyManager::get<DeferredLightingEffect>(); | 641 | auto deferredLighting = DependencyManager::get<DeferredLightingEffect>(); |
| 642 | Transform transform; // = Transform(); | ||
| 643 | |||
| 644 | // draw a blue sphere at the capsule top point | 642 | // draw a blue sphere at the capsule top point |
| 645 | glm::vec3 topPoint = _translation + _boundingCapsuleLocalOffset + (0.5f * _boundingCapsuleHeight) * glm::vec3(0.0f, 1.0f, 0.0f); | 643 | glm::vec3 topPoint = _translation + _boundingCapsuleLocalOffset + (0.5f * _boundingCapsuleHeight) * glm::vec3(0.0f, 1.0f, 0.0f); |
| 646 | transform.setTranslation(topPoint); | 644 | |
| 647 | batch.setModelTransform(transform); | 645 | deferredLighting->renderSolidSphereInstance(batch, |
| 648 | deferredLighting->bindSimpleProgram(batch); | 646 | Transform().setTranslation(topPoint).postScale(_boundingCapsuleRadius * 2.0), |
| 649 | geometryCache->renderSphere(batch, _boundingCapsuleRadius, BALL_SUBDIVISIONS, BALL_SUBDIVISIONS, | 647 | glm::vec4(0.6f, 0.6f, 0.8f, alpha)); |
| 650 | glm::vec4(0.6f, 0.6f, 0.8f, alpha)); | ||
| 651 | 648 | ||
| 652 | // draw a yellow sphere at the capsule bottom point | 649 | // draw a yellow sphere at the capsule bottom point |
| 653 | glm::vec3 bottomPoint = topPoint - glm::vec3(0.0f, _boundingCapsuleHeight, 0.0f); | 650 | glm::vec3 bottomPoint = topPoint - glm::vec3(0.0f, _boundingCapsuleHeight, 0.0f); |
| 654 | glm::vec3 axis = topPoint - bottomPoint; | 651 | glm::vec3 axis = topPoint - bottomPoint; |
| 655 | transform.setTranslation(bottomPoint); | 652 | |
| 656 | batch.setModelTransform(transform); | 653 | deferredLighting->renderSolidSphereInstance(batch, |
| 657 | deferredLighting->bindSimpleProgram(batch); | 654 | Transform().setTranslation(bottomPoint).postScale(_boundingCapsuleRadius * 2.0), |
| 658 | geometryCache->renderSphere(batch, _boundingCapsuleRadius, BALL_SUBDIVISIONS, BALL_SUBDIVISIONS, | 655 | glm::vec4(0.8f, 0.8f, 0.6f, alpha)); |
| 659 | glm::vec4(0.8f, 0.8f, 0.6f, alpha)); | ||
| 660 | 656 | ||
| 661 | // draw a green cylinder between the two points | 657 | // draw a green cylinder between the two points |
| 662 | glm::vec3 origin(0.0f); | 658 | glm::vec3 origin(0.0f); |
| 659 | batch.setModelTransform(Transform().setTranslation(bottomPoint)); | ||
| 660 | deferredLighting->bindSimpleProgram(batch); | ||
| 663 | Avatar::renderJointConnectingCone(batch, origin, axis, _boundingCapsuleRadius, _boundingCapsuleRadius, | 661 | Avatar::renderJointConnectingCone(batch, origin, axis, _boundingCapsuleRadius, _boundingCapsuleRadius, |
| 664 | glm::vec4(0.6f, 0.8f, 0.6f, alpha)); | 662 | glm::vec4(0.6f, 0.8f, 0.6f, alpha)); |
| 665 | } | 663 | } |