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

Function NearestPointQueryNearest

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

Source from the content-addressed store, hash-verified

58}
59
60static cpCollisionID
61NearestPointQueryNearest(struct PointQueryContext *context, cpShape *shape, cpCollisionID id, cpPointQueryInfo *out)
62{
63 if(
64 !cpShapeFilterReject(shape->filter, context->filter) && !shape->sensor
65 ){
66 cpPointQueryInfo info;
67 cpShapePointQuery(shape, context->point, &info);
68
69 if(info.distance < out->distance) (*out) = info;
70 }
71
72 return id;
73}
74
75cpShape *
76cpSpacePointQueryNearest(cpSpace *space, cpVect point, cpFloat maxDistance, cpShapeFilter filter, cpPointQueryInfo *out)

Callers

nothing calls this directly

Calls 2

cpShapeFilterRejectFunction · 0.85
cpShapePointQueryFunction · 0.85

Tested by

no test coverage detected