box2d-bindings 0.1.2 → 0.1.3
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 +0 -1
- data/lib/box2d_collision.rb +5 -5
- data/lib/box2d_id.rb +25 -0
- data/lib/box2d_id_inline.rb +4 -0
- data/lib/box2d_main.rb +17 -12
- data/lib/box2d_math_functions.rb +4 -3
- data/lib/box2d_math_inline_functions.rb +2 -1
- data/lib/box2d_types.rb +142 -219
- 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 +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1bddea8645aa9411d7a34eabb9d7f4f0e52ccc1b07e351bb6c3b6b236f6ed211
|
4
|
+
data.tar.gz: 5d55a7896cd3e072b0970442f884d384f5ec7f7027b8e060d6e57c902f23b9d6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8ca0c03cef5652f54b2c5c255e76e212642fabb7cd68540afa5541cff916b8218832f7fb6fabef56775009d551b9e2fce40489b3f758f802570f3a146d0a0e90
|
7
|
+
data.tar.gz: 939d11af3c428ebe1d0e5811d2f1f7a164fc20819d0922702211221eb51dd898b23bb0f08a08b263d5f41866aece701419d5ac5378ccb5ba54882e5282bfefea
|
data/ChangeLog
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
2025-06-06 vaiorabbit <http://twitter.com/vaiorabbit>
|
2
|
+
|
3
|
+
* https://github.com/erincatto/box2d/commit/d3d2b926c6694f46f8d511ee90cb3f553bf488b2
|
4
|
+
|
1
5
|
2025-05-11 vaiorabbit <http://twitter.com/vaiorabbit>
|
2
6
|
|
3
7
|
* https://github.com/erincatto/box2d/commit/2d088533b921e912c18c654f8b46c43e04ad0ca8
|
data/README.md
CHANGED
data/lib/box2d_base.rb
CHANGED
@@ -53,7 +53,6 @@ module Box2D
|
|
53
53
|
[:GetByteCount, :b2GetByteCount, [], :int],
|
54
54
|
[:SetAssertFcn, :b2SetAssertFcn, [:pointer], :void],
|
55
55
|
[:GetVersion, :b2GetVersion, [], Version.by_value],
|
56
|
-
[:InternalAssertFcn, :b2InternalAssertFcn, [:pointer, :pointer, :int], :int],
|
57
56
|
[:GetTicks, :b2GetTicks, [], :ulong_long],
|
58
57
|
[:GetMilliseconds, :b2GetMilliseconds, [:ulong_long], :float],
|
59
58
|
[:GetMillisecondsAndReset, :b2GetMillisecondsAndReset, [:pointer], :float],
|
data/lib/box2d_collision.rb
CHANGED
@@ -799,16 +799,16 @@ module Box2D
|
|
799
799
|
|
800
800
|
class PlaneSolverResult < FFI::Struct
|
801
801
|
layout(
|
802
|
-
:
|
802
|
+
:translation, Vec2,
|
803
803
|
:iterationCount, :int,
|
804
804
|
)
|
805
|
-
def
|
806
|
-
def
|
805
|
+
def translation = self[:translation]
|
806
|
+
def translation=(v) self[:translation] = v end
|
807
807
|
def iterationCount = self[:iterationCount]
|
808
808
|
def iterationCount=(v) self[:iterationCount] = v end
|
809
|
-
def self.create_as(
|
809
|
+
def self.create_as(_translation_, _iterationCount_)
|
810
810
|
instance = PlaneSolverResult.new
|
811
|
-
instance[:
|
811
|
+
instance[:translation] = _translation_
|
812
812
|
instance[:iterationCount] = _iterationCount_
|
813
813
|
instance
|
814
814
|
end
|
data/lib/box2d_id.rb
CHANGED
@@ -120,6 +120,31 @@ module Box2D
|
|
120
120
|
end
|
121
121
|
end
|
122
122
|
|
123
|
+
class ContactId < FFI::Struct
|
124
|
+
layout(
|
125
|
+
:index1, :int,
|
126
|
+
:world0, :ushort,
|
127
|
+
:padding, :short,
|
128
|
+
:generation, :uint,
|
129
|
+
)
|
130
|
+
def index1 = self[:index1]
|
131
|
+
def index1=(v) self[:index1] = v end
|
132
|
+
def world0 = self[:world0]
|
133
|
+
def world0=(v) self[:world0] = v end
|
134
|
+
def padding = self[:padding]
|
135
|
+
def padding=(v) self[:padding] = v end
|
136
|
+
def generation = self[:generation]
|
137
|
+
def generation=(v) self[:generation] = v end
|
138
|
+
def self.create_as(_index1_, _world0_, _padding_, _generation_)
|
139
|
+
instance = ContactId.new
|
140
|
+
instance[:index1] = _index1_
|
141
|
+
instance[:world0] = _world0_
|
142
|
+
instance[:padding] = _padding_
|
143
|
+
instance[:generation] = _generation_
|
144
|
+
instance
|
145
|
+
end
|
146
|
+
end
|
147
|
+
|
123
148
|
|
124
149
|
# Function
|
125
150
|
|
data/lib/box2d_id_inline.rb
CHANGED
@@ -24,6 +24,8 @@ module Box2D
|
|
24
24
|
|
25
25
|
def self.setup_id_inline_symbols(method_naming: :original)
|
26
26
|
entries = [
|
27
|
+
[:StoreWorldId, :b2StoreWorldId, [WorldId.by_value], :uint],
|
28
|
+
[:LoadWorldId, :b2LoadWorldId, [:uint], WorldId.by_value],
|
27
29
|
[:StoreBodyId, :b2StoreBodyId, [BodyId.by_value], :ulong_long],
|
28
30
|
[:LoadBodyId, :b2LoadBodyId, [:ulong_long], BodyId.by_value],
|
29
31
|
[:StoreShapeId, :b2StoreShapeId, [ShapeId.by_value], :ulong_long],
|
@@ -32,6 +34,8 @@ module Box2D
|
|
32
34
|
[:LoadChainId, :b2LoadChainId, [:ulong_long], ChainId.by_value],
|
33
35
|
[:StoreJointId, :b2StoreJointId, [JointId.by_value], :ulong_long],
|
34
36
|
[:LoadJointId, :b2LoadJointId, [:ulong_long], JointId.by_value],
|
37
|
+
[:StoreContactId, :b2StoreContactId, [ContactId.by_value, :pointer], :void],
|
38
|
+
[:LoadContactId, :b2LoadContactId, [:pointer], ContactId.by_value],
|
35
39
|
]
|
36
40
|
entries.each do |entry|
|
37
41
|
api_name = if method_naming == :snake_case
|
data/lib/box2d_main.rb
CHANGED
@@ -32,6 +32,7 @@ module Box2D
|
|
32
32
|
[:World_GetBodyEvents, :b2World_GetBodyEvents, [WorldId.by_value], BodyEvents.by_value],
|
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
|
+
[:World_GetJointEvents, :b2World_GetJointEvents, [WorldId.by_value], JointEvents.by_value],
|
35
36
|
[:World_OverlapAABB, :b2World_OverlapAABB, [WorldId.by_value, AABB.by_value, QueryFilter.by_value, :pointer, :pointer], TreeStats.by_value],
|
36
37
|
[:World_OverlapShape, :b2World_OverlapShape, [WorldId.by_value, :pointer, QueryFilter.by_value, :pointer, :pointer], TreeStats.by_value],
|
37
38
|
[:World_CastRay, :b2World_CastRay, [WorldId.by_value, Vec2.by_value, Vec2.by_value, QueryFilter.by_value, :pointer, :pointer], TreeStats.by_value],
|
@@ -53,7 +54,6 @@ module Box2D
|
|
53
54
|
[:World_GetGravity, :b2World_GetGravity, [WorldId.by_value], Vec2.by_value],
|
54
55
|
[:World_Explode, :b2World_Explode, [WorldId.by_value, :pointer], :void],
|
55
56
|
[:World_SetContactTuning, :b2World_SetContactTuning, [WorldId.by_value, :float, :float, :float], :void],
|
56
|
-
[:World_SetJointTuning, :b2World_SetJointTuning, [WorldId.by_value, :float, :float], :void],
|
57
57
|
[:World_SetMaximumLinearSpeed, :b2World_SetMaximumLinearSpeed, [WorldId.by_value, :float], :void],
|
58
58
|
[:World_GetMaximumLinearSpeed, :b2World_GetMaximumLinearSpeed, [WorldId.by_value], :float],
|
59
59
|
[:World_EnableWarmStarting, :b2World_EnableWarmStarting, [WorldId.by_value, :bool], :void],
|
@@ -154,8 +154,8 @@ module Box2D
|
|
154
154
|
[:Shape_GetRestitution, :b2Shape_GetRestitution, [ShapeId.by_value], :float],
|
155
155
|
[:Shape_SetMaterial, :b2Shape_SetMaterial, [ShapeId.by_value, :int], :void],
|
156
156
|
[:Shape_GetMaterial, :b2Shape_GetMaterial, [ShapeId.by_value], :int],
|
157
|
-
[:Shape_GetSurfaceMaterial, :b2Shape_GetSurfaceMaterial, [ShapeId.by_value], SurfaceMaterial.by_value],
|
158
157
|
[:Shape_SetSurfaceMaterial, :b2Shape_SetSurfaceMaterial, [ShapeId.by_value, SurfaceMaterial.by_value], :void],
|
158
|
+
[:Shape_GetSurfaceMaterial, :b2Shape_GetSurfaceMaterial, [ShapeId.by_value], SurfaceMaterial.by_value],
|
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
161
|
[:Shape_EnableSensorEvents, :b2Shape_EnableSensorEvents, [ShapeId.by_value, :bool], :void],
|
@@ -203,8 +203,10 @@ module Box2D
|
|
203
203
|
[:Joint_GetBodyA, :b2Joint_GetBodyA, [JointId.by_value], BodyId.by_value],
|
204
204
|
[:Joint_GetBodyB, :b2Joint_GetBodyB, [JointId.by_value], BodyId.by_value],
|
205
205
|
[:Joint_GetWorld, :b2Joint_GetWorld, [JointId.by_value], WorldId.by_value],
|
206
|
-
[:
|
207
|
-
[:
|
206
|
+
[:Joint_SetLocalFrameA, :b2Joint_SetLocalFrameA, [JointId.by_value, Transform.by_value], :void],
|
207
|
+
[:Joint_GetLocalFrameA, :b2Joint_GetLocalFrameA, [JointId.by_value], Transform.by_value],
|
208
|
+
[:Joint_SetLocalFrameB, :b2Joint_SetLocalFrameB, [JointId.by_value, Transform.by_value], :void],
|
209
|
+
[:Joint_GetLocalFrameB, :b2Joint_GetLocalFrameB, [JointId.by_value], Transform.by_value],
|
208
210
|
[:Joint_SetCollideConnected, :b2Joint_SetCollideConnected, [JointId.by_value, :bool], :void],
|
209
211
|
[:Joint_GetCollideConnected, :b2Joint_GetCollideConnected, [JointId.by_value], :bool],
|
210
212
|
[:Joint_SetUserData, :b2Joint_SetUserData, [JointId.by_value, :pointer], :void],
|
@@ -212,6 +214,10 @@ module Box2D
|
|
212
214
|
[:Joint_WakeBodies, :b2Joint_WakeBodies, [JointId.by_value], :void],
|
213
215
|
[:Joint_GetConstraintForce, :b2Joint_GetConstraintForce, [JointId.by_value], Vec2.by_value],
|
214
216
|
[:Joint_GetConstraintTorque, :b2Joint_GetConstraintTorque, [JointId.by_value], :float],
|
217
|
+
[:Joint_GetLinearSeparation, :b2Joint_GetLinearSeparation, [JointId.by_value], :float],
|
218
|
+
[:Joint_GetAngularSeparation, :b2Joint_GetAngularSeparation, [JointId.by_value], :float],
|
219
|
+
[:Joint_GetConstraintTuning, :b2Joint_GetConstraintTuning, [JointId.by_value, :pointer, :pointer], :void],
|
220
|
+
[:Joint_SetConstraintTuning, :b2Joint_SetConstraintTuning, [JointId.by_value, :float, :float], :void],
|
215
221
|
[:CreateDistanceJoint, :b2CreateDistanceJoint, [WorldId.by_value, :pointer], JointId.by_value],
|
216
222
|
[:DistanceJoint_SetLength, :b2DistanceJoint_SetLength, [JointId.by_value, :float], :void],
|
217
223
|
[:DistanceJoint_GetLength, :b2DistanceJoint_GetLength, [JointId.by_value], :float],
|
@@ -235,10 +241,6 @@ module Box2D
|
|
235
241
|
[:DistanceJoint_GetMaxMotorForce, :b2DistanceJoint_GetMaxMotorForce, [JointId.by_value], :float],
|
236
242
|
[:DistanceJoint_GetMotorForce, :b2DistanceJoint_GetMotorForce, [JointId.by_value], :float],
|
237
243
|
[:CreateMotorJoint, :b2CreateMotorJoint, [WorldId.by_value, :pointer], JointId.by_value],
|
238
|
-
[:MotorJoint_SetLinearOffset, :b2MotorJoint_SetLinearOffset, [JointId.by_value, Vec2.by_value], :void],
|
239
|
-
[:MotorJoint_GetLinearOffset, :b2MotorJoint_GetLinearOffset, [JointId.by_value], Vec2.by_value],
|
240
|
-
[:MotorJoint_SetAngularOffset, :b2MotorJoint_SetAngularOffset, [JointId.by_value, :float], :void],
|
241
|
-
[:MotorJoint_GetAngularOffset, :b2MotorJoint_GetAngularOffset, [JointId.by_value], :float],
|
242
244
|
[:MotorJoint_SetMaxForce, :b2MotorJoint_SetMaxForce, [JointId.by_value, :float], :void],
|
243
245
|
[:MotorJoint_GetMaxForce, :b2MotorJoint_GetMaxForce, [JointId.by_value], :float],
|
244
246
|
[:MotorJoint_SetMaxTorque, :b2MotorJoint_SetMaxTorque, [JointId.by_value, :float], :void],
|
@@ -246,8 +248,6 @@ module Box2D
|
|
246
248
|
[:MotorJoint_SetCorrectionFactor, :b2MotorJoint_SetCorrectionFactor, [JointId.by_value, :float], :void],
|
247
249
|
[:MotorJoint_GetCorrectionFactor, :b2MotorJoint_GetCorrectionFactor, [JointId.by_value], :float],
|
248
250
|
[:CreateMouseJoint, :b2CreateMouseJoint, [WorldId.by_value, :pointer], JointId.by_value],
|
249
|
-
[:MouseJoint_SetTarget, :b2MouseJoint_SetTarget, [JointId.by_value, Vec2.by_value], :void],
|
250
|
-
[:MouseJoint_GetTarget, :b2MouseJoint_GetTarget, [JointId.by_value], Vec2.by_value],
|
251
251
|
[:MouseJoint_SetSpringHertz, :b2MouseJoint_SetSpringHertz, [JointId.by_value, :float], :void],
|
252
252
|
[:MouseJoint_GetSpringHertz, :b2MouseJoint_GetSpringHertz, [JointId.by_value], :float],
|
253
253
|
[:MouseJoint_SetSpringDampingRatio, :b2MouseJoint_SetSpringDampingRatio, [JointId.by_value, :float], :void],
|
@@ -262,6 +262,8 @@ module Box2D
|
|
262
262
|
[:PrismaticJoint_GetSpringHertz, :b2PrismaticJoint_GetSpringHertz, [JointId.by_value], :float],
|
263
263
|
[:PrismaticJoint_SetSpringDampingRatio, :b2PrismaticJoint_SetSpringDampingRatio, [JointId.by_value, :float], :void],
|
264
264
|
[:PrismaticJoint_GetSpringDampingRatio, :b2PrismaticJoint_GetSpringDampingRatio, [JointId.by_value], :float],
|
265
|
+
[:PrismaticJoint_SetTargetTranslation, :b2PrismaticJoint_SetTargetTranslation, [JointId.by_value, :float], :void],
|
266
|
+
[:PrismaticJoint_GetTargetTranslation, :b2PrismaticJoint_GetTargetTranslation, [JointId.by_value], :float],
|
265
267
|
[:PrismaticJoint_EnableLimit, :b2PrismaticJoint_EnableLimit, [JointId.by_value, :bool], :void],
|
266
268
|
[:PrismaticJoint_IsLimitEnabled, :b2PrismaticJoint_IsLimitEnabled, [JointId.by_value], :bool],
|
267
269
|
[:PrismaticJoint_GetLowerLimit, :b2PrismaticJoint_GetLowerLimit, [JointId.by_value], :float],
|
@@ -283,6 +285,8 @@ module Box2D
|
|
283
285
|
[:RevoluteJoint_GetSpringHertz, :b2RevoluteJoint_GetSpringHertz, [JointId.by_value], :float],
|
284
286
|
[:RevoluteJoint_SetSpringDampingRatio, :b2RevoluteJoint_SetSpringDampingRatio, [JointId.by_value, :float], :void],
|
285
287
|
[:RevoluteJoint_GetSpringDampingRatio, :b2RevoluteJoint_GetSpringDampingRatio, [JointId.by_value], :float],
|
288
|
+
[:RevoluteJoint_SetTargetAngle, :b2RevoluteJoint_SetTargetAngle, [JointId.by_value, :float], :void],
|
289
|
+
[:RevoluteJoint_GetTargetAngle, :b2RevoluteJoint_GetTargetAngle, [JointId.by_value], :float],
|
286
290
|
[:RevoluteJoint_GetAngle, :b2RevoluteJoint_GetAngle, [JointId.by_value], :float],
|
287
291
|
[:RevoluteJoint_EnableLimit, :b2RevoluteJoint_EnableLimit, [JointId.by_value, :bool], :void],
|
288
292
|
[:RevoluteJoint_IsLimitEnabled, :b2RevoluteJoint_IsLimitEnabled, [JointId.by_value], :bool],
|
@@ -297,8 +301,6 @@ module Box2D
|
|
297
301
|
[:RevoluteJoint_SetMaxMotorTorque, :b2RevoluteJoint_SetMaxMotorTorque, [JointId.by_value, :float], :void],
|
298
302
|
[:RevoluteJoint_GetMaxMotorTorque, :b2RevoluteJoint_GetMaxMotorTorque, [JointId.by_value], :float],
|
299
303
|
[:CreateWeldJoint, :b2CreateWeldJoint, [WorldId.by_value, :pointer], JointId.by_value],
|
300
|
-
[:WeldJoint_GetReferenceAngle, :b2WeldJoint_GetReferenceAngle, [JointId.by_value], :float],
|
301
|
-
[:WeldJoint_SetReferenceAngle, :b2WeldJoint_SetReferenceAngle, [JointId.by_value, :float], :void],
|
302
304
|
[:WeldJoint_SetLinearHertz, :b2WeldJoint_SetLinearHertz, [JointId.by_value, :float], :void],
|
303
305
|
[:WeldJoint_GetLinearHertz, :b2WeldJoint_GetLinearHertz, [JointId.by_value], :float],
|
304
306
|
[:WeldJoint_SetLinearDampingRatio, :b2WeldJoint_SetLinearDampingRatio, [JointId.by_value, :float], :void],
|
@@ -326,6 +328,9 @@ module Box2D
|
|
326
328
|
[:WheelJoint_SetMaxMotorTorque, :b2WheelJoint_SetMaxMotorTorque, [JointId.by_value, :float], :void],
|
327
329
|
[:WheelJoint_GetMaxMotorTorque, :b2WheelJoint_GetMaxMotorTorque, [JointId.by_value], :float],
|
328
330
|
[:WheelJoint_GetMotorTorque, :b2WheelJoint_GetMotorTorque, [JointId.by_value], :float],
|
331
|
+
[:Contact_IsValid, :b2Contact_IsValid, [ContactId.by_value], :bool],
|
332
|
+
[:Contact_GetManifold, :b2Contact_GetManifold, [ContactId.by_value], Manifold.by_value],
|
333
|
+
[:Contact_GetShapeIds, :b2Contact_GetShapeIds, [ContactId.by_value, :pointer, :pointer], :void],
|
329
334
|
]
|
330
335
|
entries.each do |entry|
|
331
336
|
api_name = if method_naming == :snake_case
|
data/lib/box2d_math_functions.rb
CHANGED
@@ -143,14 +143,15 @@ module Box2D
|
|
143
143
|
|
144
144
|
def self.setup_math_functions_symbols(method_naming: :original)
|
145
145
|
entries = [
|
146
|
-
[:Atan2, :b2Atan2, [:float, :float], :float],
|
147
|
-
[:ComputeCosSin, :b2ComputeCosSin, [:float], CosSin.by_value],
|
148
|
-
[:ComputeRotationBetweenUnitVectors, :b2ComputeRotationBetweenUnitVectors, [Vec2.by_value, Vec2.by_value], Rot.by_value],
|
149
146
|
[:IsValidFloat, :b2IsValidFloat, [:float], :bool],
|
150
147
|
[:IsValidVec2, :b2IsValidVec2, [Vec2.by_value], :bool],
|
151
148
|
[:IsValidRotation, :b2IsValidRotation, [Rot.by_value], :bool],
|
149
|
+
[:IsValidTransform, :b2IsValidTransform, [Transform.by_value], :bool],
|
152
150
|
[:IsValidAABB, :b2IsValidAABB, [AABB.by_value], :bool],
|
153
151
|
[:IsValidPlane, :b2IsValidPlane, [Plane.by_value], :bool],
|
152
|
+
[:Atan2, :b2Atan2, [:float, :float], :float],
|
153
|
+
[:ComputeCosSin, :b2ComputeCosSin, [:float], CosSin.by_value],
|
154
|
+
[:ComputeRotationBetweenUnitVectors, :b2ComputeRotationBetweenUnitVectors, [Vec2.by_value, Vec2.by_value], Rot.by_value],
|
154
155
|
[:SetLengthUnitsPerMeter, :b2SetLengthUnitsPerMeter, [:float], :void],
|
155
156
|
[:GetLengthUnitsPerMeter, :b2GetLengthUnitsPerMeter, [], :float],
|
156
157
|
]
|
@@ -60,6 +60,7 @@ module Box2D
|
|
60
60
|
[:LengthSquared, :b2LengthSquared, [Vec2.by_value], :float],
|
61
61
|
[:DistanceSquared, :b2DistanceSquared, [Vec2.by_value, Vec2.by_value], :float],
|
62
62
|
[:MakeRot, :b2MakeRot, [:float], Rot.by_value],
|
63
|
+
[:MakeRotFromUnitVector, :b2MakeRotFromUnitVector, [Vec2.by_value], Rot.by_value],
|
63
64
|
[:IsNormalizedRot, :b2IsNormalizedRot, [Rot.by_value], :bool],
|
64
65
|
[:NLerp, :b2NLerp, [Rot.by_value, Rot.by_value, :float], Rot.by_value],
|
65
66
|
[:ComputeAngularVelocity, :b2ComputeAngularVelocity, [Rot.by_value, Rot.by_value, :float], :float],
|
@@ -70,7 +71,6 @@ module Box2D
|
|
70
71
|
[:InvMulRot, :b2InvMulRot, [Rot.by_value, Rot.by_value], Rot.by_value],
|
71
72
|
[:RelativeAngle, :b2RelativeAngle, [Rot.by_value, Rot.by_value], :float],
|
72
73
|
[:UnwindAngle, :b2UnwindAngle, [:float], :float],
|
73
|
-
[:UnwindLargeAngle, :b2UnwindLargeAngle, [:float], :float],
|
74
74
|
[:RotateVector, :b2RotateVector, [Rot.by_value, Vec2.by_value], Vec2.by_value],
|
75
75
|
[:InvRotateVector, :b2InvRotateVector, [Rot.by_value, Vec2.by_value], Vec2.by_value],
|
76
76
|
[:TransformPoint, :b2TransformPoint, [Transform.by_value, Vec2.by_value], Vec2.by_value],
|
@@ -87,6 +87,7 @@ module Box2D
|
|
87
87
|
[:AABB_Overlaps, :b2AABB_Overlaps, [AABB.by_value, AABB.by_value], :bool],
|
88
88
|
[:MakeAABB, :b2MakeAABB, [:pointer, :int, :float], AABB.by_value],
|
89
89
|
[:PlaneSeparation, :b2PlaneSeparation, [Plane.by_value, Vec2.by_value], :float],
|
90
|
+
[:SpringDamper, :b2SpringDamper, [:float, :float, :float, :float, :float], :float],
|
90
91
|
]
|
91
92
|
entries.each do |entry|
|
92
93
|
api_name = if method_naming == :snake_case
|
data/lib/box2d_types.rb
CHANGED
@@ -242,8 +242,6 @@ module Box2D
|
|
242
242
|
:contactHertz, :float,
|
243
243
|
:contactDampingRatio, :float,
|
244
244
|
:maxContactPushSpeed, :float,
|
245
|
-
:jointHertz, :float,
|
246
|
-
:jointDampingRatio, :float,
|
247
245
|
:maximumLinearSpeed, :float,
|
248
246
|
:frictionCallback, :pointer,
|
249
247
|
:restitutionCallback, :pointer,
|
@@ -268,10 +266,6 @@ module Box2D
|
|
268
266
|
def contactDampingRatio=(v) self[:contactDampingRatio] = v end
|
269
267
|
def maxContactPushSpeed = self[:maxContactPushSpeed]
|
270
268
|
def maxContactPushSpeed=(v) self[:maxContactPushSpeed] = v end
|
271
|
-
def jointHertz = self[:jointHertz]
|
272
|
-
def jointHertz=(v) self[:jointHertz] = v end
|
273
|
-
def jointDampingRatio = self[:jointDampingRatio]
|
274
|
-
def jointDampingRatio=(v) self[:jointDampingRatio] = v end
|
275
269
|
def maximumLinearSpeed = self[:maximumLinearSpeed]
|
276
270
|
def maximumLinearSpeed=(v) self[:maximumLinearSpeed] = v end
|
277
271
|
def frictionCallback = self[:frictionCallback]
|
@@ -294,7 +288,7 @@ module Box2D
|
|
294
288
|
def userData=(v) self[:userData] = v end
|
295
289
|
def internalValue = self[:internalValue]
|
296
290
|
def internalValue=(v) self[:internalValue] = v end
|
297
|
-
def self.create_as(_gravity_, _restitutionThreshold_, _hitEventThreshold_, _contactHertz_, _contactDampingRatio_, _maxContactPushSpeed_,
|
291
|
+
def self.create_as(_gravity_, _restitutionThreshold_, _hitEventThreshold_, _contactHertz_, _contactDampingRatio_, _maxContactPushSpeed_, _maximumLinearSpeed_, _frictionCallback_, _restitutionCallback_, _enableSleep_, _enableContinuous_, _workerCount_, _enqueueTask_, _finishTask_, _userTaskContext_, _userData_, _internalValue_)
|
298
292
|
instance = WorldDef.new
|
299
293
|
instance[:gravity] = _gravity_
|
300
294
|
instance[:restitutionThreshold] = _restitutionThreshold_
|
@@ -302,8 +296,6 @@ module Box2D
|
|
302
296
|
instance[:contactHertz] = _contactHertz_
|
303
297
|
instance[:contactDampingRatio] = _contactDampingRatio_
|
304
298
|
instance[:maxContactPushSpeed] = _maxContactPushSpeed_
|
305
|
-
instance[:jointHertz] = _jointHertz_
|
306
|
-
instance[:jointDampingRatio] = _jointDampingRatio_
|
307
299
|
instance[:maximumLinearSpeed] = _maximumLinearSpeed_
|
308
300
|
instance[:frictionCallback] = _frictionCallback_
|
309
301
|
instance[:restitutionCallback] = _restitutionCallback_
|
@@ -592,6 +584,7 @@ module Box2D
|
|
592
584
|
:storeImpulses, :float,
|
593
585
|
:splitIslands, :float,
|
594
586
|
:transforms, :float,
|
587
|
+
:jointEvents, :float,
|
595
588
|
:hitEvents, :float,
|
596
589
|
:refit, :float,
|
597
590
|
:bullets, :float,
|
@@ -632,6 +625,8 @@ module Box2D
|
|
632
625
|
def splitIslands=(v) self[:splitIslands] = v end
|
633
626
|
def transforms = self[:transforms]
|
634
627
|
def transforms=(v) self[:transforms] = v end
|
628
|
+
def jointEvents = self[:jointEvents]
|
629
|
+
def jointEvents=(v) self[:jointEvents] = v end
|
635
630
|
def hitEvents = self[:hitEvents]
|
636
631
|
def hitEvents=(v) self[:hitEvents] = v end
|
637
632
|
def refit = self[:refit]
|
@@ -642,7 +637,7 @@ module Box2D
|
|
642
637
|
def sleepIslands=(v) self[:sleepIslands] = v end
|
643
638
|
def sensors = self[:sensors]
|
644
639
|
def sensors=(v) self[:sensors] = v end
|
645
|
-
def self.create_as(_step_, _pairs_, _collide_, _solve_, _mergeIslands_, _prepareStages_, _solveConstraints_, _prepareConstraints_, _integrateVelocities_, _warmStart_, _solveImpulses_, _integratePositions_, _relaxImpulses_, _applyRestitution_, _storeImpulses_, _splitIslands_, _transforms_, _hitEvents_, _refit_, _bullets_, _sleepIslands_, _sensors_)
|
640
|
+
def self.create_as(_step_, _pairs_, _collide_, _solve_, _mergeIslands_, _prepareStages_, _solveConstraints_, _prepareConstraints_, _integrateVelocities_, _warmStart_, _solveImpulses_, _integratePositions_, _relaxImpulses_, _applyRestitution_, _storeImpulses_, _splitIslands_, _transforms_, _jointEvents_, _hitEvents_, _refit_, _bullets_, _sleepIslands_, _sensors_)
|
646
641
|
instance = Profile.new
|
647
642
|
instance[:step] = _step_
|
648
643
|
instance[:pairs] = _pairs_
|
@@ -661,6 +656,7 @@ module Box2D
|
|
661
656
|
instance[:storeImpulses] = _storeImpulses_
|
662
657
|
instance[:splitIslands] = _splitIslands_
|
663
658
|
instance[:transforms] = _transforms_
|
659
|
+
instance[:jointEvents] = _jointEvents_
|
664
660
|
instance[:hitEvents] = _hitEvents_
|
665
661
|
instance[:refit] = _refit_
|
666
662
|
instance[:bullets] = _bullets_
|
@@ -723,12 +719,54 @@ module Box2D
|
|
723
719
|
end
|
724
720
|
end
|
725
721
|
|
726
|
-
class
|
722
|
+
class JointDef < FFI::Struct
|
727
723
|
layout(
|
724
|
+
:userData, :pointer,
|
728
725
|
:bodyIdA, BodyId,
|
729
726
|
:bodyIdB, BodyId,
|
730
|
-
:
|
731
|
-
:
|
727
|
+
:localFrameA, Transform,
|
728
|
+
:localFrameB, Transform,
|
729
|
+
:forceThreshold, :float,
|
730
|
+
:torqueThreshold, :float,
|
731
|
+
:drawSize, :float,
|
732
|
+
:collideConnected, :bool,
|
733
|
+
)
|
734
|
+
def userData = self[:userData]
|
735
|
+
def userData=(v) self[:userData] = v end
|
736
|
+
def bodyIdA = self[:bodyIdA]
|
737
|
+
def bodyIdA=(v) self[:bodyIdA] = v end
|
738
|
+
def bodyIdB = self[:bodyIdB]
|
739
|
+
def bodyIdB=(v) self[:bodyIdB] = v end
|
740
|
+
def localFrameA = self[:localFrameA]
|
741
|
+
def localFrameA=(v) self[:localFrameA] = v end
|
742
|
+
def localFrameB = self[:localFrameB]
|
743
|
+
def localFrameB=(v) self[:localFrameB] = v end
|
744
|
+
def forceThreshold = self[:forceThreshold]
|
745
|
+
def forceThreshold=(v) self[:forceThreshold] = v end
|
746
|
+
def torqueThreshold = self[:torqueThreshold]
|
747
|
+
def torqueThreshold=(v) self[:torqueThreshold] = v end
|
748
|
+
def drawSize = self[:drawSize]
|
749
|
+
def drawSize=(v) self[:drawSize] = v end
|
750
|
+
def collideConnected = self[:collideConnected]
|
751
|
+
def collideConnected=(v) self[:collideConnected] = v end
|
752
|
+
def self.create_as(_userData_, _bodyIdA_, _bodyIdB_, _localFrameA_, _localFrameB_, _forceThreshold_, _torqueThreshold_, _drawSize_, _collideConnected_)
|
753
|
+
instance = JointDef.new
|
754
|
+
instance[:userData] = _userData_
|
755
|
+
instance[:bodyIdA] = _bodyIdA_
|
756
|
+
instance[:bodyIdB] = _bodyIdB_
|
757
|
+
instance[:localFrameA] = _localFrameA_
|
758
|
+
instance[:localFrameB] = _localFrameB_
|
759
|
+
instance[:forceThreshold] = _forceThreshold_
|
760
|
+
instance[:torqueThreshold] = _torqueThreshold_
|
761
|
+
instance[:drawSize] = _drawSize_
|
762
|
+
instance[:collideConnected] = _collideConnected_
|
763
|
+
instance
|
764
|
+
end
|
765
|
+
end
|
766
|
+
|
767
|
+
class DistanceJointDef < FFI::Struct
|
768
|
+
layout(
|
769
|
+
:base, JointDef,
|
732
770
|
:length, :float,
|
733
771
|
:enableSpring, :bool,
|
734
772
|
:hertz, :float,
|
@@ -739,18 +777,10 @@ module Box2D
|
|
739
777
|
:enableMotor, :bool,
|
740
778
|
:maxMotorForce, :float,
|
741
779
|
:motorSpeed, :float,
|
742
|
-
:collideConnected, :bool,
|
743
|
-
:userData, :pointer,
|
744
780
|
:internalValue, :int,
|
745
781
|
)
|
746
|
-
def
|
747
|
-
def
|
748
|
-
def bodyIdB = self[:bodyIdB]
|
749
|
-
def bodyIdB=(v) self[:bodyIdB] = v end
|
750
|
-
def localAnchorA = self[:localAnchorA]
|
751
|
-
def localAnchorA=(v) self[:localAnchorA] = v end
|
752
|
-
def localAnchorB = self[:localAnchorB]
|
753
|
-
def localAnchorB=(v) self[:localAnchorB] = v end
|
782
|
+
def base = self[:base]
|
783
|
+
def base=(v) self[:base] = v end
|
754
784
|
def length = self[:length]
|
755
785
|
def length=(v) self[:length] = v end
|
756
786
|
def enableSpring = self[:enableSpring]
|
@@ -771,18 +801,11 @@ module Box2D
|
|
771
801
|
def maxMotorForce=(v) self[:maxMotorForce] = v end
|
772
802
|
def motorSpeed = self[:motorSpeed]
|
773
803
|
def motorSpeed=(v) self[:motorSpeed] = v end
|
774
|
-
def collideConnected = self[:collideConnected]
|
775
|
-
def collideConnected=(v) self[:collideConnected] = v end
|
776
|
-
def userData = self[:userData]
|
777
|
-
def userData=(v) self[:userData] = v end
|
778
804
|
def internalValue = self[:internalValue]
|
779
805
|
def internalValue=(v) self[:internalValue] = v end
|
780
|
-
def self.create_as(
|
806
|
+
def self.create_as(_base_, _length_, _enableSpring_, _hertz_, _dampingRatio_, _enableLimit_, _minLength_, _maxLength_, _enableMotor_, _maxMotorForce_, _motorSpeed_, _internalValue_)
|
781
807
|
instance = DistanceJointDef.new
|
782
|
-
instance[:
|
783
|
-
instance[:bodyIdB] = _bodyIdB_
|
784
|
-
instance[:localAnchorA] = _localAnchorA_
|
785
|
-
instance[:localAnchorB] = _localAnchorB_
|
808
|
+
instance[:base] = _base_
|
786
809
|
instance[:length] = _length_
|
787
810
|
instance[:enableSpring] = _enableSpring_
|
788
811
|
instance[:hertz] = _hertz_
|
@@ -793,8 +816,6 @@ module Box2D
|
|
793
816
|
instance[:enableMotor] = _enableMotor_
|
794
817
|
instance[:maxMotorForce] = _maxMotorForce_
|
795
818
|
instance[:motorSpeed] = _motorSpeed_
|
796
|
-
instance[:collideConnected] = _collideConnected_
|
797
|
-
instance[:userData] = _userData_
|
798
819
|
instance[:internalValue] = _internalValue_
|
799
820
|
instance
|
800
821
|
end
|
@@ -802,48 +823,28 @@ module Box2D
|
|
802
823
|
|
803
824
|
class MotorJointDef < FFI::Struct
|
804
825
|
layout(
|
805
|
-
:
|
806
|
-
:bodyIdB, BodyId,
|
807
|
-
:linearOffset, Vec2,
|
808
|
-
:angularOffset, :float,
|
826
|
+
:base, JointDef,
|
809
827
|
:maxForce, :float,
|
810
828
|
:maxTorque, :float,
|
811
829
|
:correctionFactor, :float,
|
812
|
-
:collideConnected, :bool,
|
813
|
-
:userData, :pointer,
|
814
830
|
:internalValue, :int,
|
815
831
|
)
|
816
|
-
def
|
817
|
-
def
|
818
|
-
def bodyIdB = self[:bodyIdB]
|
819
|
-
def bodyIdB=(v) self[:bodyIdB] = v end
|
820
|
-
def linearOffset = self[:linearOffset]
|
821
|
-
def linearOffset=(v) self[:linearOffset] = v end
|
822
|
-
def angularOffset = self[:angularOffset]
|
823
|
-
def angularOffset=(v) self[:angularOffset] = v end
|
832
|
+
def base = self[:base]
|
833
|
+
def base=(v) self[:base] = v end
|
824
834
|
def maxForce = self[:maxForce]
|
825
835
|
def maxForce=(v) self[:maxForce] = v end
|
826
836
|
def maxTorque = self[:maxTorque]
|
827
837
|
def maxTorque=(v) self[:maxTorque] = v end
|
828
838
|
def correctionFactor = self[:correctionFactor]
|
829
839
|
def correctionFactor=(v) self[:correctionFactor] = v end
|
830
|
-
def collideConnected = self[:collideConnected]
|
831
|
-
def collideConnected=(v) self[:collideConnected] = v end
|
832
|
-
def userData = self[:userData]
|
833
|
-
def userData=(v) self[:userData] = v end
|
834
840
|
def internalValue = self[:internalValue]
|
835
841
|
def internalValue=(v) self[:internalValue] = v end
|
836
|
-
def self.create_as(
|
842
|
+
def self.create_as(_base_, _maxForce_, _maxTorque_, _correctionFactor_, _internalValue_)
|
837
843
|
instance = MotorJointDef.new
|
838
|
-
instance[:
|
839
|
-
instance[:bodyIdB] = _bodyIdB_
|
840
|
-
instance[:linearOffset] = _linearOffset_
|
841
|
-
instance[:angularOffset] = _angularOffset_
|
844
|
+
instance[:base] = _base_
|
842
845
|
instance[:maxForce] = _maxForce_
|
843
846
|
instance[:maxTorque] = _maxTorque_
|
844
847
|
instance[:correctionFactor] = _correctionFactor_
|
845
|
-
instance[:collideConnected] = _collideConnected_
|
846
|
-
instance[:userData] = _userData_
|
847
848
|
instance[:internalValue] = _internalValue_
|
848
849
|
instance
|
849
850
|
end
|
@@ -851,44 +852,28 @@ module Box2D
|
|
851
852
|
|
852
853
|
class MouseJointDef < FFI::Struct
|
853
854
|
layout(
|
854
|
-
:
|
855
|
-
:bodyIdB, BodyId,
|
856
|
-
:target, Vec2,
|
855
|
+
:base, JointDef,
|
857
856
|
:hertz, :float,
|
858
857
|
:dampingRatio, :float,
|
859
858
|
:maxForce, :float,
|
860
|
-
:collideConnected, :bool,
|
861
|
-
:userData, :pointer,
|
862
859
|
:internalValue, :int,
|
863
860
|
)
|
864
|
-
def
|
865
|
-
def
|
866
|
-
def bodyIdB = self[:bodyIdB]
|
867
|
-
def bodyIdB=(v) self[:bodyIdB] = v end
|
868
|
-
def target = self[:target]
|
869
|
-
def target=(v) self[:target] = v end
|
861
|
+
def base = self[:base]
|
862
|
+
def base=(v) self[:base] = v end
|
870
863
|
def hertz = self[:hertz]
|
871
864
|
def hertz=(v) self[:hertz] = v end
|
872
865
|
def dampingRatio = self[:dampingRatio]
|
873
866
|
def dampingRatio=(v) self[:dampingRatio] = v end
|
874
867
|
def maxForce = self[:maxForce]
|
875
868
|
def maxForce=(v) self[:maxForce] = v end
|
876
|
-
def collideConnected = self[:collideConnected]
|
877
|
-
def collideConnected=(v) self[:collideConnected] = v end
|
878
|
-
def userData = self[:userData]
|
879
|
-
def userData=(v) self[:userData] = v end
|
880
869
|
def internalValue = self[:internalValue]
|
881
870
|
def internalValue=(v) self[:internalValue] = v end
|
882
|
-
def self.create_as(
|
871
|
+
def self.create_as(_base_, _hertz_, _dampingRatio_, _maxForce_, _internalValue_)
|
883
872
|
instance = MouseJointDef.new
|
884
|
-
instance[:
|
885
|
-
instance[:bodyIdB] = _bodyIdB_
|
886
|
-
instance[:target] = _target_
|
873
|
+
instance[:base] = _base_
|
887
874
|
instance[:hertz] = _hertz_
|
888
875
|
instance[:dampingRatio] = _dampingRatio_
|
889
876
|
instance[:maxForce] = _maxForce_
|
890
|
-
instance[:collideConnected] = _collideConnected_
|
891
|
-
instance[:userData] = _userData_
|
892
877
|
instance[:internalValue] = _internalValue_
|
893
878
|
instance
|
894
879
|
end
|
@@ -896,24 +881,16 @@ module Box2D
|
|
896
881
|
|
897
882
|
class FilterJointDef < FFI::Struct
|
898
883
|
layout(
|
899
|
-
:
|
900
|
-
:bodyIdB, BodyId,
|
901
|
-
:userData, :pointer,
|
884
|
+
:base, JointDef,
|
902
885
|
:internalValue, :int,
|
903
886
|
)
|
904
|
-
def
|
905
|
-
def
|
906
|
-
def bodyIdB = self[:bodyIdB]
|
907
|
-
def bodyIdB=(v) self[:bodyIdB] = v end
|
908
|
-
def userData = self[:userData]
|
909
|
-
def userData=(v) self[:userData] = v end
|
887
|
+
def base = self[:base]
|
888
|
+
def base=(v) self[:base] = v end
|
910
889
|
def internalValue = self[:internalValue]
|
911
890
|
def internalValue=(v) self[:internalValue] = v end
|
912
|
-
def self.create_as(
|
891
|
+
def self.create_as(_base_, _internalValue_)
|
913
892
|
instance = FilterJointDef.new
|
914
|
-
instance[:
|
915
|
-
instance[:bodyIdB] = _bodyIdB_
|
916
|
-
instance[:userData] = _userData_
|
893
|
+
instance[:base] = _base_
|
917
894
|
instance[:internalValue] = _internalValue_
|
918
895
|
instance
|
919
896
|
end
|
@@ -921,12 +898,8 @@ module Box2D
|
|
921
898
|
|
922
899
|
class PrismaticJointDef < FFI::Struct
|
923
900
|
layout(
|
924
|
-
:
|
925
|
-
:
|
926
|
-
:localAnchorA, Vec2,
|
927
|
-
:localAnchorB, Vec2,
|
928
|
-
:localAxisA, Vec2,
|
929
|
-
:referenceAngle, :float,
|
901
|
+
:base, JointDef,
|
902
|
+
:targetTranslation, :float,
|
930
903
|
:enableSpring, :bool,
|
931
904
|
:hertz, :float,
|
932
905
|
:dampingRatio, :float,
|
@@ -936,22 +909,12 @@ module Box2D
|
|
936
909
|
:enableMotor, :bool,
|
937
910
|
:maxMotorForce, :float,
|
938
911
|
:motorSpeed, :float,
|
939
|
-
:collideConnected, :bool,
|
940
|
-
:userData, :pointer,
|
941
912
|
:internalValue, :int,
|
942
913
|
)
|
943
|
-
def
|
944
|
-
def
|
945
|
-
def
|
946
|
-
def
|
947
|
-
def localAnchorA = self[:localAnchorA]
|
948
|
-
def localAnchorA=(v) self[:localAnchorA] = v end
|
949
|
-
def localAnchorB = self[:localAnchorB]
|
950
|
-
def localAnchorB=(v) self[:localAnchorB] = v end
|
951
|
-
def localAxisA = self[:localAxisA]
|
952
|
-
def localAxisA=(v) self[:localAxisA] = v end
|
953
|
-
def referenceAngle = self[:referenceAngle]
|
954
|
-
def referenceAngle=(v) self[:referenceAngle] = v end
|
914
|
+
def base = self[:base]
|
915
|
+
def base=(v) self[:base] = v end
|
916
|
+
def targetTranslation = self[:targetTranslation]
|
917
|
+
def targetTranslation=(v) self[:targetTranslation] = v end
|
955
918
|
def enableSpring = self[:enableSpring]
|
956
919
|
def enableSpring=(v) self[:enableSpring] = v end
|
957
920
|
def hertz = self[:hertz]
|
@@ -970,20 +933,12 @@ module Box2D
|
|
970
933
|
def maxMotorForce=(v) self[:maxMotorForce] = v end
|
971
934
|
def motorSpeed = self[:motorSpeed]
|
972
935
|
def motorSpeed=(v) self[:motorSpeed] = v end
|
973
|
-
def collideConnected = self[:collideConnected]
|
974
|
-
def collideConnected=(v) self[:collideConnected] = v end
|
975
|
-
def userData = self[:userData]
|
976
|
-
def userData=(v) self[:userData] = v end
|
977
936
|
def internalValue = self[:internalValue]
|
978
937
|
def internalValue=(v) self[:internalValue] = v end
|
979
|
-
def self.create_as(
|
938
|
+
def self.create_as(_base_, _targetTranslation_, _enableSpring_, _hertz_, _dampingRatio_, _enableLimit_, _lowerTranslation_, _upperTranslation_, _enableMotor_, _maxMotorForce_, _motorSpeed_, _internalValue_)
|
980
939
|
instance = PrismaticJointDef.new
|
981
|
-
instance[:
|
982
|
-
instance[:
|
983
|
-
instance[:localAnchorA] = _localAnchorA_
|
984
|
-
instance[:localAnchorB] = _localAnchorB_
|
985
|
-
instance[:localAxisA] = _localAxisA_
|
986
|
-
instance[:referenceAngle] = _referenceAngle_
|
940
|
+
instance[:base] = _base_
|
941
|
+
instance[:targetTranslation] = _targetTranslation_
|
987
942
|
instance[:enableSpring] = _enableSpring_
|
988
943
|
instance[:hertz] = _hertz_
|
989
944
|
instance[:dampingRatio] = _dampingRatio_
|
@@ -993,8 +948,6 @@ module Box2D
|
|
993
948
|
instance[:enableMotor] = _enableMotor_
|
994
949
|
instance[:maxMotorForce] = _maxMotorForce_
|
995
950
|
instance[:motorSpeed] = _motorSpeed_
|
996
|
-
instance[:collideConnected] = _collideConnected_
|
997
|
-
instance[:userData] = _userData_
|
998
951
|
instance[:internalValue] = _internalValue_
|
999
952
|
instance
|
1000
953
|
end
|
@@ -1002,11 +955,8 @@ module Box2D
|
|
1002
955
|
|
1003
956
|
class RevoluteJointDef < FFI::Struct
|
1004
957
|
layout(
|
1005
|
-
:
|
1006
|
-
:
|
1007
|
-
:localAnchorA, Vec2,
|
1008
|
-
:localAnchorB, Vec2,
|
1009
|
-
:referenceAngle, :float,
|
958
|
+
:base, JointDef,
|
959
|
+
:targetAngle, :float,
|
1010
960
|
:enableSpring, :bool,
|
1011
961
|
:hertz, :float,
|
1012
962
|
:dampingRatio, :float,
|
@@ -1016,21 +966,12 @@ module Box2D
|
|
1016
966
|
:enableMotor, :bool,
|
1017
967
|
:maxMotorTorque, :float,
|
1018
968
|
:motorSpeed, :float,
|
1019
|
-
:drawSize, :float,
|
1020
|
-
:collideConnected, :bool,
|
1021
|
-
:userData, :pointer,
|
1022
969
|
:internalValue, :int,
|
1023
970
|
)
|
1024
|
-
def
|
1025
|
-
def
|
1026
|
-
def
|
1027
|
-
def
|
1028
|
-
def localAnchorA = self[:localAnchorA]
|
1029
|
-
def localAnchorA=(v) self[:localAnchorA] = v end
|
1030
|
-
def localAnchorB = self[:localAnchorB]
|
1031
|
-
def localAnchorB=(v) self[:localAnchorB] = v end
|
1032
|
-
def referenceAngle = self[:referenceAngle]
|
1033
|
-
def referenceAngle=(v) self[:referenceAngle] = v end
|
971
|
+
def base = self[:base]
|
972
|
+
def base=(v) self[:base] = v end
|
973
|
+
def targetAngle = self[:targetAngle]
|
974
|
+
def targetAngle=(v) self[:targetAngle] = v end
|
1034
975
|
def enableSpring = self[:enableSpring]
|
1035
976
|
def enableSpring=(v) self[:enableSpring] = v end
|
1036
977
|
def hertz = self[:hertz]
|
@@ -1049,21 +990,12 @@ module Box2D
|
|
1049
990
|
def maxMotorTorque=(v) self[:maxMotorTorque] = v end
|
1050
991
|
def motorSpeed = self[:motorSpeed]
|
1051
992
|
def motorSpeed=(v) self[:motorSpeed] = v end
|
1052
|
-
def drawSize = self[:drawSize]
|
1053
|
-
def drawSize=(v) self[:drawSize] = v end
|
1054
|
-
def collideConnected = self[:collideConnected]
|
1055
|
-
def collideConnected=(v) self[:collideConnected] = v end
|
1056
|
-
def userData = self[:userData]
|
1057
|
-
def userData=(v) self[:userData] = v end
|
1058
993
|
def internalValue = self[:internalValue]
|
1059
994
|
def internalValue=(v) self[:internalValue] = v end
|
1060
|
-
def self.create_as(
|
995
|
+
def self.create_as(_base_, _targetAngle_, _enableSpring_, _hertz_, _dampingRatio_, _enableLimit_, _lowerAngle_, _upperAngle_, _enableMotor_, _maxMotorTorque_, _motorSpeed_, _internalValue_)
|
1061
996
|
instance = RevoluteJointDef.new
|
1062
|
-
instance[:
|
1063
|
-
instance[:
|
1064
|
-
instance[:localAnchorA] = _localAnchorA_
|
1065
|
-
instance[:localAnchorB] = _localAnchorB_
|
1066
|
-
instance[:referenceAngle] = _referenceAngle_
|
997
|
+
instance[:base] = _base_
|
998
|
+
instance[:targetAngle] = _targetAngle_
|
1067
999
|
instance[:enableSpring] = _enableSpring_
|
1068
1000
|
instance[:hertz] = _hertz_
|
1069
1001
|
instance[:dampingRatio] = _dampingRatio_
|
@@ -1073,9 +1005,6 @@ module Box2D
|
|
1073
1005
|
instance[:enableMotor] = _enableMotor_
|
1074
1006
|
instance[:maxMotorTorque] = _maxMotorTorque_
|
1075
1007
|
instance[:motorSpeed] = _motorSpeed_
|
1076
|
-
instance[:drawSize] = _drawSize_
|
1077
|
-
instance[:collideConnected] = _collideConnected_
|
1078
|
-
instance[:userData] = _userData_
|
1079
1008
|
instance[:internalValue] = _internalValue_
|
1080
1009
|
instance
|
1081
1010
|
end
|
@@ -1083,29 +1012,15 @@ module Box2D
|
|
1083
1012
|
|
1084
1013
|
class WeldJointDef < FFI::Struct
|
1085
1014
|
layout(
|
1086
|
-
:
|
1087
|
-
:bodyIdB, BodyId,
|
1088
|
-
:localAnchorA, Vec2,
|
1089
|
-
:localAnchorB, Vec2,
|
1090
|
-
:referenceAngle, :float,
|
1015
|
+
:base, JointDef,
|
1091
1016
|
:linearHertz, :float,
|
1092
1017
|
:angularHertz, :float,
|
1093
1018
|
:linearDampingRatio, :float,
|
1094
1019
|
:angularDampingRatio, :float,
|
1095
|
-
:collideConnected, :bool,
|
1096
|
-
:userData, :pointer,
|
1097
1020
|
:internalValue, :int,
|
1098
1021
|
)
|
1099
|
-
def
|
1100
|
-
def
|
1101
|
-
def bodyIdB = self[:bodyIdB]
|
1102
|
-
def bodyIdB=(v) self[:bodyIdB] = v end
|
1103
|
-
def localAnchorA = self[:localAnchorA]
|
1104
|
-
def localAnchorA=(v) self[:localAnchorA] = v end
|
1105
|
-
def localAnchorB = self[:localAnchorB]
|
1106
|
-
def localAnchorB=(v) self[:localAnchorB] = v end
|
1107
|
-
def referenceAngle = self[:referenceAngle]
|
1108
|
-
def referenceAngle=(v) self[:referenceAngle] = v end
|
1022
|
+
def base = self[:base]
|
1023
|
+
def base=(v) self[:base] = v end
|
1109
1024
|
def linearHertz = self[:linearHertz]
|
1110
1025
|
def linearHertz=(v) self[:linearHertz] = v end
|
1111
1026
|
def angularHertz = self[:angularHertz]
|
@@ -1114,25 +1029,15 @@ module Box2D
|
|
1114
1029
|
def linearDampingRatio=(v) self[:linearDampingRatio] = v end
|
1115
1030
|
def angularDampingRatio = self[:angularDampingRatio]
|
1116
1031
|
def angularDampingRatio=(v) self[:angularDampingRatio] = v end
|
1117
|
-
def collideConnected = self[:collideConnected]
|
1118
|
-
def collideConnected=(v) self[:collideConnected] = v end
|
1119
|
-
def userData = self[:userData]
|
1120
|
-
def userData=(v) self[:userData] = v end
|
1121
1032
|
def internalValue = self[:internalValue]
|
1122
1033
|
def internalValue=(v) self[:internalValue] = v end
|
1123
|
-
def self.create_as(
|
1034
|
+
def self.create_as(_base_, _linearHertz_, _angularHertz_, _linearDampingRatio_, _angularDampingRatio_, _internalValue_)
|
1124
1035
|
instance = WeldJointDef.new
|
1125
|
-
instance[:
|
1126
|
-
instance[:bodyIdB] = _bodyIdB_
|
1127
|
-
instance[:localAnchorA] = _localAnchorA_
|
1128
|
-
instance[:localAnchorB] = _localAnchorB_
|
1129
|
-
instance[:referenceAngle] = _referenceAngle_
|
1036
|
+
instance[:base] = _base_
|
1130
1037
|
instance[:linearHertz] = _linearHertz_
|
1131
1038
|
instance[:angularHertz] = _angularHertz_
|
1132
1039
|
instance[:linearDampingRatio] = _linearDampingRatio_
|
1133
1040
|
instance[:angularDampingRatio] = _angularDampingRatio_
|
1134
|
-
instance[:collideConnected] = _collideConnected_
|
1135
|
-
instance[:userData] = _userData_
|
1136
1041
|
instance[:internalValue] = _internalValue_
|
1137
1042
|
instance
|
1138
1043
|
end
|
@@ -1140,11 +1045,7 @@ module Box2D
|
|
1140
1045
|
|
1141
1046
|
class WheelJointDef < FFI::Struct
|
1142
1047
|
layout(
|
1143
|
-
:
|
1144
|
-
:bodyIdB, BodyId,
|
1145
|
-
:localAnchorA, Vec2,
|
1146
|
-
:localAnchorB, Vec2,
|
1147
|
-
:localAxisA, Vec2,
|
1048
|
+
:base, JointDef,
|
1148
1049
|
:enableSpring, :bool,
|
1149
1050
|
:hertz, :float,
|
1150
1051
|
:dampingRatio, :float,
|
@@ -1154,20 +1055,10 @@ module Box2D
|
|
1154
1055
|
:enableMotor, :bool,
|
1155
1056
|
:maxMotorTorque, :float,
|
1156
1057
|
:motorSpeed, :float,
|
1157
|
-
:collideConnected, :bool,
|
1158
|
-
:userData, :pointer,
|
1159
1058
|
:internalValue, :int,
|
1160
1059
|
)
|
1161
|
-
def
|
1162
|
-
def
|
1163
|
-
def bodyIdB = self[:bodyIdB]
|
1164
|
-
def bodyIdB=(v) self[:bodyIdB] = v end
|
1165
|
-
def localAnchorA = self[:localAnchorA]
|
1166
|
-
def localAnchorA=(v) self[:localAnchorA] = v end
|
1167
|
-
def localAnchorB = self[:localAnchorB]
|
1168
|
-
def localAnchorB=(v) self[:localAnchorB] = v end
|
1169
|
-
def localAxisA = self[:localAxisA]
|
1170
|
-
def localAxisA=(v) self[:localAxisA] = v end
|
1060
|
+
def base = self[:base]
|
1061
|
+
def base=(v) self[:base] = v end
|
1171
1062
|
def enableSpring = self[:enableSpring]
|
1172
1063
|
def enableSpring=(v) self[:enableSpring] = v end
|
1173
1064
|
def hertz = self[:hertz]
|
@@ -1186,19 +1077,11 @@ module Box2D
|
|
1186
1077
|
def maxMotorTorque=(v) self[:maxMotorTorque] = v end
|
1187
1078
|
def motorSpeed = self[:motorSpeed]
|
1188
1079
|
def motorSpeed=(v) self[:motorSpeed] = v end
|
1189
|
-
def collideConnected = self[:collideConnected]
|
1190
|
-
def collideConnected=(v) self[:collideConnected] = v end
|
1191
|
-
def userData = self[:userData]
|
1192
|
-
def userData=(v) self[:userData] = v end
|
1193
1080
|
def internalValue = self[:internalValue]
|
1194
1081
|
def internalValue=(v) self[:internalValue] = v end
|
1195
|
-
def self.create_as(
|
1082
|
+
def self.create_as(_base_, _enableSpring_, _hertz_, _dampingRatio_, _enableLimit_, _lowerTranslation_, _upperTranslation_, _enableMotor_, _maxMotorTorque_, _motorSpeed_, _internalValue_)
|
1196
1083
|
instance = WheelJointDef.new
|
1197
|
-
instance[:
|
1198
|
-
instance[:bodyIdB] = _bodyIdB_
|
1199
|
-
instance[:localAnchorA] = _localAnchorA_
|
1200
|
-
instance[:localAnchorB] = _localAnchorB_
|
1201
|
-
instance[:localAxisA] = _localAxisA_
|
1084
|
+
instance[:base] = _base_
|
1202
1085
|
instance[:enableSpring] = _enableSpring_
|
1203
1086
|
instance[:hertz] = _hertz_
|
1204
1087
|
instance[:dampingRatio] = _dampingRatio_
|
@@ -1208,8 +1091,6 @@ module Box2D
|
|
1208
1091
|
instance[:enableMotor] = _enableMotor_
|
1209
1092
|
instance[:maxMotorTorque] = _maxMotorTorque_
|
1210
1093
|
instance[:motorSpeed] = _motorSpeed_
|
1211
|
-
instance[:collideConnected] = _collideConnected_
|
1212
|
-
instance[:userData] = _userData_
|
1213
1094
|
instance[:internalValue] = _internalValue_
|
1214
1095
|
instance
|
1215
1096
|
end
|
@@ -1307,18 +1188,22 @@ module Box2D
|
|
1307
1188
|
layout(
|
1308
1189
|
:shapeIdA, ShapeId,
|
1309
1190
|
:shapeIdB, ShapeId,
|
1191
|
+
:contactId, ContactId,
|
1310
1192
|
:manifold, Manifold,
|
1311
1193
|
)
|
1312
1194
|
def shapeIdA = self[:shapeIdA]
|
1313
1195
|
def shapeIdA=(v) self[:shapeIdA] = v end
|
1314
1196
|
def shapeIdB = self[:shapeIdB]
|
1315
1197
|
def shapeIdB=(v) self[:shapeIdB] = v end
|
1198
|
+
def contactId = self[:contactId]
|
1199
|
+
def contactId=(v) self[:contactId] = v end
|
1316
1200
|
def manifold = self[:manifold]
|
1317
1201
|
def manifold=(v) self[:manifold] = v end
|
1318
|
-
def self.create_as(_shapeIdA_, _shapeIdB_, _manifold_)
|
1202
|
+
def self.create_as(_shapeIdA_, _shapeIdB_, _contactId_, _manifold_)
|
1319
1203
|
instance = ContactBeginTouchEvent.new
|
1320
1204
|
instance[:shapeIdA] = _shapeIdA_
|
1321
1205
|
instance[:shapeIdB] = _shapeIdB_
|
1206
|
+
instance[:contactId] = _contactId_
|
1322
1207
|
instance[:manifold] = _manifold_
|
1323
1208
|
instance
|
1324
1209
|
end
|
@@ -1328,15 +1213,19 @@ module Box2D
|
|
1328
1213
|
layout(
|
1329
1214
|
:shapeIdA, ShapeId,
|
1330
1215
|
:shapeIdB, ShapeId,
|
1216
|
+
:contactId, ContactId,
|
1331
1217
|
)
|
1332
1218
|
def shapeIdA = self[:shapeIdA]
|
1333
1219
|
def shapeIdA=(v) self[:shapeIdA] = v end
|
1334
1220
|
def shapeIdB = self[:shapeIdB]
|
1335
1221
|
def shapeIdB=(v) self[:shapeIdB] = v end
|
1336
|
-
def self
|
1222
|
+
def contactId = self[:contactId]
|
1223
|
+
def contactId=(v) self[:contactId] = v end
|
1224
|
+
def self.create_as(_shapeIdA_, _shapeIdB_, _contactId_)
|
1337
1225
|
instance = ContactEndTouchEvent.new
|
1338
1226
|
instance[:shapeIdA] = _shapeIdA_
|
1339
1227
|
instance[:shapeIdB] = _shapeIdB_
|
1228
|
+
instance[:contactId] = _contactId_
|
1340
1229
|
instance
|
1341
1230
|
end
|
1342
1231
|
end
|
@@ -1445,6 +1334,40 @@ module Box2D
|
|
1445
1334
|
end
|
1446
1335
|
end
|
1447
1336
|
|
1337
|
+
class JointEvent < FFI::Struct
|
1338
|
+
layout(
|
1339
|
+
:jointId, JointId,
|
1340
|
+
:userData, :pointer,
|
1341
|
+
)
|
1342
|
+
def jointId = self[:jointId]
|
1343
|
+
def jointId=(v) self[:jointId] = v end
|
1344
|
+
def userData = self[:userData]
|
1345
|
+
def userData=(v) self[:userData] = v end
|
1346
|
+
def self.create_as(_jointId_, _userData_)
|
1347
|
+
instance = JointEvent.new
|
1348
|
+
instance[:jointId] = _jointId_
|
1349
|
+
instance[:userData] = _userData_
|
1350
|
+
instance
|
1351
|
+
end
|
1352
|
+
end
|
1353
|
+
|
1354
|
+
class JointEvents < FFI::Struct
|
1355
|
+
layout(
|
1356
|
+
:jointEvents, :pointer,
|
1357
|
+
:count, :int,
|
1358
|
+
)
|
1359
|
+
def jointEvents = self[:jointEvents]
|
1360
|
+
def jointEvents=(v) self[:jointEvents] = v end
|
1361
|
+
def count = self[:count]
|
1362
|
+
def count=(v) self[:count] = v end
|
1363
|
+
def self.create_as(_jointEvents_, _count_)
|
1364
|
+
instance = JointEvents.new
|
1365
|
+
instance[:jointEvents] = _jointEvents_
|
1366
|
+
instance[:count] = _count_
|
1367
|
+
instance
|
1368
|
+
end
|
1369
|
+
end
|
1370
|
+
|
1448
1371
|
class ContactData < FFI::Struct
|
1449
1372
|
layout(
|
1450
1373
|
:shapeIdA, ShapeId,
|
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.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- vaiorabbit
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-
|
10
|
+
date: 2025-06-06 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: ffi
|