示例#1
0
文件: Utils.cs 项目: tcerdaj/PoolGuy
        /// <summary>
        /// Convert Volumen unit type
        /// </summary>
        /// <param name="units"></param>
        /// <param name="from"></param>
        /// <param name="to"></param>
        /// <returns></returns>
        public static double ConvertUnits(this int units, eVolumeType from, eVolumeType to)
        {
            double[][] factor =
            {
                new double[] {   1, 2,  0.25 },
                new double[] { 0.5, 1, 0.125 },
                new double[] {   4, 8,     1 }
            };

            return(units * factor[(int)from][(int)to]);
        }
示例#2
0
        public override bool intersects(UWB_BoundingVolume other)
        {
            eVolumeType vt = other.getType();

            if (eVolumeType.box == vt)
            {
                UWB_BoundingBox otherBox = other as UWB_BoundingBox;
                return(intesectBoxBox(mMin, mMax, otherBox.getMin(), otherBox.getMax()));
            }

            return(false);
        }
示例#3
0
 public override void add(UWB_BoundingVolume other)
 {
     if (other != null)
     {
         eVolumeType vt = other.getType();
         if (eVolumeType.box == vt)
         {
             UWB_BoundingBox box = other as UWB_BoundingBox;
             add(box);
         }
     }
 }