Use vector member in HE_vert struct
This commit is contained in:
parent
f2f4833392
commit
ce4032f0be
@ -75,9 +75,9 @@ static void draw_vertices(HE_obj const * const obj)
|
||||
HE_edge *tmp_edge = obj->faces[i].edge;
|
||||
|
||||
do { /* for all edges of the face */
|
||||
glVertex3f(tmp_edge->vert->x,
|
||||
tmp_edge->vert->y,
|
||||
tmp_edge->vert->z);
|
||||
glVertex3f(tmp_edge->vert->vec->x,
|
||||
tmp_edge->vert->vec->y,
|
||||
tmp_edge->vert->vec->z);
|
||||
} while ((tmp_edge = tmp_edge->next) != obj->faces[i].edge);
|
||||
}
|
||||
}
|
||||
|
@ -67,9 +67,9 @@ bool find_center(HE_obj const * const obj, vector *vec)
|
||||
|
||||
|
||||
for (i = 0; i < obj->vc; i++) {
|
||||
x += obj->vertices[i].x;
|
||||
y += obj->vertices[i].y;
|
||||
z += obj->vertices[i].z;
|
||||
x += obj->vertices[i].vec->x;
|
||||
y += obj->vertices[i].vec->y;
|
||||
z += obj->vertices[i].vec->z;
|
||||
}
|
||||
|
||||
vec->x = x / i;
|
||||
@ -95,24 +95,24 @@ float get_normalized_scale_factor(HE_obj const * const obj)
|
||||
if (!obj)
|
||||
return -1;
|
||||
|
||||
max = obj->vertices[0].x +
|
||||
obj->vertices[0].y + obj->vertices[0].z;
|
||||
min = obj->vertices[0].x +
|
||||
obj->vertices[0].y + obj->vertices[0].z;
|
||||
max = obj->vertices[0].vec->x +
|
||||
obj->vertices[0].vec->y + obj->vertices[0].vec->z;
|
||||
min = obj->vertices[0].vec->x +
|
||||
obj->vertices[0].vec->y + obj->vertices[0].vec->z;
|
||||
|
||||
for (i = 0; i < obj->vc; i++) {
|
||||
if ((obj->vertices[i].x +
|
||||
obj->vertices[i].y +
|
||||
obj->vertices[i].z) > max)
|
||||
max = obj->vertices[i].x +
|
||||
obj->vertices[i].y +
|
||||
obj->vertices[i].z;
|
||||
else if ((obj->vertices[i].x +
|
||||
obj->vertices[i].y +
|
||||
obj->vertices[i].z) < min)
|
||||
min = obj->vertices[i].x +
|
||||
obj->vertices[i].y +
|
||||
obj->vertices[i].z;
|
||||
if ((obj->vertices[i].vec->x +
|
||||
obj->vertices[i].vec->y +
|
||||
obj->vertices[i].vec->z) > max)
|
||||
max = obj->vertices[i].vec->x +
|
||||
obj->vertices[i].vec->y +
|
||||
obj->vertices[i].vec->z;
|
||||
else if ((obj->vertices[i].vec->x +
|
||||
obj->vertices[i].vec->y +
|
||||
obj->vertices[i].vec->z) < min)
|
||||
min = obj->vertices[i].vec->x +
|
||||
obj->vertices[i].vec->y +
|
||||
obj->vertices[i].vec->z;
|
||||
}
|
||||
|
||||
return 1 / (max - min);
|
||||
@ -155,6 +155,8 @@ HE_obj *parse_obj(char const * const obj_string)
|
||||
if (!strcmp(str_tmp_ptr, "v")) {
|
||||
char *myfloat = NULL;
|
||||
HE_vert *tmp_ptr;
|
||||
vector *tmp_vec = malloc(sizeof(vector));
|
||||
CHECK_PTR_VAL(tmp_vec);
|
||||
|
||||
tmp_ptr = (HE_vert*) realloc(vertices,
|
||||
sizeof(HE_vert) * (vc + 1));
|
||||
@ -164,17 +166,19 @@ HE_obj *parse_obj(char const * const obj_string)
|
||||
/* fill x */
|
||||
myfloat = strtok_r(NULL, " ", &str_ptr_space);
|
||||
CHECK_PTR_VAL(myfloat);
|
||||
vertices[vc].x = atof(myfloat);
|
||||
tmp_vec->x = atof(myfloat);
|
||||
|
||||
/* fill y */
|
||||
myfloat = strtok_r(NULL, " ", &str_ptr_space);
|
||||
CHECK_PTR_VAL(myfloat);
|
||||
vertices[vc].y = atof(myfloat);
|
||||
tmp_vec->y = atof(myfloat);
|
||||
|
||||
/* fill z */
|
||||
myfloat = strtok_r(NULL, " ", &str_ptr_space);
|
||||
CHECK_PTR_VAL(myfloat);
|
||||
vertices[vc].z = atof(myfloat);
|
||||
tmp_vec->z = atof(myfloat);
|
||||
|
||||
vertices[vc].vec = tmp_vec;
|
||||
|
||||
/* set edge NULL */
|
||||
vertices[vc].edge = NULL;
|
||||
|
@ -73,9 +73,11 @@ struct HE_edge {
|
||||
* hald-edge.
|
||||
*/
|
||||
struct HE_vert {
|
||||
float x;
|
||||
float y;
|
||||
float z;
|
||||
/**
|
||||
* A vector pointing
|
||||
* to the coordinates of the vertex.
|
||||
*/
|
||||
vector *vec;
|
||||
|
||||
/**
|
||||
* One of the half-edges emanating from the vertex.
|
||||
|
18
src/print.c
18
src/print.c
@ -40,9 +40,9 @@ void print_edges(HE_obj *obj)
|
||||
{
|
||||
for (uint32_t i = 0; i < obj->ec; i++) {
|
||||
printf("edge vertices %i:\n", i);
|
||||
printf(" x: %f\n", obj->edges[i].vert->x);
|
||||
printf(" y: %f\n", obj->edges[i].vert->y);
|
||||
printf(" z: %f\n", obj->edges[i].vert->z);
|
||||
printf(" x: %f\n", obj->edges[i].vert->vec->x);
|
||||
printf(" y: %f\n", obj->edges[i].vert->vec->y);
|
||||
printf(" z: %f\n", obj->edges[i].vert->vec->z);
|
||||
printf("\n");
|
||||
}
|
||||
}
|
||||
@ -56,9 +56,9 @@ void print_vertices(HE_obj *obj)
|
||||
{
|
||||
printf("vertices: %d\n", obj->vc);
|
||||
for (uint32_t i = 0; i < obj->vc; i++) {
|
||||
printf("x[%d]: %f\n", i, obj->vertices[i].x);
|
||||
printf("y[%d]: %f\n", i, obj->vertices[i].y);
|
||||
printf("z[%d]: %f\n", i, obj->vertices[i].z);
|
||||
printf("x[%d]: %f\n", i, obj->vertices[i].vec->x);
|
||||
printf("y[%d]: %f\n", i, obj->vertices[i].vec->y);
|
||||
printf("z[%d]: %f\n", i, obj->vertices[i].vec->z);
|
||||
printf("\n");
|
||||
}
|
||||
}
|
||||
@ -73,9 +73,9 @@ void print_faces(HE_obj *obj)
|
||||
{
|
||||
for (uint32_t i = 0; i < obj->fc; i++) {
|
||||
printf("face edge vertice %i:\n", i);
|
||||
printf(" x: %f\n", obj->faces[i].edge->vert->x);
|
||||
printf(" y: %f\n", obj->faces[i].edge->vert->y);
|
||||
printf(" z: %f\n", obj->faces[i].edge->vert->z);
|
||||
printf(" x: %f\n", obj->faces[i].edge->vert->vec->x);
|
||||
printf(" y: %f\n", obj->faces[i].edge->vert->vec->y);
|
||||
printf(" z: %f\n", obj->faces[i].edge->vert->vec->z);
|
||||
printf("\n");
|
||||
}
|
||||
}
|
||||
|
@ -90,37 +90,37 @@ void test_read_obj_file1(void)
|
||||
|
||||
CU_ASSERT_PTR_NOT_NULL(obj);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->vertices[0].x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[0].y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[0].z, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[0].vec->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[0].vec->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[0].vec->z, 11.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->vertices[1].x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[1].y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[1].z, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[1].vec->x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[1].vec->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[1].vec->z, 11.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->vertices[2].x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[2].y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[2].z, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[2].vec->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[2].vec->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[2].vec->z, 11.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->vertices[3].x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[3].y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[3].z, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[3].vec->x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[3].vec->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[3].vec->z, 11.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->vertices[4].x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[4].y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[4].z, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[4].vec->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[4].vec->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[4].vec->z, 9.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->vertices[5].x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[5].y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[5].z, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[5].vec->x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[5].vec->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[5].vec->z, 9.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->vertices[6].x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[6].y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[6].z, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[6].vec->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[6].vec->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[6].vec->z, 9.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->vertices[7].x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[7].y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[7].z, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[7].vec->x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[7].vec->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[7].vec->z, 9.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->vc, 8);
|
||||
|
||||
@ -128,125 +128,125 @@ void test_read_obj_file1(void)
|
||||
* The following relies on faces always saving the
|
||||
* last listed vertice as their edge member.
|
||||
*/
|
||||
CU_ASSERT_EQUAL(obj->faces[0].edge->vert->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[0].edge->vert->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[0].edge->vert->z, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[0].edge->vert->vec->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[0].edge->vert->vec->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[0].edge->vert->vec->z, 11.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->faces[0].edge->next->vert->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[0].edge->next->vert->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[0].edge->next->vert->z, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[0].edge->next->vert->vec->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[0].edge->next->vert->vec->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[0].edge->next->vert->vec->z, 11.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->faces[0].edge->next->next->vert->x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[0].edge->next->next->vert->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[0].edge->next->next->vert->z, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[0].edge->next->next->vert->vec->x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[0].edge->next->next->vert->vec->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[0].edge->next->next->vert->vec->z, 11.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->faces[0].edge->next->next->next->vert->x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[0].edge->next->next->next->vert->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[0].edge->next->next->next->vert->z, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[0].edge->next->next->next->vert->vec->x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[0].edge->next->next->next->vert->vec->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[0].edge->next->next->next->vert->vec->z, 11.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->faces[0].edge->next->next->next->next->vert->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[0].edge->next->next->next->next->vert->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[0].edge->next->next->next->next->vert->z, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[0].edge->next->next->next->next->vert->vec->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[0].edge->next->next->next->next->vert->vec->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[0].edge->next->next->next->next->vert->vec->z, 11.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->faces[1].edge->vert->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[1].edge->vert->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[1].edge->vert->z, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[1].edge->vert->vec->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[1].edge->vert->vec->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[1].edge->vert->vec->z, 9.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->faces[1].edge->next->vert->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[1].edge->next->vert->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[1].edge->next->vert->z, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[1].edge->next->vert->vec->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[1].edge->next->vert->vec->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[1].edge->next->vert->vec->z, 11.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->faces[1].edge->next->next->vert->x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[1].edge->next->next->vert->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[1].edge->next->next->vert->z, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[1].edge->next->next->vert->vec->x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[1].edge->next->next->vert->vec->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[1].edge->next->next->vert->vec->z, 11.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->faces[1].edge->next->next->next->vert->x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[1].edge->next->next->next->vert->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[1].edge->next->next->next->vert->z, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[1].edge->next->next->next->vert->vec->x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[1].edge->next->next->next->vert->vec->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[1].edge->next->next->next->vert->vec->z, 9.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->faces[1].edge->next->next->next->next->vert->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[1].edge->next->next->next->next->vert->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[1].edge->next->next->next->next->vert->z, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[1].edge->next->next->next->next->vert->vec->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[1].edge->next->next->next->next->vert->vec->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[1].edge->next->next->next->next->vert->vec->z, 9.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->faces[2].edge->vert->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[2].edge->vert->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[2].edge->vert->z, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[2].edge->vert->vec->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[2].edge->vert->vec->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[2].edge->vert->vec->z, 9.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->faces[2].edge->next->vert->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[2].edge->next->vert->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[2].edge->next->vert->z, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[2].edge->next->vert->vec->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[2].edge->next->vert->vec->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[2].edge->next->vert->vec->z, 9.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->faces[2].edge->next->next->vert->x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[2].edge->next->next->vert->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[2].edge->next->next->vert->z, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[2].edge->next->next->vert->vec->x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[2].edge->next->next->vert->vec->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[2].edge->next->next->vert->vec->z, 9.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->faces[2].edge->next->next->next->vert->x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[2].edge->next->next->next->vert->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[2].edge->next->next->next->vert->z, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[2].edge->next->next->next->vert->vec->x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[2].edge->next->next->next->vert->vec->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[2].edge->next->next->next->vert->vec->z, 9.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->faces[2].edge->next->next->next->next->vert->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[2].edge->next->next->next->next->vert->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[2].edge->next->next->next->next->vert->z, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[2].edge->next->next->next->next->vert->vec->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[2].edge->next->next->next->next->vert->vec->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[2].edge->next->next->next->next->vert->vec->z, 9.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->faces[3].edge->vert->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[3].edge->vert->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[3].edge->vert->z, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[3].edge->vert->vec->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[3].edge->vert->vec->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[3].edge->vert->vec->z, 11.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->faces[3].edge->next->vert->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[3].edge->next->vert->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[3].edge->next->vert->z, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[3].edge->next->vert->vec->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[3].edge->next->vert->vec->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[3].edge->next->vert->vec->z, 9.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->faces[3].edge->next->next->vert->x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[3].edge->next->next->vert->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[3].edge->next->next->vert->z, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[3].edge->next->next->vert->vec->x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[3].edge->next->next->vert->vec->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[3].edge->next->next->vert->vec->z, 9.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->faces[3].edge->next->next->next->vert->x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[3].edge->next->next->next->vert->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[3].edge->next->next->next->vert->z, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[3].edge->next->next->next->vert->vec->x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[3].edge->next->next->next->vert->vec->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[3].edge->next->next->next->vert->vec->z, 11.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->faces[3].edge->next->next->next->next->vert->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[3].edge->next->next->next->next->vert->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[3].edge->next->next->next->next->vert->z, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[3].edge->next->next->next->next->vert->vec->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[3].edge->next->next->next->next->vert->vec->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[3].edge->next->next->next->next->vert->vec->z, 11.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->faces[4].edge->vert->x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[4].edge->vert->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[4].edge->vert->z, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[4].edge->vert->vec->x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[4].edge->vert->vec->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[4].edge->vert->vec->z, 11.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->faces[4].edge->next->vert->x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[4].edge->next->vert->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[4].edge->next->vert->z, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[4].edge->next->vert->vec->x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[4].edge->next->vert->vec->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[4].edge->next->vert->vec->z, 11.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->faces[4].edge->next->next->vert->x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[4].edge->next->next->vert->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[4].edge->next->next->vert->z, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[4].edge->next->next->vert->vec->x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[4].edge->next->next->vert->vec->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[4].edge->next->next->vert->vec->z, 9.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->faces[4].edge->next->next->next->vert->x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[4].edge->next->next->next->vert->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[4].edge->next->next->next->vert->z, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[4].edge->next->next->next->vert->vec->x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[4].edge->next->next->next->vert->vec->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[4].edge->next->next->next->vert->vec->z, 9.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->faces[4].edge->next->next->next->next->vert->x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[4].edge->next->next->next->next->vert->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[4].edge->next->next->next->next->vert->z, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[4].edge->next->next->next->next->vert->vec->x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[4].edge->next->next->next->next->vert->vec->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[4].edge->next->next->next->next->vert->vec->z, 11.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->faces[5].edge->vert->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[5].edge->vert->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[5].edge->vert->z, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[5].edge->vert->vec->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[5].edge->vert->vec->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[5].edge->vert->vec->z, 9.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->faces[5].edge->next->vert->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[5].edge->next->vert->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[5].edge->next->vert->z, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[5].edge->next->vert->vec->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[5].edge->next->vert->vec->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[5].edge->next->vert->vec->z, 9.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->faces[5].edge->next->next->vert->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[5].edge->next->next->vert->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[5].edge->next->next->vert->z, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[5].edge->next->next->vert->vec->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[5].edge->next->next->vert->vec->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[5].edge->next->next->vert->vec->z, 11.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->faces[5].edge->next->next->next->vert->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[5].edge->next->next->next->vert->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[5].edge->next->next->next->vert->z, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[5].edge->next->next->next->vert->vec->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[5].edge->next->next->next->vert->vec->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[5].edge->next->next->next->vert->vec->z, 11.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->faces[5].edge->next->next->next->next->vert->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[5].edge->next->next->next->next->vert->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[5].edge->next->next->next->next->vert->z, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[5].edge->next->next->next->next->vert->vec->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[5].edge->next->next->next->next->vert->vec->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[5].edge->next->next->next->next->vert->vec->z, 9.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->fc, 6);
|
||||
|
||||
|
@ -56,37 +56,37 @@ void test_parse_obj1(void)
|
||||
|
||||
CU_ASSERT_PTR_NOT_NULL(obj);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->vertices[0].x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[0].y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[0].z, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[0].vec->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[0].vec->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[0].vec->z, 11.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->vertices[1].x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[1].y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[1].z, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[1].vec->x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[1].vec->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[1].vec->z, 11.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->vertices[2].x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[2].y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[2].z, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[2].vec->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[2].vec->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[2].vec->z, 11.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->vertices[3].x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[3].y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[3].z, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[3].vec->x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[3].vec->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[3].vec->z, 11.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->vertices[4].x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[4].y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[4].z, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[4].vec->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[4].vec->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[4].vec->z, 9.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->vertices[5].x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[5].y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[5].z, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[5].vec->x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[5].vec->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[5].vec->z, 9.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->vertices[6].x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[6].y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[6].z, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[6].vec->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[6].vec->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[6].vec->z, 9.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->vertices[7].x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[7].y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[7].z, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[7].vec->x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[7].vec->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[7].vec->z, 9.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->vc, 8);
|
||||
|
||||
@ -94,131 +94,132 @@ void test_parse_obj1(void)
|
||||
* The following relies on faces always saving the
|
||||
* last listed vertice as their edge member.
|
||||
*/
|
||||
CU_ASSERT_EQUAL(obj->faces[0].edge->vert->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[0].edge->vert->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[0].edge->vert->z, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[0].edge->vert->vec->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[0].edge->vert->vec->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[0].edge->vert->vec->z, 11.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->faces[0].edge->next->vert->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[0].edge->next->vert->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[0].edge->next->vert->z, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[0].edge->next->vert->vec->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[0].edge->next->vert->vec->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[0].edge->next->vert->vec->z, 11.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->faces[0].edge->next->next->vert->x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[0].edge->next->next->vert->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[0].edge->next->next->vert->z, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[0].edge->next->next->vert->vec->x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[0].edge->next->next->vert->vec->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[0].edge->next->next->vert->vec->z, 11.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->faces[0].edge->next->next->next->vert->x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[0].edge->next->next->next->vert->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[0].edge->next->next->next->vert->z, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[0].edge->next->next->next->vert->vec->x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[0].edge->next->next->next->vert->vec->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[0].edge->next->next->next->vert->vec->z, 11.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->faces[0].edge->next->next->next->next->vert->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[0].edge->next->next->next->next->vert->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[0].edge->next->next->next->next->vert->z, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[0].edge->next->next->next->next->vert->vec->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[0].edge->next->next->next->next->vert->vec->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[0].edge->next->next->next->next->vert->vec->z, 11.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->faces[1].edge->vert->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[1].edge->vert->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[1].edge->vert->z, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[1].edge->vert->vec->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[1].edge->vert->vec->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[1].edge->vert->vec->z, 9.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->faces[1].edge->next->vert->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[1].edge->next->vert->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[1].edge->next->vert->z, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[1].edge->next->vert->vec->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[1].edge->next->vert->vec->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[1].edge->next->vert->vec->z, 11.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->faces[1].edge->next->next->vert->x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[1].edge->next->next->vert->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[1].edge->next->next->vert->z, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[1].edge->next->next->vert->vec->x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[1].edge->next->next->vert->vec->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[1].edge->next->next->vert->vec->z, 11.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->faces[1].edge->next->next->next->vert->x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[1].edge->next->next->next->vert->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[1].edge->next->next->next->vert->z, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[1].edge->next->next->next->vert->vec->x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[1].edge->next->next->next->vert->vec->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[1].edge->next->next->next->vert->vec->z, 9.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->faces[1].edge->next->next->next->next->vert->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[1].edge->next->next->next->next->vert->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[1].edge->next->next->next->next->vert->z, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[1].edge->next->next->next->next->vert->vec->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[1].edge->next->next->next->next->vert->vec->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[1].edge->next->next->next->next->vert->vec->z, 9.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->faces[2].edge->vert->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[2].edge->vert->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[2].edge->vert->z, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[2].edge->vert->vec->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[2].edge->vert->vec->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[2].edge->vert->vec->z, 9.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->faces[2].edge->next->vert->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[2].edge->next->vert->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[2].edge->next->vert->z, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[2].edge->next->vert->vec->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[2].edge->next->vert->vec->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[2].edge->next->vert->vec->z, 9.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->faces[2].edge->next->next->vert->x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[2].edge->next->next->vert->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[2].edge->next->next->vert->z, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[2].edge->next->next->vert->vec->x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[2].edge->next->next->vert->vec->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[2].edge->next->next->vert->vec->z, 9.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->faces[2].edge->next->next->next->vert->x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[2].edge->next->next->next->vert->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[2].edge->next->next->next->vert->z, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[2].edge->next->next->next->vert->vec->x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[2].edge->next->next->next->vert->vec->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[2].edge->next->next->next->vert->vec->z, 9.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->faces[2].edge->next->next->next->next->vert->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[2].edge->next->next->next->next->vert->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[2].edge->next->next->next->next->vert->z, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[2].edge->next->next->next->next->vert->vec->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[2].edge->next->next->next->next->vert->vec->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[2].edge->next->next->next->next->vert->vec->z, 9.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->faces[3].edge->vert->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[3].edge->vert->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[3].edge->vert->z, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[3].edge->vert->vec->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[3].edge->vert->vec->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[3].edge->vert->vec->z, 11.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->faces[3].edge->next->vert->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[3].edge->next->vert->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[3].edge->next->vert->z, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[3].edge->next->vert->vec->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[3].edge->next->vert->vec->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[3].edge->next->vert->vec->z, 9.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->faces[3].edge->next->next->vert->x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[3].edge->next->next->vert->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[3].edge->next->next->vert->z, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[3].edge->next->next->vert->vec->x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[3].edge->next->next->vert->vec->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[3].edge->next->next->vert->vec->z, 9.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->faces[3].edge->next->next->next->vert->x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[3].edge->next->next->next->vert->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[3].edge->next->next->next->vert->z, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[3].edge->next->next->next->vert->vec->x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[3].edge->next->next->next->vert->vec->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[3].edge->next->next->next->vert->vec->z, 11.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->faces[3].edge->next->next->next->next->vert->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[3].edge->next->next->next->next->vert->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[3].edge->next->next->next->next->vert->z, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[3].edge->next->next->next->next->vert->vec->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[3].edge->next->next->next->next->vert->vec->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[3].edge->next->next->next->next->vert->vec->z, 11.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->faces[4].edge->vert->x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[4].edge->vert->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[4].edge->vert->z, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[4].edge->vert->vec->x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[4].edge->vert->vec->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[4].edge->vert->vec->z, 11.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->faces[4].edge->next->vert->x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[4].edge->next->vert->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[4].edge->next->vert->z, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[4].edge->next->vert->vec->x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[4].edge->next->vert->vec->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[4].edge->next->vert->vec->z, 11.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->faces[4].edge->next->next->vert->x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[4].edge->next->next->vert->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[4].edge->next->next->vert->z, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[4].edge->next->next->vert->vec->x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[4].edge->next->next->vert->vec->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[4].edge->next->next->vert->vec->z, 9.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->faces[4].edge->next->next->next->vert->x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[4].edge->next->next->next->vert->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[4].edge->next->next->next->vert->z, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[4].edge->next->next->next->vert->vec->x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[4].edge->next->next->next->vert->vec->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[4].edge->next->next->next->vert->vec->z, 9.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->faces[4].edge->next->next->next->next->vert->x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[4].edge->next->next->next->next->vert->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[4].edge->next->next->next->next->vert->z, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[4].edge->next->next->next->next->vert->vec->x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[4].edge->next->next->next->next->vert->vec->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[4].edge->next->next->next->next->vert->vec->z, 11.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->faces[5].edge->vert->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[5].edge->vert->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[5].edge->vert->z, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[5].edge->vert->vec->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[5].edge->vert->vec->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[5].edge->vert->vec->z, 9.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->faces[5].edge->next->vert->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[5].edge->next->vert->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[5].edge->next->vert->z, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[5].edge->next->vert->vec->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[5].edge->next->vert->vec->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[5].edge->next->vert->vec->z, 9.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->faces[5].edge->next->next->vert->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[5].edge->next->next->vert->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[5].edge->next->next->vert->z, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[5].edge->next->next->vert->vec->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[5].edge->next->next->vert->vec->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[5].edge->next->next->vert->vec->z, 11.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->faces[5].edge->next->next->next->vert->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[5].edge->next->next->next->vert->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[5].edge->next->next->next->vert->z, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[5].edge->next->next->next->vert->vec->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[5].edge->next->next->next->vert->vec->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[5].edge->next->next->next->vert->vec->z, 11.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->faces[5].edge->next->next->next->next->vert->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[5].edge->next->next->next->next->vert->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[5].edge->next->next->next->next->vert->z, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[5].edge->next->next->next->next->vert->vec->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[5].edge->next->next->next->next->vert->vec->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[5].edge->next->next->next->next->vert->vec->z, 9.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->fc, 6);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->ec, 24);
|
||||
}
|
||||
|
||||
/* TODO: test pair building */
|
||||
/**
|
||||
* Test if the parser correctly ignores comments and other
|
||||
* junk.
|
||||
@ -248,37 +249,37 @@ void test_parse_obj2(void)
|
||||
|
||||
CU_ASSERT_PTR_NOT_NULL(obj);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->vertices[0].x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[0].y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[0].z, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[0].vec->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[0].vec->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[0].vec->z, 11.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->vertices[1].x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[1].y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[1].z, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[1].vec->x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[1].vec->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[1].vec->z, 11.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->vertices[2].x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[2].y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[2].z, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[2].vec->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[2].vec->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[2].vec->z, 11.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->vertices[3].x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[3].y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[3].z, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[3].vec->x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[3].vec->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[3].vec->z, 11.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->vertices[4].x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[4].y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[4].z, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[4].vec->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[4].vec->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[4].vec->z, 9.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->vertices[5].x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[5].y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[5].z, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[5].vec->x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[5].vec->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[5].vec->z, 9.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->vertices[6].x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[6].y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[6].z, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[6].vec->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[6].vec->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[6].vec->z, 9.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->vertices[7].x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[7].y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[7].z, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[7].vec->x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[7].vec->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->vertices[7].vec->z, 9.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->vc, 8);
|
||||
|
||||
@ -286,125 +287,125 @@ void test_parse_obj2(void)
|
||||
* The following relies on faces always saving the
|
||||
* last listed vertice as their edge member.
|
||||
*/
|
||||
CU_ASSERT_EQUAL(obj->faces[0].edge->vert->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[0].edge->vert->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[0].edge->vert->z, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[0].edge->vert->vec->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[0].edge->vert->vec->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[0].edge->vert->vec->z, 11.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->faces[0].edge->next->vert->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[0].edge->next->vert->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[0].edge->next->vert->z, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[0].edge->next->vert->vec->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[0].edge->next->vert->vec->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[0].edge->next->vert->vec->z, 11.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->faces[0].edge->next->next->vert->x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[0].edge->next->next->vert->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[0].edge->next->next->vert->z, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[0].edge->next->next->vert->vec->x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[0].edge->next->next->vert->vec->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[0].edge->next->next->vert->vec->z, 11.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->faces[0].edge->next->next->next->vert->x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[0].edge->next->next->next->vert->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[0].edge->next->next->next->vert->z, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[0].edge->next->next->next->vert->vec->x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[0].edge->next->next->next->vert->vec->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[0].edge->next->next->next->vert->vec->z, 11.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->faces[0].edge->next->next->next->next->vert->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[0].edge->next->next->next->next->vert->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[0].edge->next->next->next->next->vert->z, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[0].edge->next->next->next->next->vert->vec->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[0].edge->next->next->next->next->vert->vec->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[0].edge->next->next->next->next->vert->vec->z, 11.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->faces[1].edge->vert->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[1].edge->vert->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[1].edge->vert->z, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[1].edge->vert->vec->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[1].edge->vert->vec->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[1].edge->vert->vec->z, 9.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->faces[1].edge->next->vert->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[1].edge->next->vert->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[1].edge->next->vert->z, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[1].edge->next->vert->vec->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[1].edge->next->vert->vec->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[1].edge->next->vert->vec->z, 11.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->faces[1].edge->next->next->vert->x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[1].edge->next->next->vert->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[1].edge->next->next->vert->z, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[1].edge->next->next->vert->vec->x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[1].edge->next->next->vert->vec->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[1].edge->next->next->vert->vec->z, 11.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->faces[1].edge->next->next->next->vert->x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[1].edge->next->next->next->vert->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[1].edge->next->next->next->vert->z, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[1].edge->next->next->next->vert->vec->x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[1].edge->next->next->next->vert->vec->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[1].edge->next->next->next->vert->vec->z, 9.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->faces[1].edge->next->next->next->next->vert->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[1].edge->next->next->next->next->vert->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[1].edge->next->next->next->next->vert->z, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[1].edge->next->next->next->next->vert->vec->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[1].edge->next->next->next->next->vert->vec->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[1].edge->next->next->next->next->vert->vec->z, 9.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->faces[2].edge->vert->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[2].edge->vert->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[2].edge->vert->z, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[2].edge->vert->vec->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[2].edge->vert->vec->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[2].edge->vert->vec->z, 9.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->faces[2].edge->next->vert->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[2].edge->next->vert->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[2].edge->next->vert->z, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[2].edge->next->vert->vec->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[2].edge->next->vert->vec->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[2].edge->next->vert->vec->z, 9.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->faces[2].edge->next->next->vert->x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[2].edge->next->next->vert->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[2].edge->next->next->vert->z, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[2].edge->next->next->vert->vec->x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[2].edge->next->next->vert->vec->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[2].edge->next->next->vert->vec->z, 9.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->faces[2].edge->next->next->next->vert->x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[2].edge->next->next->next->vert->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[2].edge->next->next->next->vert->z, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[2].edge->next->next->next->vert->vec->x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[2].edge->next->next->next->vert->vec->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[2].edge->next->next->next->vert->vec->z, 9.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->faces[2].edge->next->next->next->next->vert->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[2].edge->next->next->next->next->vert->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[2].edge->next->next->next->next->vert->z, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[2].edge->next->next->next->next->vert->vec->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[2].edge->next->next->next->next->vert->vec->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[2].edge->next->next->next->next->vert->vec->z, 9.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->faces[3].edge->vert->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[3].edge->vert->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[3].edge->vert->z, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[3].edge->vert->vec->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[3].edge->vert->vec->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[3].edge->vert->vec->z, 11.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->faces[3].edge->next->vert->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[3].edge->next->vert->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[3].edge->next->vert->z, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[3].edge->next->vert->vec->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[3].edge->next->vert->vec->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[3].edge->next->vert->vec->z, 9.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->faces[3].edge->next->next->vert->x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[3].edge->next->next->vert->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[3].edge->next->next->vert->z, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[3].edge->next->next->vert->vec->x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[3].edge->next->next->vert->vec->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[3].edge->next->next->vert->vec->z, 9.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->faces[3].edge->next->next->next->vert->x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[3].edge->next->next->next->vert->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[3].edge->next->next->next->vert->z, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[3].edge->next->next->next->vert->vec->x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[3].edge->next->next->next->vert->vec->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[3].edge->next->next->next->vert->vec->z, 11.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->faces[3].edge->next->next->next->next->vert->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[3].edge->next->next->next->next->vert->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[3].edge->next->next->next->next->vert->z, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[3].edge->next->next->next->next->vert->vec->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[3].edge->next->next->next->next->vert->vec->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[3].edge->next->next->next->next->vert->vec->z, 11.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->faces[4].edge->vert->x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[4].edge->vert->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[4].edge->vert->z, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[4].edge->vert->vec->x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[4].edge->vert->vec->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[4].edge->vert->vec->z, 11.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->faces[4].edge->next->vert->x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[4].edge->next->vert->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[4].edge->next->vert->z, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[4].edge->next->vert->vec->x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[4].edge->next->vert->vec->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[4].edge->next->vert->vec->z, 11.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->faces[4].edge->next->next->vert->x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[4].edge->next->next->vert->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[4].edge->next->next->vert->z, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[4].edge->next->next->vert->vec->x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[4].edge->next->next->vert->vec->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[4].edge->next->next->vert->vec->z, 9.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->faces[4].edge->next->next->next->vert->x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[4].edge->next->next->next->vert->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[4].edge->next->next->next->vert->z, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[4].edge->next->next->next->vert->vec->x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[4].edge->next->next->next->vert->vec->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[4].edge->next->next->next->vert->vec->z, 9.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->faces[4].edge->next->next->next->next->vert->x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[4].edge->next->next->next->next->vert->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[4].edge->next->next->next->next->vert->z, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[4].edge->next->next->next->next->vert->vec->x, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[4].edge->next->next->next->next->vert->vec->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[4].edge->next->next->next->next->vert->vec->z, 11.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->faces[5].edge->vert->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[5].edge->vert->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[5].edge->vert->z, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[5].edge->vert->vec->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[5].edge->vert->vec->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[5].edge->vert->vec->z, 9.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->faces[5].edge->next->vert->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[5].edge->next->vert->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[5].edge->next->vert->z, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[5].edge->next->vert->vec->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[5].edge->next->vert->vec->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[5].edge->next->vert->vec->z, 9.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->faces[5].edge->next->next->vert->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[5].edge->next->next->vert->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[5].edge->next->next->vert->z, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[5].edge->next->next->vert->vec->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[5].edge->next->next->vert->vec->y, 10.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[5].edge->next->next->vert->vec->z, 11.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->faces[5].edge->next->next->next->vert->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[5].edge->next->next->next->vert->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[5].edge->next->next->next->vert->z, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[5].edge->next->next->next->vert->vec->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[5].edge->next->next->next->vert->vec->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[5].edge->next->next->next->vert->vec->z, 11.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->faces[5].edge->next->next->next->next->vert->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[5].edge->next->next->next->next->vert->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[5].edge->next->next->next->next->vert->z, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[5].edge->next->next->next->next->vert->vec->x, 9.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[5].edge->next->next->next->next->vert->vec->y, 11.0);
|
||||
CU_ASSERT_EQUAL(obj->faces[5].edge->next->next->next->next->vert->vec->z, 9.0);
|
||||
|
||||
CU_ASSERT_EQUAL(obj->fc, 6);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user