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 | #include <ViewFrustum.h> | 22 | #include <ViewFrustum.h> |
| 23 | 23 | ||
| 24 | #include "AbstractViewStateInterface.h" | 24 | #include "AbstractViewStateInterface.h" |
| 25 | #include "DeferredPipelineLib.h" | ||
| 26 | #include "MeshPartPayload.h" | 25 | #include "MeshPartPayload.h" |
| 27 | #include "Model.h" | 26 | #include "Model.h" |
| 28 | 27 | ||
| @@ -36,6 +35,8 @@ static int vec3VectorTypeId = qRegisterMetaType<QVector<glm::vec3> >(); · 7 unmodified lines | |||
| 36 | float Model::FAKE_DIMENSION_PLACEHOLDER = -1.0f; | 35 | float Model::FAKE_DIMENSION_PLACEHOLDER = -1.0f; |
| 37 | #define HTTP_INVALID_COM "http://invalid.com" | 36 | #define HTTP_INVALID_COM "http://invalid.com" |
| 38 | 37 | ||
| 38 | model::MaterialPointer Model::_collisionHullMaterial; | ||
| 39 | |||
| 39 | Model::Model(RigPointer rig, QObject* parent) : | 40 | Model::Model(RigPointer rig, QObject* parent) : |
| 40 | QObject(parent), | 41 | QObject(parent), |
| 41 | _translation(0.0f), | 42 | _translation(0.0f), |
| @@ -1194,8 +1195,13 @@ void Model::segregateMeshGroups() { · 1152 unmodified lines | |||
| 1194 | int totalParts = mesh.parts.size(); | 1195 | int totalParts = mesh.parts.size(); |
| 1195 | for (int partIndex = 0; partIndex < totalParts; partIndex++) { | 1196 | for (int partIndex = 0; partIndex < totalParts; partIndex++) { |
| 1196 | if (showingCollisionHull) { | 1197 | if (showingCollisionHull) { |
| 1197 | _renderItemsSet << std::make_shared<MeshPartPayload>(networkMesh._mesh, partIndex, DeferredPipelineLib::getCollisionHullMaterial(), transform, offset); | 1198 | if (!_collisionHullMaterial) { |
| 1198 | 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 | } else { | 1205 | } else { |
| 1200 | _renderItemsSet << std::make_shared<ModelMeshPartPayload>(this, i, partIndex, shapeID, transform, offset); | 1206 | _renderItemsSet << std::make_shared<ModelMeshPartPayload>(this, i, partIndex, shapeID, transform, offset); |
| 1201 | } | 1207 | } |