• Runtimes
  • spine c feature request

  • Изменено
Related Discussions
...

Wondering if its possible to add 2 other methods on top of...

spBoundingBoxAttachment* spSkeletonBounds_containsPoint (spSkeletonBounds* self, float x, float y) {
int i;
for (i = 0; i < self->count; ++i)
if (spBoundingPolygon_containsPoint(self->polygons, x, y)) return self->boundingBoxes;
return 0;
}

spBoundingBoxAttachment* spSkeletonBounds_intersectsSegment (spSkeletonBounds* self, float x1, float y1, float x2, float y2) {
int i;
for (i = 0; i < self->count; ++i)
if (spBoundingPolygon_intersectsSegment(self->polygons, x1, y1, x2, y2)) return self->boundingBoxes;
return 0;
}

which returns a array of attachments rather than first it finds, as in some cases i have overlapping attachments.

5 дней спустя

Probably better to write a function to do it yourself, since it is just a couple lines. There are many ways of doing hit detection, swept polygon detection, etc. The functions provided are just a couple basic ones.