コード例 #1
0
 void ExecuteModifier()
 {
     _origin.CopyTo(_buffer, true);
     for (int i = modifiers.Count; i-- > 0;)
     {
         if (_modifiers[i].enabled)
         {
             _modifiers[i].ModifyModel(_buffer);
         }
     }
     _bounds = new SphereBounds4(_buffer.m_Vertices.GetBounding(_buffer.m_VerticesCount));
 }
コード例 #2
0
 /// <summary>
 /// Is the sphere overlap the plane?
 /// </summary>
 public static bool IsIntersecting(Plane4 plane, SphereBounds4 sphere)
 {
     return(Math.Abs(plane.Distance(sphere.center)) < sphere.radius);
 }
コード例 #3
0
        /// <summary>
        /// Is both sphere colliding?
        /// </summary>
        public static bool IsIntersecting(SphereBounds4 a, SphereBounds4 b)
        {
            var r = a.radius + b.radius;

            return(Vector4.LengthSq(a.center - b.center) < r * r);
        }