Ejemplo n.º 1
0
 public Treetrunk2()
 {
     MainGraphic = new MetaModel
     {
         XMesh = new MeshFromFile("Models/Props/Treetrunk2.x"),
         Texture = new TextureFromFile("Models/Props/Treetrunk1.png"),
         SpecularTexture = new TextureFromFile("Models/Props/TreetrunkSpecular1.png"),
         World = Matrix.Scaling(0.08f, 0.08f, 0.08f) * SkinnedMesh.InitSkinnedMeshFromMaya,
         Visible = Priority.High,
         CastShadows = global::Graphics.Content.Priority.Medium,
         ReceivesShadows = Priority.High,
         ReceivesSpecular = Priority.Medium,
         SpecularExponent = 4,
     };
     VisibilityLocalBounding = CreateBoundingBoxFromModel((MetaModel)MainGraphic);
     PickingLocalBounding = CreateBoundingMeshFromModel((MetaModel)MainGraphic);
     var physicsMesh = new MeshFromFile("Models/Props/Treetrunk2Pathmesh.x");
     PhysicsLocalBounding = CreatePhysicsMeshBounding(new MetaModel { XMesh = physicsMesh, World = ((MetaModel)MainGraphic).World });
     EditorPlacementLocalBounding = new Common.Bounding.Cylinder(Vector3.Zero, 3, 1.5f);
     EditorRandomRotation = true;
 }
Ejemplo n.º 2
0
        public FloatingTreetrunk1()
        {
            MainGraphic = new MetaModel
            {
                SkinnedMesh = new SkinnedMeshFromFile("Models/Props/FloatingTreetrunk1.x"),
                Texture = new TextureFromFile("Models/Props/FloatingTreetrunk1.png"),
                SpecularTexture = new TextureFromFile("Models/Props/FloatingTreetrunkSpecular1.png"),
                World = Matrix.Scaling(0.1f, 0.1f, 0.1f) * SkinnedMesh.InitSkinnedMeshFromMaya * Matrix.Translation(0, 0, -0.1f),
                Visible = Priority.High,
                CastShadows = global::Graphics.Content.Priority.Medium,
                ReceivesShadows = Priority.High,
                ReceivesSpecular = Priority.Medium,
                SpecularExponent = 8,
            };
            VisibilityLocalBounding = CreateBoundingBoxFromModel((MetaModel)MainGraphic);
            PickingLocalBounding = CreateBoundingMeshFromModel((MetaModel)MainGraphic);

            var physicsMesh = new MeshFromFile("Models/Props/FloatingTreetrunk1Pathmesh.x");
            PhysicsLocalBounding = CreatePhysicsMeshBounding(new MetaModel { XMesh = physicsMesh, World = ((MetaModel)MainGraphic).World });
            EditorRandomRotation = true;
            EditorFollowGroundType = EditorFollowGroupType.Water;
        }
Ejemplo n.º 3
0
        public Stone4()
        {
            MainGraphic = new MetaModel
            {
                XMesh = new MeshFromFile("Models/Props/Stone4.x"),
                Texture = new TextureFromFile("Models/Props/Stone4.png"),
                SpecularTexture = new TextureFromFile("Models/Props/StoneSpecular4.png"),
                World = Matrix.Scaling(0.1f, 0.1f, 0.1f) * SkinnedMesh.InitSkinnedMeshFromMaya,
                Visible = Priority.High,
                CastShadows = global::Graphics.Content.Priority.Medium,
                ReceivesShadows = Priority.High,
                ReceivesSpecular = Priority.Medium,
                SpecularExponent = 4,
            };

            VisibilityLocalBounding = CreateBoundingBoxFromModel((MetaModel)MainGraphic);
            PickingLocalBounding = CreateBoundingMeshFromModel((MetaModel)MainGraphic);
            var physicsMesh = new MeshFromFile("Models/Props/Stone4Pathmesh.x");
            PhysicsLocalBounding = CreatePhysicsMeshBounding(new MetaModel { XMesh = physicsMesh, World = ((MetaModel)MainGraphic).World });
            //PhysicsLocalBounding = null;
            EditorRandomRotation = true;
        }
Ejemplo n.º 4
0
        public Cannon2()
        {
            MainGraphic = new MetaModel
            {
                XMesh = new MeshFromFile("Models/Props/Cannon2.x"),
                Texture = new TextureFromFile("Models/Props/Cannon1.png"),
                SpecularTexture = new TextureFromFile("Models/Props/CannonSpecular1.png"),
                World = Matrix.Scaling(0.12f, 0.12f, 0.12f) * SkinnedMesh.InitSkinnedMeshFromMaya,
                CastShadows = global::Graphics.Content.Priority.Medium,
                ReceivesShadows = Priority.High,
                ReceivesSpecular = Priority.High,
            };

            VisibilityLocalBounding = CreateBoundingBoxFromModel((MetaModel)MainGraphic);
            PickingLocalBounding = CreateBoundingMeshFromModel((MetaModel)MainGraphic);
            var physicsMesh = new MeshFromFile("Models/Props/Cannon2Hitbox.x");
            PhysicsLocalBounding = CreatePhysicsMeshBounding(new MetaModel { XMesh = physicsMesh, World = ((MetaModel)MainGraphic).World });
            EditorRandomRotation = true;
        }
Ejemplo n.º 5
0
        void UpdatePhysicsLocalBounding()
        {
            if (MainGraphic == null) return;

            MeshFromFile physicsMesh;
            if (State == UnitState.Alive)
                physicsMesh = new MeshFromFile("Models/Props/Bridge1Pathmesh.x");
            else
                physicsMesh = new MeshFromFile("Models/Props/BridgeBroken1Pathmesh.x");
            PhysicsLocalBounding = CreatePhysicsMeshBounding(new MetaModel { XMesh = physicsMesh, World = ((MetaModel)MainGraphic).World });
        }
Ejemplo n.º 6
0
 public Hut2()
 {
     MainGraphic = new MetaModel
     {
         XMesh = new MeshFromFile("Models/Props/Hut2.x"),
         Texture = new TextureFromFile("Models/Props/Hut1.png"),
         SpecularTexture = new TextureFromFile("Models/Props/HutSpecular1.png"),
         World = Matrix.Scaling(0.12f, 0.12f, 0.12f) * SkinnedMesh.InitSkinnedMeshFromMaya,
         AlphaRef = 254,
         Visible = Priority.High,
         CastShadows = global::Graphics.Content.Priority.High,
         ReceivesShadows = Priority.High,
         ReceivesSpecular = Priority.High,
         SpecularExponent = 6,
     };
     VisibilityLocalBounding = CreateBoundingBoxFromModel((MetaModel)MainGraphic);
     PickingLocalBounding = CreateBoundingMeshFromModel((MetaModel)MainGraphic);
     var physicsMesh = new MeshFromFile("Models/Props/Hut2Pathmesh.x");
     PhysicsLocalBounding = CreatePhysicsMeshBounding(new MetaModel { XMesh = physicsMesh, World = ((MetaModel)MainGraphic).World });
     EditorRandomRotation = true;
 }
Ejemplo n.º 7
0
        void UpdatePhysicsLocalBounding()
        {
            if (MainGraphic == null) return;

            #if GATE_LOCAL_BOUNDING_HACK
            if (State == UnitState.Alive)
            {
                PhysicsLocalBounding = CreatePhysicsMeshBounding(new MetaModel { XMesh = new MeshFromFile("Models/Props/GatePathmeshClosed1.x"), World = ((MetaModel)Graphic).World });
                UpdateMotionObject();
            }
            else
            {
                PhysicsLocalBounding = null;
                MotionObject = null;
            }
            #else
            MeshFromFile physicsMesh;
            if (State == UnitState.Alive)
                PhysicsLocalBounding = new Common.Bounding.Box { LocalBoundingBox = new BoundingBox(new Vector3(-0.47f, -1.62f, -0.42f), new Vector3(0.46f, 1.59f, 2.54f)) };
            else
            {
                physicsMesh = new MeshFromFile("Models/Props/GatePathmeshOpen1.x");
                PhysicsLocalBounding = CreatePhysicsMeshBounding(new MetaModel { XMesh = physicsMesh, World = ((MetaModel)MainGraphic).World });
            }
            #endif
        }