History

Merge branch 'master' into plugins

Bradley Austin Davis committed 11 years ago

Commit 1db41622 parents b636cd9 e729a8728 files · +446 −361Browse files

Showing the changes to interface/src/avatar/SkeletonModel.cpp (1 of 28 files). Show all

Unified · Split

interface/src/avatar/SkeletonModel.cpp+14−10
@@ -13,6 +13,7 @@ · 12 unmodified lines
1313 #include <QMultiMap>
1414
1515 #include <CapsuleShape.h>
16+#include <DeferredLightingEffect.h>
1617 #include <SphereShape.h>
1718
1819 #include "Application.h"
@@ -790,31 +791,34 @@ void SkeletonModel::renderBoundingCollisionShapes(gpu::Batch& batch, float alpha · 771 unmodified lines
790791 const int BALL_SUBDIVISIONS = 10;
791792 #if 0
792793 if (_shapes.isEmpty()) {
793− // the bounding shape has not been propery computed
794+ // the bounding shape has not been properly computed
794795 // so no need to render it
795796 return;
796797 }
797798
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
799804 glm::vec3 endPoint;
800805 _boundingShape.getEndPoint(endPoint);
801806 endPoint = endPoint + _translation;
802− Transform transform = Transform();
803807 transform.setTranslation(endPoint);
804808 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,
807811 glm::vec4(0.6f, 0.6f, 0.8f, alpha));
808812
809− // draw a yellow sphere at the capsule startpoint
813+ // draw a yellow sphere at the capsule start point
810814 glm::vec3 startPoint;
811815 _boundingShape.getStartPoint(startPoint);
812816 startPoint = startPoint + _translation;
813817 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,
818822 glm::vec4(0.8f, 0.8f, 0.6f, alpha));
819823
820824 // draw a green cylinder between the two points

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t