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


C# SceneNode.GetObject方法代码示例

本文整理汇总了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 );
				}
			}
		}
开发者ID:ryan-bunker,项目名称:axiom3d,代码行数:75,代码来源:Grid2PageStrategy.cs


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