本文整理汇总了C#中Axiom.Core.SceneNode.CreateChild方法的典型用法代码示例。如果您正苦于以下问题:C# SceneNode.CreateChild方法的具体用法?C# SceneNode.CreateChild怎么用?C# SceneNode.CreateChild使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Axiom.Core.SceneNode
的用法示例。
在下文中一共展示了SceneNode.CreateChild方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestRecreationOfChildNodeAfterRemovalByReference
public void TestRecreationOfChildNodeAfterRemovalByReference()
{
Node node = new SceneNode( this.fakeSceneManager );
Node childNode = node.CreateChild( Name );
node.RemoveChild( childNode );
node.CreateChild( Name );
}
示例2: 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;
}
示例3: TestReaddingOfChildNodeAfterRemovalByName
public void TestReaddingOfChildNodeAfterRemovalByName()
{
Node node = new SceneNode( this.fakeSceneManager );
Node childNode = node.CreateChild( Name );
node.RemoveChild( Name );
node.AddChild( childNode );
}
示例4: LoadWorldGeometry
//.........这里部分代码省略.........
tileSize = options.size;
// load the heightmap
Image image = Image.FromFile(terrainFileName);
// TODO: Check terrain size for 2^n + 1
// get the data from the heightmap
options.data = image.Data;
options.worldSize = image.Width;
float maxx = options.scalex * options.worldSize;
float maxy = 255 * options.scaley;
float maxz = options.scalez * options.worldSize;
Resize(new AxisAlignedBox(Vector3.Zero, new Vector3(maxx, maxy, maxz)));
terrainMaterial = CreateMaterial("Terrain");
if(worldTexture != "")
{
terrainMaterial.GetTechnique(0).GetPass(0).CreateTextureUnitState(worldTexture, 0);
}
if(detailTexture != "")
{
terrainMaterial.GetTechnique(0).GetPass(0).CreateTextureUnitState(detailTexture, 1);
}
terrainMaterial.Lighting = options.isLit;
terrainMaterial.Load();
terrainRoot = (SceneNode)RootSceneNode.CreateChild("TerrainRoot");
numTiles = (options.worldSize - 1) / (options.size - 1);
tiles = new TerrainRenderable[numTiles, numTiles];
int p = 0, q = 0;
for(int j = 0; j < options.worldSize - 1; j += (options.size - 1))
{
p = 0;
for(int i = 0; i < options.worldSize - 1; i += (options.size - 1))
{
options.startx = i;
options.startz = j;
string name = string.Format("Tile[{0},{1}]", p, q);
SceneNode node = (SceneNode)terrainRoot.CreateChild(name);
TerrainRenderable tile = new TerrainRenderable();
tile.Name = name;
tile.SetMaterial(terrainMaterial);
tile.Init(options);
tiles[p,q] = tile;
node.AttachObject(tile);
p++;
}