Avara3D 0.2.0
C++ API reference
a3d::ext::FlyCameraController Class Reference

Applies free-flight keyboard and pointer controls to a point-of-view Node. More...

#include <a3d/extension/camera/FlyCameraController.h>

Classes

struct  Config
 Free-flight sensitivity, speed, and control bindings. More...
 
struct  Controls
 Key bindings used for free-flight translation and speed control. More...
 

Public Member Functions

 FlyCameraController ()
 Creates a FlyCameraController with the default configuration. More...
 
 FlyCameraController (const Config &config)
 Creates a FlyCameraController with config. More...
 
const Configconfig () const
 Returns the current controller configuration. More...
 
void config (const Config &config)
 Replaces the controller configuration. More...
 
bool update (Node &pov, DesktopInputContext &input, double deltaTime)
 Updates pov from the current input state. More...
 

Detailed Description

Applies free-flight keyboard and pointer controls to a point-of-view Node.

Pointer motion changes pitch and yaw while configured keys translate the Node along its local axes expressed in parent coordinates. update() modifies the supplied Node directly and returns whether its transform changed.

Definition at line 29 of file FlyCameraController.h.

Constructor & Destructor Documentation

◆ FlyCameraController() [1/2]

a3d::ext::FlyCameraController::FlyCameraController ( )

Creates a FlyCameraController with the default configuration.

◆ FlyCameraController() [2/2]

a3d::ext::FlyCameraController::FlyCameraController ( const Config config)
explicit

Creates a FlyCameraController with config.

Member Function Documentation

◆ config() [1/2]

const Config & a3d::ext::FlyCameraController::config ( ) const

Returns the current controller configuration.

◆ config() [2/2]

void a3d::ext::FlyCameraController::config ( const Config config)

Replaces the controller configuration.

◆ update()

bool a3d::ext::FlyCameraController::update ( Node pov,
DesktopInputContext input,
double  deltaTime 
)

Updates pov from the current input state.

Pointer displacement changes pitch and yaw and clears roll when look input is applied. Translation uses the configured movement keys and deltaTime.

Parameters
povNode whose transform is controlled.
inputCurrent desktop-style input state.
deltaTimeElapsed time represented by this update, in seconds.
Returns
true if the POV transform changed.

The documentation for this class was generated from the following file: