MCPcopy Create free account
hub / github.com/axmolengine/axmol / cpSpacePointQuery

Function cpSpacePointQuery

3rdparty/chipmunk/src/cpSpaceQuery.c:48–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46}
47
48void
49cpSpacePointQuery(cpSpace *space, cpVect point, cpFloat maxDistance, cpShapeFilter filter, cpSpacePointQueryFunc func, void *data)
50{
51 struct PointQueryContext context = {point, maxDistance, filter, func};
52 cpBB bb = cpBBNewForCircle(point, cpfmax(maxDistance, 0.0f));
53
54 cpSpaceLock(space); {
55 cpSpatialIndexQuery(space->dynamicShapes, &context, bb, (cpSpatialIndexQueryFunc)NearestPointQuery, data);
56 cpSpatialIndexQuery(space->staticShapes, &context, bb, (cpSpatialIndexQueryFunc)NearestPointQuery, data);
57 } cpSpaceUnlock(space, cpTrue);
58}
59
60static cpCollisionID
61NearestPointQueryNearest(struct PointQueryContext *context, cpShape *shape, cpCollisionID id, cpPointQueryInfo *out)

Callers 3

cpSpacePointQuery_bFunction · 0.85
queryPointMethod · 0.85
getShapesMethod · 0.85

Calls 5

cpBBNewForCircleFunction · 0.85
cpfmaxFunction · 0.85
cpSpaceLockFunction · 0.85
cpSpatialIndexQueryFunction · 0.85
cpSpaceUnlockFunction · 0.85

Tested by

no test coverage detected