Public Member Functions | Private Attributes
Obstacle Class Reference

The functions and elements of an Obstacle. More...

#include <Obstacle.h>

List of all members.

Public Member Functions

 Obstacle (std::string _objFileName)
 Constructor for Obstacle.
 ~Obstacle ()
 Destructor for Obstacle.
void createMesh (const std::string _objFileName)
 Create a mesh for the Obstacle.
void drawMesh ()
 Draws the mesh.
ngl::Obj * getMesh ()
 An accessor to get the m_mesh variable.
ngl::Vec3 getPosition () const
 An accessor to get the m_position variable.
ngl::Vec3 getRotation () const
 An accessor to get the m_rotation variable.
ngl::Vec3 getScale () const
 An accessor to get the m_scale variable.
ngl::Transformation * getTransMatrix ()
 An accessor to get the m_transMatrix variable.
ngl::Vec3 multTransMatrixAndVertex (ngl::Vec3 _vertex)
 Multiplies the transformation matrix by a vertex and return the new vertex.
void setPosition (ngl::Vec3 _pos)
 Sets the obstacle's position.
void setPosition (const float _x, const float _y, const float _z)
 Sets the obstacle's position.
void setRotation (ngl::Vec3 _rotation)
 Sets the obstacle's rotation.
void setScale (ngl::Vec3 _scale)
 Sets the obstacle's scale.
void setTransMatrix (ngl::Transformation _matrix)
 Sets the obstacle's transformation matrix.

Private Attributes

ngl::Obj * m_mesh
 The mesh of the obstacle.
ngl::Vec3 m_position
 The position of the obstacle.
ngl::Vec3 m_rotation
 The rotation of the obstacle.
ngl::Vec3 m_scale
 The scale of the obstacle.
ngl::Transformation m_transMatrix
 The transformation matrix of the obstacle.

Detailed Description

The functions and elements of an Obstacle.


Constructor & Destructor Documentation

Obstacle::Obstacle ( std::string  _objFileName)

Constructor for Obstacle.

1. Create the mesh.

2. Initialize the class member variables.

Destructor for Obstacle.

1. De-allocate memory.


Member Function Documentation

void Obstacle::createMesh ( const std::string  _objFileName)

Create a mesh for the Obstacle.

Parameters:
[in]_objFileNamethe file name of the obj file.

1. Initialize the mesh object.

2. Create the vertex array object for the mesh.

Draws the mesh.

1. Draw the mesh.

ngl::Obj* Obstacle::getMesh ( ) [inline]

An accessor to get the m_mesh variable.

Returns:
the m_mesh variable
ngl::Vec3 Obstacle::getPosition ( ) const [inline]

An accessor to get the m_position variable.

Returns:
the m_position variable
ngl::Vec3 Obstacle::getRotation ( ) const [inline]

An accessor to get the m_rotation variable.

Returns:
the m_rotation variable
ngl::Vec3 Obstacle::getScale ( ) const [inline]

An accessor to get the m_scale variable.

Returns:
the m_scale variable
ngl::Transformation* Obstacle::getTransMatrix ( ) [inline]

An accessor to get the m_transMatrix variable.

Returns:
the m_transMatrix variable
ngl::Vec3 Obstacle::multTransMatrixAndVertex ( ngl::Vec3  _vertex)

Multiplies the transformation matrix by a vertex and return the new vertex.

Parameters:
[in]_vertexthe vertex
Returns:
the new vertex

1. Multiply the vertex by the obstacle's transformation matrix to get the location of the vertex in world space.

void Obstacle::setPosition ( ngl::Vec3  _pos) [inline]

Sets the obstacle's position.

Parameters:
[in]_posa vector to be set to the m_position variable.
void Obstacle::setPosition ( const float  _x,
const float  _y,
const float  _z 
)

Sets the obstacle's position.

Parameters:
[in]_xthe obstacle's x position
[in]_ythe obstacle's y position
[in]_zthe obstacle's z position

1. Set the position based on the parameters.

void Obstacle::setRotation ( ngl::Vec3  _rotation) [inline]

Sets the obstacle's rotation.

Parameters:
[in]_rotationa vector to be set to the m_rotation variable.
void Obstacle::setScale ( ngl::Vec3  _scale) [inline]

Sets the obstacle's scale.

Parameters:
[in]_scalea vector to be set to the m_scale variable.
void Obstacle::setTransMatrix ( ngl::Transformation  _matrix) [inline]

Sets the obstacle's transformation matrix.

Parameters:
[in]_matrixa matrix to be set to the obstacle's transformation matrix variable (m_transMatrix).

The documentation for this class was generated from the following files:
 All Classes Files Functions Variables