The AbstractGraphicsObject class is the root of a class hierarchy of objects that contain independen game logic and are visible in the game.
More...
#include <abstractgraphicsobject.h>
The AbstractGraphicsObject class is the root of a class hierarchy of objects that contain independen game logic and are visible in the game.
terminus::AbstractGraphicsObject::AbstractGraphicsObject |
( |
World & |
world | ) |
|
terminus::AbstractGraphicsObject::~AbstractGraphicsObject |
( |
| ) |
|
|
virtual |
Do not delete this destructor, even if it is empty
- otherwise std::shared_ptr<IncompleteType> in the header will break
void terminus::AbstractGraphicsObject::adjustCamera |
( |
| ) |
|
|
virtual |
override this method to adjust the parameters of a bound camera according to this objects own state
Reimplemented in terminus::AbstractWagon.
void terminus::AbstractGraphicsObject::bindCamera |
( |
Camera * |
camera | ) |
|
|
virtual |
void terminus::AbstractGraphicsObject::dispose |
( |
| ) |
|
|
protected |
remove this object from the world and delete it as soon as it is safe to do so
- See also
- World::deleteObject()
void terminus::AbstractGraphicsObject::doForAllChildren |
( |
std::function< void(AbstractGraphicsObject &)> |
callback | ) |
|
|
protectedvirtual |
override this method to make child objects known
- Parameters
-
callback | callback must be called once for every child object |
Reimplemented in terminus::Train, and terminus::Terrain.
void terminus::AbstractGraphicsObject::localRender |
( |
QOpenGLFunctions & |
gl | ) |
const |
|
protectedvirtual |
void terminus::AbstractGraphicsObject::localRenderCleanup |
( |
QOpenGLFunctions & |
gl, |
|
|
Program & |
program |
|
) |
| const |
|
protectedvirtual |
bool terminus::AbstractGraphicsObject::localRenderEnabled |
( |
| ) |
const |
|
protectedvirtual |
void terminus::AbstractGraphicsObject::localRenderSetup |
( |
QOpenGLFunctions & |
gl, |
|
|
Program & |
program |
|
) |
| const |
|
protectedvirtual |
void terminus::AbstractGraphicsObject::localUpdate |
( |
| ) |
|
|
protectedvirtual |
const QVector3D & terminus::AbstractGraphicsObject::maxBB |
( |
| ) |
const |
- Returns
- the maximum vector of this objects AABB given that it has a an associated Geometry instance
const QVector3D & terminus::AbstractGraphicsObject::minBB |
( |
| ) |
const |
- Returns
- the minimum vector of this objects AABB given that it has a an associated Geometry instance
QMatrix4x4 terminus::AbstractGraphicsObject::modelMatrix |
( |
| ) |
const |
- Returns
- this objects model matrix
If necessary, the matrix is recalculated from the position, rotation and scaling information
QMatrix4x4 terminus::AbstractGraphicsObject::modelMatrixInverted |
( |
| ) |
const |
- Returns
- this objects inverted model matrix
If necessary, the matrix is recalculated from the model matrix
QVector3D terminus::AbstractGraphicsObject::modelToWorld |
( |
const QVector3D & |
vModel | ) |
|
|
protected |
- Parameters
-
- Returns
- the world space position corresponding to vModel in model space
- See also
- modelMatrix()
void terminus::AbstractGraphicsObject::moveEvent |
( |
QVector3D |
movement | ) |
|
|
virtual |
override this method to react to move events received by a bound camera
- Parameters
-
void terminus::AbstractGraphicsObject::onBindCamera |
( |
| ) |
|
|
virtual |
override this method to perform specific actions once a camera has been bound
Reimplemented in terminus::AbstractWagon.
void terminus::AbstractGraphicsObject::onUnbindCamera |
( |
| ) |
|
|
virtual |
override this method to perform specific actions once a camera has been released
QVector3D terminus::AbstractGraphicsObject::position |
( |
| ) |
const |
- Returns
- the position vector that was used to construct the model matrix
void terminus::AbstractGraphicsObject::render |
( |
QOpenGLFunctions & |
gl | ) |
|
|
finalvirtual |
render object hierarchy beginning at this object
- Parameters
-
gl | This method is not meant to be overridden as it contains logic to update child objects. |
- See also
- AbstractGraphicsObject::localRender
void terminus::AbstractGraphicsObject::rotateEvent |
( |
QVector2D |
rotation | ) |
|
|
virtual |
override this method to react to rotate events received by a bound camera
- Parameters
-
Reimplemented in terminus::AbstractWagon.
QQuaternion terminus::AbstractGraphicsObject::rotation |
( |
| ) |
const |
- Returns
- the quaternion that was used to construct the model matrix
QVector3D terminus::AbstractGraphicsObject::scale |
( |
| ) |
const |
- Returns
- the scaling vector that was used to construct the model matrix
void terminus::AbstractGraphicsObject::setPosition |
( |
const QVector3D & |
position | ) |
|
|
protected |
sets the position and invalidates the model matrices
- Parameters
-
void terminus::AbstractGraphicsObject::setRotation |
( |
const QQuaternion & |
rotation | ) |
|
|
protected |
sets the rotation and invalidates the model matrices
- Parameters
-
void terminus::AbstractGraphicsObject::setScale |
( |
const QVector3D & |
scale | ) |
|
|
protected |
sets the scale and invalidates the model matrices
- Parameters
-
void terminus::AbstractGraphicsObject::setScale |
( |
float |
scale | ) |
|
|
protected |
sets the scale uniformly on all three axes and invalidates the model matrices
- Parameters
-
void terminus::AbstractGraphicsObject::unbindCamera |
( |
Camera * |
camera | ) |
|
|
virtual |
release a camera so that it wont track this object any longer
- See also
- bindCamera()
void terminus::AbstractGraphicsObject::update |
( |
| ) |
|
|
finalvirtual |
update object hierarchy beginning at this object
This method is not meant to be overridden as it contains logic to update child objects.
- See also
- AbstractGraphicsObject::localUpdate
QVector3D terminus::AbstractGraphicsObject::worldFront |
( |
| ) |
|
- Returns
- the front-vector of the model coordinate system transformed to world space
QVector3D terminus::AbstractGraphicsObject::worldSide |
( |
| ) |
|
- Returns
- the side-vector of the model coordinate system transformed to world space
QVector3D terminus::AbstractGraphicsObject::worldToModel |
( |
const QVector3D & |
vWorld | ) |
|
|
protected |
- Parameters
-
- Returns
- the model space position corresponding to vWorld in world space
- See also
- modelMatrixInverted()
QVector3D terminus::AbstractGraphicsObject::worldUp |
( |
| ) |
|
- Returns
- the up-vector of the model coordinate system transformed to world space
Camera* terminus::AbstractGraphicsObject::m_camera |
|
protected |
std::shared_ptr<std::unique_ptr<Geometry> > terminus::AbstractGraphicsObject::m_geometry |
|
protected |
std::shared_ptr<std::unique_ptr<Material> > terminus::AbstractGraphicsObject::m_material |
|
protected |
QMatrix4x4 terminus::AbstractGraphicsObject::m_modelMatrix |
|
mutableprotected |
bool terminus::AbstractGraphicsObject::m_modelMatrixChanged |
|
mutableprotected |
QMatrix4x4 terminus::AbstractGraphicsObject::m_modelMatrixInverted |
|
mutableprotected |
bool terminus::AbstractGraphicsObject::m_modelMatrixInvertedChanged |
|
mutableprotected |
QVector3D terminus::AbstractGraphicsObject::m_position |
|
protected |
std::shared_ptr<std::unique_ptr<Program> > terminus::AbstractGraphicsObject::m_program |
|
protected |
QQuaternion terminus::AbstractGraphicsObject::m_rotation |
|
protected |
QVector3D terminus::AbstractGraphicsObject::m_scale |
|
protected |
bool terminus::AbstractGraphicsObject::m_validState |
|
protected |
World& terminus::AbstractGraphicsObject::m_world |
|
protected |
The documentation for this class was generated from the following files: