/// <summary> /// Create a simple Sphere object /// </summary> /// <param name="pos"></param> /// <param name="ori"></param> /// <returns></returns> private ThrowParticlesObject SpawnPrimitive(DefaultSprite3DBillboardParticleSystem particleSystem, Vector3 pos, Matrix ori) { ///Load a Model with a custom texture SimpleModel sm2 = new SimpleModel(scene.GraphicFactory, "Model\\ball"); sm2.SetTexture(scene.GraphicFactory.CreateTexture2DColor(1, 1, Color.White, false), TextureType.DIFFUSE); DeferredNormalShader nd = new DeferredNormalShader(); IMaterial m = new DeferredMaterial(nd); SphereObject pi2 = new SphereObject(pos, 1, 10, 1, MaterialDescription.DefaultBepuMaterial()); ThrowParticlesObject o = new ThrowParticlesObject(particleSystem, m, sm2, pi2); return(o); }
public void mousebuttonteste(MouseState ms) { SmokeParticleSystem smoke = new SmokeParticleSystem(); DPFSParticleSystem ps = new DPFSParticleSystem("smoke" + particleSystemNumber, smoke); scene.World.ParticleManager.AddAndInitializeParticleSystem(ps); ///Create an object ThrowParticlesObject physObj = SpawnPrimitive(smoke, this.scene.World.CameraManager.ActiveCamera.Position, Matrix.CreateRotationX(0.5f)); physObj.PhysicObject.Velocity = (this.scene.World.CameraManager.ActiveCamera.Target - this.scene.World.CameraManager.ActiveCamera.Position) * 10.0f; scene.World.AddObject(physObj); }