Added AddBounds function, which only needs the Min and Max of a bounding box, rather than 8 updated corners. All calls to AddPoints were just adding bounds, so AddPoints is now unused. Not that AddPoints was a bottleneck before... but it's faster with AddBounds now.
Changed AddPoints to accept an IEnumerable of points, rather than an array.
Made public property IsSet, which is now used by ModelEntity, rather than tracking hasBounds manually.
Added Reset function to change IsSet back to false.
Renamed MagnitudeFromCenter to a more fitting name: MagnitudeFromOrigin.
Added MagnitudeFromCenter property (which is just Extents.Length). Note that Scene still uses the renamed MagnitudeFromOrigin property.
Added MagnitudeFromPosition function for any other position that isn't (0, 0, 0) or the bounds center.
Replaced GetMinMax with individual calls to Vector3.ComponentMin and Vector3.ComponentMax.
Simplified ToString, since Vector3.ToString() already outputs the same format used for both Min and Max.
Scene changes
Added comments in Scene.UpdateViewMatrix describing how the camera translation works, because I spent a good one hour trying to do something the camera wasn't designed to do.
Simplified eye to use the Xyz property, rather than constructing a new Vector3 by hand.
View Matrix now supports a non-(0, 0, 0) origin (which is assigned to _viewTarget). Added _viewOriginMatrix, which is the transform before _viewTarget translation is applied. This origin view matrix is needed for some properties like getting the camera rotation and distance to the target (which effects camera movement speed). View target is assigned in FocusOnBounds.
BoundingBox changes
Scene changes
_viewTarget
). Added_viewOriginMatrix
, which is the transform before_viewTarget
translation is applied. This origin view matrix is needed for some properties like getting the camera rotation and distance to the target (which effects camera movement speed). View target is assigned in FocusOnBounds.