mirror of
https://github.com/Poikilos/SAM-Viewer.git
synced 2023-10-03 07:58:48 -07:00
Always recalculate normals after scaling
This commit is contained in:
parent
b29cc97810
commit
f94900d824
@ -171,8 +171,6 @@ void Viewer::exportStaticMesh(const char *caption, const char **filters,
|
|||||||
mesh = smgr->getMesh(fn);
|
mesh = smgr->getMesh(fn);
|
||||||
if (flags & E_MESH_EXPORT_FLIP)
|
if (flags & E_MESH_EXPORT_FLIP)
|
||||||
manip->flipSurfaces(mesh);
|
manip->flipSurfaces(mesh);
|
||||||
if (flags & E_MESH_EXPORT_NORMAL)
|
|
||||||
manip->recalculateNormals(mesh);
|
|
||||||
if (flags & E_MESH_EXPORT_TRANSFORM)
|
if (flags & E_MESH_EXPORT_TRANSFORM)
|
||||||
manip->transform(mesh, model->getRelativeTransformation());
|
manip->transform(mesh, model->getRelativeTransformation());
|
||||||
if (scale != 100)
|
if (scale != 100)
|
||||||
@ -180,6 +178,9 @@ void Viewer::exportStaticMesh(const char *caption, const char **filters,
|
|||||||
f32 sf = (f32)scale / 100.f;
|
f32 sf = (f32)scale / 100.f;
|
||||||
manip->scale(mesh, vector3df(sf, sf, sf));
|
manip->scale(mesh, vector3df(sf, sf, sf));
|
||||||
}
|
}
|
||||||
|
if (scale != 100 || flags & E_MESH_EXPORT_NORMAL)
|
||||||
|
manip->recalculateNormals(mesh);
|
||||||
|
|
||||||
file = fs->createAndWriteFile(fn);
|
file = fs->createAndWriteFile(fn);
|
||||||
writer = smgr->createMeshWriter(id);
|
writer = smgr->createMeshWriter(id);
|
||||||
writer->writeMesh(file, mesh);
|
writer->writeMesh(file, mesh);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user