A six-degree of freedom camera control.
sealed class
|
CameraControlFree
|
extends
|
CameraControlBase
|
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 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~| +------+---+---+---+---+--LetterW, LetterA, LetterS, LetterD:
The alternative key binding is this:
+----+---+---+---+---+-- | | 1 | 2 | 3 | 4 | +-----+---+---+---+---+-- | TAB | A*| Z*| E | R | +------+---+---+---+---+-- | CAPS | Q*| S | D |~F~| +------+---+---+---+---+--LetterZ, LetterQ, LetterS, LetterD:
Returns current world-space anchor point.
public
virtual
property
|
Anchor
{
get
}
|
||
type
|
Vec3D
|
||
value
|
The current anchor point or Undefined is this camera control is not active. | ||
inherited
|
CameraControlBase.Anchor
|
Remarks:
This property is purely informational and has no functional relevance.
Use the alternative key binding?
public
property
|
Azerty
{
get
set
}
|
||
type
|
bool
|
||
value
|
true
to
use
the
alternative
binding,
false
to
use
the
default
one.
|
Remarks:
The
default
value
is
false
.
Distance to the terrain that that has been computed during the last call to UpdateFrameTime.
public
property
|
Distance
{
get
}
|
||
type
|
float64
|
||
value
|
|
The distance to the terrain. |
See also:
DistanceToGroundThe mouse cursor that is most appropriate for the current state of this camera control.
public
virtual
property
|
MouseCursor
{
get
}
|
||
type
|
MouseCursor
|
||
value
|
The mouse cursor. | ||
inherited
|
CameraControlBase.MouseCursor
|
Remarks:
This property is purely informational and has no functional relevance.
Controls the rotation speed (yaw, pitch, roll).
public
property
|
RotationFactor
{
get
set
}
|
||
type
|
float64
|
||
value
|
The
rotation
speed,
in
degrees
per
pixel.
Set
to
0
to
disable
rotation.
|
Remarks:
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
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).
Should the mouse be captured, because this input consumer only processes relative input?
public
override
property
|
ShouldCaptureMouse
{
get
}
|
||
type
|
bool
|
||
value
|
true
if
the
mouse
should
be
captured,
false
if
not. |
||
overrides
|
CameraControlBase.ShouldCaptureMouse
|
See also:
IApplicationWindow.MouseCapturedThe movement speed boost factor.
public
property
|
SpeedBoost
{
get
set
}
|
||
type
|
float64
|
||
value
|
|
The boost factor. |
Remarks:
Defaults
to
3
.
Controls the movement speed.
public
property
|
SpeedFactor
{
get
set
}
|
||
type
|
Vec3D
|
||
value
|
The
coefficient
vector
S
(see
remarks). |
Remarks:
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)
.
Controls the movement speed inertness.
public
property
|
SpeedInertness
{
get
set
}
|
||
type
|
float64
|
||
value
|
|
The
movement
speed
inertness
factor.
Set
to
0
or
1
to
disable
inertness.
|
Remarks:
Smaller values result in smoother camera movement.
The
default
value
is
0.5
.
The ICameraViewport object that provides the view into the world.
public
virtual
property
|
View
{
get
set
}
|
||
type
|
ICameraViewport
|
||
value
|
The
viewport
object.
If
null ,
the
camera
control
will
be
disabled. |
||
inherited
|
CameraControlBase.View
|
The ICameraWorld object that provides the world.
public
virtual
property
|
World
{
get
set
}
|
||
type
|
ICameraWorld
|
||
value
|
The
world
object.
If
null ,
the
camera
control
will
be
disabled. |
||
inherited
|
CameraControlBase.World
|
Creates a new instance of CameraControlFree.
public
constructor
|
CameraControlFree
()
|
Stops the current camera control gesture.
public
override
method
|
Cancel
()
|
||
overrides
|
CameraControlBase.Cancel
|
Consumes the given user input event.
public
override
method
|
ConsumeInput
(InputEvent inputEvent)
|
||
type
|
bool
|
||
params
|
inputEvent
|
The user input event. | |
returns
|
true
if
the
input
event
has
been
consumed,
false
if
not. |
||
overrides
|
CameraControlBase.ConsumeInput
|
Remarks:
Input events are provided to an IInputConsumer object only if it has the input focus (see FocusGained and FocusLost). Mouse events are provided when the mouse cursor is inside of the input bounds (MouseEnter and MouseLeave). The Closing event can be provided at any time.
Attaches this input consumer to the given input state object.
public
virtual
method
|
InputAttach
(IInputState input)
|
||
params
|
input
|
[not-null]
|
The input state object. |
inherited
|
CameraControlBase.InputAttach
|
Remarks:
The input state object provides a snapshot of the input keys and buttons. It should not be used to detect up/down/click events.
Detached this input consumer from its input state object.
public
virtual
method
|
InputDetach
()
|
||
inherited
|
CameraControlBase.InputDetach
|
This method is called once per application frame.
public
override
method
|
UpdateFrameTime
(float32 time)
|
||
type
|
bool
|
||
params
|
time
|
[>0]
|
The amount of time that has elapsed since the last frame, in seconds. |
returns
|
true
if
the
object
needs
to
be
presented
again,
false
if
the
current
presentation
is
still
valid.
|
||
overrides
|
CameraControlBase.UpdateFrameTime
|