ELEC2645 (2018/19) / Mbed 2 deprecated el17cd

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Face Class Reference

Face Class Reference

Face class. More...

#include <Face.h>

Public Member Functions

 Face ()
 The constructor of the Face class which instantiates the face object.
float getVertexValue (int vertex, int axis)
 An accessor method which returns the value depending on the index of the vertex and the axis required.
bool getVisible ()
 An accessor method which returns whether the face is visible or not.
void setVisible (bool v)
 A mutator method which sets whether the face is visible or not.
void setVerticies (float(&PointArray)[4][3])
 A mutator method which sets the verticies of the face.
float getAvgZ ()
 An accessor method which returns the average z axis value of the faces verticies.

Detailed Description

Face class.

A class used to instantiate a Face object, each cube will store 6 of these and will all be passed to the renderer to display the cube. Each Face object will be sorted in terms of its average z axis position upon which the renderer draws the faces from back to front to create depth.

Author:
Christopher Doel
Date:
April, 2019

Definition at line 9 of file Face.h.


Constructor & Destructor Documentation

Face (  )

The constructor of the Face class which instantiates the face object.

No parameters are required as the face attributes will be defined after instantiation using the mutator methods.

Definition at line 6 of file Face.cpp.


Member Function Documentation

float getAvgZ (  )

An accessor method which returns the average z axis value of the faces verticies.

Returns:
A float representing the average z axis value of the face

Definition at line 34 of file Face.cpp.

float getVertexValue ( int  vertex,
int  axis 
)

An accessor method which returns the value depending on the index of the vertex and the axis required.

Parameters:
Theindex of which vertex is required
Theaxis of the 3 dimensional coordinate required
Returns:
The float value of the required vertex in a specific axis

Definition at line 30 of file Face.cpp.

bool getVisible (  )

An accessor method which returns whether the face is visible or not.

Returns:
The boolean value of the attribute 'visible'

Definition at line 10 of file Face.cpp.

void setVerticies ( float(&)  PointArray[4][3] )

A mutator method which sets the verticies of the face.

Parameters:
Amemory address of a two dimentional array containing each vertex and the values of the x, y and z coordinates

Definition at line 19 of file Face.cpp.

void setVisible ( bool  v )

A mutator method which sets whether the face is visible or not.

Parameters:
Aboolean which determines whether the visible attribute will be true or false

Definition at line 15 of file Face.cpp.