protected override void LoadContent(GraphicInfo GraphicInfo, GraphicFactory factory, IContentManager contentManager) { PhysxPhysicWorld PhysxPhysicWorld = World.PhysicWorld as PhysxPhysicWorld; base.LoadContent(GraphicInfo, factory, contentManager); { SimpleModel simpleModel = new SimpleModel(factory, "Model//cenario"); PhysxTriangleMesh tmesh = new PhysxTriangleMesh(PhysxPhysicWorld, simpleModel, Matrix.Identity, Vector3.One); ForwardXNABasicShader shader = new ForwardXNABasicShader(ForwardXNABasicShaderDescription.Default()); ForwardMaterial fmaterial = new ForwardMaterial(shader); IObject obj = new IObject(fmaterial, simpleModel, tmesh); this.World.AddObject(obj); } { ///Load a Model with a custom texture SimpleModel sm2 = new SimpleModel(factory, "Model\\ball"); sm2.SetTexture(factory.CreateTexture2DColor(1, 1, Color.Aquamarine, false), TextureType.DIFFUSE); ForwardXNABasicShader nd = new ForwardXNABasicShader(); IMaterial m = new ForwardMaterial(nd); SphereShapeDescription SphereGeometry = new SphereShapeDescription(5f); PhysxGhostObject PhysxPhysicObject = new PhysxGhostObject(new Vector3(100, 100, 100), Matrix.Identity, Vector3.One * 5f); IObject o = new IObject(m, sm2, PhysxPhysicObject); this.World.AddObject(o); PhysxTrigger PhysxTrigger = new PloobsEngine.Physics.PhysxTrigger( SphereGeometry, Matrix.CreateTranslation(new Vector3(100, 100, 100)), new PloobsEngine.Trigger.TriggerEvent("TriggerEvent", "TriggerEvent"), null, true); World.AddTrigger(PhysxTrigger); } BallThrowPhysx28 BallThrowBullet = new BallThrowPhysx28(this.World, GraphicFactory); this.AttachCleanUpAble(BallThrowBullet); this.World.CameraManager.AddCamera(new CameraFirstPerson(GraphicInfo)); ReciveMessage ReciveMessage = new ReciveMessage(); }
protected override void LoadContent(GraphicInfo GraphicInfo, GraphicFactory factory ,IContentManager contentManager) { PhysxPhysicWorld PhysxPhysicWorld = World.PhysicWorld as PhysxPhysicWorld; base.LoadContent(GraphicInfo, factory, contentManager); { SimpleModel simpleModel = new SimpleModel(factory, "Model//cenario"); PhysxTriangleMesh tmesh = new PhysxTriangleMesh(PhysxPhysicWorld,simpleModel, Matrix.Identity, Vector3.One); ForwardXNABasicShader shader = new ForwardXNABasicShader(ForwardXNABasicShaderDescription.Default()); ForwardMaterial fmaterial = new ForwardMaterial(shader); IObject obj = new IObject(fmaterial, simpleModel, tmesh); this.World.AddObject(obj); } { ///Load a Model with a custom texture SimpleModel sm2 = new SimpleModel(factory, "Model\\ball"); sm2.SetTexture(factory.CreateTexture2DColor(1, 1, Color.Aquamarine, false), TextureType.DIFFUSE); ForwardXNABasicShader nd = new ForwardXNABasicShader(); IMaterial m =new ForwardMaterial(nd); SphereShapeDescription SphereGeometry = new SphereShapeDescription(5f); PhysxGhostObject PhysxPhysicObject = new PhysxGhostObject(new Vector3(100,100,100),Matrix.Identity, Vector3.One * 5f); IObject o = new IObject(m, sm2, PhysxPhysicObject); this.World.AddObject(o); PhysxTrigger PhysxTrigger = new PloobsEngine.Physics.PhysxTrigger( SphereGeometry, Matrix.CreateTranslation(new Vector3(100, 100, 100)), new PloobsEngine.Trigger.TriggerEvent("TriggerEvent", "TriggerEvent"), null, true); World.AddTrigger(PhysxTrigger); } BallThrowPhysx28 BallThrowBullet = new BallThrowPhysx28(this.World, GraphicFactory); this.AttachCleanUpAble(BallThrowBullet); this.World.CameraManager.AddCamera(new CameraFirstPerson(GraphicInfo)); ReciveMessage ReciveMessage = new ReciveMessage(); }