Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Face/Face.cpp@17:3c9672c6e532, 2019-03-31 (annotated)
- Committer:
- el17cd
- Date:
- Sun Mar 31 18:10:18 2019 +0000
- Revision:
- 17:3c9672c6e532
- Parent:
- 13:f4de03202477
- Child:
- 22:236319885874
changed from double precision to single (massive performance gain!)
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| el17cd | 1:044238f7bdda | 1 | #include "mbed.h" |
| el17cd | 4:759a5c34e239 | 2 | #ifndef FACE_H |
| el17cd | 4:759a5c34e239 | 3 | #define FACE_H |
| el17cd | 1:044238f7bdda | 4 | #include "Face.h" |
| el17cd | 4:759a5c34e239 | 5 | #endif |
| el17cd | 1:044238f7bdda | 6 | |
| el17cd | 13:f4de03202477 | 7 | Face::Face(){ |
| el17cd | 13:f4de03202477 | 8 | } |
| el17cd | 13:f4de03202477 | 9 | |
| el17cd | 13:f4de03202477 | 10 | bool Face::getVisible(){ |
| el17cd | 13:f4de03202477 | 11 | return visible; |
| el17cd | 4:759a5c34e239 | 12 | } |
| el17cd | 13:f4de03202477 | 13 | |
| el17cd | 13:f4de03202477 | 14 | |
| el17cd | 13:f4de03202477 | 15 | void Face::setVisible(bool v){ |
| el17cd | 13:f4de03202477 | 16 | visible = v; |
| el17cd | 13:f4de03202477 | 17 | } |
| el17cd | 13:f4de03202477 | 18 | |
| el17cd | 17:3c9672c6e532 | 19 | void Face::setVerticies(float (&PointArray)[4][3]){ |
| el17cd | 17:3c9672c6e532 | 20 | float z = 0; |
| el17cd | 1:044238f7bdda | 21 | for(int vertex = 0; vertex < 4; vertex++){ |
| el17cd | 1:044238f7bdda | 22 | for(int axis = 0; axis < 3; axis++){ |
| el17cd | 1:044238f7bdda | 23 | verticies[vertex][axis] = PointArray[vertex][axis]; |
| el17cd | 1:044238f7bdda | 24 | } |
| el17cd | 10:07a23afd5088 | 25 | z += verticies[vertex][2]; |
| el17cd | 1:044238f7bdda | 26 | } |
| el17cd | 9:5915fc800824 | 27 | avgZ = z/4; |
| el17cd | 1:044238f7bdda | 28 | } |
| el17cd | 4:759a5c34e239 | 29 | |
| el17cd | 17:3c9672c6e532 | 30 | float Face::getVertexValue(int vertex, int axis){ |
| el17cd | 1:044238f7bdda | 31 | return verticies[vertex][axis]; |
| el17cd | 9:5915fc800824 | 32 | } |
| el17cd | 9:5915fc800824 | 33 | |
| el17cd | 17:3c9672c6e532 | 34 | float Face::getAvgZ(){ |
| el17cd | 9:5915fc800824 | 35 | return avgZ; |
| el17cd | 1:044238f7bdda | 36 | } |