Example #1
0
        public weapon_reference(string weapon_name, GraphicsDevice p_device, ContentManager p_content, string p_folder,
                                string ani_idle, string ani_reload, string ani_shoot)
        {
            model = new CSMDModel(weapon_name, p_device, p_content, p_folder);
            String ani_folder = weapon_name + "_anims";

            model.cargar_ani(ani_folder, ani_idle);
            model.cargar_ani(ani_folder, ani_reload);
            model.cargar_ani(ani_folder, ani_shoot);
            model.anim[1].loop = false;
            model.setAnimation(0);
        }
Example #2
0
        public void computeHitpoints()
        {
            // como uso el mismo modelo para todos los enemigos tengo que actualizar el esqueleto
            model.currentTime = currentTime;
            model.setAnimation(currentAnimation);
            Matrix World = Matrix.CreateRotationY(MathF.PI / 2.0f) * CalcularMatrizOrientacion(Position - new Vector3(0, game.soldier_height / 2, 0), Direction);

            for (int i = 0; i < cant_hp; ++i)
            {
                hit_points[i].Position = Vector3.Transform(model.bones[hit_points[i].bone_id].Position, model.invMetric * World);
            }
        }