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


C# SceneManager.CreateEntity方法代码示例

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


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

示例1: Arena

        public Arena(SceneManager pSceneManager, Int32 pScale, Int32 pNumAdditionalGrids)
        {
            var random = new Random();
            var topgrid = pSceneManager.CreateEntity("grid top", "grid.mesh");
            var topgridnode = pSceneManager.RootSceneNode.CreateChildSceneNode("grid top");

            topgridnode.Position = new Vector3(0, 0, -10);
            topgridnode.Orientation = Quaternion.FromAxes(Vector3.UnitX, Vector3.UnitZ, Vector3.NegativeUnitY);
            topgridnode.Scale = new Vector3(pScale, 1, pScale);
            topgridnode.AttachObject(topgrid);

            Width = (Int32)(topgrid.BoundingBox.Size.x * pScale);
            Height = (Int32)(topgrid.BoundingBox.Size.z * pScale);

            Right = Width / 2;
            Bottom = Height / 2;
            Left = -Right;
            Top = -Bottom;

            for (var i = 1; i <= pNumAdditionalGrids; i++)
            {
                var grid = pSceneManager.CreateEntity("grid" + i, "grid.mesh");
                var gridnode = pSceneManager.RootSceneNode.CreateChildSceneNode("grid" + i);

                gridnode.Position = new Vector3(
                    random.Next(-pScale / 5, pScale / 5),
                    random.Next(-pScale / 5, pScale / 5),
                    -10 - pScale * i / 10);
                gridnode.Orientation = Quaternion.FromAxes(
                    Vector3.UnitX,
                    Vector3.UnitZ,
                    Vector3.NegativeUnitY);
                gridnode.Scale = new Vector3(
                    pScale + i * random.Next(pScale / 8, pScale / 4),
                    1,
                    pScale + i * random.Next(pScale / 8, pScale / 4));
                gridnode.AttachObject(grid);
            }
        }
开发者ID:jonathandlo,项目名称:Evolution_War,代码行数:39,代码来源:Arena.cs

示例2: Ship

        public Ship(SceneManager pSceneManager, Controller pController)
            : base(pController)
        {
            var name = Methods.GenerateUniqueID.ToString();

            Node = pSceneManager.RootSceneNode.CreateChildSceneNode(name);
            MeshNode = Node.CreateChildSceneNode();
            MeshNode.Orientation = new Quaternion(0.5, 0.5, -0.5, -0.5);
            MeshNode.AttachObject(pSceneManager.CreateEntity(name, "ship_assault_1.mesh"));

            UpgradeGroup = new UpgradeGroup
            {
                CannonAutoFire = { Level = 10 },
                CannonMultiFire = { Level = 10 },
                CannonSpeed = { Level = 7 },
                CannonPower = { Level = 5 }
            };

            cannon = new Cannon(this);
            UpgradeGroup.UpgradeCannon(ref cannon, UpgradeGroup);
        }
开发者ID:jonathandlo,项目名称:Evolution_War,代码行数:21,代码来源:Ship.cs

示例3: SetupBody

		/// <summary>
		/// 
		/// </summary>
		/// <param name="sceneMgr"></param>
		private void SetupBody( SceneManager sceneMgr )
		{
			// create main model
			bodyNode = sceneMgr.RootSceneNode.CreateChildSceneNode( Vector3.UnitY * CharHeight );
			bodyEnt = sceneMgr.CreateEntity( "SinbadBody", "Sinbad.mesh" );
			bodyNode.AttachObject( bodyEnt );

			// create swords and attach to sheath
			sword1 = sceneMgr.CreateEntity( "SinbadSword1", "Sword.mesh" );
			sword2 = sceneMgr.CreateEntity( "SinbadSword2", "Sword.mesh" );
			bodyEnt.AttachObjectToBone( "Sheath.L", sword1 );
			bodyEnt.AttachObjectToBone( "Sheath.R", sword2 );

			// create a couple of ribbon trails for the swords, just for fun
			NamedParameterList paras = new NamedParameterList();
			paras[ "numberOfChains" ] = "2";
			paras[ "maxElements" ] = "80";
			swordTrail = (RibbonTrail)sceneMgr.CreateMovableObject( "SinbadRibbon", "RibbonTrail", paras );
			swordTrail.MaterialName = "Examples/LightRibbonTrail";
			swordTrail.TrailLength = 20;
			swordTrail.IsVisible = false;
			sceneMgr.RootSceneNode.AttachObject( swordTrail );

			for ( int i = 0; i < 2; i++ )
			{
				swordTrail.SetInitialColor( i, new ColorEx( 1, 0.8f, 0 ) );
				swordTrail.SetColorChange( i, new ColorEx( 0.75f, 0.25f, 0.25f, 0.25f ) );
				swordTrail.SetWidthChange( i, 1 );
				swordTrail.SetInitialWidth( i, 0.5f );
			}

			keyDirection = Vector3.Zero;
			verticalVelocity = 0;

		}
开发者ID:WolfgangSt,项目名称:axiom,代码行数:39,代码来源:SinbadCharacterController.cs

示例4: OnLoad

        public void OnLoad()
        {
            // Create patch with positions, normals, and 1 set of texcoords
            var patchDeclaration = HardwareBufferManager.Instance.CreateVertexDeclaration();
            patchDeclaration.AddElement(0, 0, VertexElementType.Float3, VertexElementSemantic.Position);
            patchDeclaration.AddElement(0, 12, VertexElementType.Float3, VertexElementSemantic.Normal);
            patchDeclaration.AddElement(0, 24, VertexElementType.Float2, VertexElementSemantic.TexCoords, 0);

            var patchVertices = new PatchVertex[9];

            patchVertices[0].X = -500;
            patchVertices[0].Y = 200;
            patchVertices[0].Z = -500;
            patchVertices[0].Nx = -0.5f;
            patchVertices[0].Ny = 0.5f;
            patchVertices[0].Nz = 0;
            patchVertices[0].U = 0;
            patchVertices[0].V = 0;

            patchVertices[1].X = 0;
            patchVertices[1].Y = 500;
            patchVertices[1].Z = -750;
            patchVertices[1].Nx = 0;
            patchVertices[1].Ny = 0.5f;
            patchVertices[1].Nz = 0;
            patchVertices[1].U = 0.5f;
            patchVertices[1].V = 0;

            patchVertices[2].X = 500;
            patchVertices[2].Y = 1000;
            patchVertices[2].Z = -500;
            patchVertices[2].Nx = 0.5f;
            patchVertices[2].Ny = 0.5f;
            patchVertices[2].Nz = 0;
            patchVertices[2].U = 1;
            patchVertices[2].V = 0;

            patchVertices[3].X = -500;
            patchVertices[3].Y = 0;
            patchVertices[3].Z = 0;
            patchVertices[3].Nx = -0.5f;
            patchVertices[3].Ny = 0.5f;
            patchVertices[3].Nz = 0;
            patchVertices[3].U = 0;
            patchVertices[3].V = 0.5f;

            patchVertices[4].X = 0;
            patchVertices[4].Y = 500;
            patchVertices[4].Z = 0;
            patchVertices[4].Nx = 0;
            patchVertices[4].Ny = 0.5f;
            patchVertices[4].Nz = 0;
            patchVertices[4].U = 0.5f;
            patchVertices[4].V = 0.5f;

            patchVertices[5].X = 500;
            patchVertices[5].Y = -50;
            patchVertices[5].Z = 0;
            patchVertices[5].Nx = 0.5f;
            patchVertices[5].Ny = 0.5f;
            patchVertices[5].Nz = 0;
            patchVertices[5].U = 1;
            patchVertices[5].V = 0.5f;

            patchVertices[6].X = -500;
            patchVertices[6].Y = 0;
            patchVertices[6].Z = 500;
            patchVertices[6].Nx = -0.5f;
            patchVertices[6].Ny = 0.5f;
            patchVertices[6].Nz = 0;
            patchVertices[6].U = 0;
            patchVertices[6].V = 1;

            patchVertices[7].X = 0;
            patchVertices[7].Y = 500;
            patchVertices[7].Z = 500;
            patchVertices[7].Nx = 0;
            patchVertices[7].Ny = 0.5f;
            patchVertices[7].Nz = 0;
            patchVertices[7].U = 0.5f;
            patchVertices[7].V = 1;

            patchVertices[8].X = 500;
            patchVertices[8].Y = 200;
            patchVertices[8].Z = 800;
            patchVertices[8].Nx = 0.5f;
            patchVertices[8].Ny = 0.5f;
            patchVertices[8].Nz = 0;
            patchVertices[8].U = 1;
            patchVertices[8].V = 1;

            _patch = MeshManager.Instance.CreateBezierPatch("Bezier1", ResourceGroupManager.DefaultResourceGroupName, patchVertices, patchDeclaration, 3, 3, 5, 5, VisibleSide.Both, BufferUsage.StaticWriteOnly, BufferUsage.DynamicWriteOnly, true, true);
            _patch.Subdivision = 1.0f;

            _scene = _root.CreateSceneManager("DefaultSceneManager", "SLSharpInstance");
            _scene.ClearScene();

            _patchEntity = _scene.CreateEntity("Entity1", "Bezier1");
            _camera = _scene.CreateCamera("MainCamera");

//.........这里部分代码省略.........
开发者ID:WolfgangSt,项目名称:axiom,代码行数:101,代码来源:DemoWindow.cs


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