Showing the changes to libraries/render-utils/src/Model.cpp (1 of 10 files). Show all
Unified · Split
| @@ -22,7 +22,6 @@ · 21 unmodified lines | ||
| 22 | 22 | #include <ViewFrustum.h> |
| 23 | 23 | |
| 24 | 24 | #include "AbstractViewStateInterface.h" |
| 25 | −#include "DeferredPipelineLib.h" | |
| 26 | 25 | #include "MeshPartPayload.h" |
| 27 | 26 | #include "Model.h" |
| 28 | 27 | |
| @@ -36,6 +35,8 @@ static int vec3VectorTypeId = qRegisterMetaType<QVector<glm::vec3> >(); · 7 unmodified lines | ||
| 36 | 35 | float Model::FAKE_DIMENSION_PLACEHOLDER = -1.0f; |
| 37 | 36 | #define HTTP_INVALID_COM "http://invalid.com" |
| 38 | 37 | |
| 38 | +model::MaterialPointer Model::_collisionHullMaterial; | |
| 39 | + | |
| 39 | 40 | Model::Model(RigPointer rig, QObject* parent) : |
| 40 | 41 | QObject(parent), |
| 41 | 42 | _translation(0.0f), |
| @@ -1194,8 +1195,13 @@ void Model::segregateMeshGroups() { · 1152 unmodified lines | ||
| 1194 | 1195 | int totalParts = mesh.parts.size(); |
| 1195 | 1196 | for (int partIndex = 0; partIndex < totalParts; partIndex++) { |
| 1196 | 1197 | if (showingCollisionHull) { |
| 1197 | − _renderItemsSet << std::make_shared<MeshPartPayload>(networkMesh._mesh, partIndex, DeferredPipelineLib::getCollisionHullMaterial(), transform, offset); | |
| 1198 | − | |
| 1198 | + if (!_collisionHullMaterial) { | |
| 1199 | + _collisionHullMaterial = std::make_shared<model::Material>(); | |
| 1200 | + _collisionHullMaterial->setDiffuse(glm::vec3(1.0f, 0.5f, 0.0f)); | |
| 1201 | + _collisionHullMaterial->setMetallic(0.02f); | |
| 1202 | + _collisionHullMaterial->setGloss(1.0f); | |
| 1203 | + } | |
| 1204 | + _renderItemsSet << std::make_shared<MeshPartPayload>(networkMesh._mesh, partIndex, _collisionHullMaterial, transform, offset); | |
| 1199 | 1205 | } else { |
| 1200 | 1206 | _renderItemsSet << std::make_shared<ModelMeshPartPayload>(this, i, partIndex, shapeID, transform, offset); |
| 1201 | 1207 | } |