Esempio n. 1
0
 // Token: 0x060019A5 RID: 6565 RVA: 0x000634EC File Offset: 0x000616EC
 private static void RegisterGrid(global::CullGrid grid)
 {
     if (grid)
     {
         global::CullGrid.grid     = new global::CullGrid.CullGridRuntime(grid);
         global::CullGrid.has_grid = true;
     }
 }
Esempio n. 2
0
        // Token: 0x060019DE RID: 6622 RVA: 0x00063EF0 File Offset: 0x000620F0
        public CullGridRuntime(global::CullGrid cullGrid) : base(cullGrid.setup)
        {
            this.cullGrid             = cullGrid;
            this.transform            = cullGrid.transform;
            this.halfCellTall         = (double)this.cellsTall / 2.0;
            this.halfCellWide         = (double)this.cellsWide / 2.0;
            this.twoMinusOddTall      = 2 - (this.cellsTall & 1);
            this.twoMinusOddWide      = 2 - (this.cellsWide & 1);
            this.halfTwoMinusOddTall  = (double)this.twoMinusOddTall / 2.0;
            this.halfTwoMinusOddWide /= 2.0;
            this.halfCellTallMinusHalfTwoMinusOddTall = this.halfCellTall - this.halfTwoMinusOddTall;
            this.halfCellWideMinusHalfTwoMinusOddWide = this.halfCellWide - this.halfTwoMinusOddWide;
            Vector3 forward  = this.transform.forward;
            Vector3 right    = this.transform.right;
            Vector3 position = this.transform.position;

            this.fx = (double)forward.x;
            this.fy = (double)forward.y;
            this.fz = (double)forward.z;
            double num = Math.Sqrt(this.fx * this.fx + this.fy * this.fy + this.fz * this.fz);

            this.fx           /= num;
            this.fy           /= num;
            this.fz           /= num;
            this.rx            = (double)right.x;
            this.ry            = (double)right.y;
            this.rz            = (double)right.z;
            num                = Math.Sqrt(this.rx * this.rx + this.ry * this.ry + this.rz * this.rz);
            this.rx           /= num;
            this.ry           /= num;
            this.rz           /= num;
            this.px            = (double)position.x;
            this.py            = (double)position.y;
            this.pz            = (double)position.z;
            this.flat_wide_ofs = (double)this.cellSquareDimension * (this.halfCellWide - (double)(1 - (this.cellsWide & 1)) / 2.0);
            this.flat_tall_ofs = (double)this.cellSquareDimension * (this.halfCellTall - (double)(1 - (this.cellsTall & 1)) / 2.0);
            this.cellTallLast  = (ushort)(this.cellsTall - 1);
            this.cellWideLast  = (ushort)(this.cellsWide - 1);
            this.cellTallLastTimesSquareDimension = (double)this.cellTallLast * (double)this.cellSquareDimension;
            this.cellWideLastTimesSquareDimension = (double)this.cellWideLast * (double)this.cellSquareDimension;
            this.numCells = this.cellsTall * this.cellsWide;
            this.groupEnd = this.groupBegin + this.numCells;
        }