Exemple #1
0
        public Room(Model Room, Effect RoomEffect, GraphicsDevice device)
        {
            this.room       = Room;
            this.roomEffect = RoomEffect;
            this.device     = device;
            PresentationParameters pp = device.PresentationParameters;

            foreach (ModelMesh mesh in this.room.Meshes)
            {
                if (mesh.Effects.Count > 0)
                {
                    if (mesh.Effects[0] is BasicEffect)
                    {
                        foreach (BasicEffect effect in mesh.Effects)
                        {
                            this.OriginalDiffuseColors.Add(effect.DiffuseColor);
                        }
                    }
                }
                foreach (ModelMeshPart meshPart in mesh.MeshParts)
                {
                    meshPart.Effect = this.roomEffect.Clone();
                }
            }

            bones = new Matrix[room.Bones.Count];
            room.CopyAbsoluteBoneTransformsTo(bones);



            bBoxManager = new BoundingBoxManager(room, this.device, bones, roomWorldMatrix);
            mirror      = new Mirror(bBoxManager.boundingBoxes, device);
        }
Exemple #2
0
        public Room(Model Room, Effect RoomEffect, GraphicsDevice device)
        {
            this.room = Room;
            this.roomEffect = RoomEffect;
            this.device = device;
            PresentationParameters pp = device.PresentationParameters;

            foreach (ModelMesh mesh in this.room.Meshes)
            {
                if (mesh.Effects.Count > 0)
                    if (mesh.Effects[0] is BasicEffect)
                        foreach (BasicEffect effect in mesh.Effects)
                            this.OriginalDiffuseColors.Add(effect.DiffuseColor);
                foreach (ModelMeshPart meshPart in mesh.MeshParts)
                    meshPart.Effect = this.roomEffect.Clone();
            }

            bones = new Matrix[room.Bones.Count];
            room.CopyAbsoluteBoneTransformsTo(bones);

            bBoxManager = new BoundingBoxManager(room, this.device, bones, roomWorldMatrix);
            mirror = new Mirror(bBoxManager.boundingBoxes, device);
        }