Exemplo n.º 1
0
		/// <summary>
		/// Default constructor.
		/// </summary>
		public Camera(Scene scene)
		{
			_scene = scene;
			
			// set default positioning
			_position = new Vector(0.0, 0.0, 9.0);
			_upVec = new Vector(0.0, 1.0, 0.0);
			_center = new Vector();
			
			// set default field of view
			fov = new Angle();
			fov["deg"] = 28.0;
			
			// set default interaction factors
			dollyFactor = 0.15;
			panFactor = 0.05;
			
			lastDirection = ViewDirection.Front;

			Frustum = new FrustumDef();

			DefaultAnimationOptions.Duration = 4.0;
			DefaultAnimationOptions.EaseType = EaseType.Quadratic;

			UseInertia = true;
			InertiaAnimationOptions = new AnimationOptions() {
				Duration = 6.0,
				EaseType = EaseType.Linear
			};
			InertiaType = InteractionType.None;
		}
Exemplo n.º 2
0
		/// <summary>
		/// Animates to the given set of vectors. 
		/// </summary>
		/// <remarks>All other AnimateTo() methods should call this one.</remarks>
		public void AnimateTo(Vector center, Vector position, Vector upVec, AnimationOptions opts)
		{
			EndInertiaAnimation();
			Configure();
			animStartCenter = this._center;
			animStartDir = Direction.Normalize();
			animStartUpVec = this._upVec;
			animStartDist = Distance;

			animStopCenter = center;
			animStopUpVec = upVec;
			animStopDir = position - center;
			animStopDist = animStopDir.Magnitude;
			animStopDir = animStopDir.Normalize();

			_currentAnimationOptions = opts;
			_scene.Animator.RegisterAnimation(this, opts.Duration);
		}