本文整理汇总了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;
}
示例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();
}
}
示例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;
}