The Scene class provides access to geometry and collision detection methods. Furthermore, some game logic is implemented, so the scene holds the player, the gem influenced by player and cameras. More...
#include <scene.h>
Public Slots | |
virtual void | update (int elapsedTime) |
void | handleGameLost () |
void | handleGameStarted () |
void | registerNavigation (Navigation *navigation) |
void | rotateCurrentGem (const QQuaternion &quaternion) |
Signals | |
void | cubesChanged () |
void | geometriesChanged () |
void | rootLightRayChanged () |
void | gameStarted () |
void | gameLost () |
Public Member Functions | |
Scene (QQuickItem *parent=0) | |
Creates a new scene without any further information. Before use scene you have to set geometries(), rootLightRay(), camera(), previewCamera() and registerNavigation() More... | |
virtual | ~Scene () |
QQmlListProperty< AbstractGem > | geometriesQML () |
Allow QML classes to read our gems. Initially it was planned to manipulate our gems from QML classes, but we did not get it to work. Now we create it over a JSON-object and set it once, which works. All in all gem manipulation from QML is magic and we do not know why and how it really works. More... | |
QList< AbstractGem * > | geometries () |
Camera * | camera () const |
void | setCamera (Camera *camera) |
Camera * | previewCamera () const |
void | setPreviewCamera (Camera *camera) |
AbstractGem * | findGemWithBoundingSphereIntersectedBy (const LightRay &ray, QVector3D *collisionPoint=nullptr) const |
Finds the nearest gem, that bounding sphere is intersected by given ray. More... | |
AbstractGem * | findGemIntersectedBy (const LightRay &ray, QVector3D *collisionPoint=nullptr) const |
Finds the nearest gem with bounding sphere intersected by given ray. More... | |
void | setCurrentGem (AbstractGem *currentGem) |
Sets the gem, that will be controlled by player. More... | |
LightRay * | rootLightRay () const |
void | setRootLightRay (LightRay *rootLightRay) |
Protected Attributes | |
SceneBounds * | m_bounds |
Camera * | m_camera |
Camera * | m_previewCamera |
AbstractGem * | m_currentGem |
QList< AbstractGem * > | m_gems |
Navigation * | m_navigation |
LightRay * | m_rootLightRay |
The Scene class provides access to geometry and collision detection methods. Furthermore, some game logic is implemented, so the scene holds the player, the gem influenced by player and cameras.
|
explicit |
Creates a new scene without any further information. Before use scene you have to set geometries(), rootLightRay(), camera(), previewCamera() and registerNavigation()
parent |
|
virtual |
Camera* Scene::camera | ( | ) | const |
|
signal |
AbstractGem * Scene::findGemIntersectedBy | ( | const LightRay & | ray, |
QVector3D * | collisionPoint = nullptr |
||
) | const |
Finds the nearest gem with bounding sphere intersected by given ray.
ray | Ray sent into scene to find gem. |
collisionPoint | Optional parameter. The point of collision is written into. |
AbstractGem * Scene::findGemWithBoundingSphereIntersectedBy | ( | const LightRay & | ray, |
QVector3D * | collisionPoint = nullptr |
||
) | const |
Finds the nearest gem, that bounding sphere is intersected by given ray.
ray | Ray sent into scene to find gem. |
collisionPoint | Optional parameter. The point of collision is written into. Only if no nullptr is returned this value is usable. |
|
signal |
|
signal |
QList<AbstractGem *> Scene::geometries | ( | ) |
|
signal |
QQmlListProperty< AbstractGem > Scene::geometriesQML | ( | ) |
Allow QML classes to read our gems. Initially it was planned to manipulate our gems from QML classes, but we did not get it to work. Now we create it over a JSON-object and set it once, which works. All in all gem manipulation from QML is magic and we do not know why and how it really works.
|
slot |
|
slot |
Camera* Scene::previewCamera | ( | ) | const |
|
slot |
LightRay* Scene::rootLightRay | ( | ) | const |
|
signal |
|
slot |
void Scene::setCamera | ( | Camera * | camera | ) |
void Scene::setCurrentGem | ( | AbstractGem * | currentGem | ) |
Sets the gem, that will be controlled by player.
currentGem | The gem that will be controlled by player. |
void Scene::setPreviewCamera | ( | Camera * | camera | ) |
void Scene::setRootLightRay | ( | LightRay * | rootLightRay | ) |
|
virtualslot |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |