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


C# ParticleSystem.GetEmitter方法代码示例

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


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

示例1: ForceBall

        public ForceBall(SceneManager sceneManager, MogreNewt.World physicsWorld, float tempSize, int own)
        {
            MogreNewt.ConvexCollision col;
            Mogre.Vector3 offset;
            Mogre.Vector3 inertia;

            unique++;

            // Create the visible mesh (no physics)
            ent = sceneManager.CreateEntity("forceball" + unique, "Sph.mesh");
            sn = sceneManager.RootSceneNode.CreateChildSceneNode();
            sn.AttachObject(ent);
            Console.WriteLine("end ball create");
            size = tempSize;

            sn.SetScale(size, size, size);

            // Create the collision hull
            col = new MogreNewt.CollisionPrimitives.ConvexHull(physicsWorld, sn);
            col.calculateInertialMatrix(out inertia, out offset);

            // Create the physics body. This body is what you manipulate. The graphical Ogre scenenode is automatically synced with the physics body
            body = new MogreNewt.Body(physicsWorld, col);
            col.Dispose();

            //body.setPositionOrientation(new Vector3(0, 10, 0), Quaternion.IDENTITY);

            body.attachToNode(sn);
            body.setContinuousCollisionMode(1);
            body.setMassMatrix(mass, mass * inertia);
            body.IsGravityEnabled = true;
            body.setUserData(this);

            trail = sceneManager.CreateParticleSystem("awesome" + StringConverter.ToString(unique), "Char/Smoke");
            trail.CastShadows = true;
            trail.GetEmitter(0).EmissionRate = 100;
            sn.AttachObject(trail);

            Console.WriteLine("player stuff");

            owner = own;
            Player tempP = (Player)Program.p1;
            colour = tempP.cv;
        }
开发者ID:CharcoalStyles,项目名称:3DRL,代码行数:44,代码来源:Force+ball.cs

示例2: xRemoveSystem

        public void xRemoveSystem(ParticleSystem ps)
        {
            if (ps == null) return;

            if(psystem == ps){

                // destroy emitter model data
                for(int i=0; i<ps.NumEmitters; i++){
                    xRemoveEmitterModels(ps.GetEmitter((ushort)i).Name);
                }

                // free model data
                SceneNode node = sceneMgr.GetSceneNode(ps.Name);
                node.DetachAllObjects();
                sceneMgr.DestroySceneNode(node);
                sceneMgr.DestroyParticleSystem(ps);
            }

            plist.Remove(ps);
        }
开发者ID:RainsSoft,项目名称:ogreflow,代码行数:20,代码来源:App.cs

示例3: CreateScene

		// Just override the mandatory create scene method
		public override void CreateScene()
		{
			RAND = new Random( 0 ); // najak: use a time-based seed
			GuiMgr = OverlayManager.Instance.Elements;
			scene.AmbientLight = new ColorEx( 0.75f, 0.75f, 0.75f ); // default Ambient Light
			// Customize Controls - speed up camera and slow down the input update rate
			this.camSpeed = 5.0f;
			inputInterval = inputTimer = 0.02f;

			// Create water mesh and entity, and attach to sceneNode
			waterMesh = new WaterMesh( "WaterMesh", PLANE_SIZE, CMPLX );
			waterEntity = scene.CreateEntity( "WaterEntity", "WaterMesh" );
			SceneNode waterNode = scene.RootSceneNode.CreateChildSceneNode();
			waterNode.AttachObject( waterEntity );

			// Add Ogre head, give it it's own node
			headNode = waterNode.CreateChildSceneNode();
			Entity ent = scene.CreateEntity( "head", "ogrehead.mesh" );
			headNode.AttachObject( ent );

			// Create the camera node, set its position & attach camera
			camera.Yaw( -45f );
			camera.Move( new Vector3( 1500f, 700f, PLANE_SIZE + 700f ) );
			camera.LookAt( new Vector3( PLANE_SIZE / 2f, 300f, PLANE_SIZE / 2f ) );
			camera.SetAutoTracking( false, headNode ); // Autotrack the head, but it isn't working right

			//scene.SetFog(FogMode.Exp, ColorEx.White, 0.000020f); // add Fog for fun, cuz we can

			// show overlay
			waterOverlay = OverlayManager.Instance.GetByName( "Example/WaterOverlay" );
			waterOverlay.Show();

			// Create Rain Emitter, but default Rain to OFF
			particleSystem = ParticleSystemManager.Instance.CreateSystem( "rain", "Examples/Water/Rain" );
			particleEmitter = particleSystem.GetEmitter( 0 );
			particleEmitter.EmissionRate = 0f;

			// Attach Rain Emitter to SceneNode, and place it 3000f above the water surface
			SceneNode rNode = scene.RootSceneNode.CreateChildSceneNode();
			rNode.Translate( new Vector3( PLANE_SIZE / 2.0f, 3000, PLANE_SIZE / 2.0f ) );
			rNode.AttachObject( particleSystem );
			particleSystem.FastForward( 20 ); // Fastforward rain to make it look natural

			// It can't be set in .particle file, and we need it ;)
			//particleSystem.Origin = BillboardOrigin.BottomCenter;

			// Set Lighting
			lightNode = scene.RootSceneNode.CreateChildSceneNode();
			lightSet = scene.CreateBillboardSet( "Lights", 20 );
			lightSet.MaterialName = "Particles/Flare";
			lightNode.AttachObject( lightSet );
			SetLighting( "Ambient" ); // Add Lights - added by Najak to show lighted Water conditions - cool!

			#region STUBBED LIGHT ANIMATION
			// Create a new animation state to track this
			// TODO: Light Animation not working.
			//this.animState = scene.CreateAnimationState("WaterLight");
			//this.animState.Time = 0f;
			//this.animState.IsEnabled = false;

			// set up spline animation of light node.  Create random Spline
			Animation anim = scene.CreateAnimation( "WaterLight", 20 );
			AnimationTrack track = anim.CreateNodeTrack( 0, this.lightNode );
			TransformKeyFrame key = (TransformKeyFrame)track.CreateKeyFrame( 0 );
			for ( int ff = 1; ff <= 19; ff++ )
			{
				key = (TransformKeyFrame)track.CreateKeyFrame( ff );
				Random rand = new Random( 0 );
				Vector3 lpos = new Vector3(
					(float)rand.NextDouble() % (int)PLANE_SIZE, //- PLANE_SIZE/2,
					(float)rand.NextDouble() % 300 + 100,
					(float)rand.NextDouble() % (int)PLANE_SIZE ); //- PLANE_SIZE/2
				key.Translate = lpos;
			}
			key = (TransformKeyFrame)track.CreateKeyFrame( 20 );
			#endregion STUBBED LIGHT ANIMATION

			// Initialize the Materials/Demo
			UpdateMaterial();
			UpdateInfoParamC();
			UpdateInfoParamD();
			UpdateInfoParamU();
			UpdateInfoParamT();
			UpdateInfoNormals();
			UpdateInfoHeadDepth();
			UpdateInfoSkyBox();
			UpdateInfoHeadSpeed();
			UpdateInfoLights();
			UpdateInfoTracking();

			// Init Head Animation:  Load adds[] elements - Ogre head animation
			adds[ 0 ] = 0.3f;
			adds[ 1 ] = -1.6f;
			adds[ 2 ] = 1.1f;
			adds[ 3 ] = 0.5f;
			sines[ 0 ] = 0;
			sines[ 1 ] = 100;
			sines[ 2 ] = 200;
			sines[ 3 ] = 300;
//.........这里部分代码省略.........
开发者ID:WolfgangSt,项目名称:axiom,代码行数:101,代码来源:Water.cs


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