Ejemplo n.º 1
0
        /// <summary>
        /// Updates the center of the bounding box.
        /// </summary>
        /// <param name="this"></param>
        /// <param name="center"></param>
        public static void UpdateCenter(this AxisAlignedBoundingBox @this, Vector3 center)
        {
            var offset     = center - @this.Center;
            var currentMin = @this.Min;
            var currentMax = @this.Max;

            @this.SetExtents(currentMin - offset, currentMax - offset);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Set new extents for the orientated bounding box
 /// </summary>
 /// <param name="Min">Minimum x,y,z</param>
 /// <param name="Max">Maximum x,y,z</param>
 public void SetExtents(Vector3 Min, Vector3 Max)
 {
     box.SetExtents(Min, Max);
 }