box2d-bindings 0.1.1-x86_64-darwin → 0.1.2-x86_64-darwin
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/ChangeLog +4 -0
- data/README.md +1 -1
- data/lib/box2d_base.rb +1 -1
- data/lib/box2d_collision.rb +110 -37
- data/lib/box2d_main.rb +10 -8
- data/lib/box2d_math_functions.rb +18 -0
- data/lib/box2d_math_inline_functions.rb +5 -1
- data/lib/box2d_types.rb +104 -107
- data/lib/libbox2d.x86_64.dylib +0 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2b65c081606773daefdae56b9dfb025cff5112538d27502f145f780a168d92d4
|
4
|
+
data.tar.gz: 9ff0ed5eff35614b2cb2c0a1dbf722718c468886c807951d3121afebbe724b44
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8c7a18c7f22f315283804c37a8f42ffc422f52c574e37c306d090594b3351a9fb57d3b82c063f55f26bd94e529d19aff15d752072a7bc3da3dc5cfafa8c8e06d
|
7
|
+
data.tar.gz: 763a3945c959fb676a15004a9acff228b83124571e082f28c6dc860ac7d7dab5341fc49d3eb18a20f385536ec290d7bf56e4e4d06309ba7486a34bc5ac83f06b
|
data/ChangeLog
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
2025-05-11 vaiorabbit <http://twitter.com/vaiorabbit>
|
2
|
+
|
3
|
+
* https://github.com/erincatto/box2d/commit/2d088533b921e912c18c654f8b46c43e04ad0ca8
|
4
|
+
|
1
5
|
2025-02-01 vaiorabbit <http://twitter.com/vaiorabbit>
|
2
6
|
|
3
7
|
* https://github.com/erincatto/box2d/commit/28adacf82377d4113f2ed00586141463244b9d10
|
data/README.md
CHANGED
data/lib/box2d_base.rb
CHANGED
@@ -52,8 +52,8 @@ module Box2D
|
|
52
52
|
[:SetAllocator, :b2SetAllocator, [:pointer, :pointer], :void],
|
53
53
|
[:GetByteCount, :b2GetByteCount, [], :int],
|
54
54
|
[:SetAssertFcn, :b2SetAssertFcn, [:pointer], :void],
|
55
|
-
[:InternalAssertFcn, :b2InternalAssertFcn, [:pointer, :pointer, :int], :int],
|
56
55
|
[:GetVersion, :b2GetVersion, [], Version.by_value],
|
56
|
+
[:InternalAssertFcn, :b2InternalAssertFcn, [:pointer, :pointer, :int], :int],
|
57
57
|
[:GetTicks, :b2GetTicks, [], :ulong_long],
|
58
58
|
[:GetMilliseconds, :b2GetMilliseconds, [:ulong_long], :float],
|
59
59
|
[:GetMillisecondsAndReset, :b2GetMillisecondsAndReset, [:pointer], :float],
|
data/lib/box2d_collision.rb
CHANGED
@@ -141,13 +141,11 @@ module Box2D
|
|
141
141
|
end
|
142
142
|
end
|
143
143
|
|
144
|
-
class
|
144
|
+
class ShapeProxy < FFI::Struct
|
145
145
|
layout(
|
146
146
|
:points, [Vec2, 8],
|
147
147
|
:count, :int,
|
148
148
|
:radius, :float,
|
149
|
-
:translation, Vec2,
|
150
|
-
:maxFraction, :float,
|
151
149
|
)
|
152
150
|
def points = self[:points]
|
153
151
|
def points=(v) self[:points] = v end
|
@@ -155,17 +153,36 @@ module Box2D
|
|
155
153
|
def count=(v) self[:count] = v end
|
156
154
|
def radius = self[:radius]
|
157
155
|
def radius=(v) self[:radius] = v end
|
156
|
+
def self.create_as(_points_, _count_, _radius_)
|
157
|
+
instance = ShapeProxy.new
|
158
|
+
instance[:points] = _points_
|
159
|
+
instance[:count] = _count_
|
160
|
+
instance[:radius] = _radius_
|
161
|
+
instance
|
162
|
+
end
|
163
|
+
end
|
164
|
+
|
165
|
+
class ShapeCastInput < FFI::Struct
|
166
|
+
layout(
|
167
|
+
:proxy, ShapeProxy,
|
168
|
+
:translation, Vec2,
|
169
|
+
:maxFraction, :float,
|
170
|
+
:canEncroach, :bool,
|
171
|
+
)
|
172
|
+
def proxy = self[:proxy]
|
173
|
+
def proxy=(v) self[:proxy] = v end
|
158
174
|
def translation = self[:translation]
|
159
175
|
def translation=(v) self[:translation] = v end
|
160
176
|
def maxFraction = self[:maxFraction]
|
161
177
|
def maxFraction=(v) self[:maxFraction] = v end
|
162
|
-
def
|
178
|
+
def canEncroach = self[:canEncroach]
|
179
|
+
def canEncroach=(v) self[:canEncroach] = v end
|
180
|
+
def self.create_as(_proxy_, _translation_, _maxFraction_, _canEncroach_)
|
163
181
|
instance = ShapeCastInput.new
|
164
|
-
instance[:
|
165
|
-
instance[:count] = _count_
|
166
|
-
instance[:radius] = _radius_
|
182
|
+
instance[:proxy] = _proxy_
|
167
183
|
instance[:translation] = _translation_
|
168
184
|
instance[:maxFraction] = _maxFraction_
|
185
|
+
instance[:canEncroach] = _canEncroach_
|
169
186
|
instance
|
170
187
|
end
|
171
188
|
end
|
@@ -358,27 +375,6 @@ module Box2D
|
|
358
375
|
end
|
359
376
|
end
|
360
377
|
|
361
|
-
class ShapeProxy < FFI::Struct
|
362
|
-
layout(
|
363
|
-
:points, [Vec2, 8],
|
364
|
-
:count, :int,
|
365
|
-
:radius, :float,
|
366
|
-
)
|
367
|
-
def points = self[:points]
|
368
|
-
def points=(v) self[:points] = v end
|
369
|
-
def count = self[:count]
|
370
|
-
def count=(v) self[:count] = v end
|
371
|
-
def radius = self[:radius]
|
372
|
-
def radius=(v) self[:radius] = v end
|
373
|
-
def self.create_as(_points_, _count_, _radius_)
|
374
|
-
instance = ShapeProxy.new
|
375
|
-
instance[:points] = _points_
|
376
|
-
instance[:count] = _count_
|
377
|
-
instance[:radius] = _radius_
|
378
|
-
instance
|
379
|
-
end
|
380
|
-
end
|
381
|
-
|
382
378
|
class DistanceInput < FFI::Struct
|
383
379
|
layout(
|
384
380
|
:proxyA, ShapeProxy,
|
@@ -412,6 +408,7 @@ module Box2D
|
|
412
408
|
layout(
|
413
409
|
:pointA, Vec2,
|
414
410
|
:pointB, Vec2,
|
411
|
+
:normal, Vec2,
|
415
412
|
:distance, :float,
|
416
413
|
:iterations, :int,
|
417
414
|
:simplexCount, :int,
|
@@ -420,16 +417,19 @@ module Box2D
|
|
420
417
|
def pointA=(v) self[:pointA] = v end
|
421
418
|
def pointB = self[:pointB]
|
422
419
|
def pointB=(v) self[:pointB] = v end
|
420
|
+
def normal = self[:normal]
|
421
|
+
def normal=(v) self[:normal] = v end
|
423
422
|
def distance = self[:distance]
|
424
423
|
def distance=(v) self[:distance] = v end
|
425
424
|
def iterations = self[:iterations]
|
426
425
|
def iterations=(v) self[:iterations] = v end
|
427
426
|
def simplexCount = self[:simplexCount]
|
428
427
|
def simplexCount=(v) self[:simplexCount] = v end
|
429
|
-
def self.create_as(_pointA_, _pointB_, _distance_, _iterations_, _simplexCount_)
|
428
|
+
def self.create_as(_pointA_, _pointB_, _normal_, _distance_, _iterations_, _simplexCount_)
|
430
429
|
instance = DistanceOutput.new
|
431
430
|
instance[:pointA] = _pointA_
|
432
431
|
instance[:pointB] = _pointB_
|
432
|
+
instance[:normal] = _normal_
|
433
433
|
instance[:distance] = _distance_
|
434
434
|
instance[:iterations] = _iterations_
|
435
435
|
instance[:simplexCount] = _simplexCount_
|
@@ -503,6 +503,7 @@ module Box2D
|
|
503
503
|
:transformB, Transform,
|
504
504
|
:translationB, Vec2,
|
505
505
|
:maxFraction, :float,
|
506
|
+
:canEncroach, :bool,
|
506
507
|
)
|
507
508
|
def proxyA = self[:proxyA]
|
508
509
|
def proxyA=(v) self[:proxyA] = v end
|
@@ -516,7 +517,9 @@ module Box2D
|
|
516
517
|
def translationB=(v) self[:translationB] = v end
|
517
518
|
def maxFraction = self[:maxFraction]
|
518
519
|
def maxFraction=(v) self[:maxFraction] = v end
|
519
|
-
def
|
520
|
+
def canEncroach = self[:canEncroach]
|
521
|
+
def canEncroach=(v) self[:canEncroach] = v end
|
522
|
+
def self.create_as(_proxyA_, _proxyB_, _transformA_, _transformB_, _translationB_, _maxFraction_, _canEncroach_)
|
520
523
|
instance = ShapeCastPairInput.new
|
521
524
|
instance[:proxyA] = _proxyA_
|
522
525
|
instance[:proxyB] = _proxyB_
|
@@ -524,6 +527,7 @@ module Box2D
|
|
524
527
|
instance[:transformB] = _transformB_
|
525
528
|
instance[:translationB] = _translationB_
|
526
529
|
instance[:maxFraction] = _maxFraction_
|
530
|
+
instance[:canEncroach] = _canEncroach_
|
527
531
|
instance
|
528
532
|
end
|
529
533
|
end
|
@@ -611,7 +615,7 @@ module Box2D
|
|
611
615
|
:separation, :float,
|
612
616
|
:normalImpulse, :float,
|
613
617
|
:tangentImpulse, :float,
|
614
|
-
:
|
618
|
+
:totalNormalImpulse, :float,
|
615
619
|
:normalVelocity, :float,
|
616
620
|
:id, :ushort,
|
617
621
|
:persisted, :bool,
|
@@ -628,15 +632,15 @@ module Box2D
|
|
628
632
|
def normalImpulse=(v) self[:normalImpulse] = v end
|
629
633
|
def tangentImpulse = self[:tangentImpulse]
|
630
634
|
def tangentImpulse=(v) self[:tangentImpulse] = v end
|
631
|
-
def
|
632
|
-
def
|
635
|
+
def totalNormalImpulse = self[:totalNormalImpulse]
|
636
|
+
def totalNormalImpulse=(v) self[:totalNormalImpulse] = v end
|
633
637
|
def normalVelocity = self[:normalVelocity]
|
634
638
|
def normalVelocity=(v) self[:normalVelocity] = v end
|
635
639
|
def id = self[:id]
|
636
640
|
def id=(v) self[:id] = v end
|
637
641
|
def persisted = self[:persisted]
|
638
642
|
def persisted=(v) self[:persisted] = v end
|
639
|
-
def self.create_as(_point_, _anchorA_, _anchorB_, _separation_, _normalImpulse_, _tangentImpulse_,
|
643
|
+
def self.create_as(_point_, _anchorA_, _anchorB_, _separation_, _normalImpulse_, _tangentImpulse_, _totalNormalImpulse_, _normalVelocity_, _id_, _persisted_)
|
640
644
|
instance = ManifoldPoint.new
|
641
645
|
instance[:point] = _point_
|
642
646
|
instance[:anchorA] = _anchorA_
|
@@ -644,7 +648,7 @@ module Box2D
|
|
644
648
|
instance[:separation] = _separation_
|
645
649
|
instance[:normalImpulse] = _normalImpulse_
|
646
650
|
instance[:tangentImpulse] = _tangentImpulse_
|
647
|
-
instance[:
|
651
|
+
instance[:totalNormalImpulse] = _totalNormalImpulse_
|
648
652
|
instance[:normalVelocity] = _normalVelocity_
|
649
653
|
instance[:id] = _id_
|
650
654
|
instance[:persisted] = _persisted_
|
@@ -747,6 +751,69 @@ module Box2D
|
|
747
751
|
end
|
748
752
|
end
|
749
753
|
|
754
|
+
class PlaneResult < FFI::Struct
|
755
|
+
layout(
|
756
|
+
:plane, Plane,
|
757
|
+
:point, Vec2,
|
758
|
+
:hit, :bool,
|
759
|
+
)
|
760
|
+
def plane = self[:plane]
|
761
|
+
def plane=(v) self[:plane] = v end
|
762
|
+
def point = self[:point]
|
763
|
+
def point=(v) self[:point] = v end
|
764
|
+
def hit = self[:hit]
|
765
|
+
def hit=(v) self[:hit] = v end
|
766
|
+
def self.create_as(_plane_, _point_, _hit_)
|
767
|
+
instance = PlaneResult.new
|
768
|
+
instance[:plane] = _plane_
|
769
|
+
instance[:point] = _point_
|
770
|
+
instance[:hit] = _hit_
|
771
|
+
instance
|
772
|
+
end
|
773
|
+
end
|
774
|
+
|
775
|
+
class CollisionPlane < FFI::Struct
|
776
|
+
layout(
|
777
|
+
:plane, Plane,
|
778
|
+
:pushLimit, :float,
|
779
|
+
:push, :float,
|
780
|
+
:clipVelocity, :bool,
|
781
|
+
)
|
782
|
+
def plane = self[:plane]
|
783
|
+
def plane=(v) self[:plane] = v end
|
784
|
+
def pushLimit = self[:pushLimit]
|
785
|
+
def pushLimit=(v) self[:pushLimit] = v end
|
786
|
+
def push = self[:push]
|
787
|
+
def push=(v) self[:push] = v end
|
788
|
+
def clipVelocity = self[:clipVelocity]
|
789
|
+
def clipVelocity=(v) self[:clipVelocity] = v end
|
790
|
+
def self.create_as(_plane_, _pushLimit_, _push_, _clipVelocity_)
|
791
|
+
instance = CollisionPlane.new
|
792
|
+
instance[:plane] = _plane_
|
793
|
+
instance[:pushLimit] = _pushLimit_
|
794
|
+
instance[:push] = _push_
|
795
|
+
instance[:clipVelocity] = _clipVelocity_
|
796
|
+
instance
|
797
|
+
end
|
798
|
+
end
|
799
|
+
|
800
|
+
class PlaneSolverResult < FFI::Struct
|
801
|
+
layout(
|
802
|
+
:position, Vec2,
|
803
|
+
:iterationCount, :int,
|
804
|
+
)
|
805
|
+
def position = self[:position]
|
806
|
+
def position=(v) self[:position] = v end
|
807
|
+
def iterationCount = self[:iterationCount]
|
808
|
+
def iterationCount=(v) self[:iterationCount] = v end
|
809
|
+
def self.create_as(_position_, _iterationCount_)
|
810
|
+
instance = PlaneSolverResult.new
|
811
|
+
instance[:position] = _position_
|
812
|
+
instance[:iterationCount] = _iterationCount_
|
813
|
+
instance
|
814
|
+
end
|
815
|
+
end
|
816
|
+
|
750
817
|
|
751
818
|
# Function
|
752
819
|
|
@@ -786,6 +853,7 @@ module Box2D
|
|
786
853
|
[:ShapeDistance, :b2ShapeDistance, [:pointer, :pointer, :pointer, :int], DistanceOutput.by_value],
|
787
854
|
[:ShapeCast, :b2ShapeCast, [:pointer], CastOutput.by_value],
|
788
855
|
[:MakeProxy, :b2MakeProxy, [:pointer, :int, :float], ShapeProxy.by_value],
|
856
|
+
[:MakeOffsetProxy, :b2MakeOffsetProxy, [:pointer, :int, :float, Vec2.by_value, Rot.by_value], ShapeProxy.by_value],
|
789
857
|
[:GetSweepTransform, :b2GetSweepTransform, [:pointer, :float], Transform.by_value],
|
790
858
|
[:TimeOfImpact, :b2TimeOfImpact, [:pointer], TOIOutput.by_value],
|
791
859
|
[:CollideCircles, :b2CollideCircles, [:pointer, Transform.by_value, :pointer, Transform.by_value], Manifold.by_value],
|
@@ -802,22 +870,27 @@ module Box2D
|
|
802
870
|
[:CollideChainSegmentAndPolygon, :b2CollideChainSegmentAndPolygon, [:pointer, Transform.by_value, :pointer, Transform.by_value, :pointer], Manifold.by_value],
|
803
871
|
[:DynamicTree_Create, :b2DynamicTree_Create, [], DynamicTree.by_value],
|
804
872
|
[:DynamicTree_Destroy, :b2DynamicTree_Destroy, [:pointer], :void],
|
805
|
-
[:DynamicTree_CreateProxy, :b2DynamicTree_CreateProxy, [:pointer, AABB.by_value, :ulong_long, :
|
873
|
+
[:DynamicTree_CreateProxy, :b2DynamicTree_CreateProxy, [:pointer, AABB.by_value, :ulong_long, :ulong_long], :int],
|
806
874
|
[:DynamicTree_DestroyProxy, :b2DynamicTree_DestroyProxy, [:pointer, :int], :void],
|
807
875
|
[:DynamicTree_MoveProxy, :b2DynamicTree_MoveProxy, [:pointer, :int, AABB.by_value], :void],
|
808
876
|
[:DynamicTree_EnlargeProxy, :b2DynamicTree_EnlargeProxy, [:pointer, :int, AABB.by_value], :void],
|
877
|
+
[:DynamicTree_SetCategoryBits, :b2DynamicTree_SetCategoryBits, [:pointer, :int, :ulong_long], :void],
|
878
|
+
[:DynamicTree_GetCategoryBits, :b2DynamicTree_GetCategoryBits, [:pointer, :int], :ulong_long],
|
809
879
|
[:DynamicTree_Query, :b2DynamicTree_Query, [:pointer, AABB.by_value, :ulong_long, :pointer, :pointer], TreeStats.by_value],
|
810
880
|
[:DynamicTree_RayCast, :b2DynamicTree_RayCast, [:pointer, :pointer, :ulong_long, :pointer, :pointer], TreeStats.by_value],
|
811
881
|
[:DynamicTree_ShapeCast, :b2DynamicTree_ShapeCast, [:pointer, :pointer, :ulong_long, :pointer, :pointer], TreeStats.by_value],
|
812
882
|
[:DynamicTree_GetHeight, :b2DynamicTree_GetHeight, [:pointer], :int],
|
813
883
|
[:DynamicTree_GetAreaRatio, :b2DynamicTree_GetAreaRatio, [:pointer], :float],
|
884
|
+
[:DynamicTree_GetRootBounds, :b2DynamicTree_GetRootBounds, [:pointer], AABB.by_value],
|
814
885
|
[:DynamicTree_GetProxyCount, :b2DynamicTree_GetProxyCount, [:pointer], :int],
|
815
886
|
[:DynamicTree_Rebuild, :b2DynamicTree_Rebuild, [:pointer, :bool], :int],
|
816
887
|
[:DynamicTree_GetByteCount, :b2DynamicTree_GetByteCount, [:pointer], :int],
|
817
|
-
[:DynamicTree_GetUserData, :b2DynamicTree_GetUserData, [:pointer, :int], :
|
888
|
+
[:DynamicTree_GetUserData, :b2DynamicTree_GetUserData, [:pointer, :int], :ulong_long],
|
818
889
|
[:DynamicTree_GetAABB, :b2DynamicTree_GetAABB, [:pointer, :int], AABB.by_value],
|
819
890
|
[:DynamicTree_Validate, :b2DynamicTree_Validate, [:pointer], :void],
|
820
891
|
[:DynamicTree_ValidateNoEnlarged, :b2DynamicTree_ValidateNoEnlarged, [:pointer], :void],
|
892
|
+
[:SolvePlanes, :b2SolvePlanes, [Vec2.by_value, :pointer, :int], PlaneSolverResult.by_value],
|
893
|
+
[:ClipVector, :b2ClipVector, [Vec2.by_value, :pointer, :int], Vec2.by_value],
|
821
894
|
]
|
822
895
|
entries.each do |entry|
|
823
896
|
api_name = if method_naming == :snake_case
|
data/lib/box2d_main.rb
CHANGED
@@ -33,15 +33,12 @@ module Box2D
|
|
33
33
|
[:World_GetSensorEvents, :b2World_GetSensorEvents, [WorldId.by_value], SensorEvents.by_value],
|
34
34
|
[:World_GetContactEvents, :b2World_GetContactEvents, [WorldId.by_value], ContactEvents.by_value],
|
35
35
|
[:World_OverlapAABB, :b2World_OverlapAABB, [WorldId.by_value, AABB.by_value, QueryFilter.by_value, :pointer, :pointer], TreeStats.by_value],
|
36
|
-
[:
|
37
|
-
[:World_OverlapCircle, :b2World_OverlapCircle, [WorldId.by_value, :pointer, Transform.by_value, QueryFilter.by_value, :pointer, :pointer], TreeStats.by_value],
|
38
|
-
[:World_OverlapCapsule, :b2World_OverlapCapsule, [WorldId.by_value, :pointer, Transform.by_value, QueryFilter.by_value, :pointer, :pointer], TreeStats.by_value],
|
39
|
-
[:World_OverlapPolygon, :b2World_OverlapPolygon, [WorldId.by_value, :pointer, Transform.by_value, QueryFilter.by_value, :pointer, :pointer], TreeStats.by_value],
|
36
|
+
[:World_OverlapShape, :b2World_OverlapShape, [WorldId.by_value, :pointer, QueryFilter.by_value, :pointer, :pointer], TreeStats.by_value],
|
40
37
|
[:World_CastRay, :b2World_CastRay, [WorldId.by_value, Vec2.by_value, Vec2.by_value, QueryFilter.by_value, :pointer, :pointer], TreeStats.by_value],
|
41
38
|
[:World_CastRayClosest, :b2World_CastRayClosest, [WorldId.by_value, Vec2.by_value, Vec2.by_value, QueryFilter.by_value], RayResult.by_value],
|
42
|
-
[:
|
43
|
-
[:
|
44
|
-
[:
|
39
|
+
[:World_CastShape, :b2World_CastShape, [WorldId.by_value, :pointer, Vec2.by_value, QueryFilter.by_value, :pointer, :pointer], TreeStats.by_value],
|
40
|
+
[:World_CastMover, :b2World_CastMover, [WorldId.by_value, :pointer, Vec2.by_value, QueryFilter.by_value], :float],
|
41
|
+
[:World_CollideMover, :b2World_CollideMover, [WorldId.by_value, :pointer, QueryFilter.by_value, :pointer, :pointer], :void],
|
45
42
|
[:World_EnableSleeping, :b2World_EnableSleeping, [WorldId.by_value, :bool], :void],
|
46
43
|
[:World_IsSleepingEnabled, :b2World_IsSleepingEnabled, [WorldId.by_value], :bool],
|
47
44
|
[:World_EnableContinuous, :b2World_EnableContinuous, [WorldId.by_value, :bool], :void],
|
@@ -92,6 +89,7 @@ module Box2D
|
|
92
89
|
[:Body_GetAngularVelocity, :b2Body_GetAngularVelocity, [BodyId.by_value], :float],
|
93
90
|
[:Body_SetLinearVelocity, :b2Body_SetLinearVelocity, [BodyId.by_value, Vec2.by_value], :void],
|
94
91
|
[:Body_SetAngularVelocity, :b2Body_SetAngularVelocity, [BodyId.by_value, :float], :void],
|
92
|
+
[:Body_SetTargetTransform, :b2Body_SetTargetTransform, [BodyId.by_value, Transform.by_value, :float], :void],
|
95
93
|
[:Body_GetLocalPointVelocity, :b2Body_GetLocalPointVelocity, [BodyId.by_value, Vec2.by_value], Vec2.by_value],
|
96
94
|
[:Body_GetWorldPointVelocity, :b2Body_GetWorldPointVelocity, [BodyId.by_value, Vec2.by_value], Vec2.by_value],
|
97
95
|
[:Body_ApplyForce, :b2Body_ApplyForce, [BodyId.by_value, Vec2.by_value, Vec2.by_value, :bool], :void],
|
@@ -156,8 +154,12 @@ module Box2D
|
|
156
154
|
[:Shape_GetRestitution, :b2Shape_GetRestitution, [ShapeId.by_value], :float],
|
157
155
|
[:Shape_SetMaterial, :b2Shape_SetMaterial, [ShapeId.by_value, :int], :void],
|
158
156
|
[:Shape_GetMaterial, :b2Shape_GetMaterial, [ShapeId.by_value], :int],
|
157
|
+
[:Shape_GetSurfaceMaterial, :b2Shape_GetSurfaceMaterial, [ShapeId.by_value], SurfaceMaterial.by_value],
|
158
|
+
[:Shape_SetSurfaceMaterial, :b2Shape_SetSurfaceMaterial, [ShapeId.by_value, SurfaceMaterial.by_value], :void],
|
159
159
|
[:Shape_GetFilter, :b2Shape_GetFilter, [ShapeId.by_value], Filter.by_value],
|
160
160
|
[:Shape_SetFilter, :b2Shape_SetFilter, [ShapeId.by_value, Filter.by_value], :void],
|
161
|
+
[:Shape_EnableSensorEvents, :b2Shape_EnableSensorEvents, [ShapeId.by_value, :bool], :void],
|
162
|
+
[:Shape_AreSensorEventsEnabled, :b2Shape_AreSensorEventsEnabled, [ShapeId.by_value], :bool],
|
161
163
|
[:Shape_EnableContactEvents, :b2Shape_EnableContactEvents, [ShapeId.by_value, :bool], :void],
|
162
164
|
[:Shape_AreContactEventsEnabled, :b2Shape_AreContactEventsEnabled, [ShapeId.by_value], :bool],
|
163
165
|
[:Shape_EnablePreSolveEvents, :b2Shape_EnablePreSolveEvents, [ShapeId.by_value, :bool], :void],
|
@@ -252,7 +254,7 @@ module Box2D
|
|
252
254
|
[:MouseJoint_GetSpringDampingRatio, :b2MouseJoint_GetSpringDampingRatio, [JointId.by_value], :float],
|
253
255
|
[:MouseJoint_SetMaxForce, :b2MouseJoint_SetMaxForce, [JointId.by_value, :float], :void],
|
254
256
|
[:MouseJoint_GetMaxForce, :b2MouseJoint_GetMaxForce, [JointId.by_value], :float],
|
255
|
-
[:
|
257
|
+
[:CreateFilterJoint, :b2CreateFilterJoint, [WorldId.by_value, :pointer], JointId.by_value],
|
256
258
|
[:CreatePrismaticJoint, :b2CreatePrismaticJoint, [WorldId.by_value, :pointer], JointId.by_value],
|
257
259
|
[:PrismaticJoint_EnableSpring, :b2PrismaticJoint_EnableSpring, [JointId.by_value, :bool], :void],
|
258
260
|
[:PrismaticJoint_IsSpringEnabled, :b2PrismaticJoint_IsSpringEnabled, [JointId.by_value], :bool],
|
data/lib/box2d_math_functions.rb
CHANGED
@@ -121,6 +121,23 @@ module Box2D
|
|
121
121
|
end
|
122
122
|
end
|
123
123
|
|
124
|
+
class Plane < FFI::Struct
|
125
|
+
layout(
|
126
|
+
:normal, Vec2,
|
127
|
+
:offset, :float,
|
128
|
+
)
|
129
|
+
def normal = self[:normal]
|
130
|
+
def normal=(v) self[:normal] = v end
|
131
|
+
def offset = self[:offset]
|
132
|
+
def offset=(v) self[:offset] = v end
|
133
|
+
def self.create_as(_normal_, _offset_)
|
134
|
+
instance = Plane.new
|
135
|
+
instance[:normal] = _normal_
|
136
|
+
instance[:offset] = _offset_
|
137
|
+
instance
|
138
|
+
end
|
139
|
+
end
|
140
|
+
|
124
141
|
|
125
142
|
# Function
|
126
143
|
|
@@ -133,6 +150,7 @@ module Box2D
|
|
133
150
|
[:IsValidVec2, :b2IsValidVec2, [Vec2.by_value], :bool],
|
134
151
|
[:IsValidRotation, :b2IsValidRotation, [Rot.by_value], :bool],
|
135
152
|
[:IsValidAABB, :b2IsValidAABB, [AABB.by_value], :bool],
|
153
|
+
[:IsValidPlane, :b2IsValidPlane, [Plane.by_value], :bool],
|
136
154
|
[:SetLengthUnitsPerMeter, :b2SetLengthUnitsPerMeter, [:float], :void],
|
137
155
|
[:GetLengthUnitsPerMeter, :b2GetLengthUnitsPerMeter, [], :float],
|
138
156
|
]
|
@@ -53,13 +53,14 @@ module Box2D
|
|
53
53
|
[:Length, :b2Length, [Vec2.by_value], :float],
|
54
54
|
[:Distance, :b2Distance, [Vec2.by_value, Vec2.by_value], :float],
|
55
55
|
[:Normalize, :b2Normalize, [Vec2.by_value], Vec2.by_value],
|
56
|
+
[:IsNormalized, :b2IsNormalized, [Vec2.by_value], :bool],
|
56
57
|
[:GetLengthAndNormalize, :b2GetLengthAndNormalize, [:pointer, Vec2.by_value], Vec2.by_value],
|
57
58
|
[:NormalizeRot, :b2NormalizeRot, [Rot.by_value], Rot.by_value],
|
58
59
|
[:IntegrateRotation, :b2IntegrateRotation, [Rot.by_value, :float], Rot.by_value],
|
59
60
|
[:LengthSquared, :b2LengthSquared, [Vec2.by_value], :float],
|
60
61
|
[:DistanceSquared, :b2DistanceSquared, [Vec2.by_value, Vec2.by_value], :float],
|
61
62
|
[:MakeRot, :b2MakeRot, [:float], Rot.by_value],
|
62
|
-
[:
|
63
|
+
[:IsNormalizedRot, :b2IsNormalizedRot, [Rot.by_value], :bool],
|
63
64
|
[:NLerp, :b2NLerp, [Rot.by_value, Rot.by_value, :float], Rot.by_value],
|
64
65
|
[:ComputeAngularVelocity, :b2ComputeAngularVelocity, [Rot.by_value, Rot.by_value, :float], :float],
|
65
66
|
[:Rot_GetAngle, :b2Rot_GetAngle, [Rot.by_value], :float],
|
@@ -83,6 +84,9 @@ module Box2D
|
|
83
84
|
[:AABB_Center, :b2AABB_Center, [AABB.by_value], Vec2.by_value],
|
84
85
|
[:AABB_Extents, :b2AABB_Extents, [AABB.by_value], Vec2.by_value],
|
85
86
|
[:AABB_Union, :b2AABB_Union, [AABB.by_value, AABB.by_value], AABB.by_value],
|
87
|
+
[:AABB_Overlaps, :b2AABB_Overlaps, [AABB.by_value, AABB.by_value], :bool],
|
88
|
+
[:MakeAABB, :b2MakeAABB, [:pointer, :int, :float], AABB.by_value],
|
89
|
+
[:PlaneSeparation, :b2PlaneSeparation, [Plane.by_value, Vec2.by_value], :float],
|
86
90
|
]
|
87
91
|
entries.each do |entry|
|
88
92
|
api_name = if method_naming == :snake_case
|
data/lib/box2d_types.rb
CHANGED
@@ -25,9 +25,9 @@ module Box2D
|
|
25
25
|
ShapeType_chainSegmentShape = 4
|
26
26
|
ShapeType_shapeTypeCount = 5
|
27
27
|
JointType_distanceJoint = 0
|
28
|
-
|
29
|
-
|
30
|
-
|
28
|
+
JointType_filterJoint = 1
|
29
|
+
JointType_motorJoint = 2
|
30
|
+
JointType_mouseJoint = 3
|
31
31
|
JointType_prismaticJoint = 4
|
32
32
|
JointType_revoluteJoint = 5
|
33
33
|
JointType_weldJoint = 6
|
@@ -192,6 +192,7 @@ module Box2D
|
|
192
192
|
typedef :pointer, :b2PreSolveFcn
|
193
193
|
typedef :pointer, :b2OverlapResultFcn
|
194
194
|
typedef :pointer, :b2CastResultFcn
|
195
|
+
typedef :pointer, :b2PlaneResultFcn
|
195
196
|
typedef :int, :b2HexColor
|
196
197
|
|
197
198
|
# Struct
|
@@ -240,7 +241,7 @@ module Box2D
|
|
240
241
|
:hitEventThreshold, :float,
|
241
242
|
:contactHertz, :float,
|
242
243
|
:contactDampingRatio, :float,
|
243
|
-
:
|
244
|
+
:maxContactPushSpeed, :float,
|
244
245
|
:jointHertz, :float,
|
245
246
|
:jointDampingRatio, :float,
|
246
247
|
:maximumLinearSpeed, :float,
|
@@ -265,8 +266,8 @@ module Box2D
|
|
265
266
|
def contactHertz=(v) self[:contactHertz] = v end
|
266
267
|
def contactDampingRatio = self[:contactDampingRatio]
|
267
268
|
def contactDampingRatio=(v) self[:contactDampingRatio] = v end
|
268
|
-
def
|
269
|
-
def
|
269
|
+
def maxContactPushSpeed = self[:maxContactPushSpeed]
|
270
|
+
def maxContactPushSpeed=(v) self[:maxContactPushSpeed] = v end
|
270
271
|
def jointHertz = self[:jointHertz]
|
271
272
|
def jointHertz=(v) self[:jointHertz] = v end
|
272
273
|
def jointDampingRatio = self[:jointDampingRatio]
|
@@ -293,14 +294,14 @@ module Box2D
|
|
293
294
|
def userData=(v) self[:userData] = v end
|
294
295
|
def internalValue = self[:internalValue]
|
295
296
|
def internalValue=(v) self[:internalValue] = v end
|
296
|
-
def self.create_as(_gravity_, _restitutionThreshold_, _hitEventThreshold_, _contactHertz_, _contactDampingRatio_,
|
297
|
+
def self.create_as(_gravity_, _restitutionThreshold_, _hitEventThreshold_, _contactHertz_, _contactDampingRatio_, _maxContactPushSpeed_, _jointHertz_, _jointDampingRatio_, _maximumLinearSpeed_, _frictionCallback_, _restitutionCallback_, _enableSleep_, _enableContinuous_, _workerCount_, _enqueueTask_, _finishTask_, _userTaskContext_, _userData_, _internalValue_)
|
297
298
|
instance = WorldDef.new
|
298
299
|
instance[:gravity] = _gravity_
|
299
300
|
instance[:restitutionThreshold] = _restitutionThreshold_
|
300
301
|
instance[:hitEventThreshold] = _hitEventThreshold_
|
301
302
|
instance[:contactHertz] = _contactHertz_
|
302
303
|
instance[:contactDampingRatio] = _contactDampingRatio_
|
303
|
-
instance[:
|
304
|
+
instance[:maxContactPushSpeed] = _maxContactPushSpeed_
|
304
305
|
instance[:jointHertz] = _jointHertz_
|
305
306
|
instance[:jointDampingRatio] = _jointDampingRatio_
|
306
307
|
instance[:maximumLinearSpeed] = _maximumLinearSpeed_
|
@@ -437,18 +438,47 @@ module Box2D
|
|
437
438
|
end
|
438
439
|
end
|
439
440
|
|
440
|
-
class
|
441
|
+
class SurfaceMaterial < FFI::Struct
|
441
442
|
layout(
|
442
|
-
:userData, :pointer,
|
443
443
|
:friction, :float,
|
444
444
|
:restitution, :float,
|
445
445
|
:rollingResistance, :float,
|
446
446
|
:tangentSpeed, :float,
|
447
|
-
:
|
447
|
+
:userMaterialId, :int,
|
448
|
+
:customColor, :uint,
|
449
|
+
)
|
450
|
+
def friction = self[:friction]
|
451
|
+
def friction=(v) self[:friction] = v end
|
452
|
+
def restitution = self[:restitution]
|
453
|
+
def restitution=(v) self[:restitution] = v end
|
454
|
+
def rollingResistance = self[:rollingResistance]
|
455
|
+
def rollingResistance=(v) self[:rollingResistance] = v end
|
456
|
+
def tangentSpeed = self[:tangentSpeed]
|
457
|
+
def tangentSpeed=(v) self[:tangentSpeed] = v end
|
458
|
+
def userMaterialId = self[:userMaterialId]
|
459
|
+
def userMaterialId=(v) self[:userMaterialId] = v end
|
460
|
+
def customColor = self[:customColor]
|
461
|
+
def customColor=(v) self[:customColor] = v end
|
462
|
+
def self.create_as(_friction_, _restitution_, _rollingResistance_, _tangentSpeed_, _userMaterialId_, _customColor_)
|
463
|
+
instance = SurfaceMaterial.new
|
464
|
+
instance[:friction] = _friction_
|
465
|
+
instance[:restitution] = _restitution_
|
466
|
+
instance[:rollingResistance] = _rollingResistance_
|
467
|
+
instance[:tangentSpeed] = _tangentSpeed_
|
468
|
+
instance[:userMaterialId] = _userMaterialId_
|
469
|
+
instance[:customColor] = _customColor_
|
470
|
+
instance
|
471
|
+
end
|
472
|
+
end
|
473
|
+
|
474
|
+
class ShapeDef < FFI::Struct
|
475
|
+
layout(
|
476
|
+
:userData, :pointer,
|
477
|
+
:material, SurfaceMaterial,
|
448
478
|
:density, :float,
|
449
479
|
:filter, Filter,
|
450
|
-
:customColor, :uint,
|
451
480
|
:isSensor, :bool,
|
481
|
+
:enableSensorEvents, :bool,
|
452
482
|
:enableContactEvents, :bool,
|
453
483
|
:enableHitEvents, :bool,
|
454
484
|
:enablePreSolveEvents, :bool,
|
@@ -458,24 +488,16 @@ module Box2D
|
|
458
488
|
)
|
459
489
|
def userData = self[:userData]
|
460
490
|
def userData=(v) self[:userData] = v end
|
461
|
-
def friction = self[:friction]
|
462
|
-
def friction=(v) self[:friction] = v end
|
463
|
-
def restitution = self[:restitution]
|
464
|
-
def restitution=(v) self[:restitution] = v end
|
465
|
-
def rollingResistance = self[:rollingResistance]
|
466
|
-
def rollingResistance=(v) self[:rollingResistance] = v end
|
467
|
-
def tangentSpeed = self[:tangentSpeed]
|
468
|
-
def tangentSpeed=(v) self[:tangentSpeed] = v end
|
469
491
|
def material = self[:material]
|
470
492
|
def material=(v) self[:material] = v end
|
471
493
|
def density = self[:density]
|
472
494
|
def density=(v) self[:density] = v end
|
473
495
|
def filter = self[:filter]
|
474
496
|
def filter=(v) self[:filter] = v end
|
475
|
-
def customColor = self[:customColor]
|
476
|
-
def customColor=(v) self[:customColor] = v end
|
477
497
|
def isSensor = self[:isSensor]
|
478
498
|
def isSensor=(v) self[:isSensor] = v end
|
499
|
+
def enableSensorEvents = self[:enableSensorEvents]
|
500
|
+
def enableSensorEvents=(v) self[:enableSensorEvents] = v end
|
479
501
|
def enableContactEvents = self[:enableContactEvents]
|
480
502
|
def enableContactEvents=(v) self[:enableContactEvents] = v end
|
481
503
|
def enableHitEvents = self[:enableHitEvents]
|
@@ -488,18 +510,14 @@ module Box2D
|
|
488
510
|
def updateBodyMass=(v) self[:updateBodyMass] = v end
|
489
511
|
def internalValue = self[:internalValue]
|
490
512
|
def internalValue=(v) self[:internalValue] = v end
|
491
|
-
def self.create_as(_userData_,
|
513
|
+
def self.create_as(_userData_, _material_, _density_, _filter_, _isSensor_, _enableSensorEvents_, _enableContactEvents_, _enableHitEvents_, _enablePreSolveEvents_, _invokeContactCreation_, _updateBodyMass_, _internalValue_)
|
492
514
|
instance = ShapeDef.new
|
493
515
|
instance[:userData] = _userData_
|
494
|
-
instance[:friction] = _friction_
|
495
|
-
instance[:restitution] = _restitution_
|
496
|
-
instance[:rollingResistance] = _rollingResistance_
|
497
|
-
instance[:tangentSpeed] = _tangentSpeed_
|
498
516
|
instance[:material] = _material_
|
499
517
|
instance[:density] = _density_
|
500
518
|
instance[:filter] = _filter_
|
501
|
-
instance[:customColor] = _customColor_
|
502
519
|
instance[:isSensor] = _isSensor_
|
520
|
+
instance[:enableSensorEvents] = _enableSensorEvents_
|
503
521
|
instance[:enableContactEvents] = _enableContactEvents_
|
504
522
|
instance[:enableHitEvents] = _enableHitEvents_
|
505
523
|
instance[:enablePreSolveEvents] = _enablePreSolveEvents_
|
@@ -510,39 +528,6 @@ module Box2D
|
|
510
528
|
end
|
511
529
|
end
|
512
530
|
|
513
|
-
class SurfaceMaterial < FFI::Struct
|
514
|
-
layout(
|
515
|
-
:friction, :float,
|
516
|
-
:restitution, :float,
|
517
|
-
:rollingResistance, :float,
|
518
|
-
:tangentSpeed, :float,
|
519
|
-
:material, :int,
|
520
|
-
:customColor, :uint,
|
521
|
-
)
|
522
|
-
def friction = self[:friction]
|
523
|
-
def friction=(v) self[:friction] = v end
|
524
|
-
def restitution = self[:restitution]
|
525
|
-
def restitution=(v) self[:restitution] = v end
|
526
|
-
def rollingResistance = self[:rollingResistance]
|
527
|
-
def rollingResistance=(v) self[:rollingResistance] = v end
|
528
|
-
def tangentSpeed = self[:tangentSpeed]
|
529
|
-
def tangentSpeed=(v) self[:tangentSpeed] = v end
|
530
|
-
def material = self[:material]
|
531
|
-
def material=(v) self[:material] = v end
|
532
|
-
def customColor = self[:customColor]
|
533
|
-
def customColor=(v) self[:customColor] = v end
|
534
|
-
def self.create_as(_friction_, _restitution_, _rollingResistance_, _tangentSpeed_, _material_, _customColor_)
|
535
|
-
instance = SurfaceMaterial.new
|
536
|
-
instance[:friction] = _friction_
|
537
|
-
instance[:restitution] = _restitution_
|
538
|
-
instance[:rollingResistance] = _rollingResistance_
|
539
|
-
instance[:tangentSpeed] = _tangentSpeed_
|
540
|
-
instance[:material] = _material_
|
541
|
-
instance[:customColor] = _customColor_
|
542
|
-
instance
|
543
|
-
end
|
544
|
-
end
|
545
|
-
|
546
531
|
class ChainDef < FFI::Struct
|
547
532
|
layout(
|
548
533
|
:userData, :pointer,
|
@@ -552,6 +537,7 @@ module Box2D
|
|
552
537
|
:materialCount, :int,
|
553
538
|
:filter, Filter,
|
554
539
|
:isLoop, :bool,
|
540
|
+
:enableSensorEvents, :bool,
|
555
541
|
:internalValue, :int,
|
556
542
|
)
|
557
543
|
def userData = self[:userData]
|
@@ -568,9 +554,11 @@ module Box2D
|
|
568
554
|
def filter=(v) self[:filter] = v end
|
569
555
|
def isLoop = self[:isLoop]
|
570
556
|
def isLoop=(v) self[:isLoop] = v end
|
557
|
+
def enableSensorEvents = self[:enableSensorEvents]
|
558
|
+
def enableSensorEvents=(v) self[:enableSensorEvents] = v end
|
571
559
|
def internalValue = self[:internalValue]
|
572
560
|
def internalValue=(v) self[:internalValue] = v end
|
573
|
-
def self.create_as(_userData_, _points_, _count_, _materials_, _materialCount_, _filter_, _isLoop_, _internalValue_)
|
561
|
+
def self.create_as(_userData_, _points_, _count_, _materials_, _materialCount_, _filter_, _isLoop_, _enableSensorEvents_, _internalValue_)
|
574
562
|
instance = ChainDef.new
|
575
563
|
instance[:userData] = _userData_
|
576
564
|
instance[:points] = _points_
|
@@ -579,6 +567,7 @@ module Box2D
|
|
579
567
|
instance[:materialCount] = _materialCount_
|
580
568
|
instance[:filter] = _filter_
|
581
569
|
instance[:isLoop] = _isLoop_
|
570
|
+
instance[:enableSensorEvents] = _enableSensorEvents_
|
582
571
|
instance[:internalValue] = _internalValue_
|
583
572
|
instance
|
584
573
|
end
|
@@ -905,7 +894,7 @@ module Box2D
|
|
905
894
|
end
|
906
895
|
end
|
907
896
|
|
908
|
-
class
|
897
|
+
class FilterJointDef < FFI::Struct
|
909
898
|
layout(
|
910
899
|
:bodyIdA, BodyId,
|
911
900
|
:bodyIdB, BodyId,
|
@@ -921,7 +910,7 @@ module Box2D
|
|
921
910
|
def internalValue = self[:internalValue]
|
922
911
|
def internalValue=(v) self[:internalValue] = v end
|
923
912
|
def self.create_as(_bodyIdA_, _bodyIdB_, _userData_, _internalValue_)
|
924
|
-
instance =
|
913
|
+
instance = FilterJointDef.new
|
925
914
|
instance[:bodyIdA] = _bodyIdA_
|
926
915
|
instance[:bodyIdB] = _bodyIdB_
|
927
916
|
instance[:userData] = _userData_
|
@@ -1479,48 +1468,50 @@ module Box2D
|
|
1479
1468
|
|
1480
1469
|
class DebugDraw < FFI::Struct
|
1481
1470
|
layout(
|
1482
|
-
:
|
1483
|
-
:
|
1484
|
-
:
|
1485
|
-
:
|
1486
|
-
:
|
1487
|
-
:
|
1488
|
-
:
|
1489
|
-
:
|
1490
|
-
:
|
1471
|
+
:DrawPolygonFcn, :pointer,
|
1472
|
+
:DrawSolidPolygonFcn, :pointer,
|
1473
|
+
:DrawCircleFcn, :pointer,
|
1474
|
+
:DrawSolidCircleFcn, :pointer,
|
1475
|
+
:DrawSolidCapsuleFcn, :pointer,
|
1476
|
+
:DrawSegmentFcn, :pointer,
|
1477
|
+
:DrawTransformFcn, :pointer,
|
1478
|
+
:DrawPointFcn, :pointer,
|
1479
|
+
:DrawStringFcn, :pointer,
|
1491
1480
|
:drawingBounds, AABB,
|
1492
1481
|
:useDrawingBounds, :bool,
|
1493
1482
|
:drawShapes, :bool,
|
1494
1483
|
:drawJoints, :bool,
|
1495
1484
|
:drawJointExtras, :bool,
|
1496
|
-
:
|
1485
|
+
:drawBounds, :bool,
|
1497
1486
|
:drawMass, :bool,
|
1498
1487
|
:drawBodyNames, :bool,
|
1499
1488
|
:drawContacts, :bool,
|
1500
1489
|
:drawGraphColors, :bool,
|
1501
1490
|
:drawContactNormals, :bool,
|
1502
1491
|
:drawContactImpulses, :bool,
|
1492
|
+
:drawContactFeatures, :bool,
|
1503
1493
|
:drawFrictionImpulses, :bool,
|
1494
|
+
:drawIslands, :bool,
|
1504
1495
|
:context, :pointer,
|
1505
1496
|
)
|
1506
|
-
def
|
1507
|
-
def
|
1508
|
-
def
|
1509
|
-
def
|
1510
|
-
def
|
1511
|
-
def
|
1512
|
-
def
|
1513
|
-
def
|
1514
|
-
def
|
1515
|
-
def
|
1516
|
-
def
|
1517
|
-
def
|
1518
|
-
def
|
1519
|
-
def
|
1520
|
-
def
|
1521
|
-
def
|
1522
|
-
def
|
1523
|
-
def
|
1497
|
+
def DrawPolygonFcn = self[:DrawPolygonFcn]
|
1498
|
+
def DrawPolygonFcn=(v) self[:DrawPolygonFcn] = v end
|
1499
|
+
def DrawSolidPolygonFcn = self[:DrawSolidPolygonFcn]
|
1500
|
+
def DrawSolidPolygonFcn=(v) self[:DrawSolidPolygonFcn] = v end
|
1501
|
+
def DrawCircleFcn = self[:DrawCircleFcn]
|
1502
|
+
def DrawCircleFcn=(v) self[:DrawCircleFcn] = v end
|
1503
|
+
def DrawSolidCircleFcn = self[:DrawSolidCircleFcn]
|
1504
|
+
def DrawSolidCircleFcn=(v) self[:DrawSolidCircleFcn] = v end
|
1505
|
+
def DrawSolidCapsuleFcn = self[:DrawSolidCapsuleFcn]
|
1506
|
+
def DrawSolidCapsuleFcn=(v) self[:DrawSolidCapsuleFcn] = v end
|
1507
|
+
def DrawSegmentFcn = self[:DrawSegmentFcn]
|
1508
|
+
def DrawSegmentFcn=(v) self[:DrawSegmentFcn] = v end
|
1509
|
+
def DrawTransformFcn = self[:DrawTransformFcn]
|
1510
|
+
def DrawTransformFcn=(v) self[:DrawTransformFcn] = v end
|
1511
|
+
def DrawPointFcn = self[:DrawPointFcn]
|
1512
|
+
def DrawPointFcn=(v) self[:DrawPointFcn] = v end
|
1513
|
+
def DrawStringFcn = self[:DrawStringFcn]
|
1514
|
+
def DrawStringFcn=(v) self[:DrawStringFcn] = v end
|
1524
1515
|
def drawingBounds = self[:drawingBounds]
|
1525
1516
|
def drawingBounds=(v) self[:drawingBounds] = v end
|
1526
1517
|
def useDrawingBounds = self[:useDrawingBounds]
|
@@ -1531,8 +1522,8 @@ module Box2D
|
|
1531
1522
|
def drawJoints=(v) self[:drawJoints] = v end
|
1532
1523
|
def drawJointExtras = self[:drawJointExtras]
|
1533
1524
|
def drawJointExtras=(v) self[:drawJointExtras] = v end
|
1534
|
-
def
|
1535
|
-
def
|
1525
|
+
def drawBounds = self[:drawBounds]
|
1526
|
+
def drawBounds=(v) self[:drawBounds] = v end
|
1536
1527
|
def drawMass = self[:drawMass]
|
1537
1528
|
def drawMass=(v) self[:drawMass] = v end
|
1538
1529
|
def drawBodyNames = self[:drawBodyNames]
|
@@ -1545,34 +1536,40 @@ module Box2D
|
|
1545
1536
|
def drawContactNormals=(v) self[:drawContactNormals] = v end
|
1546
1537
|
def drawContactImpulses = self[:drawContactImpulses]
|
1547
1538
|
def drawContactImpulses=(v) self[:drawContactImpulses] = v end
|
1539
|
+
def drawContactFeatures = self[:drawContactFeatures]
|
1540
|
+
def drawContactFeatures=(v) self[:drawContactFeatures] = v end
|
1548
1541
|
def drawFrictionImpulses = self[:drawFrictionImpulses]
|
1549
1542
|
def drawFrictionImpulses=(v) self[:drawFrictionImpulses] = v end
|
1543
|
+
def drawIslands = self[:drawIslands]
|
1544
|
+
def drawIslands=(v) self[:drawIslands] = v end
|
1550
1545
|
def context = self[:context]
|
1551
1546
|
def context=(v) self[:context] = v end
|
1552
|
-
def self.create_as(
|
1547
|
+
def self.create_as(_DrawPolygonFcn_, _DrawSolidPolygonFcn_, _DrawCircleFcn_, _DrawSolidCircleFcn_, _DrawSolidCapsuleFcn_, _DrawSegmentFcn_, _DrawTransformFcn_, _DrawPointFcn_, _DrawStringFcn_, _drawingBounds_, _useDrawingBounds_, _drawShapes_, _drawJoints_, _drawJointExtras_, _drawBounds_, _drawMass_, _drawBodyNames_, _drawContacts_, _drawGraphColors_, _drawContactNormals_, _drawContactImpulses_, _drawContactFeatures_, _drawFrictionImpulses_, _drawIslands_, _context_)
|
1553
1548
|
instance = DebugDraw.new
|
1554
|
-
instance[:
|
1555
|
-
instance[:
|
1556
|
-
instance[:
|
1557
|
-
instance[:
|
1558
|
-
instance[:
|
1559
|
-
instance[:
|
1560
|
-
instance[:
|
1561
|
-
instance[:
|
1562
|
-
instance[:
|
1549
|
+
instance[:DrawPolygonFcn] = _DrawPolygonFcn_
|
1550
|
+
instance[:DrawSolidPolygonFcn] = _DrawSolidPolygonFcn_
|
1551
|
+
instance[:DrawCircleFcn] = _DrawCircleFcn_
|
1552
|
+
instance[:DrawSolidCircleFcn] = _DrawSolidCircleFcn_
|
1553
|
+
instance[:DrawSolidCapsuleFcn] = _DrawSolidCapsuleFcn_
|
1554
|
+
instance[:DrawSegmentFcn] = _DrawSegmentFcn_
|
1555
|
+
instance[:DrawTransformFcn] = _DrawTransformFcn_
|
1556
|
+
instance[:DrawPointFcn] = _DrawPointFcn_
|
1557
|
+
instance[:DrawStringFcn] = _DrawStringFcn_
|
1563
1558
|
instance[:drawingBounds] = _drawingBounds_
|
1564
1559
|
instance[:useDrawingBounds] = _useDrawingBounds_
|
1565
1560
|
instance[:drawShapes] = _drawShapes_
|
1566
1561
|
instance[:drawJoints] = _drawJoints_
|
1567
1562
|
instance[:drawJointExtras] = _drawJointExtras_
|
1568
|
-
instance[:
|
1563
|
+
instance[:drawBounds] = _drawBounds_
|
1569
1564
|
instance[:drawMass] = _drawMass_
|
1570
1565
|
instance[:drawBodyNames] = _drawBodyNames_
|
1571
1566
|
instance[:drawContacts] = _drawContacts_
|
1572
1567
|
instance[:drawGraphColors] = _drawGraphColors_
|
1573
1568
|
instance[:drawContactNormals] = _drawContactNormals_
|
1574
1569
|
instance[:drawContactImpulses] = _drawContactImpulses_
|
1570
|
+
instance[:drawContactFeatures] = _drawContactFeatures_
|
1575
1571
|
instance[:drawFrictionImpulses] = _drawFrictionImpulses_
|
1572
|
+
instance[:drawIslands] = _drawIslands_
|
1576
1573
|
instance[:context] = _context_
|
1577
1574
|
instance
|
1578
1575
|
end
|
@@ -1587,13 +1584,13 @@ module Box2D
|
|
1587
1584
|
[:DefaultBodyDef, :b2DefaultBodyDef, [], BodyDef.by_value],
|
1588
1585
|
[:DefaultFilter, :b2DefaultFilter, [], Filter.by_value],
|
1589
1586
|
[:DefaultQueryFilter, :b2DefaultQueryFilter, [], QueryFilter.by_value],
|
1590
|
-
[:DefaultShapeDef, :b2DefaultShapeDef, [], ShapeDef.by_value],
|
1591
1587
|
[:DefaultSurfaceMaterial, :b2DefaultSurfaceMaterial, [], SurfaceMaterial.by_value],
|
1588
|
+
[:DefaultShapeDef, :b2DefaultShapeDef, [], ShapeDef.by_value],
|
1592
1589
|
[:DefaultChainDef, :b2DefaultChainDef, [], ChainDef.by_value],
|
1593
1590
|
[:DefaultDistanceJointDef, :b2DefaultDistanceJointDef, [], DistanceJointDef.by_value],
|
1594
1591
|
[:DefaultMotorJointDef, :b2DefaultMotorJointDef, [], MotorJointDef.by_value],
|
1595
1592
|
[:DefaultMouseJointDef, :b2DefaultMouseJointDef, [], MouseJointDef.by_value],
|
1596
|
-
[:
|
1593
|
+
[:DefaultFilterJointDef, :b2DefaultFilterJointDef, [], FilterJointDef.by_value],
|
1597
1594
|
[:DefaultPrismaticJointDef, :b2DefaultPrismaticJointDef, [], PrismaticJointDef.by_value],
|
1598
1595
|
[:DefaultRevoluteJointDef, :b2DefaultRevoluteJointDef, [], RevoluteJointDef.by_value],
|
1599
1596
|
[:DefaultWeldJointDef, :b2DefaultWeldJointDef, [], WeldJointDef.by_value],
|
data/lib/libbox2d.x86_64.dylib
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: box2d-bindings
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: x86_64-darwin
|
6
6
|
authors:
|
7
7
|
- vaiorabbit
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-
|
10
|
+
date: 2025-05-11 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: ffi
|
@@ -64,7 +64,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
64
64
|
- !ruby/object:Gem::Version
|
65
65
|
version: '0'
|
66
66
|
requirements: []
|
67
|
-
rubygems_version: 3.6.
|
67
|
+
rubygems_version: 3.6.5
|
68
68
|
specification_version: 4
|
69
69
|
summary: Ruby bindings for Box2D
|
70
70
|
test_files: []
|