I ran into an issue I could not understand but I tried to debug.
Some of the polygons has vertices duplicated at the end of the polygon (the bounding boxes are always ok in the json and in the code). At some place I cant find, vertices were added.
As I cant find why, I looked in the libgdx code and the AS3 code, in the place I think it occurs. In those libs, in SkeletonBounds exists this code, just before computing world vertices for the polygon :
libgdx
int vertexCount = boundingBox.getVertices().length;
polygon.ensureCapacity(vertexCount);
polygon.size = vertexCount;
It solves the problem, I can now draw the polygons as in Spine or SkeletonViewer :)
It was quite hard for me to dive into this so perhaps I've been mistaken somewhere, I don't know. I want to do polygon collision between two FlxSpine objects and wanted to be sure the polygons were right.
From this point I want to loop over the polygons (after done aabb checks for better speed), I'm not sure how to use the built-in methods from SkeletonBounds to achieve this. Can you show me the path ? Thanks.
PS : If needed, I can give you the .json file that has vertices added once used in the runtime and show you where it happens.
Hi,
I ran into an issue I could not understand but I tried to debug. Some of the polygons has vertices duplicated at the end of the polygon (the bounding boxes are always ok in the json and in the code). At some place I cant find, vertices were added.
As I cant find why, I looked in the libgdx code and the AS3 code, in the place I think it occurs. In those libs, in SkeletonBounds exists this code, just before computing world vertices for the polygon :
Perhaps there is a reason why this code is here and it seems to go in my direction. So I inserted this code at line 80 of SkeletonBounds.hx :
It solves the problem, I can now draw the polygons as in Spine or SkeletonViewer :)
It was quite hard for me to dive into this so perhaps I've been mistaken somewhere, I don't know. I want to do polygon collision between two FlxSpine objects and wanted to be sure the polygons were right. From this point I want to loop over the polygons (after done aabb checks for better speed), I'm not sure how to use the built-in methods from SkeletonBounds to achieve this. Can you show me the path ? Thanks.
PS : If needed, I can give you the .json file that has vertices added once used in the runtime and show you where it happens.