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

Function NearestPointQuery

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

Source from the content-addressed store, hash-verified

31};
32
33static cpCollisionID
34NearestPointQuery(struct PointQueryContext *context, cpShape *shape, cpCollisionID id, void *data)
35{
36 if(
37 !cpShapeFilterReject(shape->filter, context->filter)
38 ){
39 cpPointQueryInfo info;
40 cpShapePointQuery(shape, context->point, &info);
41
42 if(info.shape && info.distance < context->maxDistance) context->func(shape, info.point, info.distance, info.gradient, data);
43 }
44
45 return id;
46}
47
48void
49cpSpacePointQuery(cpSpace *space, cpVect point, cpFloat maxDistance, cpShapeFilter filter, cpSpacePointQueryFunc func, void *data)

Callers

nothing calls this directly

Calls 2

cpShapeFilterRejectFunction · 0.85
cpShapePointQueryFunction · 0.85

Tested by

no test coverage detected