Ejemplo n.º 1
0
        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;
        }
Ejemplo n.º 2
0
 public List <Vector3> GetCornerPoints()
 {
     return(BoxMath.CalcBoxCornerPoints(_center, _size, Quaternion.identity));
 }
Ejemplo n.º 3
0
 public List <Vector3> GetCornerPoints()
 {
     return(BoxMath.CalcBoxCornerPoints(_center, _size, _rotation));
 }