//#include #include #include #include #include inline int streq(const char *a,const char *b) { return strcmp(a,b)==0; } using namespace qslim; SMF_State::SMF_State(const SMF_ivars& ivar, SMF_State *link) { next = link; first_vertex = ivar.next_vertex; if( next ) { vertex_correction = next->vertex_correction; xform = next->xform; } else { vertex_correction = 0; xform = Mat4::identity; } } void SMF_State::vertex(Vec3& v) { Vec4 v2 = xform * Vec4(v,1); v[X] = v2[X]/v2[W]; v[Y] = v2[Y]/v2[W]; v[Z] = v2[Z]/v2[W]; } void SMF_State::normal(Vec3& v) { Vec4 v2 = xform * Vec4(v,0); // v[X] = v2[X]/v2[W]; // v[Y] = v2[Y]/v2[W]; // v[Z] = v2[Z]/v2[W]; v[X] = v2[X]; v[Y] = v2[Y]; v[Z] = v2[Z]; } void SMF_State::face(buffer& verts, const SMF_ivars& ivar) { for(int i=0; i