TINMAN 3D / REALTIME TERRAIN
Software Development Kit - User Manual

class CameraControlBase in Tinman.AddOns.Components

Abstract base class for ICameraControl implementations.

abstract class CameraControlBase implements ICameraControl
  base of CameraControl
  CameraControlDrag
  CameraControlFree

Public / Attributes

Anchor

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.
implements ICameraControl.Anchor

Remarks:

This property is purely informational and has no functional relevance.

MouseCursor

The 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.
implements ICameraControl.MouseCursor

Remarks:

This property is purely informational and has no functional relevance.

ShouldCaptureMouse

Should the mouse be captured, because this input consumer only processes relative input?

public virtual property ShouldCaptureMouse { get }
type bool
value true if the mouse should be captured, false if not.
implements IInputConsumerEx.ShouldCaptureMouse

See also:

IApplicationWindow.MouseCaptured

View

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.
implements ICameraControl.View

World

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.
implements ICameraControl.World

Public / Methods

Cancel

Stops the current camera control gesture.

public virtual method Cancel ()
implements ICameraControl.Cancel

ConsumeInput

Consumes the given user input event.

public virtual method ConsumeInput (InputEvent inputEvent)
type bool
params inputEvent The user input event.
returns true if the input event has been consumed, false if not.
implements IInputConsumer.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.

  1. FocusGained: gained input focus
  2. Keyboard events:
  3. Mouse events:
    1. MouseEnter
    2. Mouse events:
    3. MouseLeave
  4. FocusLost: lost input focus
  5. Closing: user request to shut down

InputAttach

Attaches this input consumer to the given input state object.

public virtual method InputAttach (IInputState input)
params input [not-null] The input state object.
implements IInputConsumerEx.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.

InputDetach

Detached this input consumer from its input state object.

public virtual method InputDetach ()
implements IInputConsumerEx.InputDetach

UpdateFrameTime

This method is called once per application frame.

public virtual 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.
implements IUpdateableFrameTime.UpdateFrameTime

Protected / Attributes

input

The current IInputState object.

protected field input
type IInputState

See also:

InputAttach
InputDetach

MaximumDistance

Returns the maximum distance that is used by FixMaximumDistance.

protected property MaximumDistance { get }
type float64
value The maximum distance.

view

The current ICameraViewport object.

protected field view
type ICameraViewport

See also:

View

WillFixMaximumDistance

Checks if a call to FixMaximumDistance will update the camera.

protected property WillFixMaximumDistance { get }
type int32
value Zero or more flags, indicating how the camera will be updated:
1: Look towards bounding sphere center when approaching maximum distance.
2: Clamp to maximum distance to bounding sphere center.

world

The current ICameraWorld object.

protected field world
type ICameraWorld

See also:

World

Protected / Methods

FixMaximumDistance

Clamps the camera so that it maintains a maximum distance to the bounding sphere of the world and looks towards the bounding sphere center.

protected method FixMaximumDistance (float64 lookCenterScale = 1)
type bool
params lookCenterScale [>=0] Controls how much the camera shall be adjusted to look towards the bounding sphere center. Set to 0 to disable centering. Values between 0 and 1 will cause earlier adjustment at smaller distances. Values greater than 1 will cause later adjustment at greater distances. Defaults to 1.
returns true if the camera has been modified, false if not.

Remarks:

The maximum distance is chosen so that the bounding sphere fits the screen.

Rotate

protected static method Rotate (Vec3D origin, Vec3D first, Vec3D second)
type Mat4D
params origin
  first
  second