Showing the changes to libraries/render-utils/src/Model.cpp (1 of 71 files). Show all
Unified · Split
| @@ -46,7 +46,7 @@ float Model::FAKE_DIMENSION_PLACEHOLDER = -1.0f; · 45 unmodified lines | |||
| 46 | #define HTTP_INVALID_COM "http://invalid.com" | 46 | #define HTTP_INVALID_COM "http://invalid.com" |
| 47 | 47 | ||
| 48 | const int NUM_COLLISION_HULL_COLORS = 24; | 48 | const int NUM_COLLISION_HULL_COLORS = 24; |
| 49 | std::vector<model::MaterialPointer> _collisionMaterials; | 49 | std::vector<graphics::MaterialPointer> _collisionMaterials; |
| 50 | 50 | ||
| 51 | void initCollisionMaterials() { | 51 | void initCollisionMaterials() { |
| 52 | // generates bright colors in red, green, blue, yellow, magenta, and cyan spectrums | 52 | // generates bright colors in red, green, blue, yellow, magenta, and cyan spectrums |
| @@ -72,8 +72,8 @@ void initCollisionMaterials() { · 19 unmodified lines | |||
| 72 | // so they don't tend to group together for large models | 72 | // so they don't tend to group together for large models |
| 73 | for (int i = 0; i < sectionWidth; ++i) { | 73 | for (int i = 0; i < sectionWidth; ++i) { |
| 74 | for (int j = 0; j < numComponents; ++j) { | 74 | for (int j = 0; j < numComponents; ++j) { |
| 75 | model::MaterialPointer material; | 75 | graphics::MaterialPointer material; |
| 76 | material = std::make_shared<model::Material>(); | 76 | material = std::make_shared<graphics::Material>(); |
| 77 | int index = j * sectionWidth + i; | 77 | int index = j * sectionWidth + i; |
| 78 | float red = component[index]; | 78 | float red = component[index]; |
| 79 | float green = component[(index + greenPhase) % NUM_COLLISION_HULL_COLORS]; | 79 | float green = component[(index + greenPhase) % NUM_COLLISION_HULL_COLORS]; |
| @@ -559,7 +559,7 @@ MeshProxyList Model::getMeshes() const { · 479 unmodified lines | |||
| 559 | offset.postTranslate(_offset); | 559 | offset.postTranslate(_offset); |
| 560 | glm::mat4 offsetMat = offset.getMatrix(); | 560 | glm::mat4 offsetMat = offset.getMatrix(); |
| 561 | 561 | ||
| 562 | for (std::shared_ptr<const model::Mesh> mesh : meshes) { | 562 | for (std::shared_ptr<const graphics::Mesh> mesh : meshes) { |
| 563 | if (!mesh) { | 563 | if (!mesh) { |
| 564 | continue; | 564 | continue; |
| 565 | } | 565 | } |
| @@ -1481,7 +1481,7 @@ void Model::createCollisionRenderItemSet() { · 915 unmodified lines | |||
| 1481 | // Create the render payloads | 1481 | // Create the render payloads |
| 1482 | int numParts = (int)mesh->getNumParts(); | 1482 | int numParts = (int)mesh->getNumParts(); |
| 1483 | for (int partIndex = 0; partIndex < numParts; partIndex++) { | 1483 | for (int partIndex = 0; partIndex < numParts; partIndex++) { |
| 1484 | model::MaterialPointer& material = _collisionMaterials[partIndex % NUM_COLLISION_HULL_COLORS]; | 1484 | graphics::MaterialPointer& material = _collisionMaterials[partIndex % NUM_COLLISION_HULL_COLORS]; |
| 1485 | auto payload = std::make_shared<MeshPartPayload>(mesh, partIndex, material); | 1485 | auto payload = std::make_shared<MeshPartPayload>(mesh, partIndex, material); |
| 1486 | payload->updateTransform(identity, offset); | 1486 | payload->updateTransform(identity, offset); |
| 1487 | _collisionRenderItems << payload; | 1487 | _collisionRenderItems << payload; |
| @@ -1495,7 +1495,7 @@ bool Model::isRenderable() const { · 7 unmodified lines | |||
| 1495 | 1495 | ||
| 1496 | class CollisionRenderGeometry : public Geometry { | 1496 | class CollisionRenderGeometry : public Geometry { |
| 1497 | public: | 1497 | public: |
| 1498 | CollisionRenderGeometry(model::MeshPointer mesh) { | 1498 | CollisionRenderGeometry(graphics::MeshPointer mesh) { |
| 1499 | _fbxGeometry = std::make_shared<FBXGeometry>(); | 1499 | _fbxGeometry = std::make_shared<FBXGeometry>(); |
| 1500 | std::shared_ptr<GeometryMeshes> meshes = std::make_shared<GeometryMeshes>(); | 1500 | std::shared_ptr<GeometryMeshes> meshes = std::make_shared<GeometryMeshes>(); |
| 1501 | meshes->push_back(mesh); | 1501 | meshes->push_back(mesh); |
| @@ -1504,7 +1504,7 @@ public: · 2 unmodified lines | |||
| 1504 | } | 1504 | } |
| 1505 | }; | 1505 | }; |
| 1506 | 1506 | ||
| 1507 | void Model::setCollisionMesh(model::MeshPointer mesh) { | 1507 | void Model::setCollisionMesh(graphics::MeshPointer mesh) { |
| 1508 | if (mesh) { | 1508 | if (mesh) { |
| 1509 | _collisionGeometry = std::make_shared<CollisionRenderGeometry>(mesh); | 1509 | _collisionGeometry = std::make_shared<CollisionRenderGeometry>(mesh); |
| 1510 | } else { | 1510 | } else { |