예제 #1
0
 public Pokeball(Model model1, GraphicsDevice device, Camera camera)
     : base(model1)
 {
     this.model = model1;
     mousePick = new MousePick(device, camera);
     initPosition = new Vector3(0, 0, 0);
     translation = Matrix.CreateTranslation(initPosition);
 }
예제 #2
0
        public FleeTank(Model model, GraphicsDevice device, Camera camera, Vector3 position, int tankID)
            : base(model)
        {
            mousePick = new MousePick(device, camera);
            npcTankID = tankID;
            //position = new Vector3(100, 0, -100);         //enemy tank's spawn position
            this.position = position;
            currentVelocity = Vector3.Normalize(new Vector3(0, 0, 1));  //enemy tank is facing vector3(0,0,1) when it spawn, this is initial velocity
            turretBone = model.Bones["turret_geo"];
            backWheelBone = model.Bones["r_back_wheel_geo"];

            //9-11 patrol
            RandomPatrolPoint();

            translation = Matrix.CreateTranslation(position);
        }
예제 #3
0
        public Tank(Model model, GraphicsDevice device, Camera camera)
            : base(model)
        {
            mousePick = new MousePick(device, camera);
            tankCamera = camera;
            position = Vector3.Zero;
            pickPositionCur = Vector3.Zero;
            tankDirection = new Vector3(0, 0, 1);
            tankDirection.Normalize();

            //update 9/3
            currentCameraDirection = tankCamera.cameraDirection;

            pickPositionCur = Vector3.Zero;
            turretBone = model.Bones["turret_geo"];

            //update 9/4 00:22
            cannonBone = model.Bones["canon_geo"];
            lSteerEngineBone = model.Bones["l_steer_geo"];
            rSteerEngineBone = model.Bones["r_steer_geo"];
            leftBackWheelBone = model.Bones["l_back_wheel_geo"];
            rightBackWheelBone = model.Bones["r_back_wheel_geo"];
            leftFrontWheelBone = model.Bones["l_front_wheel_geo"];
            rightFrontWheelBone = model.Bones["r_front_wheel_geo"];
            hatchBone = model.Bones["hatch_geo"];
            tankBone = model.Bones["tank_geo"];

            leftFrontWheelTransform = leftFrontWheelBone.Transform;
            rightFrontWheelTransform = rightFrontWheelBone.Transform;
            leftBackWheelTransform = leftBackWheelBone.Transform;
            rightBackWheelTransform = rightBackWheelBone.Transform;
            leftFrontWheelTransform = leftFrontWheelBone.Transform;
            hatchTransform = hatchBone.Transform;
            tankTransform = tankBone.Transform;

            prevMouseState = Mouse.GetState();
        }