CameraControlFree
Description
- Derived from
-
CameraControlBase abstract
A six-degree of freedom camera control.
The mouse X-axis is used to yaw the camera, the Y-axis is used to pitch the camera. The mouse wheel zooms the camera. Clicking MouseButton.Middle resets the zoom factor to one.
The default key binding is this:
+----+---+---+---+---+-- | | 1 | 2 | 3 | 4 | +-----+---+---+---+---+-- | TAB | Q*| W*| E | R | +------+---+---+---+---+-- | CAPS | A*| S | D |~F~| +------+---+---+---+---+--
KeyboardKey.LetterW, KeyboardKey.LetterA, KeyboardKey.LetterS, KeyboardKey.LetterD:
Move camera forwards, to the left, backwards and to the right.
KeyboardKey.LetterQ, KeyboardKey.LetterE:
Roll camera to the left and to the right.
KeyboardKey.LetterR, KeyboardKey.LetterF:
Move camera upwards and downwards.
The alternative key binding is this:
+----+---+---+---+---+-- | | 1 | 2 | 3 | 4 | +-----+---+---+---+---+-- | TAB | A*| Z*| E | R | +------+---+---+---+---+-- | CAPS | Q*| S | D |~F~| +------+---+---+---+---+--
KeyboardKey.LetterZ, KeyboardKey.LetterQ, KeyboardKey.LetterS, KeyboardKey.LetterD:
Move camera forwards, to the left, backwards and to the right.
KeyboardKey.LetterA, KeyboardKey.LetterE:
Roll camera to the left and to the right.
KeyboardKey.LetterR, KeyboardKey.LetterF:
Move camera upwards and downwards.
Public / Attributes
Distance
Distance to the terrain that that has been computed during the last call to IUpdateableFrameTime.UpdateFrameTime.
- See also
RotationFactor
Controls the rotation speed (yaw, pitch, roll).
A mouse movement of X
pixels on the screen corresponds to a rotation of X*abs(F)/Z
degrees, where F
is the rotation factor and Z
is the camera zoom factor (see Camera.Zoom).
When the rotation factor is positive, the camera will pitch down when the mouse is moved towards the screen. If negative, the pitch rotation is flipped.
The default value is -0.1
(i.e. 10 pixels per degree, flipped pitch rotation).
SpeedFactor
Controls the movement speed.
The movement speed M
(world units per second) is computed from the speed factor S
as follows:
M = S.X * pow(d / S.Y, S.Z)
where d
is the distance of the camera position to the terrain surface (see DistanceToGround).
Set S.X
to the desired movement speed, in world-units per second. To use a constant movement speed, set S.Y
to 1
and S.Z
to 0
.
The default value is (1, 1, 0.8)
.