VoltAir
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Groups Pages
Signals | Public Member Functions | Properties | List of all members
CameraMovementLogic Class Reference

Logic to make the camera follow the bounding box of all Actor::PlayerActors. More...

Inheritance diagram for CameraMovementLogic:
Logic QObject

Signals

void minFovChanged ()
 Emitted when minFov changes. More...
 
void xPullFactorChanged ()
 Emitted when xPullFactor changes. More...
 
void yPullFactorChanged ()
 Emitted when yPullFactor changes. More...
 
void towedXPullFactorChanged ()
 Emitted when towedXPullFactor changes. More...
 
void towedYPullFactorChanged ()
 Emitted when towedYPullFactor changes. More...
 
void lookaheadScaleChanged ()
 Emitted when lookaheadScale changes. More...
 
void fovPullFactorChanged ()
 Emitted when fovPullFactor changes. More...
 
void xFovBorderChanged ()
 Emitted when xFovBorder changes. More...
 
void yFovBorderChanged ()
 Emitted when yFovBorder changes. More...
 
- Signals inherited from Logic
void activeChanged ()
 Emitted when active changes. More...
 

Public Member Functions

float getMinFov () const
 Returns minFov. More...
 
void setMinFov (float value)
 Sets minFov. More...
 
float getXPullFactor () const
 Returns xPullFactor. More...
 
void setXPullFactor (float value)
 Sets xPullFactor. More...
 
float getYPullFactor () const
 Returns yPullFactor. More...
 
void setYPullFactor (float value)
 Sets yPullFactor. More...
 
float getTowedXPullFactor () const
 Returns towedXPullFactor. More...
 
void setTowedXPullFactor (float value)
 Sets towedXPullFactor. More...
 
float getTowedYPullFactor () const
 Returns towedYPullFactor. More...
 
void setTowedYPullFactor (float value)
 Sets towedYPullFactor. More...
 
float getLookaheadScale () const
 Returns lookaheadScale. More...
 
void setLookaheadScale (float value)
 Sets lookaheadScale. More...
 
float getFovPullFactor () const
 Returns fovPullFactor. More...
 
void setFovPullFactor (float value)
 Sets fovPullFactor. More...
 
float getXFovBorder () const
 Returns xFovBorder. More...
 
void setXFovBorder (float value)
 Sets xFovBorder. More...
 
float getYFovBorder () const
 Returns yFovBorder. More...
 
void setYFovBorder (float value)
 Sets yFovBorder. More...
 
virtual void init () override
 Initializes the parent actor Camera with parameters for the current scene. More...
 
virtual void update () override
 Updates the parent actor Camera's properties to follow the constraints from the scene. More...
 
- Public Member Functions inherited from Logic
 Logic (QObject *parent=nullptr)
 Constructs a Logic. More...
 
ActorgetActor () const
 Returns actor. More...
 
bool isActive () const
 Returns active. More...
 
void setActive (bool value)
 Sets active. More...
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
virtual const QMetaObjectmetaObject () const
 
QString objectName () const
 
void setObjectName (const QString &name)
 
bool isWidgetType () const
 
bool isWindowType () const
 
bool signalsBlocked () const
 
bool blockSignals (bool block)
 
QThreadthread () const
 
void moveToThread (QThread *targetThread)
 
int startTimer (int interval, Qt::TimerType timerType)
 
void killTimer (int id)
 
findChild (const QString &name, QFlags< Qt::FindChildOption > options) const
 
QList< T > findChildren (const QString &name, QFlags< Qt::FindChildOption > options) const
 
QList< T > findChildren (const QRegExp &regExp, QFlags< Qt::FindChildOption > options) const
 
QList< T > findChildren (const QRegularExpression &re, QFlags< Qt::FindChildOption > options) const
 
const QObjectList & children () const
 
void setParent (QObject *parent)
 
void installEventFilter (QObject *filterObj)
 
void removeEventFilter (QObject *obj)
 
QMetaObject::Connection connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const
 
bool disconnect (const char *signal, const QObject *receiver, const char *method) const
 
bool disconnect (const QObject *receiver, const char *method) const
 
void dumpObjectTree ()
 
void dumpObjectInfo ()
 
bool setProperty (const char *name, const QVariant &value)
 
QVariant property (const char *name) const
 
QList< QByteArraydynamicPropertyNames () const
 
void destroyed (QObject *obj)
 
void objectNameChanged (const QString &objectName)
 
QObjectparent () const
 
bool inherits (const char *className) const
 
void deleteLater ()
 

Properties

float minFov
 Minimum field of view the Camera will adjust to. More...
 
float xPullFactor
 Strength of horizontal force that pull the camera to the center of the bounding box. More...
 
float yPullFactor
 Strength of vertical force that pull the camera to the center of the bounding box. More...
 
float towedXPullFactor
 Strength of horizontal towing forces that slowly pull the camera to the center of the bounding box. More...
 
float towedYPullFactor
 Strength of vertical towing forces that slowly pull the camera to the center of the bounding box. More...
 
float lookaheadScale
 Extra distance that the camera leads the PlayerActors. More...
 
float fovPullFactor
 Speed of adjusting to the correct fov width. More...
 
float xFovBorder
 Extra width added to the bounding box of Actor::PlayerActors. More...
 
float yFovBorder
 Extra height added to the bounding box of Actor::PlayerActors. More...
 
- Properties inherited from Logic
Actor actor
 Parent actor that is affected by this Logic's behavior. More...
 
bool active
 Whether or not Engine calls update() on this Logic during the Engine::LOGICS_PHASE. More...
 
- Properties inherited from QObject
 objectName
 

Additional Inherited Members

- Static Public Member Functions inherited from QObject
QString tr (const char *sourceText, const char *disambiguation, int n)
 
QString trUtf8 (const char *sourceText, const char *disambiguation, int n)
 
QMetaObject::Connection connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, Functor functor)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
bool disconnect (const QMetaObject::Connection &connection)
 
bool disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method)
 
- Protected Member Functions inherited from QObject
QObjectsender () const
 
int senderSignalIndex () const
 
int receivers (const char *signal) const
 
bool isSignalConnected (const QMetaMethod &signal) const
 
virtual void timerEvent (QTimerEvent *event)
 
virtual void childEvent (QChildEvent *event)
 
virtual void customEvent (QEvent *event)
 
virtual void connectNotify (const QMetaMethod &signal)
 
virtual void disconnectNotify (const QMetaMethod &signal)
 

Detailed Description

Logic to make the camera follow the bounding box of all Actor::PlayerActors.

The camera's field of view (fov) adjusts according to the size of the bounding box of all Actor::PlayerActors that it must encapsulate. Additionally, an extrapolation of the Camera's future position is used to lead it in the direction that the tracked Actors are moving toward.

When the Camera's targets are at rest, it will center itself on the center of their bounding box.

Note
This logic's parent Actor must be a Camera.

Member Function Documentation

void CameraMovementLogic::fovPullFactorChanged ( )
signal

Emitted when fovPullFactor changes.

float CameraMovementLogic::getFovPullFactor ( ) const
inline

Returns fovPullFactor.

float CameraMovementLogic::getLookaheadScale ( ) const
inline

Returns lookaheadScale.

float CameraMovementLogic::getMinFov ( ) const
inline

Returns minFov.

float CameraMovementLogic::getTowedXPullFactor ( ) const
inline

Returns towedXPullFactor.

float CameraMovementLogic::getTowedYPullFactor ( ) const
inline

Returns towedYPullFactor.

float CameraMovementLogic::getXFovBorder ( ) const
inline

Returns xFovBorder.

float CameraMovementLogic::getXPullFactor ( ) const
inline

Returns xPullFactor.

float CameraMovementLogic::getYFovBorder ( ) const
inline

Returns yFovBorder.

float CameraMovementLogic::getYPullFactor ( ) const
inline

Returns yPullFactor.

virtual void CameraMovementLogic::init ( )
overridevirtual

Initializes the parent actor Camera with parameters for the current scene.

Reimplemented from Logic.

void CameraMovementLogic::lookaheadScaleChanged ( )
signal

Emitted when lookaheadScale changes.

void CameraMovementLogic::minFovChanged ( )
signal

Emitted when minFov changes.

void CameraMovementLogic::setFovPullFactor ( float  value)

Sets fovPullFactor.

Parameters
valueFloat to set fovPullFactor to
void CameraMovementLogic::setLookaheadScale ( float  value)

Sets lookaheadScale.

Parameters
valueFloat to set lookaheadScale to
void CameraMovementLogic::setMinFov ( float  value)

Sets minFov.

Parameters
valueFloat to set minFov to
void CameraMovementLogic::setTowedXPullFactor ( float  value)

Sets towedXPullFactor.

Parameters
valueFloat to set towedXPullFactor to
void CameraMovementLogic::setTowedYPullFactor ( float  value)

Sets towedYPullFactor.

Parameters
valueFloat to set towedYPullFactor to
void CameraMovementLogic::setXFovBorder ( float  value)

Sets xFovBorder.

Parameters
valueFloat to set xFovBorder to
void CameraMovementLogic::setXPullFactor ( float  value)

Sets xPullFactor.

Parameters
valueFloat to set xPullFactor to
void CameraMovementLogic::setYFovBorder ( float  value)

Sets yFovBorder.

Parameters
valueFloat to set yFovBorder to
void CameraMovementLogic::setYPullFactor ( float  value)

Sets yPullFactor.

Parameters
valueFloat to set yPullFactor to
void CameraMovementLogic::towedXPullFactorChanged ( )
signal

Emitted when towedXPullFactor changes.

void CameraMovementLogic::towedYPullFactorChanged ( )
signal

Emitted when towedYPullFactor changes.

virtual void CameraMovementLogic::update ( )
overridevirtual

Updates the parent actor Camera's properties to follow the constraints from the scene.

Reimplemented from Logic.

void CameraMovementLogic::xFovBorderChanged ( )
signal

Emitted when xFovBorder changes.

void CameraMovementLogic::xPullFactorChanged ( )
signal

Emitted when xPullFactor changes.

void CameraMovementLogic::yFovBorderChanged ( )
signal

Emitted when yFovBorder changes.

void CameraMovementLogic::yPullFactorChanged ( )
signal

Emitted when yPullFactor changes.

Property Documentation

float CameraMovementLogic::fovPullFactor
readwrite

Speed of adjusting to the correct fov width.

float CameraMovementLogic::lookaheadScale
readwrite

Extra distance that the camera leads the PlayerActors.

float CameraMovementLogic::minFov
readwrite

Minimum field of view the Camera will adjust to.

float CameraMovementLogic::towedXPullFactor
readwrite

Strength of horizontal towing forces that slowly pull the camera to the center of the bounding box.

float CameraMovementLogic::towedYPullFactor
readwrite

Strength of vertical towing forces that slowly pull the camera to the center of the bounding box.

float CameraMovementLogic::xFovBorder
readwrite

Extra width added to the bounding box of Actor::PlayerActors.

float CameraMovementLogic::xPullFactor
readwrite

Strength of horizontal force that pull the camera to the center of the bounding box.

float CameraMovementLogic::yFovBorder
readwrite

Extra height added to the bounding box of Actor::PlayerActors.

float CameraMovementLogic::yPullFactor
readwrite

Strength of vertical force that pull the camera to the center of the bounding box.