Code: Select all
ChipmunkSegmentQueryInfo *info = [mySpace segmentQueryFirstFrom:currPoint to:currTouch layers:CP_ALL_LAYERS group:CP_NO_GROUP];
Any ideas?
Code: Select all
ChipmunkSegmentQueryInfo *info = [mySpace segmentQueryFirstFrom:currPoint to:currTouch layers:CP_ALL_LAYERS group:CP_NO_GROUP];
Code: Select all
- (void)update {
// Step (simulate) the space based on the time since the last update.
cpFloat dt = displayLink.duration*displayLink.frameInterval;
[space step:dt];
// Update the button.
// This sets the position and rotation of the button to match the rigid body.
[fallingButton updatePosition];
ChipmunkSegmentQueryInfo *info = [space segmentQueryFirstFrom:cpv(10.f, 100.f)
to:cpv(310.f, 100.f)
layers:CP_ALL_LAYERS
group:CP_NO_GROUP];
if (info.t<1.f)
NSLog(@"Line crossed");
}
Code: Select all
static void
SubtreeSegmentQuery(Node *subtree, void *obj, cpVect a, cpVect b, cpSpatialIndexSegmentQueryFunc func, void *data)
{
if(cpBBIntersectsSegment(subtree->bb, a, b)){
if(NodeIsLeaf(subtree)){
func(obj, subtree->obj, data); // crashes when it tries to call this function pointer
} else {
SubtreeSegmentQuery(subtree->a, obj, a, b, func, data);
SubtreeSegmentQuery(subtree->b, obj, a, b, func, data);
}
}
}
Code: Select all
0x00008c44 <SubtreeSegmentQuery+444>: ldr r12, [sp, #16] // The register holding the function pointer is loaded here
0x00008c48 <SubtreeSegmentQuery+448>: sub sp, r7, #24 ; 0x18
0x00008c4c <SubtreeSegmentQuery+452>: pop {r8, r10, r11}
0x00008c50 <SubtreeSegmentQuery+456>: pop {r4, r5, r6, r7, lr}
0x00008c54 <SubtreeSegmentQuery+460>: bx r12 // and called here
Users browsing this forum: No registered users and 6 guests