本文整理汇总了C#中Axiom.Core.SceneNode.GetObject方法的典型用法代码示例。如果您正苦于以下问题:C# SceneNode.GetObject方法的具体用法?C# SceneNode.GetObject怎么用?C# SceneNode.GetObject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Axiom.Core.SceneNode
的用法示例。
在下文中一共展示了SceneNode.GetObject方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UpdateDebugDisplay
public override void UpdateDebugDisplay( Page p, SceneNode sn )
{
byte dbglvl = mManager.DebugDisplayLevel;
if ( dbglvl != 0 )
{
// we could try to avoid updating the geometry every time here, but this
// wouldn't easily deal with paging parameter changes. There shouldn't
// be that many pages anyway, and this is debug after all, so update every time
int x, y;
var stratData = (Grid2DPageStrategyData)p.ParentSection.StrategyData;
stratData.CalculateCell( p.PageID, out x, out y );
var data = (Grid2DPageStrategyData)p.ParentSection.StrategyData;
// Determine our centre point, we'll anchor here
// Note that world points are initialised to ZERO since only 2 dimensions
// are updated by the grid data (we could display this grid anywhere)
Vector2 gridMidPoint = Vector2.Zero;
Vector3 worldMidPoint = Vector3.Zero;
data.GetMidPointGridSpace( x, y, ref gridMidPoint );
data.ConvertGridToWorldSpace( gridMidPoint, ref worldMidPoint );
sn.Position = worldMidPoint;
var gridCorners = new Vector2[4];
var worldCorners = new Vector3[4];
data.GetCornersGridSpace( x, y, ref gridCorners );
for ( int i = 0; i < 4; ++i )
{
worldCorners[ i ] = Vector3.Zero;
data.ConvertGridToWorldSpace( gridCorners[ i ], ref worldCorners[ i ] );
// make relative to mid point
worldCorners[ i ] -= worldMidPoint;
}
string matName = "Axiom/G2D/Debug";
var mat = (Material)MaterialManager.Instance.GetByName( matName );
if ( mat == null )
{
mat = (Material)MaterialManager.Instance.Create( matName, ResourceGroupManager.DefaultResourceGroupName );
Pass pass = mat.GetTechnique( 0 ).GetPass( 0 );
pass.LightingEnabled = false;
pass.VertexColorTracking = TrackVertexColor.Ambient;
pass.DepthWrite = false;
mat.Load();
}
ManualObject mo = null;
if ( sn.ChildCount == 0 )
{
mo = p.ParentSection.SceneManager.CreateManualObject();
mo.Begin( matName, OperationType.LineStrip );
}
else
{
mo = (ManualObject)sn.GetObject( 0 );
mo.BeginUpdate( 0 );
}
ColorEx vcol = ColorEx.Green;
for ( int i = 0; i < 5; ++i )
{
mo.Position( worldCorners[ i%4 ] );
mo.Color( vcol );
}
mo.End();
if ( sn.ObjectCount == 0 )
{
sn.AttachObject( mo );
}
}
}