ELEC2645 (2018/19) / Mbed 2 deprecated el17cd

Dependencies:   mbed

Face/Face.cpp

Committer:
el17cd
Date:
2019-03-24
Revision:
13:f4de03202477
Parent:
10:07a23afd5088
Child:
17:3c9672c6e532

File content as of revision 13:f4de03202477:

#include "mbed.h"
#ifndef FACE_H
#define FACE_H
#include "Face.h"
#endif

Face::Face(){
}

bool Face::getVisible(){
    return visible;
}


void Face::setVisible(bool v){
    visible = v;
}

void Face::setVerticies(double (&PointArray)[4][3]){
    double z = 0;
    for(int vertex = 0; vertex < 4; vertex++){
        for(int axis = 0; axis < 3; axis++){
            verticies[vertex][axis] = PointArray[vertex][axis];
        }
        z += verticies[vertex][2];
    }
    avgZ = z/4;
}

double Face::getVertexValue(int vertex, int axis){
    return verticies[vertex][axis];
}

double Face::getAvgZ(){
    return avgZ;
}