Carna Version 3.3.3
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | List of all members
Carna::presets::CameraShowcaseControl Class Reference

Implements base::CameraControl, rotates the camera around its parent node. The camera movement is bounded to the rail from its parent to its current location. More...

#include <CameraShowcaseControl.h>

+ Inheritance diagram for Carna::presets::CameraShowcaseControl:
+ Collaboration diagram for Carna::presets::CameraShowcaseControl:

Public Member Functions

 CameraShowcaseControl ()
 Instantiates.
 
virtual ~CameraShowcaseControl ()
 Deletes.
 
void setMinDistance (float minDistance)
 Disallows the camera to move closer than minDistance to its origin. If the camera currently is closer than minDistance, it will be moved s.t. it will be minDistance units away from its origin.
 
void setMaxDistance (float maxDistance)
 Disallows the camera to move further away than maxDistance from its origin. If the camera currently is further away than maxDistance, it will be moved s.t. it will be maxDistance units away from its origin.
 
float minDistance () const
 Tells minimum allowed distance of camera to its origin.
 
float maxDistance () const
 Tells maximum allowed distance of camera to its origin.
 
virtual void setCamera (base::Spatial &) override
 Sets the node that is to be controlled by this instance.
 
virtual void rotateHorizontally (float radians) override
 Rotates the camera around the \(\left(0, 1, 0\right)^\mathrm T\) vector of its origin by radians.
 
virtual void rotateVertically (float radians) override
 Rotates the camera around its local \(\left(1, 0, 0\right)^\mathrm T\) vector, shifted to its origin, by radians.
 
virtual void moveAxially (float units) override
 Moves the camera along its local \(\left(0, 0, 1\right)^\mathrm T\) vector by units. The location is bounded by the current values for minDistance and maxDistance.
 
virtual void moveLaterally (float unitsX, float unitsY) override
 Moves the camera along its x-/y-axis. The parameters of this movement depend on the implementation.
 
- Public Member Functions inherited from Carna::base::CameraControl
virtual ~CameraControl ()
 Does nothing.
 

Static Public Attributes

static const float DEFAULT_MIN_DISTANCE
 Holds default minimum allowed distance of the camera to its origin.
 
static const float DEFAULT_MAX_DISTANCE
 Holds default maximum allowed distance of the camera to its origin.
 

Detailed Description

Implements base::CameraControl, rotates the camera around its parent node. The camera movement is bounded to the rail from its parent to its current location.

Todo:
Implement CameraShowcaseControl::moveLaterally.
Author
Leonid Kostrykin
Date
22.2.15 - 17.3.15

Definition at line 45 of file CameraShowcaseControl.h.

Member Function Documentation

◆ moveAxially()

virtual void Carna::presets::CameraShowcaseControl::moveAxially ( float  units)
overridevirtual

Moves the camera along its local \(\left(0, 0, 1\right)^\mathrm T\) vector by units. The location is bounded by the current values for minDistance and maxDistance.

Implements Carna::base::CameraControl.

◆ moveLaterally()

virtual void Carna::presets::CameraShowcaseControl::moveLaterally ( float  distanceX,
float  distanceY 
)
overridevirtual

Moves the camera along its x-/y-axis. The parameters of this movement depend on the implementation.

Implements Carna::base::CameraControl.

◆ rotateHorizontally()

virtual void Carna::presets::CameraShowcaseControl::rotateHorizontally ( float  radians)
overridevirtual

Rotates the camera around the \(\left(0, 1, 0\right)^\mathrm T\) vector of its origin by radians.

Implements Carna::base::CameraControl.

◆ rotateVertically()

virtual void Carna::presets::CameraShowcaseControl::rotateVertically ( float  radians)
overridevirtual

Rotates the camera around its local \(\left(1, 0, 0\right)^\mathrm T\) vector, shifted to its origin, by radians.

Implements Carna::base::CameraControl.

◆ setCamera()

virtual void Carna::presets::CameraShowcaseControl::setCamera ( base::Spatial )
overridevirtual

Sets the node that is to be controlled by this instance.

Implements Carna::base::CameraControl.

◆ setMaxDistance()

void Carna::presets::CameraShowcaseControl::setMaxDistance ( float  maxDistance)

Disallows the camera to move further away than maxDistance from its origin. If the camera currently is further away than maxDistance, it will be moved s.t. it will be maxDistance units away from its origin.

Precondition
minDistance >= 0

◆ setMinDistance()

void Carna::presets::CameraShowcaseControl::setMinDistance ( float  minDistance)

Disallows the camera to move closer than minDistance to its origin. If the camera currently is closer than minDistance, it will be moved s.t. it will be minDistance units away from its origin.

Precondition
minDistance >= 0

Member Data Documentation

◆ DEFAULT_MAX_DISTANCE

const float Carna::presets::CameraShowcaseControl::DEFAULT_MAX_DISTANCE
static

Holds default maximum allowed distance of the camera to its origin.

Definition at line 63 of file CameraShowcaseControl.h.

◆ DEFAULT_MIN_DISTANCE

const float Carna::presets::CameraShowcaseControl::DEFAULT_MIN_DISTANCE
static

Holds default minimum allowed distance of the camera to its origin.

Definition at line 58 of file CameraShowcaseControl.h.


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