Ejemplo n.º 1
0
 public override bool intersectsAxisAligned(OrientedBoxCollider other, out Vector3 normal1, out Vector3 normal2)
 {
     normal1 = normal2 = Vector3.Up;
     return false;
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Determine whether this box contains, intersects, or is disjoint from
        /// the given other box.
        /// </summary>
        public ContainmentType Contains(ref OrientedBoxCollider other)
        {
            // Build the 3x3 rotation matrix that defines the orientation of 'other' relative to this box
            Quaternion invOrient;
            Quaternion.Conjugate(ref Orientation, out invOrient);
            Quaternion relOrient;
            Quaternion.Multiply(ref invOrient, ref other.Orientation, out relOrient);

            Matrix relTransform = Matrix.CreateFromQuaternion(relOrient);
            relTransform.Translation = Vector3.Transform(other.Center - Center, invOrient);

            return ContainsRelativeBox(ref HalfExtent, ref other.HalfExtent, ref relTransform);
        }
Ejemplo n.º 3
0
 public override bool intersectsAxisAligned(OrientedBoxCollider other, out Vector3 normal1, out Vector3 normal2)
 {
     normal1 = normal2 = Vector3.Up;
     return Contains(ref other) != ContainmentType.Disjoint;
 }
Ejemplo n.º 4
0
 public abstract bool intersectsAxisAligned(OrientedBoxCollider other, out Vector3 normal1, out Vector3 normal2);