public void DrawMeshes(ChaseCamera Camera) { Matrix[] boneTransforms = new Matrix[Model.Bones.Count]; Model.CopyAbsoluteBoneTransformsTo(boneTransforms); foreach (ModelMesh mesh in Model.Meshes) { foreach (BasicEffect effect in mesh.Effects) { effect.EnableDefaultLighting(); effect.PreferPerPixelLighting = true; effect.World = boneTransforms[mesh.ParentBone.Index] * Matrix.CreateScale(Scale) * Matrix.CreateRotationY(MathHelper.ToRadians(m_Rotation)) * Matrix.CreateTranslation(Position); effect.Projection = Camera.Projection; effect.View = Camera.View; } mesh.Draw(); } }
public void DrawMeshes(ChaseCamera camera) { Matrix[] transforms = new Matrix[Model.Bones.Count]; Model.CopyAbsoluteBoneTransformsTo(transforms); foreach (ModelMesh mesh in Model.Meshes) { foreach (BasicEffect effect in mesh.Effects) { effect.EnableDefaultLighting(); effect.PreferPerPixelLighting = true; effect.World = transforms[mesh.ParentBone.Index] * Matrix.CreateScale(Scale) * world; // Use the matrices provided by the chase camera effect.View = camera.View; effect.Projection = camera.Projection; } mesh.Draw(); } }
public void Draw(ChaseCamera camera) { homeBathroom.DrawMeshes(camera); homeBathroomSink.DrawMeshes(camera); homeCeiling.DrawMeshes(camera); homeCouch.DrawMeshes(camera); homeCurtain.DrawMeshes(camera); homeDoor.DrawMeshes(camera); homeElevator.DrawMeshes(camera); homeFloor.DrawMeshes(camera); homeKitchenSink.DrawMeshes(camera); homeKitchenTable.DrawMeshes(camera); homeKitchenware.DrawMeshes(camera); homeRoomBig.DrawMeshes(camera); homeRoomSmall.DrawMeshes(camera); homeRoomSmallBed.DrawMeshes(camera); homeRoomSmallChest.DrawMeshes(camera); homeStairs.DrawMeshes(camera); homeTable.DrawMeshes(camera); homeTV.DrawMeshes(camera); homeWallFront.DrawMeshes(camera); homeWindow.DrawMeshes(camera); }
public override void Init(ContentManager content) { boundingBs.Add(bbConnection); boundingBs.Add(bbDoor); boundingBs.Add(bbKitchen); boundingBs.Add(bbLivingroom); boundingBs.Add(bbLivingroomDoor); target = new ChaseTarget(); target.Init(content, 0.0002f, @"HomeRScreen\JustBall"); target.Position = new Vector3(80, 50, 83); target.PositionTemp = new Vector3(80, 50, 83); camera = new ChaseCamera(); UpdateCameraChaseTarget(); camera.Reset(); homeModelHelper.Init(content); phone.Init(content, 1f, 0f, new Vector3(38, 33, 83), @"HomeEScreen\phone"); phone.boundingS.Radius = 5f; SimpleMap.Init(content, 1f, 0f, Vector3.Zero, @"HomeEScreen\Tutorial"); fireIndicator.Init(content, 0.5f, 0f, new Vector3(-80, 40, 0), @"HomeRScreen\JustBall"); fireIndicator.boundingS.Radius = 50; fireBrave.Init(content, 0.5f, 0f, new Vector3(-80, 40, 0), @"HomeRScreen\JustBall"); fireBrave.boundingS.Radius = 40; fireHP.Init(content, 0.5f, 0f, new Vector3(-80, 40, 0), @"HomeRScreen\JustBall"); fireHP.boundingS.Radius = 30; extinguisherNomal.Init(content, 0.05f, -45f, new Vector3(28, 20, -70), @"HomeEScreen\extinguisherNomal"); extinguisherNomal.boundingS.Radius = 15f; extinguisherNear.Init(content, 0.5f, 0f, new Vector3(28, 20, -70), @"HomeRScreen\JustBall"); extinguisherUse.Init(content, 0.02f, -45f, Vector3.Zero, @"HomeEScreen\extinguisherUse"); drawHelper.Init(content); fire = new SpriteAnimation(); fire.Init(content, @"HomeEScreen\fire", Vector2.Zero, 4, 4, 14, 3, 0.3f); TickTock = content.Load<SoundEffect>(@"HomeEScreen\TickTock"); Cough = content.Load<SoundEffect>(@"HomeEScreen\Cough"); Eat = content.Load<SoundEffect>(@"HomeEScreen\Eat"); pauseScreen.Init(content); }