Showing the changes to interface/src/avatar/SkeletonModel.cpp (1 of 28 files). Show all
Unified · Split
| @@ -13,6 +13,7 @@ · 12 unmodified lines | ||
| 13 | 13 | #include <QMultiMap> |
| 14 | 14 | |
| 15 | 15 | #include <CapsuleShape.h> |
| 16 | +#include <DeferredLightingEffect.h> | |
| 16 | 17 | #include <SphereShape.h> |
| 17 | 18 | |
| 18 | 19 | #include "Application.h" |
| @@ -790,31 +791,34 @@ void SkeletonModel::renderBoundingCollisionShapes(gpu::Batch& batch, float alpha · 771 unmodified lines | ||
| 790 | 791 | const int BALL_SUBDIVISIONS = 10; |
| 791 | 792 | #if 0 |
| 792 | 793 | if (_shapes.isEmpty()) { |
| 793 | − // the bounding shape has not been propery computed | |
| 794 | + // the bounding shape has not been properly computed | |
| 794 | 795 | // so no need to render it |
| 795 | 796 | return; |
| 796 | 797 | } |
| 797 | 798 | |
| 798 | − // draw a blue sphere at the capsule endpoint | |
| 799 | + auto geometryCache = DependencyManager::get<GeometryCache>(); | |
| 800 | + auto deferredLighting = DependencyManager::get<DeferredLightingEffect>(); | |
| 801 | + Transform transform; // = Transform(); | |
| 802 | + | |
| 803 | + // draw a blue sphere at the capsule end point | |
| 799 | 804 | glm::vec3 endPoint; |
| 800 | 805 | _boundingShape.getEndPoint(endPoint); |
| 801 | 806 | endPoint = endPoint + _translation; |
| 802 | − Transform transform = Transform(); | |
| 803 | 807 | transform.setTranslation(endPoint); |
| 804 | 808 | batch.setModelTransform(transform); |
| 805 | − auto geometryCache = DependencyManager::get<GeometryCache>(); | |
| 806 | − geometryCache->renderSphere(batch, _boundingShape.getRadius(), BALL_SUBDIVISIONS, BALL_SUBDIVISIONS, | |
| 809 | + deferredLighting->bindSimpleProgram(batch); | |
| 810 | + geometryCache->renderSphere(batch, _boundingShape.getRadius(), BALL_SUBDIVISIONS, BALL_SUBDIVISIONS, | |
| 807 | 811 | glm::vec4(0.6f, 0.6f, 0.8f, alpha)); |
| 808 | 812 | |
| 809 | − // draw a yellow sphere at the capsule startpoint | |
| 813 | + // draw a yellow sphere at the capsule start point | |
| 810 | 814 | glm::vec3 startPoint; |
| 811 | 815 | _boundingShape.getStartPoint(startPoint); |
| 812 | 816 | startPoint = startPoint + _translation; |
| 813 | 817 | glm::vec3 axis = endPoint - startPoint; |
| 814 | − Transform axisTransform = Transform(); | |
| 815 | − axisTransform.setTranslation(-axis); | |
| 816 | − batch.setModelTransform(axisTransform); | |
| 817 | − geometryCache->renderSphere(batch, _boundingShape.getRadius(), BALL_SUBDIVISIONS, BALL_SUBDIVISIONS, | |
| 818 | + transform.setTranslation(startPoint); | |
| 819 | + batch.setModelTransform(transform); | |
| 820 | + deferredLighting->bindSimpleProgram(batch); | |
| 821 | + geometryCache->renderSphere(batch, _boundingShape.getRadius(), BALL_SUBDIVISIONS, BALL_SUBDIVISIONS, | |
| 818 | 822 | glm::vec4(0.8f, 0.8f, 0.6f, alpha)); |
| 819 | 823 | |
| 820 | 824 | // draw a green cylinder between the two points |