[cpp] Skeleton::getBounds() without scratch buffers

This commit is contained in:
Mario Zechner 2025-07-30 00:42:27 +02:00
parent 31652b4022
commit 65f01fefb9
2 changed files with 10 additions and 3 deletions

View File

@ -241,14 +241,20 @@ namespace spine {
return NULL;
}
/// Returns the axis aligned bounding box (AABB) of the region and mesh attachments for the current pose.
/// @param outX The horizontal distance between the skeleton origin and the left side of the AABB.
/// @param outY The vertical distance between the skeleton origin and the bottom side of the AABB.
/// @param outWidth The width of the AABB
/// @param outHeight The height of the AABB.
void getBounds(float &outX, float &outY, float &outWidth, float &outHeight);
/// Returns the axis aligned bounding box (AABB) of the region and mesh attachments for the current pose.
/// @param outX The horizontal distance between the skeleton origin and the left side of the AABB.
/// @param outY The vertical distance between the skeleton origin and the bottom side of the AABB.
/// @param outWidth The width of the AABB
/// @param outHeight The height of the AABB.
/// @param outVertexBuffer Reference to hold an array of floats. This method will assign it with new floats as needed.
// @param clipping Pointer to a SkeletonClipping instance or NULL. If a clipper is given, clipping attachments will be taken into account.
void getBounds(float &outX, float &outY, float &outWidth, float &outHeight, Array<float> &outVertexBuffer);
/// @param clipping Pointer to a SkeletonClipping instance or NULL. If a clipper is given, clipping attachments will be taken into account.
void getBounds(float &outX, float &outY, float &outWidth, float &outHeight, Array<float> &outVertexBuffer, SkeletonClipping *clipper);
Color &getColor();

View File

@ -367,7 +367,8 @@ Array<PhysicsConstraint *> &Skeleton::getPhysicsConstraints() {
return _physics;
}
void Skeleton::getBounds(float &outX, float &outY, float &outWidth, float &outHeight, Array<float> &outVertexBuffer) {
void Skeleton::getBounds(float &outX, float &outY, float &outWidth, float &outHeight) {
Array<float> outVertexBuffer;
getBounds(outX, outY, outWidth, outHeight, outVertexBuffer, NULL);
}