当前位置: 首页>>代码示例>>C#>>正文


C# SceneNode.NeedUpdate方法代码示例

本文整理汇总了C#中Axiom.Core.SceneNode.NeedUpdate方法的典型用法代码示例。如果您正苦于以下问题:C# SceneNode.NeedUpdate方法的具体用法?C# SceneNode.NeedUpdate怎么用?C# SceneNode.NeedUpdate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Axiom.Core.SceneNode的用法示例。


在下文中一共展示了SceneNode.NeedUpdate方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Init

        public void Init( ref SceneNode ParentSceneNode, int tableX, int tableZ, int tileX, int tileZ )
        {
            init = true;

            Vector3 ParentPos = ParentSceneNode.DerivedPosition;

            info.PageX = tableX;
            info.PageZ = tableZ;
            info.TileX = tileX;
            info.TileZ = tileZ;
            // Calculate the offset from the parent for this tile

            Vector3 scale = Options.Instance.Scale;
            float endx = Options.Instance.TileSize * scale.x;
            float endz = Options.Instance.TileSize * scale.z;
            info.PosX = info.TileX * endx;
            info.PosZ = info.TileZ * endz;

            name = String.Format("tile[{0},{1}][{2},{3}]",info.PageX, info.PageZ, info.TileX, info.TileZ);
            tileSceneNode = (SceneNode)ParentSceneNode.CreateChild( name );

            // figure out scene node position within parent
            tileSceneNode.Position = new Vector3( info.PosX, 0, info.PosZ );

            tileSceneNode.AttachObject( this );

            float MaxHeight = Data2DManager.Instance.GetMaxHeight(info.PageX, info.PageZ);

            bounds.SetExtents( new Vector3(0,0,0) , new Vector3((float)( endx ), MaxHeight, (float)( endz )) );

            //Change Zone of this page
            boundsExt.SetExtents( new Vector3( - endx * 0.5f, - MaxHeight * 0.5f, - endz * 0.5f) , new Vector3(endx * 1.5f, MaxHeight * 1.5f , endz * 1.5f));

            //Change Zone of this page

            this.worldAABB.SetExtents( new Vector3(info.PosX + ParentPos.x ,0, info.PosZ + ParentPos.z), new Vector3((float)( info.PosX + ParentPos.x + endx), MaxHeight, (float)( info.PosZ + ParentPos.z + endz) ));
            //this.worldBounds.SetExtents( new Vector3(info.PosX + ParentPos.x ,0, info.PosZ + ParentPos.z), new Vector3((float)( info.PosX + ParentPos.x + endx), MaxHeight, (float)( info.PosZ + ParentPos.z + endz) ));

            for ( long i = 0; i < 4; i++ )
            {
                neighbors[ i ] = null;
            }
            //force update in scene node
            //tileSceneNode.update( true, true );
            tileSceneNode.NeedUpdate();
            loaded = false;
        }
开发者ID:ufosky-server,项目名称:MultiversePlatform,代码行数:47,代码来源:Tile.cs

示例2: NotifyAttached

 public virtual void NotifyAttached(Node parent)
 {
     this.parentNode = parent;
     if ( parent != null )
     {
         tileSceneNode = (SceneNode)( parent.CreateChild( name ) );
         //mTileNode.setPosition( (Real)mTableX , 0.0, (Real)mTableZ );
         if ( renderable != null)
             if (renderable.IsLoaded)
         {
             tileSceneNode.AttachObject( (MovableObject) renderable );
         }
         tileSceneNode.NeedUpdate();
     }
 }
开发者ID:ufosky-server,项目名称:MultiversePlatform,代码行数:15,代码来源:Tile.cs

示例3: Load

        /** Loads the landscape using parameters in the given in the constructor. */
        public void Load( ref SceneNode RootNode )
        {
            if ( isPreLoaded == false )
            {
                return;
            }

            if ( isLoaded == true )
            {
                return;
            }

            Texture.TextureManager.Instance.Load(tableX, tableZ);
            //create a root landscape node.
            pageNode = RootNode.CreateChildSceneNode( "Page." +  tableX.ToString() + "." + tableZ.ToString()  );
            // Set node position
            pageNode.Position = new Vector3( (float)iniX , 0.0f, (float)iniZ );

            tiles = new Tiles();
            for (long  i = 0; i < numTiles; i++ )
            {
                tiles.Add( new TileRow() );

                for (long  j = 0; j < numTiles; j++ )
                {
                    //Debug.WriteLine(String.Format("Page[{0},{1}][{2},{3}]",tableX,tableZ,i,j));

                    Tile.Tile tile = TileManager.Instance.GetTile();
                    if ( tile != null )
                    {
                        tiles[ i ].Add( tile );
                        tile.Init(ref pageNode,(int) tableX, (int)tableZ,(int) i, (int)j );
                    }
                    else
                    {
                        string err = "Error: Invalid Tile: Make sure the default TileManager size is set to WorldWidth * WorldHeight * 4. Try increasing MaxNumTiles in the configuration file.";
                        throw new ApplicationException(err);
                    }
                }
            }

            for (long  j = 0; j < numTiles; j++ )
            {
                for (long  i = 0; i < numTiles; i++ )
                {
                    if ( j != numTiles - 1 )
                    {
                        tiles[ i ][ j ].SetNeighbor( Neighbor.South, tiles[ i ][ j + 1 ] );
                        tiles[ i ][ j + 1 ].SetNeighbor( Neighbor.North, tiles[ i ][ j ] );
                    }
                    if ( i != numTiles - 1 )
                    {
                        tiles[ i ][ j ].SetNeighbor( Neighbor.East, tiles[ i + 1 ][ j ] );
                        tiles[ i + 1 ][ j ].SetNeighbor( Neighbor.West, tiles[ i ][ j ] );
                    }
                }
            }

            LinkTileNeighbors();
            pageNode.NeedUpdate();
            isLoaded = true;
        }
开发者ID:ufosky-server,项目名称:MultiversePlatform,代码行数:63,代码来源:Page.cs


注:本文中的Axiom.Core.SceneNode.NeedUpdate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。