@@ -4681,3 +4681,112 @@ void spine_texture_region_set_original_height(spine_texture_region textureRegion
4681
4681
TextureRegion *_region = (TextureRegion *) textureRegion;
4682
4682
_region->originalHeight = originalHeight;
4683
4683
}
4684
+
4685
+ spine_skeleton_bounds spine_skeleton_bounds_create () {
4686
+ return (spine_skeleton_bounds) new (__FILE__, __LINE__) SkeletonBounds ();
4687
+ }
4688
+
4689
+ void spine_skeleton_bounds_dispose (spine_skeleton_bounds bounds) {
4690
+ if (bounds == nullptr ) return ;
4691
+ SkeletonBounds *_bounds = (SkeletonBounds *) bounds;
4692
+ delete _bounds;
4693
+ }
4694
+
4695
+ void spine_skeleton_bounds_update (spine_skeleton_bounds bounds, spine_skeleton skeleton, spine_bool updateAabb) {
4696
+ if (bounds == nullptr ) return ;
4697
+ if (skeleton == nullptr ) return ;
4698
+
4699
+ SkeletonBounds *_bounds = (SkeletonBounds *) bounds;
4700
+ Skeleton *_skeleton = (Skeleton *) skeleton;
4701
+ _bounds->update (*_skeleton, updateAabb != 0 );
4702
+ }
4703
+
4704
+ spine_bool spine_skeleton_bounds_aabb_contains_point (spine_skeleton_bounds bounds, float x, float y) {
4705
+ if (bounds == nullptr ) return false ;
4706
+ return ((SkeletonBounds *) bounds)->aabbcontainsPoint (x, y);
4707
+ }
4708
+
4709
+ spine_bool spine_skeleton_bounds_aabb_intersects_segment (spine_skeleton_bounds bounds, float x1, float y1, float x2, float y2) {
4710
+ if (bounds == nullptr ) return false ;
4711
+ return ((SkeletonBounds *) bounds)->aabbintersectsSegment (x1, y1 , x2, y2);
4712
+ }
4713
+
4714
+ spine_bool spine_skeleton_bounds_aabb_intersects_skeleton (spine_skeleton_bounds bounds, spine_skeleton_bounds otherBounds) {
4715
+ if (bounds == nullptr ) return false ;
4716
+ if (otherBounds == nullptr ) return false ;
4717
+ return ((SkeletonBounds *) bounds)->aabbIntersectsSkeleton (*((SkeletonBounds *) bounds));
4718
+ }
4719
+
4720
+ spine_bool spine_skeleton_bounds_contains_point (spine_skeleton_bounds bounds, spine_polygon polygon, float x, float y) {
4721
+ if (bounds == nullptr ) return false ;
4722
+ if (polygon == nullptr ) return false ;
4723
+ return ((SkeletonBounds *) bounds)->containsPoint ((Polygon *) polygon, x, y);
4724
+ }
4725
+
4726
+ spine_bounding_box_attachment spine_skeleton_bounds_contains_point_attachment (spine_skeleton_bounds bounds, float x, float y) {
4727
+ if (bounds == nullptr ) return nullptr ;
4728
+ return (spine_bounding_box_attachment) ((SkeletonBounds *) bounds)->containsPoint (x, y);
4729
+ }
4730
+
4731
+ spine_bounding_box_attachment spine_skeleton_bounds_intersects_segment_attachment (spine_skeleton_bounds bounds, float x1, float y1, float x2, float y2) {
4732
+ if (bounds == nullptr ) return nullptr ;
4733
+ return (spine_bounding_box_attachment) ((SkeletonBounds *) bounds)->intersectsSegment (x1, y1 , x2, y2);
4734
+ }
4735
+
4736
+ spine_bool spine_skeleton_bounds_intersects_segment (spine_skeleton_bounds bounds, spine_polygon polygon, float x1, float y1, float x2, float y2) {
4737
+ if (bounds == nullptr ) return false ;
4738
+ if (polygon == nullptr ) return false ;
4739
+ return ((SkeletonBounds *) bounds)->intersectsSegment ((Polygon *) polygon, x1, y1 , x2, y2);
4740
+ }
4741
+
4742
+ spine_polygon spine_skeleton_bounds_get_polygon (spine_skeleton_bounds bounds, spine_bounding_box_attachment attachment) {
4743
+ if (bounds == nullptr ) return nullptr ;
4744
+ if (attachment == nullptr ) return nullptr ;
4745
+ return (spine_polygon) ((SkeletonBounds *) bounds)->getPolygon ((BoundingBoxAttachment *) attachment);
4746
+ }
4747
+
4748
+ spine_bounding_box_attachment spine_skeleton_bounds_get_bounding_box (spine_skeleton_bounds bounds, spine_polygon polygon) {
4749
+ if (bounds == nullptr ) return nullptr ;
4750
+ if (polygon == nullptr ) return nullptr ;
4751
+ return (spine_bounding_box_attachment) ((SkeletonBounds *) bounds)->getBoundingBox ((Polygon *) polygon);
4752
+ }
4753
+
4754
+ int32_t spine_skeleton_bounds_get_num_polygons (spine_skeleton_bounds bounds) {
4755
+ if (bounds == nullptr ) return 0 ;
4756
+ return (int32_t ) ((SkeletonBounds *) bounds)->getPolygons ().size ();
4757
+ }
4758
+
4759
+ spine_polygon *spine_skeleton_bounds_get_polygons (spine_skeleton_bounds bounds) {
4760
+ if (bounds == nullptr ) return nullptr ;
4761
+ return (spine_polygon *) ((SkeletonBounds *) bounds)->getPolygons ().buffer ();
4762
+ }
4763
+
4764
+ int32_t spine_skeleton_bounds_get_num_bounding_boxes (spine_skeleton_bounds bounds) {
4765
+ if (bounds == nullptr ) return 0 ;
4766
+ return (int32_t ) ((SkeletonBounds *) bounds)->getBoundingBoxes ().size ();
4767
+ }
4768
+
4769
+ spine_bounding_box_attachment *spine_skeleton_bounds_get_bounding_boxes (spine_skeleton_bounds bounds) {
4770
+ if (bounds == nullptr ) return nullptr ;
4771
+ return (spine_bounding_box_attachment *) ((SkeletonBounds *) bounds)->getBoundingBoxes ().buffer ();
4772
+ }
4773
+
4774
+ float spine_skeleton_bounds_get_width (spine_skeleton_bounds bounds) {
4775
+ if (bounds == nullptr ) return 0 ;
4776
+ return ((SkeletonBounds *) bounds)->getWidth ();
4777
+ }
4778
+
4779
+ float spine_skeleton_bounds_get_height (spine_skeleton_bounds bounds) {
4780
+ if (bounds == nullptr ) return 0 ;
4781
+ return ((SkeletonBounds *) bounds)->getHeight ();
4782
+ }
4783
+
4784
+ int32_t spine_polygon_get_num_vertices (spine_polygon polygon) {
4785
+ if (polygon == nullptr ) return 0 ;
4786
+ return ((Polygon *) polygon)->_vertices .size ();
4787
+ }
4788
+
4789
+ float *spine_polygon_get_vertices (spine_polygon polygon) {
4790
+ if (polygon == nullptr ) return 0 ;
4791
+ return ((Polygon *) polygon)->_vertices .buffer ();
4792
+ }
0 commit comments