コード例 #1
0
        /// <summary>
        /// Reset the values, the position, rotation etc.
        /// </summary>
        public void Reset()
        {
            // Reset the raw values
            raw_thrust = 0.0f;
            raw_yaw    = 0.0f;
            raw_pitch  = 0.0f;
            raw_roll   = 0.0f;

            //keepHeight = false;
            //autoHover = false;
            attitude_dx = 0.0f;
            attitude_dz = 0.0f;
            pidControllerAltitude.Reset();
            pidControllerAttitudeX.Reset();
            pidControllerAttitudeZ.Reset();

            // Reset rotation and position
            Rotation = new xna.Vector3();
            Position = TypeConversion.ToXNA(initialPos);

            // Reset the linear and the angular velocity
            PhysicsEntity.SetAngularVelocity(new Vector3());
            PhysicsEntity.SetLinearVelocity(new Vector3());

            // Reset the camera to the initial view
            cameraView.EyePosition = MulticopterSimulationService.INITIAL_CAMERA_EYEPOS;
            cameraView.LookAtPoint = MulticopterSimulationService.INITIAL_CAMERA_LOOKAT;
            SimulationEngine.GlobalInstancePort.Update(cameraView);
        }