Пример #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="points"></param>
        /// <param name="optionalCenter"></param>
        public void SetFromPoints(List <Vector3> points, Vector3 optionalCenter = null)
        {
            var box = new Box3();

            var center = this.Center;

            if (optionalCenter != null)
            {
                center.Copy(optionalCenter);
            }
            else
            {
                box.SetFromPoints(points).Center(center);
            }

            var maxRadiusSq = 0.0f;

            for (var i = 0; i < points.Count; i++)
            {
                maxRadiusSq = Math.Max(maxRadiusSq, center.DistanceToSquared(points[i]));
            }

            this.Radius = (float)Math.Sqrt(maxRadiusSq);
        }
Пример #2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="box"></param>
 /// <param name="optionalTarget"></param>
 /// <returns></returns>
 public Vector3 IntersectBox(Box3 box, Vector3 optionalTarget)
 {
     throw new NotImplementedException();
 }
Пример #3
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="box"></param>
 /// <returns></returns>
 public bool IsIntersectionBox(Box3 box)
 {
     return(this.IntersectBox(box, new Vector3()) != null);
 }