示例#1
0
        public override int Prepare(ref TSBBox box)
        {
            bool flag = box.min.x < this.boundings.min.x;

            if (flag)
            {
                this.minX = 0;
            }
            else
            {
                this.minX = (int)((long)FP.Floor((box.min.x - this.sphericalExpansion) / this.scaleX));
                this.minX = (int)((long)TSMath.Max(this.minX, 0));
            }
            bool flag2 = box.max.x > this.boundings.max.x;

            if (flag2)
            {
                this.maxX = this.heightsLength0 - 1;
            }
            else
            {
                this.maxX = (int)((long)FP.Ceiling((box.max.x + this.sphericalExpansion) / this.scaleX));
                this.maxX = (int)((long)TSMath.Min(this.maxX, this.heightsLength0 - 1));
            }
            bool flag3 = box.min.z < this.boundings.min.z;

            if (flag3)
            {
                this.minZ = 0;
            }
            else
            {
                this.minZ = (int)((long)FP.Floor((box.min.z - this.sphericalExpansion) / this.scaleZ));
                this.minZ = (int)((long)TSMath.Max(this.minZ, 0));
            }
            bool flag4 = box.max.z > this.boundings.max.z;

            if (flag4)
            {
                this.maxZ = this.heightsLength1 - 1;
            }
            else
            {
                this.maxZ = (int)((long)FP.Ceiling((box.max.z + this.sphericalExpansion) / this.scaleZ));
                this.maxZ = (int)((long)TSMath.Min(this.maxZ, this.heightsLength1 - 1));
            }
            this.numX = this.maxX - this.minX;
            this.numZ = this.maxZ - this.minZ;
            return(this.numX * this.numZ * 2);
        }
示例#2
0
 public static FP Ceil(FP i_Value)
 {
     return(FP.Ceiling(i_Value));
 }
示例#3
0
 public static FP Ceiling(FP value)
 {
     return(FP.Ceiling(value));
 }