History

Instancing work, second pass

Bradley Austin Davis committed 11 years ago

Commit e024d231 parent ba5109c33 files · +935 −877Browse files

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

Unified · Split

interface/src/avatar/SkeletonModel.cpp+10−12
@@ -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 point642 // 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 point649 // 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 points657 // 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}

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