Gem Illuminator
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros
Public Member Functions | List of all members
TetrahedronGem Class Reference

TetrahedronGems are gems with a shape like a tetrahedron. The only difference to AbstracGem is the fact, that a TetrahedronGem has a shape defined. More...

#include <tetrahedrongem.h>

Inheritance diagram for TetrahedronGem:
AbstractGem

Public Member Functions

 TetrahedronGem (QObject *parent=0)
 
virtual ~TetrahedronGem ()
 
- Public Member Functions inherited from AbstractGem
 AbstractGem (QObject *parent=0)
 
virtual ~AbstractGem ()
 
const QVector3D & color () const
 
void setColor (const QVector3D &color)
 
const GemDatadata () const
 Returns the GemData object describing the gem. This method was not intended to be public, but public access is needed it for rendering. More...
 
const QMatrix4x4 & model () const
 Constructs normal matrix for gem in order to transform it from objectspace into worldsapce. More...
 
const QVector3D & position () const
 
virtual void setPosition (const QVector3D &position)
 
qreal radius () const
 Radius of boundingsphere. This value is influenced by scale and the geometry of gem. More...
 
const QQuaternion & rotation () const
 Rotation around own center. More...
 
virtual void setRotation (const QQuaternion &rotation)
 Sets the rotation of gem around own center. More...
 
void rotate (const QQuaternion &quaternion)
 Rotates the gem around the center of the gem. More...
 
qreal scale () const
 
void setScale (qreal scaleFactor)
 
GemType type () const
 Returns the type of gem, in order to differentiate between types even if you have only AbstractGems. More...
 
float boundingSphereIntersectedBy (const LightRay &ray, QVector3D *collisionPoint=nullptr)
 Calculates distance to collision with gem's boundingsphere. The boundingsphere is specified by gems themself and cannot be influenced from outside. Because the collision point is only calculated with the bondingsphere computation is pretty fast. More...
 
virtual float intersectedBy (const LightRay &ray, QVector3D *collisionPoint=nullptr)
 Calcualtes the distance to collision of ray with gem. This method calculates the real collision point. Therefore, many computations are done especially for complex gems. More...
 
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 attributes. More...
 

Additional Inherited Members

- Public Slots inherited from AbstractGem
void setRotationFromEuler (const QVector3D &eulerRotation)
 Sets rotation of gem using euler angles. This method is mainly used to set initial rotation. More...
 
- Signals inherited from AbstractGem
void positionChanged ()
 
void rotationChanged ()
 
void scaleChanged ()
 
void colorChanged ()
 
- Protected Member Functions inherited from AbstractGem
int solveQuadricFormula (float a, float b, float c, float &x1, float &x2)
 
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. More...
 
Triangle inWorldCoordinates (const Triangle &triangle)
 Calculates triangle in world coordinates for given triangle. Therefore, position, rotatition and scale of gem are used. More...
 
- Protected Attributes inherited from AbstractGem
GemDatam_data
 
qreal m_radius
 

Detailed Description

TetrahedronGems are gems with a shape like a tetrahedron. The only difference to AbstracGem is the fact, that a TetrahedronGem has a shape defined.

Constructor & Destructor Documentation

TetrahedronGem::TetrahedronGem ( QObject *  parent = 0)
explicit
TetrahedronGem::~TetrahedronGem ( )
virtual

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