ELEC2645 (2018/19) / Mbed 2 deprecated el17cd

Dependencies:   mbed

Face/Face.cpp

Committer:
el17cd
Date:
2019-03-19
Revision:
9:5915fc800824
Parent:
7:15543cb10a14
Child:
10:07a23afd5088

File content as of revision 9:5915fc800824:

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

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

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

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