PGR Copakond OpenGL Engine - Bowling
Loading...
Searching...
No Matches
copakond::Geometry Class Reference

Base class for all spatial objects, serving as a node in the scene graph. More...

#include <geometry.h>

Inheritance diagram for copakond::Geometry:
copakond::Camera copakond::Mesh copakond::CollisionShape copakond::ImageMoving copakond::ImageSequenceLabel copakond::ObjMesh copakond::Skybox copakond::TextLabel copakond::CollisionBox copakond::CollisionSphere copakond::ImageLabel copakond::RigidBody copakond::CollisionPin copakond::RigidSphere

Public Member Functions

 Geometry ()
 Geometry (const glm::vec3 &position)
 Geometry (const glm::vec3 &position, const glm::vec3 &rotation)
 Geometry (const glm::vec3 &position, const glm::vec3 &rotation, const glm::vec3 &scale)
virtual ~Geometry ()
virtual void setPosition (const glm::vec3 &position)
virtual void setRotation (const glm::vec3 &rotation)
virtual void setScale (const glm::vec3 &scale)
virtual void setRotationDegrees (const glm::vec3 &rotationDegrees)
glm::mat4 getRotationXMatrix () const
glm::mat4 getRotationYMatrix () const
glm::mat4 getRotationZMatrix () const
glm::mat4 getPositionMatrix () const
glm::mat4 getRotationMatrix () const
glm::mat4 getScaleMatrix () const
glm::mat4 getModelMatrix () const
 Calculates local transformation matrix.
glm::mat4 getWorldPositionMatrix () const
glm::mat4 getWorldRotationMatrix () const
glm::mat4 getWorldScaleMatrix () const
glm::mat4 getWorldModelMatrix () const
 Calculates global transformation matrix by multiplying all ancestor matrices.
glm::vec3 getPosition () const
glm::vec3 getRotation () const
glm::vec3 getScale () const
glm::vec3 getRotationDegrees () const
glm::vec3 getWorldPosition () const
glm::vec3 getWorldRotation () const
glm::vec3 getWorldScale () const
glm::vec3 & position ()
glm::vec3 & rotation ()
glm::vec3 & scale ()
glm::vec3 worldPosition () const
glm::vec3 worldRotation () const
glm::vec3 worldScale () const
bool setParent (Geometry *newParent)
 Attaches this object to a new parent in the scene graph.
GeometrygetParent () const
std::vector< Geometry * > getChildren () const

Protected Attributes

Geometryparent = nullptr
std::vector< Geometry * > children
glm::vec3 _position
glm::vec3 _rotation
glm::vec3 _scale

Detailed Description

Base class for all spatial objects, serving as a node in the scene graph.

Constructor & Destructor Documentation

◆ Geometry() [1/4]

copakond::Geometry::Geometry ( )

◆ Geometry() [2/4]

copakond::Geometry::Geometry ( const glm::vec3 & position)

◆ Geometry() [3/4]

copakond::Geometry::Geometry ( const glm::vec3 & position,
const glm::vec3 & rotation )

◆ Geometry() [4/4]

copakond::Geometry::Geometry ( const glm::vec3 & position,
const glm::vec3 & rotation,
const glm::vec3 & scale )

◆ ~Geometry()

copakond::Geometry::~Geometry ( )
virtual

Member Function Documentation

◆ getChildren()

std::vector< Geometry * > copakond::Geometry::getChildren ( ) const
inline

◆ getModelMatrix()

glm::mat4 copakond::Geometry::getModelMatrix ( ) const

Calculates local transformation matrix.

◆ getParent()

Geometry * copakond::Geometry::getParent ( ) const
inline

◆ getPosition()

glm::vec3 copakond::Geometry::getPosition ( ) const
inline

◆ getPositionMatrix()

glm::mat4 copakond::Geometry::getPositionMatrix ( ) const

◆ getRotation()

glm::vec3 copakond::Geometry::getRotation ( ) const
inline

◆ getRotationDegrees()

glm::vec3 copakond::Geometry::getRotationDegrees ( ) const
inline

◆ getRotationMatrix()

glm::mat4 copakond::Geometry::getRotationMatrix ( ) const

◆ getRotationXMatrix()

glm::mat4 copakond::Geometry::getRotationXMatrix ( ) const

◆ getRotationYMatrix()

glm::mat4 copakond::Geometry::getRotationYMatrix ( ) const

◆ getRotationZMatrix()

glm::mat4 copakond::Geometry::getRotationZMatrix ( ) const

◆ getScale()

glm::vec3 copakond::Geometry::getScale ( ) const
inline

◆ getScaleMatrix()

glm::mat4 copakond::Geometry::getScaleMatrix ( ) const

◆ getWorldModelMatrix()

glm::mat4 copakond::Geometry::getWorldModelMatrix ( ) const

Calculates global transformation matrix by multiplying all ancestor matrices.

◆ getWorldPosition()

glm::vec3 copakond::Geometry::getWorldPosition ( ) const

◆ getWorldPositionMatrix()

glm::mat4 copakond::Geometry::getWorldPositionMatrix ( ) const

◆ getWorldRotation()

glm::vec3 copakond::Geometry::getWorldRotation ( ) const

◆ getWorldRotationMatrix()

glm::mat4 copakond::Geometry::getWorldRotationMatrix ( ) const

◆ getWorldScale()

glm::vec3 copakond::Geometry::getWorldScale ( ) const

◆ getWorldScaleMatrix()

glm::mat4 copakond::Geometry::getWorldScaleMatrix ( ) const

◆ position()

glm::vec3 & copakond::Geometry::position ( )
inline

◆ rotation()

glm::vec3 & copakond::Geometry::rotation ( )
inline

◆ scale()

glm::vec3 & copakond::Geometry::scale ( )
inline

◆ setParent()

bool copakond::Geometry::setParent ( Geometry * newParent)

Attaches this object to a new parent in the scene graph.

Parameters
newParentPointer to the new parent node.
Returns
True if successful, false if a cycle is detected.

◆ setPosition()

virtual void copakond::Geometry::setPosition ( const glm::vec3 & position)
inlinevirtual

◆ setRotation()

virtual void copakond::Geometry::setRotation ( const glm::vec3 & rotation)
inlinevirtual

Reimplemented in copakond::Camera.

◆ setRotationDegrees()

virtual void copakond::Geometry::setRotationDegrees ( const glm::vec3 & rotationDegrees)
inlinevirtual

Reimplemented in copakond::Camera.

◆ setScale()

virtual void copakond::Geometry::setScale ( const glm::vec3 & scale)
inlinevirtual

◆ worldPosition()

glm::vec3 copakond::Geometry::worldPosition ( ) const

◆ worldRotation()

glm::vec3 copakond::Geometry::worldRotation ( ) const

◆ worldScale()

glm::vec3 copakond::Geometry::worldScale ( ) const

Member Data Documentation

◆ _position

glm::vec3 copakond::Geometry::_position
protected

◆ _rotation

glm::vec3 copakond::Geometry::_rotation
protected

Rotation in radians

◆ _scale

glm::vec3 copakond::Geometry::_scale
protected

◆ children

std::vector<Geometry*> copakond::Geometry::children
protected

List of child nodes

◆ parent

Geometry* copakond::Geometry::parent = nullptr
protected

Pointer to the parent node in the hierarchy


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