Code: Select all
"Aborting due to Chipmunk error: shape is not a cpSegmentShape
Failed condition: shape->klass == &cpSegmentShapeClass
Source:/tmp/chipmunk-Vz8Z/slembcke-Chipmunk-Physics-14b5a4f/src/cpShape.c:341"
Code: Select all
void graphicsDrawFree(cairo_t* cr, cpShape* shape, gameBody *body)
{
//Get the endpoints of the line -> Throws an assertion if shape is not a segment
cpVect start = cpSegmentShapeGetA(shape);
cpVect end = cpSegmentShapeGetB(shape);
printf("GRAPHICS::GOT SEGMENT ENDS\n");
and after running through GDB, it appears that when this error is called, shape is a (cpShape *). The GDB output is below:
Code: Select all
Aborting due to Chipmunk error: shape is not a cpSegmentShape
Failed condition: shape->klass == &cpSegmentShapeClass
Source:/tmp/chipmunk-Vz8Z/slembcke-Chipmunk-Physics-14b5a4f/src/cpShape.c:341
Program received signal SIGABRT, Aborted.
0x00007fff81ec70b6 in __kill ()
(gdb) bt
#0 0x00007fff81ec70b6 in __kill ()
#1 0x00007fff81f679f6 in abort ()
#2 0x000000010000c5a7 in cpMessage ()
#3 0x0000000100015834 in cpSegmentShapeGetA ()
#4 0x000000010000415c in graphicsDrawFree (cr=0x10400fc00, shape=0x102547dfd, body=0x10254c710) at graphics.c:224
#5 0x0000000100003ac0 in graphicsDisplayBody (surface=0x1025487f0, body=0x10254c710) at graphics.c:97
#6 0x00000001000038ed in graphicsDisplayWorld (surface=0x1025487f0, space=0x1025672a0) at graphics.c:40
#7 0x00000001000027ae in guiDrawWorld (worldDisplay=0x1028c0830) at gui.c:216
#8 0x0000000100002732 in timerCB (worldDisplay=0x1028c0830) at gui.c:175
#9 0x0000000100ad5a6d in g_timeout_dispatch ()
#10 0x0000000100ad4f32 in g_main_context_dispatch ()
#11 0x0000000100ad6982 in g_main_context_iterate ()
#12 0x0000000100ad7ad5 in g_main_loop_run ()
#13 0x000000010014fadd in gtk_main ()
#14 0x00000001000038a4 in main (argc=1, argv=0x7fff5fbff7a8) at gui.c:694
(gdb) up
#1 0x00007fff81f679f6 in abort ()
(gdb) up
#2 0x000000010000c5a7 in cpMessage ()
(gdb) up
#3 0x0000000100015834 in cpSegmentShapeGetA ()
(gdb) up
#4 0x000000010000415c in graphicsDrawFree (cr=0x10400fc00, shape=0x102547dfd, body=0x10254c710) at graphics.c:224
224 cpVect start = cpSegmentShapeGetA(shape);
(gdb) up
#5 0x0000000100003ac0 in graphicsDisplayBody (surface=0x1025487f0, body=0x10254c710) at graphics.c:97
97 graphicsDrawFree(cr, body->arrayOfShapes[i], body);
(gdb) print body->arrayOfShapes[i]
$1 = (cpShape *) 0x102547dfd
(gdb) down
#4 0x000000010000415c in graphicsDrawFree (cr=0x10400fc00, shape=0x102547dfd, body=0x10254c710) at graphics.c:224
224 cpVect start = cpSegmentShapeGetA(shape);
(gdb) print shape
$2 = (cpShape *) 0x102547dfd