mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-22 18:26:12 +08:00
Merge branch '4.1' into 4.2-beta
This commit is contained in:
commit
fc2354dede
@ -88,6 +88,7 @@
|
||||
* Support for `shortestRotation` in animation state. See https://github.com/esotericsoftware/spine-runtimes/issues/2027.
|
||||
* Added CMake parameter `SPINE_SANITIZE` which will enable sanitizers on macOS and Linux.
|
||||
* Added `SPINE_MAJOR_VERSION`, `SPINE_MINOR_VERSION`, and `SPINE_VERSION_STRING`. Parsing skeleton .JSON and .skel files will report an error if the skeleton version does not match the runtime version.
|
||||
* Added `SkeletonBounds::getBoundingBox()`, `SkeletonBounds::getPolygons()`, and `SkeletonBounds::getBoundingBoxes()`.
|
||||
* **Breaking changes**
|
||||
* `RegionAttachment` and `MeshAttachment` no longer implement `HasRendererObject`.
|
||||
* `RegionAttachment` and `MeshAttachment` now contain a `TextureRegion*` instead of encoding region fields directly.
|
||||
|
||||
@ -81,8 +81,19 @@ namespace spine {
|
||||
/// Returns true if the polygon contains 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
|
||||
/// polygon can be found for the attachment. Requires a call to update() first.
|
||||
Polygon *getPolygon(BoundingBoxAttachment *attachment);
|
||||
|
||||
/// Returns the bounding box for the given polygon or null. Requires a call to update() first.
|
||||
BoundingBoxAttachment * getBoundingBox(Polygon *polygon);
|
||||
|
||||
/// Returns all polygons or an empty vector. Requires a call to update() first.
|
||||
Vector<Polygon *> &getPolygons();
|
||||
|
||||
/// Returns all bounding boxes. Requires a call to update() first.
|
||||
Vector<BoundingBoxAttachment *> &getBoundingBoxes();
|
||||
|
||||
float getWidth();
|
||||
|
||||
float getHeight();
|
||||
|
||||
@ -185,6 +185,19 @@ spine::Polygon *SkeletonBounds::getPolygon(BoundingBoxAttachment *attachment) {
|
||||
return index == -1 ? NULL : _polygons[index];
|
||||
}
|
||||
|
||||
BoundingBoxAttachment *SkeletonBounds::getBoundingBox(Polygon *polygon) {
|
||||
int index = _polygons.indexOf(polygon);
|
||||
return index == -1 ? NULL : _boundingBoxes[index];
|
||||
}
|
||||
|
||||
Vector<Polygon *> &SkeletonBounds::getPolygons() {
|
||||
return _polygons;
|
||||
}
|
||||
|
||||
Vector<BoundingBoxAttachment *> &SkeletonBounds::getBoundingBoxes() {
|
||||
return _boundingBoxes;
|
||||
}
|
||||
|
||||
float SkeletonBounds::getWidth() {
|
||||
return _maxX - _minX;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user