9 class QOpenGLFunctions;
10 class QOpenGLShaderProgram;
13 class AbstractGemRenderer;
51 const QVector3D &
color()
const;
52 void setColor(
const QVector3D &color);
65 const QMatrix4x4 &
model()
const;
68 virtual void setPosition(
const QVector3D &position);
86 virtual void setRotation(
const QQuaternion &rotation);
91 void rotate(
const QQuaternion &quaternion);
float faceIntersectedBy(const LightRay &ray, Triangle *&intersectedFace, QVector3D *collisionPoint=nullptr)
Finds face of gem intersected by given ray. Ownership of returned face is transferred to caller...
Definition: abstractgem.cpp:194
GemType type() const
Returns the type of gem, in order to differentiate between types even if you have only AbstractGems...
Definition: abstractgem.cpp:89
GemType
An enum describing current gem type. This enum is used for faster comparision of gems, because all gems of one type have same (objectspace) vertices.
Definition: abstractgem.h:22
The LightRay class describes the lightrays sent into Scene. Because LightRays are sent into Scene ri...
Definition: lightray.h:24
void setScale(qreal scaleFactor)
Definition: abstractgem.cpp:80
qreal m_radius
Definition: abstractgem.h:167
The Triangle class represents a triangle in three dimensional space.
Definition: triangle.h:11
void rotate(const QQuaternion &quaternion)
Rotates the gem around the center of the gem.
Definition: abstractgem.cpp:273
void setRotationFromEuler(const QVector3D &eulerRotation)
Sets rotation of gem using euler angles. This method is mainly used to set initial rotation...
Definition: abstractgem.cpp:38
float boundingSphereIntersectedBy(const LightRay &ray, QVector3D *collisionPoint=nullptr)
Calculates distance to collision with gem's boundingsphere. The boundingsphere is specified by gems ...
Definition: abstractgem.cpp:123
const QVector3D & color() const
virtual float intersectedBy(const LightRay &ray, QVector3D *collisionPoint=nullptr)
Calcualtes the distance to collision of ray with gem. This method calculates the real collision poin...
Definition: abstractgem.cpp:180
virtual ~AbstractGem()
Definition: abstractgem.cpp:33
The GemData class stores all required information to describe an AbstractGem. The advantage of GemDa...
Definition: gemdata.h:20
qreal radius() const
Radius of boundingsphere. This value is influenced by scale and the geometry of gem.
Definition: abstractgem.cpp:113
void setColor(const QVector3D &color)
Definition: abstractgem.cpp:99
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.
Definition: scene.h:22
const QQuaternion & rotation() const
Rotation around own center.
virtual void setPosition(const QVector3D &position)
Definition: abstractgem.cpp:52
int solveQuadricFormula(float a, float b, float c, float &x1, float &x2)
Definition: abstractgem.cpp:158
const GemData & data() const
Returns the GemData object describing the gem. This method was not intended to be public...
Definition: abstractgem.cpp:108
uint qHash(GemType key, uint seed)
Custom implementation of qHash. Providing hash calculation for GemType. In order to use GemType as ke...
Definition: abstractgem.cpp:303
virtual void setRotation(const QQuaternion &rotation)
Sets the rotation of gem around own center.
Definition: abstractgem.cpp:66
const QMatrix4x4 & model() const
Constructs normal matrix for gem in order to transform it from objectspace into worldsapce.
Definition: abstractgem.cpp:118
Triangle inWorldCoordinates(const Triangle &triangle)
Calculates triangle in world coordinates for given triangle. Therefore, position, rotatition and scal...
Definition: abstractgem.cpp:263
AbstractGem(QObject *parent=0)
Definition: abstractgem.cpp:26
virtual QList< LightRay * > processRayIntersection(const LightRay &ray, Scene *scene)
Calculates all new rays, that will be created by a collision with that gem. Also affect gem attribute...
Definition: abstractgem.cpp:278
The AbstractGem class is the base class of all gems. As base class all required information of a gem...
Definition: abstractgem.h:39
const QVector3D & position() const
GemData * m_data
Definition: abstractgem.h:166