struct vec { float x,y,z; vec(){} vec(float _x,float _y,float _z):x(_x),y(_y),z(_z) {} vec operator + (const vec& _other) { return vec(x+_other.x,y+_other.y,z+_other.z); }};
note: i use _ for functionparameters, and m_ for member variables, except in this one, because i want to access x,y and z directly, and the m_ is just overhead in this case..
"take a look around" - limp bizkit
www.google.com
edit: i just edited a typo in the text, source remains the same
[edited by - davepermen on July 25, 2002 10:41:24 AM]