protected override void LoadContent(GraphicInfo GraphicInfo, GraphicFactory factory, IContentManager contentManager) { base.LoadContent(GraphicInfo, factory, contentManager); { ///Uncoment to add your model SimpleModel simpleModel = new SimpleModel(factory, "Model/cenario"); ///Physic info (position, rotation and scale are set here) TriangleMeshObject tmesh = new TriangleMeshObject(simpleModel, Vector3.Zero, Matrix.Identity, Vector3.One, MaterialDescription.DefaultBepuMaterial()); ///Forward Shader (look at this shader construction for more info) ForwardXNABasicShader shader = new ForwardXNABasicShader(); ///Deferred material ForwardMaterial fmaterial = new ForwardMaterial(shader); ///The object itself IObject obj = new IObject(fmaterial, simpleModel, tmesh); ///Add to the world this.World.AddObject(obj); } { SnowParticleSystem snow = new SnowParticleSystem(); DPFSParticleSystem ps = new DPFSParticleSystem("snow", snow); this.World.ParticleManager.AddAndInitializeParticleSystem(ps); ///cant set emiter position before adding the particle ///IF YOU DO SO, IT WILL NOT WORK snow.Emitter.PositionData.Position = new Vector3(500, 0, 0); } CameraFirstPerson cam = new CameraFirstPerson(MathHelper.ToRadians(-50), MathHelper.ToRadians(-10), new Vector3(-200, 150, 250), GraphicInfo); this.World.CameraManager.AddCamera(cam); }
public void Initialize() { _playerVelocity = Vector3.Zero; _bubbleParticleSystem = new BubbleParticleSystem(_game, _game.Content); _bubbleParticleSystem.Initialize(); _snowParticleSystem = new SnowParticleSystem(_game, _game.Content); _snowParticleSystem.Initialize(); }
public void Initialize() { _playerVelocity = Vector3.Zero; _bubbleParticleSystem = new BubbleParticleSystem(_game, _game.Content); _bubbleParticleSystem.Initialize(); _snowParticleSystem = new SnowParticleSystem(_game, _game.Content); _snowParticleSystem.Initialize(); Camera.LeftRightRotation = 3.946f; Camera.UpDownRotation = -1.124f; _elapsedTime = 0.0f; _onBlockSlection = false; }
protected override void LoadContent(GraphicInfo GraphicInfo, GraphicFactory factory, IContentManager contentManager) { base.LoadContent(GraphicInfo, factory, contentManager); { SnowParticleSystem snow = new SnowParticleSystem(); DPFSParticleSystem ps = new DPFSParticleSystem("snow", snow); this.World.ParticleManager.AddAndInitializeParticleSystem(ps); ///cant set emiter position before adding the particle ///IF YOU DO SO, IT WILL NOT WORK snow.Emitter.PositionData.Position = new Vector3(500, 0, 0); } ObjectThrowSmokeParticle ot = new ObjectThrowSmokeParticle(this); this.AddScreenUpdateable(ot); ///OUR Classic Model { ///Create the xml file model extractor ///Loads a XML file that was export by our 3DS MAX plugin ExtractXmlModelLoader ext = new ExtractXmlModelLoader("Content//ModelInfos//", "Model//", "Textures//"); this.AttachCleanUpAble(ext); ///Extract all the XML info (Model,Cameras, ...) ModelLoaderData data = ext.Load(factory, GraphicInfo, "ilha"); ///Create the WOrld Loader ///Convert the ModelLoaderData in World Entities WorldLoader wl = new WorldLoader(); ///all default wl.LoadWorld(factory, GraphicInfo, World, data); } #region NormalLight DirectionalLightPE ld1 = new DirectionalLightPE(Vector3.Left, Color.White); DirectionalLightPE ld2 = new DirectionalLightPE(Vector3.Right, Color.White); DirectionalLightPE ld3 = new DirectionalLightPE(Vector3.Backward, Color.White); DirectionalLightPE ld4 = new DirectionalLightPE(Vector3.Forward, Color.White); DirectionalLightPE ld5 = new DirectionalLightPE(Vector3.Down, Color.White); float li = 0.5f; ld1.LightIntensity = li; ld2.LightIntensity = li; ld3.LightIntensity = li; ld4.LightIntensity = li; ld5.LightIntensity = li; this.World.AddLight(ld1); this.World.AddLight(ld2); this.World.AddLight(ld3); this.World.AddLight(ld4); this.World.AddLight(ld5); #endregion CameraFirstPerson cam = new CameraFirstPerson(MathHelper.ToRadians(-50), MathHelper.ToRadians(-10), new Vector3(-200, 150, 250), GraphicInfo); this.World.CameraManager.AddCamera(cam); SkyBoxSetTextureCube stc = new SkyBoxSetTextureCube("Textures//grassCube"); CommandProcessor.getCommandProcessor().SendCommandAssyncronous(stc); this.RenderTechnic.AddPostEffect(new AntiAliasingPostEffectStalker()); }