mirror of
https://github.com/leozide/leocad.git
synced 2026-07-27 19:56:49 +00:00
Fixed bounding box of models loaded from loose files.
This commit is contained in:
+21
-4
@@ -1,5 +1,22 @@
|
||||
################################################################################
|
||||
# This .gitignore file was automatically created by Microsoft(R) Visual Studio.
|
||||
################################################################################
|
||||
|
||||
*.suo
|
||||
*.sln
|
||||
*.vcxproj
|
||||
*.filters
|
||||
*.user
|
||||
*.pdb
|
||||
*.db
|
||||
*.psess
|
||||
*.opendb
|
||||
*.opensdf
|
||||
*.sdf
|
||||
*.suo
|
||||
*.vspx
|
||||
*.xcodeproj
|
||||
build
|
||||
debug
|
||||
release
|
||||
ipch
|
||||
Makefile
|
||||
library.bin
|
||||
leocad_plugin_import.cpp
|
||||
*.qm
|
||||
|
||||
@@ -882,6 +882,7 @@ bool lcPiecesLibrary::LoadPiece(PieceInfo* Info)
|
||||
|
||||
bool Loaded = false;
|
||||
bool SaveCache = false;
|
||||
bool UpdateBoundingBox = false;
|
||||
|
||||
if (Info->mZipFileType != LC_NUM_ZIPFILES && mZipFiles[Info->mZipFileType])
|
||||
{
|
||||
@@ -928,13 +929,17 @@ bool lcPiecesLibrary::LoadPiece(PieceInfo* Info)
|
||||
const char* OldLocale = setlocale(LC_NUMERIC, "C");
|
||||
Loaded = ReadMeshData(PieceFile, lcMatrix44Identity(), 16, TextureStack, MeshData, LC_MESHDATA_SHARED, false);
|
||||
setlocale(LC_NUMERIC, OldLocale);
|
||||
UpdateBoundingBox = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!Loaded)
|
||||
return false;
|
||||
|
||||
CreateMesh(Info, MeshData);
|
||||
lcMesh* Mesh = CreateMesh(Info, MeshData);
|
||||
|
||||
if (UpdateBoundingBox)
|
||||
Info->SetBoundingBox(Mesh->mBoundingBox.Min, Mesh->mBoundingBox.Max);
|
||||
|
||||
if (SaveCache)
|
||||
SaveCachePiece(Info);
|
||||
|
||||
Reference in New Issue
Block a user