Jamie Slowgrove - PGG Assignment 2
 All Classes Namespaces Files Functions Variables Typedefs Macros
Public Member Functions | Protected Attributes | List of all members
Entity Class Referenceabstract

Creates an Entity containing a Model. More...

#include <Entity.h>

Inheritance diagram for Entity:
Inheritance graph
Collaboration diagram for Entity:
Collaboration graph

Public Member Functions

 Entity (Model *model, float scaleValue)
 
virtual ~Entity ()
 
virtual void update (float dt)=0
 
void draw (glm::mat4 &viewMatrix, glm::mat4 &projMatrix)
 
void setPosition (glm::vec3 position)
 
void setPosition (float x, float y, float z)
 
void rotateX (float angle)
 
void rotateY (float angle)
 
void rotateZ (float angle)
 
void setScale (float scaleValue)
 
void move (glm::vec3 movement)
 
void moveX (float movement)
 
void moveY (float movement)
 
void moveZ (float movement)
 
void setMoveSpeed (float moveSpeed)
 
glm::vec3 getPosition ()
 
glm::vec3 getOrientation ()
 
float getScale ()
 

Protected Attributes

Modelmodel
 
glm::vec3 rotation
 
glm::vec3 position
 
float scaleValue
 
float moveSpeed
 
float rotateSpeed
 

Detailed Description

Creates an Entity containing a Model.

Author
Jamie Slowgrove

Constructor & Destructor Documentation

Entity::Entity ( Model model,
float  scaleValue 
)

Constructs a Entity Object. Creates a Entity Object with a Model using the shader file locations, the obj file location and OpenGL.

Parameters
modelA pointer to the Model.
scaleValueThe scale of the Model.

Here is the call graph for this function:

Entity::~Entity ( )
virtual

A virtual destructor for the Entity Object. Destructs the Entity Object deleting the Entity Object from memory.

Member Function Documentation

void Entity::draw ( glm::mat4 &  viewMatrix,
glm::mat4 &  projMatrix 
)

Draw the Entity to the screen.

Parameters
viewMatrixA reference to the camera view matrix.
projMatrixA reference to the camera projection matrix.

Here is the call graph for this function:

Here is the caller graph for this function:

glm::vec3 Entity::getOrientation ( )

Getter # Gets the position of the Entity.

Returns
The orientation of the Entity.

Here is the caller graph for this function:

glm::vec3 Entity::getPosition ( )

Getter # Gets the position of the Entity.

Returns
The position of the Entity.

Here is the caller graph for this function:

float Entity::getScale ( )

Getter # Gets the scale of the Entity.

Returns
The scale of the Entity.
void Entity::move ( glm::vec3  movement)

Move the Entity.

Parameters
movementThe amount to move by.

Here is the call graph for this function:

Here is the caller graph for this function:

void Entity::moveX ( float  movement)

Move the Entity along the X axis.

Parameters
movementThe amount to move by.

Here is the call graph for this function:

Here is the caller graph for this function:

void Entity::moveY ( float  movement)

Move the Entity along the Y axis.

Parameters
movementThe amount to move by.

Here is the call graph for this function:

Here is the caller graph for this function:

void Entity::moveZ ( float  movement)

Move the Entity along the Z axis.

Parameters
movementThe amount to move by.

Here is the call graph for this function:

Here is the caller graph for this function:

void Entity::rotateX ( float  angle)

Rotate the Entity along the X axis.

Parameters
angleThe rotation angle (Euler angle [Radians]).

Here is the call graph for this function:

Here is the caller graph for this function:

void Entity::rotateY ( float  angle)

Rotate the Entity along the Y axis.

Parameters
angleThe rotation angle (Euler angle [Radians]).

Here is the call graph for this function:

Here is the caller graph for this function:

void Entity::rotateZ ( float  angle)

Rotate the Entity along the Z axis.

Parameters
angleThe rotation angle (Euler angle [Radians]).

Here is the call graph for this function:

void Entity::setMoveSpeed ( float  moveSpeed)

Setter # Sets the moveSpeed of the Entity.

Parameters
moveSpeedThe new moveSpeed.

Here is the caller graph for this function:

void Entity::setPosition ( glm::vec3  position)

Setter # Sets the position of the Entity.

Parameters
positionThe new position.

Here is the call graph for this function:

Here is the caller graph for this function:

void Entity::setPosition ( float  x,
float  y,
float  z 
)

Setter # Sets the position of the Entity.

Parameters
xThe X position.
yThe Y position.
zThe Z position.

Here is the call graph for this function:

void Entity::setScale ( float  scaleValue)

Setter # Sets the scale of the Entity.

Parameters
scaleValueThe new scale.

Here is the call graph for this function:

virtual void Entity::update ( float  dt)
pure virtual

A pure virtual function that updates the Entity

Parameters
dtThe delta time.

Implemented in Ring, Player, Particle, Ground, and MenuEntity.

Member Data Documentation

Model* Entity::model
protected

A pointer to the Model

float Entity::moveSpeed
protected

The movement speed of the Entity

glm::vec3 Entity::position
protected

The Position of the Model

float Entity::rotateSpeed
protected

The rotation speed of the Entity

glm::vec3 Entity::rotation
protected

The rotation of the Entity Model (Euler angles)

float Entity::scaleValue
protected

The scale of the Model


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