@@ -69,12 +69,13 @@ void MapView::addTerrain(QString basePath, physis_Terrain terrain)
6969 }
7070 }
7171
72- mdlPart->addModel (plateMdl,
73- false ,
74- glm::vec3 (terrain.plates [i].position [0 ], 0 .0f , terrain.plates [i].position [1 ]),
75- QStringLiteral (" terapart%1" ).arg (i),
76- materials,
77- 0 );
72+ Transformation transformation{
73+ .translation = {terrain.plates [i].position [0 ], 0 .0f , terrain.plates [i].position [1 ]},
74+ .rotation = {0 , 0 , 0 },
75+ .scale = {1 , 1 , 1 },
76+ };
77+
78+ mdlPart->addModel (plateMdl, false , transformation, QStringLiteral (" terapart%1" ).arg (i), materials, 0 );
7879
7980 // We don't need this, and it will just take up memory
8081 physis_mdl_free (&plateMdl);
@@ -142,9 +143,9 @@ void MapView::processLayer(const physis_Layer &layer, const Transformation &root
142143 a.rotation [2 ] + b.rotation [2 ],
143144 },
144145 .scale = {
145- a.scale [0 ] + b.scale [0 ],
146- a.scale [1 ] + b.scale [1 ],
147- a.scale [2 ] + b.scale [2 ],
146+ a.scale [0 ] * b.scale [0 ],
147+ a.scale [1 ] * b.scale [1 ],
148+ a.scale [2 ] * b.scale [2 ],
148149 }};
149150 };
150151
@@ -176,12 +177,7 @@ void MapView::processLayer(const physis_Layer &layer, const Transformation &root
176177 }
177178 }
178179
179- mdlPart->addModel (plateMdl,
180- false ,
181- glm::vec3 (combinedTransform.translation [0 ], combinedTransform.translation [1 ], combinedTransform.translation [2 ]),
182- QString::fromStdString (assetPath),
183- materials,
184- 0 );
180+ mdlPart->addModel (plateMdl, false , combinedTransform, QString::fromStdString (assetPath), materials, 0 );
185181
186182 // We don't need this, and it will just take up memory
187183 physis_mdl_free (&plateMdl);
@@ -191,8 +187,7 @@ void MapView::processLayer(const physis_Layer &layer, const Transformation &root
191187
192188 physis_free_file (&plateMdlFile);
193189 } else {
194- mdlPart->addExistingModel (QString::fromStdString (assetPath),
195- glm::vec3 (combinedTransform.translation [0 ], combinedTransform.translation [1 ], combinedTransform.translation [2 ]));
190+ mdlPart->addExistingModel (QString::fromStdString (assetPath), combinedTransform);
196191 }
197192 }
198193 } break ;
0 commit comments