Object* cpyObject(Object* O) { List CT; lstInit(&CT); Node* it = lstFirst(&O->CoordTex); while(!nodeEnd(it)) { Vec2* CoordTex = newVec2(); vec2Cp(CoordTex, *((Vec2*) nodeGetData(it))); lstAdd(&CT, CoordTex); it = nodeGetNext(it); } return newObject(cpyPolygon(O->Shape), O->Tex, CT); }
Vec2 Vec2_diff(Vec2 a, Vec2 b) { return newVec2(a.x - b.x, a.y - b.y); }
Vec2 Vec2_add(Vec2 a, Vec2 b) { return newVec2(a.x + b.x, a.y + b.y); }