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