コード例 #1
0
ファイル: LandblockStruct.cs プロジェクト: havalina1/ACViewer
        public bool Generate(uint landblockID, int cellScale, LandDefs.Direction transAdj)
        {
            var cellWidth = LandDefs.BlockSide / cellScale;

            if (cellWidth == SideCellCount && TransDir == transAdj)
            {
                return(false);
            }

            var cellRegen = false;

            if (cellWidth != SideCellCount)
            {
                cellRegen = true;

                if (SideCellCount > 0)
                {
                    Destroy();
                }

                SideCellCount = cellWidth;

                SideVertexCount = SideCellCount * LandDefs.VertexPerCell + 1;
                SidePolyCount   = SideCellCount * LandDefs.VertexPerCell;

                InitPVArrays();
            }

            TransDir = transAdj;
            ConstructVertices();

            if (TransDir != LandDefs.Direction.Inside && SideCellCount > 1 && SideCellCount < LandDefs.BlockSide)
            {
                TransAdjust();
            }

            if (!cellRegen)
            {
                AdjustPlanes();
            }
            else
            {
                ConstructPolygons(landblockID);

                if (!PhysicsEngine.Instance.Server)
                {
                    ConstructNormals();
                    ConstructUVs(landblockID);      // client mode only
                }
            }

            CalcWater();

            FinalizePVArrays();

            return(cellRegen);
        }
コード例 #2
0
ファイル: Landblock.cs プロジェクト: PyrealMote/ACE
 public new void Init()
 {
     InView        = BoundingType.Outside;
     Dir           = LandDefs.Direction.Unknown;
     Closest       = new Vector2(-1, -1);
     BlockCoord    = new Vector2();
     StaticObjects = new List <PhysicsObj>();
     Buildings     = new List <BuildingObj>();
 }
コード例 #3
0
ファイル: LandblockStruct.cs プロジェクト: havalina1/ACViewer
        public void Init()
        {
            TransDir  = LandDefs.Direction.Unknown;
            WaterType = LandDefs.WaterType.NotWater;
            //BlockSurfaceIndex = -1;

            // init for landcell
            LandCells = new Dictionary <int, ObjCell>();
            for (uint i = 1; i <= 64; i++)
            {
                LandCells.Add((int)i, new LandCell((i)));
            }
        }