public void Encapsulate(OOBB otherOOBB) { var otherPts = BoxMath.CalcBoxCornerPoints(otherOOBB.Center, otherOOBB.Size, otherOOBB.Rotation); Matrix4x4 transformMtx = Matrix4x4.TRS(Center, Rotation, Vector3.one); var modelPts = transformMtx.inverse.TransformPoints(otherPts); AABB modelAABB = new AABB(Vector3.zero, Size); modelAABB.Encapsulate(modelPts); Center = (Rotation * modelAABB.Center) + Center; Size = modelAABB.Size; }
public List <Vector3> GetCornerPoints() { return(BoxMath.CalcBoxCornerPoints(_center, _size, Quaternion.identity)); }
public List <Vector3> GetCornerPoints() { return(BoxMath.CalcBoxCornerPoints(_center, _size, _rotation)); }