Exemplo n.º 1
0
        public ShipFbx(String modelName)
        {
            model = BeatShift.contentManager.Load<Model>("Models/Ships/" + modelName);

            SkinningData skd = GetSkinningDataFromTag();
            if (isAnimated) {
                clipPlayer = new ClipPlayer(skd, 24);
            }
            else
            {
                bones = new Matrix[model.Bones.Count];
                model.CopyAbsoluteBoneTransformsTo(bones);
            }

            #if !DEBUG
            Utils.fixNullLightDirections(model);
            #endif

            GC.Collect();

            //Override the default texture
            //Texture2D grayTexture;
            //grayTexture = content.Load<Texture2D>("tex5");
            //shipRenderer.Texture = grayTexture;
            //shipRenderer.TextureEnabled = true;
        }
Exemplo n.º 2
0
        public OtherPlayer(float x, float y, float z, Int32 identity, Int16 mo, float xro, float yro)
        {
            model = mo;
            Console.WriteLine(mo);
            position.X = x;
            position.Y = y;
            position.Z = z;
            id = identity;
            alive = true;
            Console.WriteLine(mo.ToString());
            if (model == Constants.HAMPUS)
            {
                mod = Globals.hampus;
                clipPlayer = new ClipPlayer(Globals.hampusSkinningData, 60);
                animationClip = Globals.hampusSkinningData.AnimationClips["Take 001"];
            }
            else if (model == Constants.RASMUS)
            {
                mod = Globals.rasmus;
                clipPlayer = new ClipPlayer(Globals.rasmusSkinningData, 60);
                animationClip = Globals.rasmusSkinningData.AnimationClips["Take 001"];
            }
            else if (model == Constants.VALTER)
            {
                mod = Globals.valter;
                clipPlayer = new ClipPlayer(Globals.valterSkinningData, 60);
                animationClip = Globals.valterSkinningData.AnimationClips["Take 001"];
            }
            else if (model == Constants.AXEL)
            {
                mod = Globals.axel;
                clipPlayer = new ClipPlayer(Globals.axelSkinningData, 60);
                animationClip = Globals.axelSkinningData.AnimationClips["Take 001"];
            }

            Globals.s += identity;

            xr = xro;
            yr = yro;
            Globals.players[identity] = this;

            //idle
            clipPlayer.play(animationClip, 570, 600, true);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Load your graphics content.
        /// </summary>
        protected override void LoadContent()
        {
            // Load the model.
            currentModel = Content.Load<Model>("dude");

            // Look up our custom skinning information.
            SkinningData skinningData = currentModel.Tag as SkinningData;

            if (skinningData == null)
                throw new InvalidOperationException
                    ("This model does not contain a SkinningData tag.");

            // Create an clip player, and start decoding an animation clip at 24fps.
            //animationPlayer = new AnimationPlayer(skinningData);
            clipPlayer = new ClipPlayer(skinningData, 24);
        }
Exemplo n.º 4
0
        private void LoadKillers()
        {
            rasmus = Content.Load<Model>("Models/rasmusFinal");
            hampus = Content.Load<Model>("Models/hampusFinal");
            valter = Content.Load<Model>("Models/valterFinal");
            axel = Content.Load<Model>("Models/axelFinal5");
            rifleModel = Content.Load<Model>("Models/rifleHands1");
            gunPos = riflePos;
            currentWep = rifleModel;

            hampusSkinningData = hampus.Tag as SkinningData;
            rasmusSkinningData = rasmus.Tag as SkinningData;
            axelSkinningData = axel.Tag as SkinningData;
            valterSkinningData = valter.Tag as SkinningData;
            if (hampusSkinningData == null)
                throw new InvalidOperationException
                    ("This model does not contain a SkinningData tag. Har du satt SkinnedModelProcessor? ");
            Globals.hampusSkinningData = hampusSkinningData;
            Globals.rasmusSkinningData = rasmusSkinningData;
            Globals.axelSkinningData = axelSkinningData;
            Globals.valterSkinningData = valterSkinningData;
            rifleSkinningData = rifleModel.Tag as SkinningData;
            if (rifleSkinningData == null)
                throw new InvalidOperationException
                    ("This model does not contain a SkinningData tag. Har du satt SkinnedModelProcessor? ");

            clipPlayer = new ClipPlayer(rifleSkinningData, fps);
            rifleClip = rifleSkinningData.AnimationClips["Take 001"];

            shadowEffect = Content.Load<Effect>("Effects/ShadowEffect");
        }
Exemplo n.º 5
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            device = graphics.GraphicsDevice;
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            //Create the spritefont
            spriteFont = Content.Load<SpriteFont>("Arial");

            // TODO: use this.Content to load your game content here

            dude = this.Content.Load<Model>("squirrel");//Load the dude
            skd = dude.Tag as SkinningData;//you need to tag is animated character

               // animationPlayer = new AnimationPlayer(skd);
            clipPlayer = new ClipPlayer(skd, 60);//ClipPlayer running at 24 frames/sec
            AnimationClip clip = skd.AnimationClips["Take 001"]; //Take name from the dude.fbx file
            //animationPlayer.StartClip(clip);

            //Clip ranges
            //idle 1-24
            //walk 36-86
            //run 99-124

            clipPlayer.play(clip, 1, 24, true); //game starts with idle animation frames 1 to 3

            //Load Skybox
            skyboxModel = Content.Load<Model>("skybox");//Load Skybox

            //Load the level
            level = Content.Load<Model>("road");

            //Load dual Texture Model
            dual = Content.Load<Model>("model");
            //grey = new Texture2D(GraphicsDevice, 1, 1);
            //grey.SetData(new Color[] { new Color(128, 128, 128, 255) });
            //Load the bullet
            Model bulletModel = Content.Load<Model>("laser_m");
            bulletShape = new Shape(bulletModel, bulletList.ToArray());

            //Load the targets and collectables
            Model collectableModel = Content.Load<Model>("target");
            collectableShape = new Shape(collectableModel, collectables.ToArray());

            //Model targetModel = Content.Load<Model>("squirrel_enemy");
            //skdTarget = targetModel.Tag as SkinningData;//you need to tag is animated character

            //// animationPlayer = new AnimationPlayer(skd);
            //clipPlayer = new ClipPlayer(skdTarget, 60);//ClipPlayer running at 24 frames/sec
            //AnimationClip modelClip = skdTarget.AnimationClips["Take 002"]; //Take name from the dude.fbx file
            //targetShape = new Shape(targetModel, targets.ToArray());
        }