OrientedBounds cleanup

This commit is contained in:
Andrew Cassidy 2020-05-29 19:03:40 -07:00
parent feb2eb3c4a
commit 835344eac9
No known key found for this signature in database
GPG Key ID: 963017B38FD477A1

View File

@ -58,9 +58,10 @@ namespace ConformalDecals {
Vector3 unitZ = matrix.GetColumn(2);
var scale = new Vector3(unitX.magnitude, unitY.magnitude, unitZ.magnitude);
_localBounds = new Bounds();
_localBounds.center = matrix.MultiplyPoint3x4(aabb.center);
_localBounds.extents = new Vector3(aabb.extents.x / scale.x, aabb.extents.y / scale.y, aabb.extents.z / scale.z);
_localBounds = new Bounds {
center = matrix.MultiplyPoint3x4(aabb.center),
extents = new Vector3(aabb.extents.x / scale.x, aabb.extents.y / scale.y, aabb.extents.z / scale.z)
};
OrientationMatrix = Matrix4x4.zero;
UnitX = unitX / scale.x;