box2d-bindings 0.1.3 → 0.1.4
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 +9 -0
- data/LICENSE.txt +1 -1
- data/README.md +2 -2
- data/lib/box2d_base.rb +2 -0
- data/lib/box2d_collision.rb +13 -4
- data/lib/box2d_id_inline.rb +1 -12
- data/lib/box2d_main.rb +43 -31
- data/lib/box2d_math_inline_functions.rb +1 -0
- data/lib/box2d_types.rb +164 -115
- data/lib/libbox2d.aarch64.so +0 -0
- data/lib/libbox2d.arm64.dylib +0 -0
- data/lib/libbox2d.dll +0 -0
- data/lib/libbox2d.x86_64.dylib +0 -0
- data/lib/libbox2d.x86_64.so +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: 878c68d88f537985d4acd0dbd8367a125e23a047bd30cbd49534c24af6a46feb
|
|
4
|
+
data.tar.gz: 6d8476360888e88ceda351a26c577837653aff4cfd7d26ec09b5cc20a1c540fa
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 54ce7b920fc7468adb03a721035088bcd6e964b7955b3d161d810f1db9f58db07a3473c7914005f64981429a502c830603c6b18db53bf19df5aceff4cf464678
|
|
7
|
+
data.tar.gz: 5db47cdfe2c42f22c28a67f27c6e82cd90c013d1836c22c8a6fdf0e6801b67eb74489803a7c33d3a954ac4f1f9b21bdd2afa30dfed4c817198f480468935b464
|
data/ChangeLog
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
2025-12-29 vaiorabbit <http://twitter.com/vaiorabbit>
|
|
2
|
+
|
|
3
|
+
* https://github.com/erincatto/box2d/commit/c05c48738fbe5c27625e36c5f0cfbdaddfc8359a
|
|
4
|
+
* Added sample_pegs.rb
|
|
5
|
+
|
|
6
|
+
2025-07-13 vaiorabbit <http://twitter.com/vaiorabbit>
|
|
7
|
+
|
|
8
|
+
* https://github.com/erincatto/box2d/commit/fb8b81f03f126ff52db5ebd25c90928fb56528d5
|
|
9
|
+
|
|
1
10
|
2025-06-06 vaiorabbit <http://twitter.com/vaiorabbit>
|
|
2
11
|
|
|
3
12
|
* https://github.com/erincatto/box2d/commit/d3d2b926c6694f46f8d511ee90cb3f553bf488b2
|
data/LICENSE.txt
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Ruby-Box2D : Box2D bindings for Ruby
|
|
2
|
-
Copyright (c) 2024-
|
|
2
|
+
Copyright (c) 2024-2026 vaiorabbit <http://twitter.com/vaiorabbit>
|
|
3
3
|
|
|
4
4
|
This software is provided 'as-is', without any express or implied
|
|
5
5
|
warranty. In no event will the authors be held liable for any damages
|
data/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
# Box2D bindings for Ruby #
|
|
4
4
|
|
|
5
5
|
* Created : 2024-08-18
|
|
6
|
-
* Last modified :
|
|
6
|
+
* Last modified : 2026-01-10
|
|
7
7
|
|
|
8
8
|
Provides Ruby bindings for Box2D
|
|
9
9
|
* https://box2d.org
|
|
@@ -27,7 +27,7 @@ All ruby codes here are available under the zlib/libpng License ( http://opensou
|
|
|
27
27
|
|
|
28
28
|
```
|
|
29
29
|
Ruby-Box2D : Box2D bindings for Ruby
|
|
30
|
-
Copyright (c) 2024-
|
|
30
|
+
Copyright (c) 2024-2026 vaiorabbit <http://twitter.com/vaiorabbit>
|
|
31
31
|
|
|
32
32
|
This software is provided 'as-is', without any express or implied
|
|
33
33
|
warranty. In no event will the authors be held liable for any damages
|
data/lib/box2d_base.rb
CHANGED
|
@@ -20,6 +20,7 @@ module Box2D
|
|
|
20
20
|
typedef :pointer, :b2AllocFcn
|
|
21
21
|
typedef :pointer, :b2FreeFcn
|
|
22
22
|
typedef :pointer, :b2AssertFcn
|
|
23
|
+
typedef :pointer, :b2LogFcn
|
|
23
24
|
|
|
24
25
|
# Struct
|
|
25
26
|
|
|
@@ -52,6 +53,7 @@ module Box2D
|
|
|
52
53
|
[:SetAllocator, :b2SetAllocator, [:pointer, :pointer], :void],
|
|
53
54
|
[:GetByteCount, :b2GetByteCount, [], :int],
|
|
54
55
|
[:SetAssertFcn, :b2SetAssertFcn, [:pointer], :void],
|
|
56
|
+
[:SetLogFcn, :b2SetLogFcn, [:pointer], :void],
|
|
55
57
|
[:GetVersion, :b2GetVersion, [], Version.by_value],
|
|
56
58
|
[:GetTicks, :b2GetTicks, [], :ulong_long],
|
|
57
59
|
[:GetMilliseconds, :b2GetMilliseconds, [:ulong_long], :float],
|
data/lib/box2d_collision.rb
CHANGED
|
@@ -593,15 +593,23 @@ module Box2D
|
|
|
593
593
|
class TOIOutput < FFI::Struct
|
|
594
594
|
layout(
|
|
595
595
|
:state, :int,
|
|
596
|
+
:point, Vec2,
|
|
597
|
+
:normal, Vec2,
|
|
596
598
|
:fraction, :float,
|
|
597
599
|
)
|
|
598
600
|
def state = self[:state]
|
|
599
601
|
def state=(v) self[:state] = v end
|
|
602
|
+
def point = self[:point]
|
|
603
|
+
def point=(v) self[:point] = v end
|
|
604
|
+
def normal = self[:normal]
|
|
605
|
+
def normal=(v) self[:normal] = v end
|
|
600
606
|
def fraction = self[:fraction]
|
|
601
607
|
def fraction=(v) self[:fraction] = v end
|
|
602
|
-
def self.create_as(_state_, _fraction_)
|
|
608
|
+
def self.create_as(_state_, _point_, _normal_, _fraction_)
|
|
603
609
|
instance = TOIOutput.new
|
|
604
610
|
instance[:state] = _state_
|
|
611
|
+
instance[:point] = _point_
|
|
612
|
+
instance[:normal] = _normal_
|
|
605
613
|
instance[:fraction] = _fraction_
|
|
606
614
|
instance
|
|
607
615
|
end
|
|
@@ -836,9 +844,9 @@ module Box2D
|
|
|
836
844
|
[:ComputeCapsuleAABB, :b2ComputeCapsuleAABB, [:pointer, Transform.by_value], AABB.by_value],
|
|
837
845
|
[:ComputePolygonAABB, :b2ComputePolygonAABB, [:pointer, Transform.by_value], AABB.by_value],
|
|
838
846
|
[:ComputeSegmentAABB, :b2ComputeSegmentAABB, [:pointer, Transform.by_value], AABB.by_value],
|
|
839
|
-
[:PointInCircle, :b2PointInCircle, [Vec2.by_value
|
|
840
|
-
[:PointInCapsule, :b2PointInCapsule, [Vec2.by_value
|
|
841
|
-
[:PointInPolygon, :b2PointInPolygon, [Vec2.by_value
|
|
847
|
+
[:PointInCircle, :b2PointInCircle, [:pointer, Vec2.by_value], :bool],
|
|
848
|
+
[:PointInCapsule, :b2PointInCapsule, [:pointer, Vec2.by_value], :bool],
|
|
849
|
+
[:PointInPolygon, :b2PointInPolygon, [:pointer, Vec2.by_value], :bool],
|
|
842
850
|
[:RayCastCircle, :b2RayCastCircle, [:pointer, :pointer], CastOutput.by_value],
|
|
843
851
|
[:RayCastCapsule, :b2RayCastCapsule, [:pointer, :pointer], CastOutput.by_value],
|
|
844
852
|
[:RayCastSegment, :b2RayCastSegment, [:pointer, :pointer, :bool], CastOutput.by_value],
|
|
@@ -877,6 +885,7 @@ module Box2D
|
|
|
877
885
|
[:DynamicTree_SetCategoryBits, :b2DynamicTree_SetCategoryBits, [:pointer, :int, :ulong_long], :void],
|
|
878
886
|
[:DynamicTree_GetCategoryBits, :b2DynamicTree_GetCategoryBits, [:pointer, :int], :ulong_long],
|
|
879
887
|
[:DynamicTree_Query, :b2DynamicTree_Query, [:pointer, AABB.by_value, :ulong_long, :pointer, :pointer], TreeStats.by_value],
|
|
888
|
+
[:DynamicTree_QueryAll, :b2DynamicTree_QueryAll, [:pointer, AABB.by_value, :pointer, :pointer], TreeStats.by_value],
|
|
880
889
|
[:DynamicTree_RayCast, :b2DynamicTree_RayCast, [:pointer, :pointer, :ulong_long, :pointer, :pointer], TreeStats.by_value],
|
|
881
890
|
[:DynamicTree_ShapeCast, :b2DynamicTree_ShapeCast, [:pointer, :pointer, :ulong_long, :pointer, :pointer], TreeStats.by_value],
|
|
882
891
|
[:DynamicTree_GetHeight, :b2DynamicTree_GetHeight, [:pointer], :int],
|
data/lib/box2d_id_inline.rb
CHANGED
|
@@ -24,18 +24,7 @@ module Box2D
|
|
|
24
24
|
|
|
25
25
|
def self.setup_id_inline_symbols(method_naming: :original)
|
|
26
26
|
entries = [
|
|
27
|
-
[:
|
|
28
|
-
[:LoadWorldId, :b2LoadWorldId, [:uint], WorldId.by_value],
|
|
29
|
-
[:StoreBodyId, :b2StoreBodyId, [BodyId.by_value], :ulong_long],
|
|
30
|
-
[:LoadBodyId, :b2LoadBodyId, [:ulong_long], BodyId.by_value],
|
|
31
|
-
[:StoreShapeId, :b2StoreShapeId, [ShapeId.by_value], :ulong_long],
|
|
32
|
-
[:LoadShapeId, :b2LoadShapeId, [:ulong_long], ShapeId.by_value],
|
|
33
|
-
[:StoreChainId, :b2StoreChainId, [ChainId.by_value], :ulong_long],
|
|
34
|
-
[:LoadChainId, :b2LoadChainId, [:ulong_long], ChainId.by_value],
|
|
35
|
-
[:StoreJointId, :b2StoreJointId, [JointId.by_value], :ulong_long],
|
|
36
|
-
[:LoadJointId, :b2LoadJointId, [:ulong_long], JointId.by_value],
|
|
37
|
-
[:StoreContactId, :b2StoreContactId, [ContactId.by_value, :pointer], :void],
|
|
38
|
-
[:LoadContactId, :b2LoadContactId, [:pointer], ContactId.by_value],
|
|
27
|
+
[:StoreContactId, :b2StoreContactId, [ContactId.by_value, :pointer], :int],
|
|
39
28
|
]
|
|
40
29
|
entries.each do |entry|
|
|
41
30
|
api_name = if method_naming == :snake_case
|
data/lib/box2d_main.rb
CHANGED
|
@@ -89,12 +89,13 @@ module Box2D
|
|
|
89
89
|
[:Body_GetAngularVelocity, :b2Body_GetAngularVelocity, [BodyId.by_value], :float],
|
|
90
90
|
[:Body_SetLinearVelocity, :b2Body_SetLinearVelocity, [BodyId.by_value, Vec2.by_value], :void],
|
|
91
91
|
[:Body_SetAngularVelocity, :b2Body_SetAngularVelocity, [BodyId.by_value, :float], :void],
|
|
92
|
-
[:Body_SetTargetTransform, :b2Body_SetTargetTransform, [BodyId.by_value, Transform.by_value, :float], :void],
|
|
92
|
+
[:Body_SetTargetTransform, :b2Body_SetTargetTransform, [BodyId.by_value, Transform.by_value, :float, :bool], :void],
|
|
93
93
|
[:Body_GetLocalPointVelocity, :b2Body_GetLocalPointVelocity, [BodyId.by_value, Vec2.by_value], Vec2.by_value],
|
|
94
94
|
[:Body_GetWorldPointVelocity, :b2Body_GetWorldPointVelocity, [BodyId.by_value, Vec2.by_value], Vec2.by_value],
|
|
95
95
|
[:Body_ApplyForce, :b2Body_ApplyForce, [BodyId.by_value, Vec2.by_value, Vec2.by_value, :bool], :void],
|
|
96
96
|
[:Body_ApplyForceToCenter, :b2Body_ApplyForceToCenter, [BodyId.by_value, Vec2.by_value, :bool], :void],
|
|
97
97
|
[:Body_ApplyTorque, :b2Body_ApplyTorque, [BodyId.by_value, :float, :bool], :void],
|
|
98
|
+
[:Body_ClearForces, :b2Body_ClearForces, [BodyId.by_value], :void],
|
|
98
99
|
[:Body_ApplyLinearImpulse, :b2Body_ApplyLinearImpulse, [BodyId.by_value, Vec2.by_value, Vec2.by_value, :bool], :void],
|
|
99
100
|
[:Body_ApplyLinearImpulseToCenter, :b2Body_ApplyLinearImpulseToCenter, [BodyId.by_value, Vec2.by_value, :bool], :void],
|
|
100
101
|
[:Body_ApplyAngularImpulse, :b2Body_ApplyAngularImpulse, [BodyId.by_value, :float, :bool], :void],
|
|
@@ -113,6 +114,7 @@ module Box2D
|
|
|
113
114
|
[:Body_GetGravityScale, :b2Body_GetGravityScale, [BodyId.by_value], :float],
|
|
114
115
|
[:Body_IsAwake, :b2Body_IsAwake, [BodyId.by_value], :bool],
|
|
115
116
|
[:Body_SetAwake, :b2Body_SetAwake, [BodyId.by_value, :bool], :void],
|
|
117
|
+
[:Body_WakeTouching, :b2Body_WakeTouching, [BodyId.by_value], :void],
|
|
116
118
|
[:Body_EnableSleep, :b2Body_EnableSleep, [BodyId.by_value, :bool], :void],
|
|
117
119
|
[:Body_IsSleepEnabled, :b2Body_IsSleepEnabled, [BodyId.by_value], :bool],
|
|
118
120
|
[:Body_SetSleepThreshold, :b2Body_SetSleepThreshold, [BodyId.by_value, :float], :void],
|
|
@@ -120,8 +122,8 @@ module Box2D
|
|
|
120
122
|
[:Body_IsEnabled, :b2Body_IsEnabled, [BodyId.by_value], :bool],
|
|
121
123
|
[:Body_Disable, :b2Body_Disable, [BodyId.by_value], :void],
|
|
122
124
|
[:Body_Enable, :b2Body_Enable, [BodyId.by_value], :void],
|
|
123
|
-
[:
|
|
124
|
-
[:
|
|
125
|
+
[:Body_SetMotionLocks, :b2Body_SetMotionLocks, [BodyId.by_value, MotionLocks.by_value], :void],
|
|
126
|
+
[:Body_GetMotionLocks, :b2Body_GetMotionLocks, [BodyId.by_value], MotionLocks.by_value],
|
|
125
127
|
[:Body_SetBullet, :b2Body_SetBullet, [BodyId.by_value, :bool], :void],
|
|
126
128
|
[:Body_IsBullet, :b2Body_IsBullet, [BodyId.by_value], :bool],
|
|
127
129
|
[:Body_EnableContactEvents, :b2Body_EnableContactEvents, [BodyId.by_value, :bool], :void],
|
|
@@ -152,9 +154,9 @@ module Box2D
|
|
|
152
154
|
[:Shape_GetFriction, :b2Shape_GetFriction, [ShapeId.by_value], :float],
|
|
153
155
|
[:Shape_SetRestitution, :b2Shape_SetRestitution, [ShapeId.by_value, :float], :void],
|
|
154
156
|
[:Shape_GetRestitution, :b2Shape_GetRestitution, [ShapeId.by_value], :float],
|
|
155
|
-
[:
|
|
156
|
-
[:
|
|
157
|
-
[:Shape_SetSurfaceMaterial, :b2Shape_SetSurfaceMaterial, [ShapeId.by_value,
|
|
157
|
+
[:Shape_SetUserMaterial, :b2Shape_SetUserMaterial, [ShapeId.by_value, :ulong_long], :void],
|
|
158
|
+
[:Shape_GetUserMaterial, :b2Shape_GetUserMaterial, [ShapeId.by_value], :ulong_long],
|
|
159
|
+
[:Shape_SetSurfaceMaterial, :b2Shape_SetSurfaceMaterial, [ShapeId.by_value, :pointer], :void],
|
|
158
160
|
[:Shape_GetSurfaceMaterial, :b2Shape_GetSurfaceMaterial, [ShapeId.by_value], SurfaceMaterial.by_value],
|
|
159
161
|
[:Shape_GetFilter, :b2Shape_GetFilter, [ShapeId.by_value], Filter.by_value],
|
|
160
162
|
[:Shape_SetFilter, :b2Shape_SetFilter, [ShapeId.by_value, Filter.by_value], :void],
|
|
@@ -181,23 +183,21 @@ module Box2D
|
|
|
181
183
|
[:Shape_GetContactCapacity, :b2Shape_GetContactCapacity, [ShapeId.by_value], :int],
|
|
182
184
|
[:Shape_GetContactData, :b2Shape_GetContactData, [ShapeId.by_value, :pointer, :int], :int],
|
|
183
185
|
[:Shape_GetSensorCapacity, :b2Shape_GetSensorCapacity, [ShapeId.by_value], :int],
|
|
184
|
-
[:
|
|
186
|
+
[:Shape_GetSensorData, :b2Shape_GetSensorData, [ShapeId.by_value, :pointer, :int], :int],
|
|
185
187
|
[:Shape_GetAABB, :b2Shape_GetAABB, [ShapeId.by_value], AABB.by_value],
|
|
186
|
-
[:
|
|
188
|
+
[:Shape_ComputeMassData, :b2Shape_ComputeMassData, [ShapeId.by_value], MassData.by_value],
|
|
187
189
|
[:Shape_GetClosestPoint, :b2Shape_GetClosestPoint, [ShapeId.by_value, Vec2.by_value], Vec2.by_value],
|
|
190
|
+
[:Shape_ApplyWind, :b2Shape_ApplyWind, [ShapeId.by_value, Vec2.by_value, :float, :float, :bool], :void],
|
|
188
191
|
[:CreateChain, :b2CreateChain, [BodyId.by_value, :pointer], ChainId.by_value],
|
|
189
192
|
[:DestroyChain, :b2DestroyChain, [ChainId.by_value], :void],
|
|
190
193
|
[:Chain_GetWorld, :b2Chain_GetWorld, [ChainId.by_value], WorldId.by_value],
|
|
191
194
|
[:Chain_GetSegmentCount, :b2Chain_GetSegmentCount, [ChainId.by_value], :int],
|
|
192
195
|
[:Chain_GetSegments, :b2Chain_GetSegments, [ChainId.by_value, :pointer, :int], :int],
|
|
193
|
-
[:
|
|
194
|
-
[:
|
|
195
|
-
[:
|
|
196
|
-
[:Chain_GetRestitution, :b2Chain_GetRestitution, [ChainId.by_value], :float],
|
|
197
|
-
[:Chain_SetMaterial, :b2Chain_SetMaterial, [ChainId.by_value, :int], :void],
|
|
198
|
-
[:Chain_GetMaterial, :b2Chain_GetMaterial, [ChainId.by_value], :int],
|
|
196
|
+
[:Chain_GetSurfaceMaterialCount, :b2Chain_GetSurfaceMaterialCount, [ChainId.by_value], :int],
|
|
197
|
+
[:Chain_SetSurfaceMaterial, :b2Chain_SetSurfaceMaterial, [ChainId.by_value, :pointer, :int], :void],
|
|
198
|
+
[:Chain_GetSurfaceMaterial, :b2Chain_GetSurfaceMaterial, [ChainId.by_value, :int], SurfaceMaterial.by_value],
|
|
199
199
|
[:Chain_IsValid, :b2Chain_IsValid, [ChainId.by_value], :bool],
|
|
200
|
-
[:DestroyJoint, :b2DestroyJoint, [JointId.by_value], :void],
|
|
200
|
+
[:DestroyJoint, :b2DestroyJoint, [JointId.by_value, :bool], :void],
|
|
201
201
|
[:Joint_IsValid, :b2Joint_IsValid, [JointId.by_value], :bool],
|
|
202
202
|
[:Joint_GetType, :b2Joint_GetType, [JointId.by_value], :int],
|
|
203
203
|
[:Joint_GetBodyA, :b2Joint_GetBodyA, [JointId.by_value], BodyId.by_value],
|
|
@@ -216,13 +216,19 @@ module Box2D
|
|
|
216
216
|
[:Joint_GetConstraintTorque, :b2Joint_GetConstraintTorque, [JointId.by_value], :float],
|
|
217
217
|
[:Joint_GetLinearSeparation, :b2Joint_GetLinearSeparation, [JointId.by_value], :float],
|
|
218
218
|
[:Joint_GetAngularSeparation, :b2Joint_GetAngularSeparation, [JointId.by_value], :float],
|
|
219
|
-
[:Joint_GetConstraintTuning, :b2Joint_GetConstraintTuning, [JointId.by_value, :pointer, :pointer], :void],
|
|
220
219
|
[:Joint_SetConstraintTuning, :b2Joint_SetConstraintTuning, [JointId.by_value, :float, :float], :void],
|
|
220
|
+
[:Joint_GetConstraintTuning, :b2Joint_GetConstraintTuning, [JointId.by_value, :pointer, :pointer], :void],
|
|
221
|
+
[:Joint_SetForceThreshold, :b2Joint_SetForceThreshold, [JointId.by_value, :float], :void],
|
|
222
|
+
[:Joint_GetForceThreshold, :b2Joint_GetForceThreshold, [JointId.by_value], :float],
|
|
223
|
+
[:Joint_SetTorqueThreshold, :b2Joint_SetTorqueThreshold, [JointId.by_value, :float], :void],
|
|
224
|
+
[:Joint_GetTorqueThreshold, :b2Joint_GetTorqueThreshold, [JointId.by_value], :float],
|
|
221
225
|
[:CreateDistanceJoint, :b2CreateDistanceJoint, [WorldId.by_value, :pointer], JointId.by_value],
|
|
222
226
|
[:DistanceJoint_SetLength, :b2DistanceJoint_SetLength, [JointId.by_value, :float], :void],
|
|
223
227
|
[:DistanceJoint_GetLength, :b2DistanceJoint_GetLength, [JointId.by_value], :float],
|
|
224
228
|
[:DistanceJoint_EnableSpring, :b2DistanceJoint_EnableSpring, [JointId.by_value, :bool], :void],
|
|
225
229
|
[:DistanceJoint_IsSpringEnabled, :b2DistanceJoint_IsSpringEnabled, [JointId.by_value], :bool],
|
|
230
|
+
[:DistanceJoint_SetSpringForceRange, :b2DistanceJoint_SetSpringForceRange, [JointId.by_value, :float, :float], :void],
|
|
231
|
+
[:DistanceJoint_GetSpringForceRange, :b2DistanceJoint_GetSpringForceRange, [JointId.by_value, :pointer, :pointer], :void],
|
|
226
232
|
[:DistanceJoint_SetSpringHertz, :b2DistanceJoint_SetSpringHertz, [JointId.by_value, :float], :void],
|
|
227
233
|
[:DistanceJoint_SetSpringDampingRatio, :b2DistanceJoint_SetSpringDampingRatio, [JointId.by_value, :float], :void],
|
|
228
234
|
[:DistanceJoint_GetSpringHertz, :b2DistanceJoint_GetSpringHertz, [JointId.by_value], :float],
|
|
@@ -241,19 +247,26 @@ module Box2D
|
|
|
241
247
|
[:DistanceJoint_GetMaxMotorForce, :b2DistanceJoint_GetMaxMotorForce, [JointId.by_value], :float],
|
|
242
248
|
[:DistanceJoint_GetMotorForce, :b2DistanceJoint_GetMotorForce, [JointId.by_value], :float],
|
|
243
249
|
[:CreateMotorJoint, :b2CreateMotorJoint, [WorldId.by_value, :pointer], JointId.by_value],
|
|
244
|
-
[:
|
|
245
|
-
[:
|
|
246
|
-
[:
|
|
247
|
-
[:
|
|
248
|
-
[:
|
|
249
|
-
[:
|
|
250
|
-
[:
|
|
251
|
-
[:
|
|
252
|
-
[:
|
|
253
|
-
[:
|
|
254
|
-
[:
|
|
255
|
-
[:
|
|
256
|
-
[:
|
|
250
|
+
[:MotorJoint_SetLinearVelocity, :b2MotorJoint_SetLinearVelocity, [JointId.by_value, Vec2.by_value], :void],
|
|
251
|
+
[:MotorJoint_GetLinearVelocity, :b2MotorJoint_GetLinearVelocity, [JointId.by_value], Vec2.by_value],
|
|
252
|
+
[:MotorJoint_SetAngularVelocity, :b2MotorJoint_SetAngularVelocity, [JointId.by_value, :float], :void],
|
|
253
|
+
[:MotorJoint_GetAngularVelocity, :b2MotorJoint_GetAngularVelocity, [JointId.by_value], :float],
|
|
254
|
+
[:MotorJoint_SetMaxVelocityForce, :b2MotorJoint_SetMaxVelocityForce, [JointId.by_value, :float], :void],
|
|
255
|
+
[:MotorJoint_GetMaxVelocityForce, :b2MotorJoint_GetMaxVelocityForce, [JointId.by_value], :float],
|
|
256
|
+
[:MotorJoint_SetMaxVelocityTorque, :b2MotorJoint_SetMaxVelocityTorque, [JointId.by_value, :float], :void],
|
|
257
|
+
[:MotorJoint_GetMaxVelocityTorque, :b2MotorJoint_GetMaxVelocityTorque, [JointId.by_value], :float],
|
|
258
|
+
[:MotorJoint_SetLinearHertz, :b2MotorJoint_SetLinearHertz, [JointId.by_value, :float], :void],
|
|
259
|
+
[:MotorJoint_GetLinearHertz, :b2MotorJoint_GetLinearHertz, [JointId.by_value], :float],
|
|
260
|
+
[:MotorJoint_SetLinearDampingRatio, :b2MotorJoint_SetLinearDampingRatio, [JointId.by_value, :float], :void],
|
|
261
|
+
[:MotorJoint_GetLinearDampingRatio, :b2MotorJoint_GetLinearDampingRatio, [JointId.by_value], :float],
|
|
262
|
+
[:MotorJoint_SetAngularHertz, :b2MotorJoint_SetAngularHertz, [JointId.by_value, :float], :void],
|
|
263
|
+
[:MotorJoint_GetAngularHertz, :b2MotorJoint_GetAngularHertz, [JointId.by_value], :float],
|
|
264
|
+
[:MotorJoint_SetAngularDampingRatio, :b2MotorJoint_SetAngularDampingRatio, [JointId.by_value, :float], :void],
|
|
265
|
+
[:MotorJoint_GetAngularDampingRatio, :b2MotorJoint_GetAngularDampingRatio, [JointId.by_value], :float],
|
|
266
|
+
[:MotorJoint_SetMaxSpringForce, :b2MotorJoint_SetMaxSpringForce, [JointId.by_value, :float], :void],
|
|
267
|
+
[:MotorJoint_GetMaxSpringForce, :b2MotorJoint_GetMaxSpringForce, [JointId.by_value], :float],
|
|
268
|
+
[:MotorJoint_SetMaxSpringTorque, :b2MotorJoint_SetMaxSpringTorque, [JointId.by_value, :float], :void],
|
|
269
|
+
[:MotorJoint_GetMaxSpringTorque, :b2MotorJoint_GetMaxSpringTorque, [JointId.by_value], :float],
|
|
257
270
|
[:CreateFilterJoint, :b2CreateFilterJoint, [WorldId.by_value, :pointer], JointId.by_value],
|
|
258
271
|
[:CreatePrismaticJoint, :b2CreatePrismaticJoint, [WorldId.by_value, :pointer], JointId.by_value],
|
|
259
272
|
[:PrismaticJoint_EnableSpring, :b2PrismaticJoint_EnableSpring, [JointId.by_value, :bool], :void],
|
|
@@ -329,8 +342,7 @@ module Box2D
|
|
|
329
342
|
[:WheelJoint_GetMaxMotorTorque, :b2WheelJoint_GetMaxMotorTorque, [JointId.by_value], :float],
|
|
330
343
|
[:WheelJoint_GetMotorTorque, :b2WheelJoint_GetMotorTorque, [JointId.by_value], :float],
|
|
331
344
|
[:Contact_IsValid, :b2Contact_IsValid, [ContactId.by_value], :bool],
|
|
332
|
-
[:
|
|
333
|
-
[:Contact_GetShapeIds, :b2Contact_GetShapeIds, [ContactId.by_value, :pointer, :pointer], :void],
|
|
345
|
+
[:Contact_GetData, :b2Contact_GetData, [ContactId.by_value], ContactData.by_value],
|
|
334
346
|
]
|
|
335
347
|
entries.each do |entry|
|
|
336
348
|
api_name = if method_naming == :snake_case
|
|
@@ -62,6 +62,7 @@ module Box2D
|
|
|
62
62
|
[:MakeRot, :b2MakeRot, [:float], Rot.by_value],
|
|
63
63
|
[:MakeRotFromUnitVector, :b2MakeRotFromUnitVector, [Vec2.by_value], Rot.by_value],
|
|
64
64
|
[:IsNormalizedRot, :b2IsNormalizedRot, [Rot.by_value], :bool],
|
|
65
|
+
[:InvertRot, :b2InvertRot, [Rot.by_value], Rot.by_value],
|
|
65
66
|
[:NLerp, :b2NLerp, [Rot.by_value, Rot.by_value, :float], Rot.by_value],
|
|
66
67
|
[:ComputeAngularVelocity, :b2ComputeAngularVelocity, [Rot.by_value, Rot.by_value, :float], :float],
|
|
67
68
|
[:Rot_GetAngle, :b2Rot_GetAngle, [Rot.by_value], :float],
|
data/lib/box2d_types.rb
CHANGED
|
@@ -10,7 +10,6 @@ module Box2D
|
|
|
10
10
|
extend FFI::Library
|
|
11
11
|
# Define/Macro
|
|
12
12
|
|
|
13
|
-
DEFAULT_CATEGORY_BITS = 0x0001
|
|
14
13
|
|
|
15
14
|
# Enum
|
|
16
15
|
|
|
@@ -27,11 +26,10 @@ module Box2D
|
|
|
27
26
|
JointType_distanceJoint = 0
|
|
28
27
|
JointType_filterJoint = 1
|
|
29
28
|
JointType_motorJoint = 2
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
JointType_wheelJoint = 7
|
|
29
|
+
JointType_prismaticJoint = 3
|
|
30
|
+
JointType_revoluteJoint = 4
|
|
31
|
+
JointType_weldJoint = 5
|
|
32
|
+
JointType_wheelJoint = 6
|
|
35
33
|
HexColor_colorAliceBlue = 15792383
|
|
36
34
|
HexColor_colorAntiqueWhite = 16444375
|
|
37
35
|
HexColor_colorAqua = 65535
|
|
@@ -241,12 +239,13 @@ module Box2D
|
|
|
241
239
|
:hitEventThreshold, :float,
|
|
242
240
|
:contactHertz, :float,
|
|
243
241
|
:contactDampingRatio, :float,
|
|
244
|
-
:
|
|
242
|
+
:contactSpeed, :float,
|
|
245
243
|
:maximumLinearSpeed, :float,
|
|
246
244
|
:frictionCallback, :pointer,
|
|
247
245
|
:restitutionCallback, :pointer,
|
|
248
246
|
:enableSleep, :bool,
|
|
249
247
|
:enableContinuous, :bool,
|
|
248
|
+
:enableContactSoftening, :bool,
|
|
250
249
|
:workerCount, :int,
|
|
251
250
|
:enqueueTask, :pointer,
|
|
252
251
|
:finishTask, :pointer,
|
|
@@ -264,8 +263,8 @@ module Box2D
|
|
|
264
263
|
def contactHertz=(v) self[:contactHertz] = v end
|
|
265
264
|
def contactDampingRatio = self[:contactDampingRatio]
|
|
266
265
|
def contactDampingRatio=(v) self[:contactDampingRatio] = v end
|
|
267
|
-
def
|
|
268
|
-
def
|
|
266
|
+
def contactSpeed = self[:contactSpeed]
|
|
267
|
+
def contactSpeed=(v) self[:contactSpeed] = v end
|
|
269
268
|
def maximumLinearSpeed = self[:maximumLinearSpeed]
|
|
270
269
|
def maximumLinearSpeed=(v) self[:maximumLinearSpeed] = v end
|
|
271
270
|
def frictionCallback = self[:frictionCallback]
|
|
@@ -276,6 +275,8 @@ module Box2D
|
|
|
276
275
|
def enableSleep=(v) self[:enableSleep] = v end
|
|
277
276
|
def enableContinuous = self[:enableContinuous]
|
|
278
277
|
def enableContinuous=(v) self[:enableContinuous] = v end
|
|
278
|
+
def enableContactSoftening = self[:enableContactSoftening]
|
|
279
|
+
def enableContactSoftening=(v) self[:enableContactSoftening] = v end
|
|
279
280
|
def workerCount = self[:workerCount]
|
|
280
281
|
def workerCount=(v) self[:workerCount] = v end
|
|
281
282
|
def enqueueTask = self[:enqueueTask]
|
|
@@ -288,19 +289,20 @@ module Box2D
|
|
|
288
289
|
def userData=(v) self[:userData] = v end
|
|
289
290
|
def internalValue = self[:internalValue]
|
|
290
291
|
def internalValue=(v) self[:internalValue] = v end
|
|
291
|
-
def self.create_as(_gravity_, _restitutionThreshold_, _hitEventThreshold_, _contactHertz_, _contactDampingRatio_,
|
|
292
|
+
def self.create_as(_gravity_, _restitutionThreshold_, _hitEventThreshold_, _contactHertz_, _contactDampingRatio_, _contactSpeed_, _maximumLinearSpeed_, _frictionCallback_, _restitutionCallback_, _enableSleep_, _enableContinuous_, _enableContactSoftening_, _workerCount_, _enqueueTask_, _finishTask_, _userTaskContext_, _userData_, _internalValue_)
|
|
292
293
|
instance = WorldDef.new
|
|
293
294
|
instance[:gravity] = _gravity_
|
|
294
295
|
instance[:restitutionThreshold] = _restitutionThreshold_
|
|
295
296
|
instance[:hitEventThreshold] = _hitEventThreshold_
|
|
296
297
|
instance[:contactHertz] = _contactHertz_
|
|
297
298
|
instance[:contactDampingRatio] = _contactDampingRatio_
|
|
298
|
-
instance[:
|
|
299
|
+
instance[:contactSpeed] = _contactSpeed_
|
|
299
300
|
instance[:maximumLinearSpeed] = _maximumLinearSpeed_
|
|
300
301
|
instance[:frictionCallback] = _frictionCallback_
|
|
301
302
|
instance[:restitutionCallback] = _restitutionCallback_
|
|
302
303
|
instance[:enableSleep] = _enableSleep_
|
|
303
304
|
instance[:enableContinuous] = _enableContinuous_
|
|
305
|
+
instance[:enableContactSoftening] = _enableContactSoftening_
|
|
304
306
|
instance[:workerCount] = _workerCount_
|
|
305
307
|
instance[:enqueueTask] = _enqueueTask_
|
|
306
308
|
instance[:finishTask] = _finishTask_
|
|
@@ -311,6 +313,27 @@ module Box2D
|
|
|
311
313
|
end
|
|
312
314
|
end
|
|
313
315
|
|
|
316
|
+
class MotionLocks < FFI::Struct
|
|
317
|
+
layout(
|
|
318
|
+
:linearX, :bool,
|
|
319
|
+
:linearY, :bool,
|
|
320
|
+
:angularZ, :bool,
|
|
321
|
+
)
|
|
322
|
+
def linearX = self[:linearX]
|
|
323
|
+
def linearX=(v) self[:linearX] = v end
|
|
324
|
+
def linearY = self[:linearY]
|
|
325
|
+
def linearY=(v) self[:linearY] = v end
|
|
326
|
+
def angularZ = self[:angularZ]
|
|
327
|
+
def angularZ=(v) self[:angularZ] = v end
|
|
328
|
+
def self.create_as(_linearX_, _linearY_, _angularZ_)
|
|
329
|
+
instance = MotionLocks.new
|
|
330
|
+
instance[:linearX] = _linearX_
|
|
331
|
+
instance[:linearY] = _linearY_
|
|
332
|
+
instance[:angularZ] = _angularZ_
|
|
333
|
+
instance
|
|
334
|
+
end
|
|
335
|
+
end
|
|
336
|
+
|
|
314
337
|
class BodyDef < FFI::Struct
|
|
315
338
|
layout(
|
|
316
339
|
:type, :int,
|
|
@@ -324,9 +347,9 @@ module Box2D
|
|
|
324
347
|
:sleepThreshold, :float,
|
|
325
348
|
:name, :pointer,
|
|
326
349
|
:userData, :pointer,
|
|
350
|
+
:motionLocks, MotionLocks,
|
|
327
351
|
:enableSleep, :bool,
|
|
328
352
|
:isAwake, :bool,
|
|
329
|
-
:fixedRotation, :bool,
|
|
330
353
|
:isBullet, :bool,
|
|
331
354
|
:isEnabled, :bool,
|
|
332
355
|
:allowFastRotation, :bool,
|
|
@@ -354,12 +377,12 @@ module Box2D
|
|
|
354
377
|
def name=(v) self[:name] = v end
|
|
355
378
|
def userData = self[:userData]
|
|
356
379
|
def userData=(v) self[:userData] = v end
|
|
380
|
+
def motionLocks = self[:motionLocks]
|
|
381
|
+
def motionLocks=(v) self[:motionLocks] = v end
|
|
357
382
|
def enableSleep = self[:enableSleep]
|
|
358
383
|
def enableSleep=(v) self[:enableSleep] = v end
|
|
359
384
|
def isAwake = self[:isAwake]
|
|
360
385
|
def isAwake=(v) self[:isAwake] = v end
|
|
361
|
-
def fixedRotation = self[:fixedRotation]
|
|
362
|
-
def fixedRotation=(v) self[:fixedRotation] = v end
|
|
363
386
|
def isBullet = self[:isBullet]
|
|
364
387
|
def isBullet=(v) self[:isBullet] = v end
|
|
365
388
|
def isEnabled = self[:isEnabled]
|
|
@@ -368,7 +391,7 @@ module Box2D
|
|
|
368
391
|
def allowFastRotation=(v) self[:allowFastRotation] = v end
|
|
369
392
|
def internalValue = self[:internalValue]
|
|
370
393
|
def internalValue=(v) self[:internalValue] = v end
|
|
371
|
-
def self.create_as(_type_, _position_, _rotation_, _linearVelocity_, _angularVelocity_, _linearDamping_, _angularDamping_, _gravityScale_, _sleepThreshold_, _name_, _userData_, _enableSleep_, _isAwake_,
|
|
394
|
+
def self.create_as(_type_, _position_, _rotation_, _linearVelocity_, _angularVelocity_, _linearDamping_, _angularDamping_, _gravityScale_, _sleepThreshold_, _name_, _userData_, _motionLocks_, _enableSleep_, _isAwake_, _isBullet_, _isEnabled_, _allowFastRotation_, _internalValue_)
|
|
372
395
|
instance = BodyDef.new
|
|
373
396
|
instance[:type] = _type_
|
|
374
397
|
instance[:position] = _position_
|
|
@@ -381,9 +404,9 @@ module Box2D
|
|
|
381
404
|
instance[:sleepThreshold] = _sleepThreshold_
|
|
382
405
|
instance[:name] = _name_
|
|
383
406
|
instance[:userData] = _userData_
|
|
407
|
+
instance[:motionLocks] = _motionLocks_
|
|
384
408
|
instance[:enableSleep] = _enableSleep_
|
|
385
409
|
instance[:isAwake] = _isAwake_
|
|
386
|
-
instance[:fixedRotation] = _fixedRotation_
|
|
387
410
|
instance[:isBullet] = _isBullet_
|
|
388
411
|
instance[:isEnabled] = _isEnabled_
|
|
389
412
|
instance[:allowFastRotation] = _allowFastRotation_
|
|
@@ -436,7 +459,7 @@ module Box2D
|
|
|
436
459
|
:restitution, :float,
|
|
437
460
|
:rollingResistance, :float,
|
|
438
461
|
:tangentSpeed, :float,
|
|
439
|
-
:userMaterialId, :
|
|
462
|
+
:userMaterialId, :ulong_long,
|
|
440
463
|
:customColor, :uint,
|
|
441
464
|
)
|
|
442
465
|
def friction = self[:friction]
|
|
@@ -469,6 +492,7 @@ module Box2D
|
|
|
469
492
|
:material, SurfaceMaterial,
|
|
470
493
|
:density, :float,
|
|
471
494
|
:filter, Filter,
|
|
495
|
+
:enableCustomFiltering, :bool,
|
|
472
496
|
:isSensor, :bool,
|
|
473
497
|
:enableSensorEvents, :bool,
|
|
474
498
|
:enableContactEvents, :bool,
|
|
@@ -486,6 +510,8 @@ module Box2D
|
|
|
486
510
|
def density=(v) self[:density] = v end
|
|
487
511
|
def filter = self[:filter]
|
|
488
512
|
def filter=(v) self[:filter] = v end
|
|
513
|
+
def enableCustomFiltering = self[:enableCustomFiltering]
|
|
514
|
+
def enableCustomFiltering=(v) self[:enableCustomFiltering] = v end
|
|
489
515
|
def isSensor = self[:isSensor]
|
|
490
516
|
def isSensor=(v) self[:isSensor] = v end
|
|
491
517
|
def enableSensorEvents = self[:enableSensorEvents]
|
|
@@ -502,12 +528,13 @@ module Box2D
|
|
|
502
528
|
def updateBodyMass=(v) self[:updateBodyMass] = v end
|
|
503
529
|
def internalValue = self[:internalValue]
|
|
504
530
|
def internalValue=(v) self[:internalValue] = v end
|
|
505
|
-
def self.create_as(_userData_, _material_, _density_, _filter_, _isSensor_, _enableSensorEvents_, _enableContactEvents_, _enableHitEvents_, _enablePreSolveEvents_, _invokeContactCreation_, _updateBodyMass_, _internalValue_)
|
|
531
|
+
def self.create_as(_userData_, _material_, _density_, _filter_, _enableCustomFiltering_, _isSensor_, _enableSensorEvents_, _enableContactEvents_, _enableHitEvents_, _enablePreSolveEvents_, _invokeContactCreation_, _updateBodyMass_, _internalValue_)
|
|
506
532
|
instance = ShapeDef.new
|
|
507
533
|
instance[:userData] = _userData_
|
|
508
534
|
instance[:material] = _material_
|
|
509
535
|
instance[:density] = _density_
|
|
510
536
|
instance[:filter] = _filter_
|
|
537
|
+
instance[:enableCustomFiltering] = _enableCustomFiltering_
|
|
511
538
|
instance[:isSensor] = _isSensor_
|
|
512
539
|
instance[:enableSensorEvents] = _enableSensorEvents_
|
|
513
540
|
instance[:enableContactEvents] = _enableContactEvents_
|
|
@@ -571,7 +598,6 @@ module Box2D
|
|
|
571
598
|
:pairs, :float,
|
|
572
599
|
:collide, :float,
|
|
573
600
|
:solve, :float,
|
|
574
|
-
:mergeIslands, :float,
|
|
575
601
|
:prepareStages, :float,
|
|
576
602
|
:solveConstraints, :float,
|
|
577
603
|
:prepareConstraints, :float,
|
|
@@ -584,6 +610,7 @@ module Box2D
|
|
|
584
610
|
:storeImpulses, :float,
|
|
585
611
|
:splitIslands, :float,
|
|
586
612
|
:transforms, :float,
|
|
613
|
+
:sensorHits, :float,
|
|
587
614
|
:jointEvents, :float,
|
|
588
615
|
:hitEvents, :float,
|
|
589
616
|
:refit, :float,
|
|
@@ -599,8 +626,6 @@ module Box2D
|
|
|
599
626
|
def collide=(v) self[:collide] = v end
|
|
600
627
|
def solve = self[:solve]
|
|
601
628
|
def solve=(v) self[:solve] = v end
|
|
602
|
-
def mergeIslands = self[:mergeIslands]
|
|
603
|
-
def mergeIslands=(v) self[:mergeIslands] = v end
|
|
604
629
|
def prepareStages = self[:prepareStages]
|
|
605
630
|
def prepareStages=(v) self[:prepareStages] = v end
|
|
606
631
|
def solveConstraints = self[:solveConstraints]
|
|
@@ -625,6 +650,8 @@ module Box2D
|
|
|
625
650
|
def splitIslands=(v) self[:splitIslands] = v end
|
|
626
651
|
def transforms = self[:transforms]
|
|
627
652
|
def transforms=(v) self[:transforms] = v end
|
|
653
|
+
def sensorHits = self[:sensorHits]
|
|
654
|
+
def sensorHits=(v) self[:sensorHits] = v end
|
|
628
655
|
def jointEvents = self[:jointEvents]
|
|
629
656
|
def jointEvents=(v) self[:jointEvents] = v end
|
|
630
657
|
def hitEvents = self[:hitEvents]
|
|
@@ -637,13 +664,12 @@ module Box2D
|
|
|
637
664
|
def sleepIslands=(v) self[:sleepIslands] = v end
|
|
638
665
|
def sensors = self[:sensors]
|
|
639
666
|
def sensors=(v) self[:sensors] = v end
|
|
640
|
-
def self.create_as(_step_, _pairs_, _collide_, _solve_,
|
|
667
|
+
def self.create_as(_step_, _pairs_, _collide_, _solve_, _prepareStages_, _solveConstraints_, _prepareConstraints_, _integrateVelocities_, _warmStart_, _solveImpulses_, _integratePositions_, _relaxImpulses_, _applyRestitution_, _storeImpulses_, _splitIslands_, _transforms_, _sensorHits_, _jointEvents_, _hitEvents_, _refit_, _bullets_, _sleepIslands_, _sensors_)
|
|
641
668
|
instance = Profile.new
|
|
642
669
|
instance[:step] = _step_
|
|
643
670
|
instance[:pairs] = _pairs_
|
|
644
671
|
instance[:collide] = _collide_
|
|
645
672
|
instance[:solve] = _solve_
|
|
646
|
-
instance[:mergeIslands] = _mergeIslands_
|
|
647
673
|
instance[:prepareStages] = _prepareStages_
|
|
648
674
|
instance[:solveConstraints] = _solveConstraints_
|
|
649
675
|
instance[:prepareConstraints] = _prepareConstraints_
|
|
@@ -656,6 +682,7 @@ module Box2D
|
|
|
656
682
|
instance[:storeImpulses] = _storeImpulses_
|
|
657
683
|
instance[:splitIslands] = _splitIslands_
|
|
658
684
|
instance[:transforms] = _transforms_
|
|
685
|
+
instance[:sensorHits] = _sensorHits_
|
|
659
686
|
instance[:jointEvents] = _jointEvents_
|
|
660
687
|
instance[:hitEvents] = _hitEvents_
|
|
661
688
|
instance[:refit] = _refit_
|
|
@@ -678,7 +705,7 @@ module Box2D
|
|
|
678
705
|
:treeHeight, :int,
|
|
679
706
|
:byteCount, :int,
|
|
680
707
|
:taskCount, :int,
|
|
681
|
-
:colorCounts, [:int,
|
|
708
|
+
:colorCounts, [:int, 24],
|
|
682
709
|
)
|
|
683
710
|
def bodyCount = self[:bodyCount]
|
|
684
711
|
def bodyCount=(v) self[:bodyCount] = v end
|
|
@@ -728,7 +755,9 @@ module Box2D
|
|
|
728
755
|
:localFrameB, Transform,
|
|
729
756
|
:forceThreshold, :float,
|
|
730
757
|
:torqueThreshold, :float,
|
|
731
|
-
:
|
|
758
|
+
:constraintHertz, :float,
|
|
759
|
+
:constraintDampingRatio, :float,
|
|
760
|
+
:drawScale, :float,
|
|
732
761
|
:collideConnected, :bool,
|
|
733
762
|
)
|
|
734
763
|
def userData = self[:userData]
|
|
@@ -745,11 +774,15 @@ module Box2D
|
|
|
745
774
|
def forceThreshold=(v) self[:forceThreshold] = v end
|
|
746
775
|
def torqueThreshold = self[:torqueThreshold]
|
|
747
776
|
def torqueThreshold=(v) self[:torqueThreshold] = v end
|
|
748
|
-
def
|
|
749
|
-
def
|
|
777
|
+
def constraintHertz = self[:constraintHertz]
|
|
778
|
+
def constraintHertz=(v) self[:constraintHertz] = v end
|
|
779
|
+
def constraintDampingRatio = self[:constraintDampingRatio]
|
|
780
|
+
def constraintDampingRatio=(v) self[:constraintDampingRatio] = v end
|
|
781
|
+
def drawScale = self[:drawScale]
|
|
782
|
+
def drawScale=(v) self[:drawScale] = v end
|
|
750
783
|
def collideConnected = self[:collideConnected]
|
|
751
784
|
def collideConnected=(v) self[:collideConnected] = v end
|
|
752
|
-
def self.create_as(_userData_, _bodyIdA_, _bodyIdB_, _localFrameA_, _localFrameB_, _forceThreshold_, _torqueThreshold_,
|
|
785
|
+
def self.create_as(_userData_, _bodyIdA_, _bodyIdB_, _localFrameA_, _localFrameB_, _forceThreshold_, _torqueThreshold_, _constraintHertz_, _constraintDampingRatio_, _drawScale_, _collideConnected_)
|
|
753
786
|
instance = JointDef.new
|
|
754
787
|
instance[:userData] = _userData_
|
|
755
788
|
instance[:bodyIdA] = _bodyIdA_
|
|
@@ -758,7 +791,9 @@ module Box2D
|
|
|
758
791
|
instance[:localFrameB] = _localFrameB_
|
|
759
792
|
instance[:forceThreshold] = _forceThreshold_
|
|
760
793
|
instance[:torqueThreshold] = _torqueThreshold_
|
|
761
|
-
instance[:
|
|
794
|
+
instance[:constraintHertz] = _constraintHertz_
|
|
795
|
+
instance[:constraintDampingRatio] = _constraintDampingRatio_
|
|
796
|
+
instance[:drawScale] = _drawScale_
|
|
762
797
|
instance[:collideConnected] = _collideConnected_
|
|
763
798
|
instance
|
|
764
799
|
end
|
|
@@ -769,6 +804,8 @@ module Box2D
|
|
|
769
804
|
:base, JointDef,
|
|
770
805
|
:length, :float,
|
|
771
806
|
:enableSpring, :bool,
|
|
807
|
+
:lowerSpringForce, :float,
|
|
808
|
+
:upperSpringForce, :float,
|
|
772
809
|
:hertz, :float,
|
|
773
810
|
:dampingRatio, :float,
|
|
774
811
|
:enableLimit, :bool,
|
|
@@ -785,6 +822,10 @@ module Box2D
|
|
|
785
822
|
def length=(v) self[:length] = v end
|
|
786
823
|
def enableSpring = self[:enableSpring]
|
|
787
824
|
def enableSpring=(v) self[:enableSpring] = v end
|
|
825
|
+
def lowerSpringForce = self[:lowerSpringForce]
|
|
826
|
+
def lowerSpringForce=(v) self[:lowerSpringForce] = v end
|
|
827
|
+
def upperSpringForce = self[:upperSpringForce]
|
|
828
|
+
def upperSpringForce=(v) self[:upperSpringForce] = v end
|
|
788
829
|
def hertz = self[:hertz]
|
|
789
830
|
def hertz=(v) self[:hertz] = v end
|
|
790
831
|
def dampingRatio = self[:dampingRatio]
|
|
@@ -803,11 +844,13 @@ module Box2D
|
|
|
803
844
|
def motorSpeed=(v) self[:motorSpeed] = v end
|
|
804
845
|
def internalValue = self[:internalValue]
|
|
805
846
|
def internalValue=(v) self[:internalValue] = v end
|
|
806
|
-
def self.create_as(_base_, _length_, _enableSpring_, _hertz_, _dampingRatio_, _enableLimit_, _minLength_, _maxLength_, _enableMotor_, _maxMotorForce_, _motorSpeed_, _internalValue_)
|
|
847
|
+
def self.create_as(_base_, _length_, _enableSpring_, _lowerSpringForce_, _upperSpringForce_, _hertz_, _dampingRatio_, _enableLimit_, _minLength_, _maxLength_, _enableMotor_, _maxMotorForce_, _motorSpeed_, _internalValue_)
|
|
807
848
|
instance = DistanceJointDef.new
|
|
808
849
|
instance[:base] = _base_
|
|
809
850
|
instance[:length] = _length_
|
|
810
851
|
instance[:enableSpring] = _enableSpring_
|
|
852
|
+
instance[:lowerSpringForce] = _lowerSpringForce_
|
|
853
|
+
instance[:upperSpringForce] = _upperSpringForce_
|
|
811
854
|
instance[:hertz] = _hertz_
|
|
812
855
|
instance[:dampingRatio] = _dampingRatio_
|
|
813
856
|
instance[:enableLimit] = _enableLimit_
|
|
@@ -824,56 +867,55 @@ module Box2D
|
|
|
824
867
|
class MotorJointDef < FFI::Struct
|
|
825
868
|
layout(
|
|
826
869
|
:base, JointDef,
|
|
827
|
-
:
|
|
828
|
-
:
|
|
829
|
-
:
|
|
870
|
+
:linearVelocity, Vec2,
|
|
871
|
+
:maxVelocityForce, :float,
|
|
872
|
+
:angularVelocity, :float,
|
|
873
|
+
:maxVelocityTorque, :float,
|
|
874
|
+
:linearHertz, :float,
|
|
875
|
+
:linearDampingRatio, :float,
|
|
876
|
+
:maxSpringForce, :float,
|
|
877
|
+
:angularHertz, :float,
|
|
878
|
+
:angularDampingRatio, :float,
|
|
879
|
+
:maxSpringTorque, :float,
|
|
830
880
|
:internalValue, :int,
|
|
831
881
|
)
|
|
832
882
|
def base = self[:base]
|
|
833
883
|
def base=(v) self[:base] = v end
|
|
834
|
-
def
|
|
835
|
-
def
|
|
836
|
-
def
|
|
837
|
-
def
|
|
838
|
-
def
|
|
839
|
-
def
|
|
884
|
+
def linearVelocity = self[:linearVelocity]
|
|
885
|
+
def linearVelocity=(v) self[:linearVelocity] = v end
|
|
886
|
+
def maxVelocityForce = self[:maxVelocityForce]
|
|
887
|
+
def maxVelocityForce=(v) self[:maxVelocityForce] = v end
|
|
888
|
+
def angularVelocity = self[:angularVelocity]
|
|
889
|
+
def angularVelocity=(v) self[:angularVelocity] = v end
|
|
890
|
+
def maxVelocityTorque = self[:maxVelocityTorque]
|
|
891
|
+
def maxVelocityTorque=(v) self[:maxVelocityTorque] = v end
|
|
892
|
+
def linearHertz = self[:linearHertz]
|
|
893
|
+
def linearHertz=(v) self[:linearHertz] = v end
|
|
894
|
+
def linearDampingRatio = self[:linearDampingRatio]
|
|
895
|
+
def linearDampingRatio=(v) self[:linearDampingRatio] = v end
|
|
896
|
+
def maxSpringForce = self[:maxSpringForce]
|
|
897
|
+
def maxSpringForce=(v) self[:maxSpringForce] = v end
|
|
898
|
+
def angularHertz = self[:angularHertz]
|
|
899
|
+
def angularHertz=(v) self[:angularHertz] = v end
|
|
900
|
+
def angularDampingRatio = self[:angularDampingRatio]
|
|
901
|
+
def angularDampingRatio=(v) self[:angularDampingRatio] = v end
|
|
902
|
+
def maxSpringTorque = self[:maxSpringTorque]
|
|
903
|
+
def maxSpringTorque=(v) self[:maxSpringTorque] = v end
|
|
840
904
|
def internalValue = self[:internalValue]
|
|
841
905
|
def internalValue=(v) self[:internalValue] = v end
|
|
842
|
-
def self.create_as(_base_,
|
|
906
|
+
def self.create_as(_base_, _linearVelocity_, _maxVelocityForce_, _angularVelocity_, _maxVelocityTorque_, _linearHertz_, _linearDampingRatio_, _maxSpringForce_, _angularHertz_, _angularDampingRatio_, _maxSpringTorque_, _internalValue_)
|
|
843
907
|
instance = MotorJointDef.new
|
|
844
908
|
instance[:base] = _base_
|
|
845
|
-
instance[:
|
|
846
|
-
instance[:
|
|
847
|
-
instance[:
|
|
848
|
-
instance[:
|
|
849
|
-
instance
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
:base, JointDef,
|
|
856
|
-
:hertz, :float,
|
|
857
|
-
:dampingRatio, :float,
|
|
858
|
-
:maxForce, :float,
|
|
859
|
-
:internalValue, :int,
|
|
860
|
-
)
|
|
861
|
-
def base = self[:base]
|
|
862
|
-
def base=(v) self[:base] = v end
|
|
863
|
-
def hertz = self[:hertz]
|
|
864
|
-
def hertz=(v) self[:hertz] = v end
|
|
865
|
-
def dampingRatio = self[:dampingRatio]
|
|
866
|
-
def dampingRatio=(v) self[:dampingRatio] = v end
|
|
867
|
-
def maxForce = self[:maxForce]
|
|
868
|
-
def maxForce=(v) self[:maxForce] = v end
|
|
869
|
-
def internalValue = self[:internalValue]
|
|
870
|
-
def internalValue=(v) self[:internalValue] = v end
|
|
871
|
-
def self.create_as(_base_, _hertz_, _dampingRatio_, _maxForce_, _internalValue_)
|
|
872
|
-
instance = MouseJointDef.new
|
|
873
|
-
instance[:base] = _base_
|
|
874
|
-
instance[:hertz] = _hertz_
|
|
875
|
-
instance[:dampingRatio] = _dampingRatio_
|
|
876
|
-
instance[:maxForce] = _maxForce_
|
|
909
|
+
instance[:linearVelocity] = _linearVelocity_
|
|
910
|
+
instance[:maxVelocityForce] = _maxVelocityForce_
|
|
911
|
+
instance[:angularVelocity] = _angularVelocity_
|
|
912
|
+
instance[:maxVelocityTorque] = _maxVelocityTorque_
|
|
913
|
+
instance[:linearHertz] = _linearHertz_
|
|
914
|
+
instance[:linearDampingRatio] = _linearDampingRatio_
|
|
915
|
+
instance[:maxSpringForce] = _maxSpringForce_
|
|
916
|
+
instance[:angularHertz] = _angularHertz_
|
|
917
|
+
instance[:angularDampingRatio] = _angularDampingRatio_
|
|
918
|
+
instance[:maxSpringTorque] = _maxSpringTorque_
|
|
877
919
|
instance[:internalValue] = _internalValue_
|
|
878
920
|
instance
|
|
879
921
|
end
|
|
@@ -899,10 +941,10 @@ module Box2D
|
|
|
899
941
|
class PrismaticJointDef < FFI::Struct
|
|
900
942
|
layout(
|
|
901
943
|
:base, JointDef,
|
|
902
|
-
:targetTranslation, :float,
|
|
903
944
|
:enableSpring, :bool,
|
|
904
945
|
:hertz, :float,
|
|
905
946
|
:dampingRatio, :float,
|
|
947
|
+
:targetTranslation, :float,
|
|
906
948
|
:enableLimit, :bool,
|
|
907
949
|
:lowerTranslation, :float,
|
|
908
950
|
:upperTranslation, :float,
|
|
@@ -913,14 +955,14 @@ module Box2D
|
|
|
913
955
|
)
|
|
914
956
|
def base = self[:base]
|
|
915
957
|
def base=(v) self[:base] = v end
|
|
916
|
-
def targetTranslation = self[:targetTranslation]
|
|
917
|
-
def targetTranslation=(v) self[:targetTranslation] = v end
|
|
918
958
|
def enableSpring = self[:enableSpring]
|
|
919
959
|
def enableSpring=(v) self[:enableSpring] = v end
|
|
920
960
|
def hertz = self[:hertz]
|
|
921
961
|
def hertz=(v) self[:hertz] = v end
|
|
922
962
|
def dampingRatio = self[:dampingRatio]
|
|
923
963
|
def dampingRatio=(v) self[:dampingRatio] = v end
|
|
964
|
+
def targetTranslation = self[:targetTranslation]
|
|
965
|
+
def targetTranslation=(v) self[:targetTranslation] = v end
|
|
924
966
|
def enableLimit = self[:enableLimit]
|
|
925
967
|
def enableLimit=(v) self[:enableLimit] = v end
|
|
926
968
|
def lowerTranslation = self[:lowerTranslation]
|
|
@@ -935,13 +977,13 @@ module Box2D
|
|
|
935
977
|
def motorSpeed=(v) self[:motorSpeed] = v end
|
|
936
978
|
def internalValue = self[:internalValue]
|
|
937
979
|
def internalValue=(v) self[:internalValue] = v end
|
|
938
|
-
def self.create_as(_base_,
|
|
980
|
+
def self.create_as(_base_, _enableSpring_, _hertz_, _dampingRatio_, _targetTranslation_, _enableLimit_, _lowerTranslation_, _upperTranslation_, _enableMotor_, _maxMotorForce_, _motorSpeed_, _internalValue_)
|
|
939
981
|
instance = PrismaticJointDef.new
|
|
940
982
|
instance[:base] = _base_
|
|
941
|
-
instance[:targetTranslation] = _targetTranslation_
|
|
942
983
|
instance[:enableSpring] = _enableSpring_
|
|
943
984
|
instance[:hertz] = _hertz_
|
|
944
985
|
instance[:dampingRatio] = _dampingRatio_
|
|
986
|
+
instance[:targetTranslation] = _targetTranslation_
|
|
945
987
|
instance[:enableLimit] = _enableLimit_
|
|
946
988
|
instance[:lowerTranslation] = _lowerTranslation_
|
|
947
989
|
instance[:upperTranslation] = _upperTranslation_
|
|
@@ -1189,7 +1231,6 @@ module Box2D
|
|
|
1189
1231
|
:shapeIdA, ShapeId,
|
|
1190
1232
|
:shapeIdB, ShapeId,
|
|
1191
1233
|
:contactId, ContactId,
|
|
1192
|
-
:manifold, Manifold,
|
|
1193
1234
|
)
|
|
1194
1235
|
def shapeIdA = self[:shapeIdA]
|
|
1195
1236
|
def shapeIdA=(v) self[:shapeIdA] = v end
|
|
@@ -1197,14 +1238,11 @@ module Box2D
|
|
|
1197
1238
|
def shapeIdB=(v) self[:shapeIdB] = v end
|
|
1198
1239
|
def contactId = self[:contactId]
|
|
1199
1240
|
def contactId=(v) self[:contactId] = v end
|
|
1200
|
-
def
|
|
1201
|
-
def manifold=(v) self[:manifold] = v end
|
|
1202
|
-
def self.create_as(_shapeIdA_, _shapeIdB_, _contactId_, _manifold_)
|
|
1241
|
+
def self.create_as(_shapeIdA_, _shapeIdB_, _contactId_)
|
|
1203
1242
|
instance = ContactBeginTouchEvent.new
|
|
1204
1243
|
instance[:shapeIdA] = _shapeIdA_
|
|
1205
1244
|
instance[:shapeIdB] = _shapeIdB_
|
|
1206
1245
|
instance[:contactId] = _contactId_
|
|
1207
|
-
instance[:manifold] = _manifold_
|
|
1208
1246
|
instance
|
|
1209
1247
|
end
|
|
1210
1248
|
end
|
|
@@ -1234,6 +1272,7 @@ module Box2D
|
|
|
1234
1272
|
layout(
|
|
1235
1273
|
:shapeIdA, ShapeId,
|
|
1236
1274
|
:shapeIdB, ShapeId,
|
|
1275
|
+
:contactId, ContactId,
|
|
1237
1276
|
:point, Vec2,
|
|
1238
1277
|
:normal, Vec2,
|
|
1239
1278
|
:approachSpeed, :float,
|
|
@@ -1242,16 +1281,19 @@ module Box2D
|
|
|
1242
1281
|
def shapeIdA=(v) self[:shapeIdA] = v end
|
|
1243
1282
|
def shapeIdB = self[:shapeIdB]
|
|
1244
1283
|
def shapeIdB=(v) self[:shapeIdB] = v end
|
|
1284
|
+
def contactId = self[:contactId]
|
|
1285
|
+
def contactId=(v) self[:contactId] = v end
|
|
1245
1286
|
def point = self[:point]
|
|
1246
1287
|
def point=(v) self[:point] = v end
|
|
1247
1288
|
def normal = self[:normal]
|
|
1248
1289
|
def normal=(v) self[:normal] = v end
|
|
1249
1290
|
def approachSpeed = self[:approachSpeed]
|
|
1250
1291
|
def approachSpeed=(v) self[:approachSpeed] = v end
|
|
1251
|
-
def self.create_as(_shapeIdA_, _shapeIdB_, _point_, _normal_, _approachSpeed_)
|
|
1292
|
+
def self.create_as(_shapeIdA_, _shapeIdB_, _contactId_, _point_, _normal_, _approachSpeed_)
|
|
1252
1293
|
instance = ContactHitEvent.new
|
|
1253
1294
|
instance[:shapeIdA] = _shapeIdA_
|
|
1254
1295
|
instance[:shapeIdB] = _shapeIdB_
|
|
1296
|
+
instance[:contactId] = _contactId_
|
|
1255
1297
|
instance[:point] = _point_
|
|
1256
1298
|
instance[:normal] = _normal_
|
|
1257
1299
|
instance[:approachSpeed] = _approachSpeed_
|
|
@@ -1294,24 +1336,24 @@ module Box2D
|
|
|
1294
1336
|
|
|
1295
1337
|
class BodyMoveEvent < FFI::Struct
|
|
1296
1338
|
layout(
|
|
1339
|
+
:userData, :pointer,
|
|
1297
1340
|
:transform, Transform,
|
|
1298
1341
|
:bodyId, BodyId,
|
|
1299
|
-
:userData, :pointer,
|
|
1300
1342
|
:fellAsleep, :bool,
|
|
1301
1343
|
)
|
|
1344
|
+
def userData = self[:userData]
|
|
1345
|
+
def userData=(v) self[:userData] = v end
|
|
1302
1346
|
def transform = self[:transform]
|
|
1303
1347
|
def transform=(v) self[:transform] = v end
|
|
1304
1348
|
def bodyId = self[:bodyId]
|
|
1305
1349
|
def bodyId=(v) self[:bodyId] = v end
|
|
1306
|
-
def userData = self[:userData]
|
|
1307
|
-
def userData=(v) self[:userData] = v end
|
|
1308
1350
|
def fellAsleep = self[:fellAsleep]
|
|
1309
1351
|
def fellAsleep=(v) self[:fellAsleep] = v end
|
|
1310
|
-
def self.create_as(_transform_, _bodyId_,
|
|
1352
|
+
def self.create_as(_userData_, _transform_, _bodyId_, _fellAsleep_)
|
|
1311
1353
|
instance = BodyMoveEvent.new
|
|
1354
|
+
instance[:userData] = _userData_
|
|
1312
1355
|
instance[:transform] = _transform_
|
|
1313
1356
|
instance[:bodyId] = _bodyId_
|
|
1314
|
-
instance[:userData] = _userData_
|
|
1315
1357
|
instance[:fellAsleep] = _fellAsleep_
|
|
1316
1358
|
instance
|
|
1317
1359
|
end
|
|
@@ -1370,18 +1412,22 @@ module Box2D
|
|
|
1370
1412
|
|
|
1371
1413
|
class ContactData < FFI::Struct
|
|
1372
1414
|
layout(
|
|
1415
|
+
:contactId, ContactId,
|
|
1373
1416
|
:shapeIdA, ShapeId,
|
|
1374
1417
|
:shapeIdB, ShapeId,
|
|
1375
1418
|
:manifold, Manifold,
|
|
1376
1419
|
)
|
|
1420
|
+
def contactId = self[:contactId]
|
|
1421
|
+
def contactId=(v) self[:contactId] = v end
|
|
1377
1422
|
def shapeIdA = self[:shapeIdA]
|
|
1378
1423
|
def shapeIdA=(v) self[:shapeIdA] = v end
|
|
1379
1424
|
def shapeIdB = self[:shapeIdB]
|
|
1380
1425
|
def shapeIdB=(v) self[:shapeIdB] = v end
|
|
1381
1426
|
def manifold = self[:manifold]
|
|
1382
1427
|
def manifold=(v) self[:manifold] = v end
|
|
1383
|
-
def self.create_as(_shapeIdA_, _shapeIdB_, _manifold_)
|
|
1428
|
+
def self.create_as(_contactId_, _shapeIdA_, _shapeIdB_, _manifold_)
|
|
1384
1429
|
instance = ContactData.new
|
|
1430
|
+
instance[:contactId] = _contactId_
|
|
1385
1431
|
instance[:shapeIdA] = _shapeIdA_
|
|
1386
1432
|
instance[:shapeIdB] = _shapeIdB_
|
|
1387
1433
|
instance[:manifold] = _manifold_
|
|
@@ -1396,24 +1442,25 @@ module Box2D
|
|
|
1396
1442
|
:DrawCircleFcn, :pointer,
|
|
1397
1443
|
:DrawSolidCircleFcn, :pointer,
|
|
1398
1444
|
:DrawSolidCapsuleFcn, :pointer,
|
|
1399
|
-
:
|
|
1445
|
+
:DrawLineFcn, :pointer,
|
|
1400
1446
|
:DrawTransformFcn, :pointer,
|
|
1401
1447
|
:DrawPointFcn, :pointer,
|
|
1402
1448
|
:DrawStringFcn, :pointer,
|
|
1403
1449
|
:drawingBounds, AABB,
|
|
1404
|
-
:
|
|
1450
|
+
:forceScale, :float,
|
|
1451
|
+
:jointScale, :float,
|
|
1405
1452
|
:drawShapes, :bool,
|
|
1406
1453
|
:drawJoints, :bool,
|
|
1407
1454
|
:drawJointExtras, :bool,
|
|
1408
1455
|
:drawBounds, :bool,
|
|
1409
1456
|
:drawMass, :bool,
|
|
1410
1457
|
:drawBodyNames, :bool,
|
|
1411
|
-
:
|
|
1458
|
+
:drawContactPoints, :bool,
|
|
1412
1459
|
:drawGraphColors, :bool,
|
|
1413
|
-
:drawContactNormals, :bool,
|
|
1414
|
-
:drawContactImpulses, :bool,
|
|
1415
1460
|
:drawContactFeatures, :bool,
|
|
1416
|
-
:
|
|
1461
|
+
:drawContactNormals, :bool,
|
|
1462
|
+
:drawContactForces, :bool,
|
|
1463
|
+
:drawFrictionForces, :bool,
|
|
1417
1464
|
:drawIslands, :bool,
|
|
1418
1465
|
:context, :pointer,
|
|
1419
1466
|
)
|
|
@@ -1427,8 +1474,8 @@ module Box2D
|
|
|
1427
1474
|
def DrawSolidCircleFcn=(v) self[:DrawSolidCircleFcn] = v end
|
|
1428
1475
|
def DrawSolidCapsuleFcn = self[:DrawSolidCapsuleFcn]
|
|
1429
1476
|
def DrawSolidCapsuleFcn=(v) self[:DrawSolidCapsuleFcn] = v end
|
|
1430
|
-
def
|
|
1431
|
-
def
|
|
1477
|
+
def DrawLineFcn = self[:DrawLineFcn]
|
|
1478
|
+
def DrawLineFcn=(v) self[:DrawLineFcn] = v end
|
|
1432
1479
|
def DrawTransformFcn = self[:DrawTransformFcn]
|
|
1433
1480
|
def DrawTransformFcn=(v) self[:DrawTransformFcn] = v end
|
|
1434
1481
|
def DrawPointFcn = self[:DrawPointFcn]
|
|
@@ -1437,8 +1484,10 @@ module Box2D
|
|
|
1437
1484
|
def DrawStringFcn=(v) self[:DrawStringFcn] = v end
|
|
1438
1485
|
def drawingBounds = self[:drawingBounds]
|
|
1439
1486
|
def drawingBounds=(v) self[:drawingBounds] = v end
|
|
1440
|
-
def
|
|
1441
|
-
def
|
|
1487
|
+
def forceScale = self[:forceScale]
|
|
1488
|
+
def forceScale=(v) self[:forceScale] = v end
|
|
1489
|
+
def jointScale = self[:jointScale]
|
|
1490
|
+
def jointScale=(v) self[:jointScale] = v end
|
|
1442
1491
|
def drawShapes = self[:drawShapes]
|
|
1443
1492
|
def drawShapes=(v) self[:drawShapes] = v end
|
|
1444
1493
|
def drawJoints = self[:drawJoints]
|
|
@@ -1451,47 +1500,48 @@ module Box2D
|
|
|
1451
1500
|
def drawMass=(v) self[:drawMass] = v end
|
|
1452
1501
|
def drawBodyNames = self[:drawBodyNames]
|
|
1453
1502
|
def drawBodyNames=(v) self[:drawBodyNames] = v end
|
|
1454
|
-
def
|
|
1455
|
-
def
|
|
1503
|
+
def drawContactPoints = self[:drawContactPoints]
|
|
1504
|
+
def drawContactPoints=(v) self[:drawContactPoints] = v end
|
|
1456
1505
|
def drawGraphColors = self[:drawGraphColors]
|
|
1457
1506
|
def drawGraphColors=(v) self[:drawGraphColors] = v end
|
|
1458
|
-
def drawContactNormals = self[:drawContactNormals]
|
|
1459
|
-
def drawContactNormals=(v) self[:drawContactNormals] = v end
|
|
1460
|
-
def drawContactImpulses = self[:drawContactImpulses]
|
|
1461
|
-
def drawContactImpulses=(v) self[:drawContactImpulses] = v end
|
|
1462
1507
|
def drawContactFeatures = self[:drawContactFeatures]
|
|
1463
1508
|
def drawContactFeatures=(v) self[:drawContactFeatures] = v end
|
|
1464
|
-
def
|
|
1465
|
-
def
|
|
1509
|
+
def drawContactNormals = self[:drawContactNormals]
|
|
1510
|
+
def drawContactNormals=(v) self[:drawContactNormals] = v end
|
|
1511
|
+
def drawContactForces = self[:drawContactForces]
|
|
1512
|
+
def drawContactForces=(v) self[:drawContactForces] = v end
|
|
1513
|
+
def drawFrictionForces = self[:drawFrictionForces]
|
|
1514
|
+
def drawFrictionForces=(v) self[:drawFrictionForces] = v end
|
|
1466
1515
|
def drawIslands = self[:drawIslands]
|
|
1467
1516
|
def drawIslands=(v) self[:drawIslands] = v end
|
|
1468
1517
|
def context = self[:context]
|
|
1469
1518
|
def context=(v) self[:context] = v end
|
|
1470
|
-
def self.create_as(_DrawPolygonFcn_, _DrawSolidPolygonFcn_, _DrawCircleFcn_, _DrawSolidCircleFcn_, _DrawSolidCapsuleFcn_,
|
|
1519
|
+
def self.create_as(_DrawPolygonFcn_, _DrawSolidPolygonFcn_, _DrawCircleFcn_, _DrawSolidCircleFcn_, _DrawSolidCapsuleFcn_, _DrawLineFcn_, _DrawTransformFcn_, _DrawPointFcn_, _DrawStringFcn_, _drawingBounds_, _forceScale_, _jointScale_, _drawShapes_, _drawJoints_, _drawJointExtras_, _drawBounds_, _drawMass_, _drawBodyNames_, _drawContactPoints_, _drawGraphColors_, _drawContactFeatures_, _drawContactNormals_, _drawContactForces_, _drawFrictionForces_, _drawIslands_, _context_)
|
|
1471
1520
|
instance = DebugDraw.new
|
|
1472
1521
|
instance[:DrawPolygonFcn] = _DrawPolygonFcn_
|
|
1473
1522
|
instance[:DrawSolidPolygonFcn] = _DrawSolidPolygonFcn_
|
|
1474
1523
|
instance[:DrawCircleFcn] = _DrawCircleFcn_
|
|
1475
1524
|
instance[:DrawSolidCircleFcn] = _DrawSolidCircleFcn_
|
|
1476
1525
|
instance[:DrawSolidCapsuleFcn] = _DrawSolidCapsuleFcn_
|
|
1477
|
-
instance[:
|
|
1526
|
+
instance[:DrawLineFcn] = _DrawLineFcn_
|
|
1478
1527
|
instance[:DrawTransformFcn] = _DrawTransformFcn_
|
|
1479
1528
|
instance[:DrawPointFcn] = _DrawPointFcn_
|
|
1480
1529
|
instance[:DrawStringFcn] = _DrawStringFcn_
|
|
1481
1530
|
instance[:drawingBounds] = _drawingBounds_
|
|
1482
|
-
instance[:
|
|
1531
|
+
instance[:forceScale] = _forceScale_
|
|
1532
|
+
instance[:jointScale] = _jointScale_
|
|
1483
1533
|
instance[:drawShapes] = _drawShapes_
|
|
1484
1534
|
instance[:drawJoints] = _drawJoints_
|
|
1485
1535
|
instance[:drawJointExtras] = _drawJointExtras_
|
|
1486
1536
|
instance[:drawBounds] = _drawBounds_
|
|
1487
1537
|
instance[:drawMass] = _drawMass_
|
|
1488
1538
|
instance[:drawBodyNames] = _drawBodyNames_
|
|
1489
|
-
instance[:
|
|
1539
|
+
instance[:drawContactPoints] = _drawContactPoints_
|
|
1490
1540
|
instance[:drawGraphColors] = _drawGraphColors_
|
|
1491
|
-
instance[:drawContactNormals] = _drawContactNormals_
|
|
1492
|
-
instance[:drawContactImpulses] = _drawContactImpulses_
|
|
1493
1541
|
instance[:drawContactFeatures] = _drawContactFeatures_
|
|
1494
|
-
instance[:
|
|
1542
|
+
instance[:drawContactNormals] = _drawContactNormals_
|
|
1543
|
+
instance[:drawContactForces] = _drawContactForces_
|
|
1544
|
+
instance[:drawFrictionForces] = _drawFrictionForces_
|
|
1495
1545
|
instance[:drawIslands] = _drawIslands_
|
|
1496
1546
|
instance[:context] = _context_
|
|
1497
1547
|
instance
|
|
@@ -1512,7 +1562,6 @@ module Box2D
|
|
|
1512
1562
|
[:DefaultChainDef, :b2DefaultChainDef, [], ChainDef.by_value],
|
|
1513
1563
|
[:DefaultDistanceJointDef, :b2DefaultDistanceJointDef, [], DistanceJointDef.by_value],
|
|
1514
1564
|
[:DefaultMotorJointDef, :b2DefaultMotorJointDef, [], MotorJointDef.by_value],
|
|
1515
|
-
[:DefaultMouseJointDef, :b2DefaultMouseJointDef, [], MouseJointDef.by_value],
|
|
1516
1565
|
[:DefaultFilterJointDef, :b2DefaultFilterJointDef, [], FilterJointDef.by_value],
|
|
1517
1566
|
[:DefaultPrismaticJointDef, :b2DefaultPrismaticJointDef, [], PrismaticJointDef.by_value],
|
|
1518
1567
|
[:DefaultRevoluteJointDef, :b2DefaultRevoluteJointDef, [], RevoluteJointDef.by_value],
|
data/lib/libbox2d.aarch64.so
CHANGED
|
Binary file
|
data/lib/libbox2d.arm64.dylib
CHANGED
|
Binary file
|
data/lib/libbox2d.dll
CHANGED
|
Binary file
|
data/lib/libbox2d.x86_64.dylib
CHANGED
|
Binary file
|
data/lib/libbox2d.x86_64.so
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.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- vaiorabbit
|
|
8
8
|
bindir: bin
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: ffi
|
|
@@ -68,7 +68,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
68
68
|
- !ruby/object:Gem::Version
|
|
69
69
|
version: '0'
|
|
70
70
|
requirements: []
|
|
71
|
-
rubygems_version:
|
|
71
|
+
rubygems_version: 4.0.3
|
|
72
72
|
specification_version: 4
|
|
73
73
|
summary: Ruby bindings for Box2D
|
|
74
74
|
test_files: []
|