mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-15 19:41:36 +08:00
[cpp] 4.3 porting WIP
This commit is contained in:
parent
98b9a056f3
commit
ede7742c46
@ -59,10 +59,10 @@ namespace spine {
|
||||
void update(Skeleton &skeleton, bool updateAabb);
|
||||
|
||||
/// Returns true if the axis aligned bounding box contains the point.
|
||||
bool aabbcontainsPoint(float x, float y);
|
||||
bool aabbContainsPoint(float x, float y);
|
||||
|
||||
/// Returns true if the axis aligned bounding box intersects the line segment.
|
||||
bool aabbintersectsSegment(float x1, float y1, float x2, float y2);
|
||||
bool aabbIntersectsSegment(float x1, float y1, float x2, float y2);
|
||||
|
||||
/// Returns true if the axis aligned bounding box intersects the axis aligned bounding box of the specified bounds.
|
||||
bool aabbIntersectsSkeleton(SkeletonBounds &bounds);
|
||||
@ -70,15 +70,15 @@ namespace spine {
|
||||
/// Returns true if the polygon contains the point.
|
||||
bool containsPoint(Polygon *polygon, float x, float y);
|
||||
|
||||
/// Returns the first bounding box attachment that contains the point, or NULL. When doing many checks, it is usually more
|
||||
/// efficient to only call this method if {@link #aabbcontainsPoint(float, float)} returns true.
|
||||
/// Returns the first bounding box attachment that contains the point, or null. When doing many checks, it is usually more
|
||||
/// efficient to only call this method if aabbContainsPoint(float, float) returns true.
|
||||
BoundingBoxAttachment *containsPoint(float x, float y);
|
||||
|
||||
/// Returns the first bounding box attachment that contains the line segment, or NULL. When doing many checks, it is usually
|
||||
/// more efficient to only call this method if {@link #aabbintersectsSegment(float, float, float, float)} returns true.
|
||||
/// Returns the first bounding box attachment that contains any part of the line segment, or null. When doing many checks, it
|
||||
/// is usually more efficient to only call this method if aabbIntersectsSegment(float, float, float, float) returns true.
|
||||
BoundingBoxAttachment *intersectsSegment(float x1, float y1, float x2, float y2);
|
||||
|
||||
/// Returns true if the polygon contains the line segment.
|
||||
/// Returns true if the polygon contains any part of the line segment.
|
||||
bool intersectsSegment(Polygon *polygon, float x1, float y1, float x2, float y2);
|
||||
|
||||
/// Returns the polygon for the given bounding box attachment or null if no
|
||||
|
||||
@ -63,7 +63,7 @@ void SkeletonBounds::update(Skeleton &skeleton, bool updateAabb) {
|
||||
Slot *slot = slots[i];
|
||||
if (!slot->getBone().isActive()) continue;
|
||||
|
||||
Attachment *attachment = slot->getAttachment();
|
||||
Attachment *attachment = slot->getAppliedPose().getAttachment();
|
||||
if (attachment == NULL || !attachment->getRTTI().instanceOf(BoundingBoxAttachment::rtti)) continue;
|
||||
BoundingBoxAttachment *boundingBox = static_cast<BoundingBoxAttachment *>(attachment);
|
||||
_boundingBoxes.add(boundingBox);
|
||||
@ -78,7 +78,7 @@ void SkeletonBounds::update(Skeleton &skeleton, bool updateAabb) {
|
||||
if (polygon._vertices.size() < count) {
|
||||
polygon._vertices.setSize(count, 0);
|
||||
}
|
||||
boundingBox->computeWorldVertices(*slot, polygon._vertices);
|
||||
boundingBox->computeWorldVertices(skeleton, *slot, 0, count, polygon._vertices, 0, 2);
|
||||
}
|
||||
|
||||
if (updateAabb)
|
||||
@ -91,11 +91,11 @@ void SkeletonBounds::update(Skeleton &skeleton, bool updateAabb) {
|
||||
}
|
||||
}
|
||||
|
||||
bool SkeletonBounds::aabbcontainsPoint(float x, float y) {
|
||||
bool SkeletonBounds::aabbContainsPoint(float x, float y) {
|
||||
return x >= _minX && x <= _maxX && y >= _minY && y <= _maxY;
|
||||
}
|
||||
|
||||
bool SkeletonBounds::aabbintersectsSegment(float x1, float y1, float x2, float y2) {
|
||||
bool SkeletonBounds::aabbIntersectsSegment(float x1, float y1, float x2, float y2) {
|
||||
float minX = _minX;
|
||||
float minY = _minY;
|
||||
float maxX = _maxX;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user