-
Notifications
You must be signed in to change notification settings - Fork 134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add automatic updating of mesh bounding box when importing, view centering improvements #335
base: 1.0.6.4
Are you sure you want to change the base?
Conversation
CosmicDreamsOfCode
commented
Feb 9, 2024
- MeshSet AABB is now updated when importing a custom mesh
- You can now view the MeshSet AABB in the Mesh tab (mostly for debugging, its readonly, but nice to have ig)
- Slight refactor of viewport bb code to have an update method, this is used when centering the view so it will actually center to the correct point after a custom mesh is imported without reopening the asset
Realised last night that this may have issue with multi-section and lod models. Closing to investigate. |
i think i fixed it, should take the largest bbox out of all sections and lods, including unrenderable ones |
vertexPositions.Add(new Vector3(position.X, position.Y, position.Z)); | ||
|
||
} | ||
boundingBox = AABBFromPoints(vertexPositions).Item2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not merge the bounding box here already?
|
||
} | ||
boundingBox = AABBFromPoints(vertexPositions).Item2; | ||
//meshSet.BoundingBox = AABBFromPoints(vertexPositions).Item1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also remove commented out stuff u added
@@ -1653,6 +1673,7 @@ public void ImportFBX(string filename, MeshSet inMeshSet, EbxAsset asset, EbxAss | |||
meshSet.ClearPartData(); | |||
List<BoundingBox> partBbox = new List<BoundingBox>(); | |||
List<LinearTransform> transforms = new List<LinearTransform>(); | |||
AxisAlignedBox AABBToWrite = new AxisAlignedBox(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why have a local variable here, just assign it to meshSet.BoundingBox directly
retVal.min = min; | ||
retVal.max = max; | ||
|
||
return retVal; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
u could also use just return new AxisAlignedBox() { min = new Vec3() { x = ... }, max = ... }, but doesnt really matter that much
other than that it looks, good to merge |