NickHardeman/openFrameworks — pull request #2 by arturoc (2013-01-31 15:46:43+00:00)
Title: ofMeshFace: arrays -> vectors to avoid memory problems + face normal as method

as it was, doing something like:

ofMeshFace face:

void Class::method1(){
ofMeshFace localFace;
...
face = localFace;
}

void Class::method2(){
face.vertices[1];
}

will crash since the copy in method 1 will be point the arrays to the memory addresses of the arrays in localFace which will be destroyed when the method ends

i've also changed points -> vertices for uniformity and faceNormal as a calculated method, it could be slightly slower having to calculate it always but i think it's less confusing than having to call calculate manually and keeping track if it was calculated before.

we could make the vectors private and do some smart caching thing for the faceNormal but i think it's not worth