summaryrefslogtreecommitdiff
path: root/assetFactory/object.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2023-03-09 01:41:26 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2023-03-09 01:41:26 +0000
commita74580123fe36ba1227611c3703c1fe1a520719a (patch)
treef667f5f0813eba8aa8048eeef9da4abfd6f6a59c /assetFactory/object.cpp
parentHugely more detailed Brush47 model and revision to test case details (diff)
downloadilt-a74580123fe36ba1227611c3703c1fe1a520719a.tar.bz2
ilt-a74580123fe36ba1227611c3703c1fe1a520719a.tar.xz
ilt-a74580123fe36ba1227611c3703c1fe1a520719a.zip
Refactor of asset factory to address mutation/face controller logic
Fixes issue where face controller extrusions applied to a rotated or scaled mesh would be applied incorrectly. Now we create the mesh at the origin, deform it as required (scale), apply face controllers and finally relocate it as required (position and rotation). A relative level of detail is cascade into the generation for shapes like cylinder, which generate fewer faces for small objects.
Diffstat (limited to 'assetFactory/object.cpp')
-rw-r--r--assetFactory/object.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/assetFactory/object.cpp b/assetFactory/object.cpp
index ae5a301..5c86f47 100644
--- a/assetFactory/object.cpp
+++ b/assetFactory/object.cpp
@@ -4,11 +4,11 @@
Object::Object(std::string i) : id {std::move(i)} { }
Object::CreatedFaces
-Object::createMesh(ModelFactoryMesh & mesh, const Mutation::Matrix & mutation) const
+Object::createMesh(ModelFactoryMesh & mesh, float levelOfDetailFactor) const
{
CreatedFaces faces;
for (const auto & use : uses) {
- auto useFaces = use->createMesh(mesh, mutation);
+ auto useFaces = use->createMesh(mesh, levelOfDetailFactor);
std::transform(useFaces.begin(), useFaces.end(), std::inserter(faces, faces.end()), [this](auto && face) {
return std::make_pair(id + ":" + face.first, std::move(face.second));
});