box2d-bindings 0.1.0 → 0.1.2
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 +10 -0
- data/README.md +1 -1
- data/lib/box2d.rb +0 -2
- data/lib/box2d_base.rb +3 -18
- data/lib/box2d_collision.rb +122 -42
- data/lib/box2d_helper.rb +1 -1
- data/lib/box2d_id.rb +25 -25
- data/lib/box2d_main.rb +19 -9
- data/lib/box2d_math_functions.rb +18 -0
- data/lib/box2d_math_inline_functions.rb +5 -1
- data/lib/box2d_types.rb +168 -133
- 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 -4
- data/lib/box2d_collision_inline.rb +0 -47
@@ -53,13 +53,14 @@ module Box2D
|
|
53
53
|
[:Length, :b2Length, [Vec2.by_value], :float],
|
54
54
|
[:Distance, :b2Distance, [Vec2.by_value, Vec2.by_value], :float],
|
55
55
|
[:Normalize, :b2Normalize, [Vec2.by_value], Vec2.by_value],
|
56
|
+
[:IsNormalized, :b2IsNormalized, [Vec2.by_value], :bool],
|
56
57
|
[:GetLengthAndNormalize, :b2GetLengthAndNormalize, [:pointer, Vec2.by_value], Vec2.by_value],
|
57
58
|
[:NormalizeRot, :b2NormalizeRot, [Rot.by_value], Rot.by_value],
|
58
59
|
[:IntegrateRotation, :b2IntegrateRotation, [Rot.by_value, :float], Rot.by_value],
|
59
60
|
[:LengthSquared, :b2LengthSquared, [Vec2.by_value], :float],
|
60
61
|
[:DistanceSquared, :b2DistanceSquared, [Vec2.by_value, Vec2.by_value], :float],
|
61
62
|
[:MakeRot, :b2MakeRot, [:float], Rot.by_value],
|
62
|
-
[:
|
63
|
+
[:IsNormalizedRot, :b2IsNormalizedRot, [Rot.by_value], :bool],
|
63
64
|
[:NLerp, :b2NLerp, [Rot.by_value, Rot.by_value, :float], Rot.by_value],
|
64
65
|
[:ComputeAngularVelocity, :b2ComputeAngularVelocity, [Rot.by_value, Rot.by_value, :float], :float],
|
65
66
|
[:Rot_GetAngle, :b2Rot_GetAngle, [Rot.by_value], :float],
|
@@ -83,6 +84,9 @@ module Box2D
|
|
83
84
|
[:AABB_Center, :b2AABB_Center, [AABB.by_value], Vec2.by_value],
|
84
85
|
[:AABB_Extents, :b2AABB_Extents, [AABB.by_value], Vec2.by_value],
|
85
86
|
[:AABB_Union, :b2AABB_Union, [AABB.by_value, AABB.by_value], AABB.by_value],
|
87
|
+
[:AABB_Overlaps, :b2AABB_Overlaps, [AABB.by_value, AABB.by_value], :bool],
|
88
|
+
[:MakeAABB, :b2MakeAABB, [:pointer, :int, :float], AABB.by_value],
|
89
|
+
[:PlaneSeparation, :b2PlaneSeparation, [Plane.by_value, Vec2.by_value], :float],
|
86
90
|
]
|
87
91
|
entries.each do |entry|
|
88
92
|
api_name = if method_naming == :snake_case
|
data/lib/box2d_types.rb
CHANGED
@@ -14,11 +14,6 @@ module Box2D
|
|
14
14
|
|
15
15
|
# Enum
|
16
16
|
|
17
|
-
MixingRule_mixAverage = 0
|
18
|
-
MixingRule_mixGeometricMean = 1
|
19
|
-
MixingRule_mixMultiply = 2
|
20
|
-
MixingRule_mixMinimum = 3
|
21
|
-
MixingRule_mixMaximum = 4
|
22
17
|
BodyType_staticBody = 0
|
23
18
|
BodyType_kinematicBody = 1
|
24
19
|
BodyType_dynamicBody = 2
|
@@ -30,9 +25,9 @@ module Box2D
|
|
30
25
|
ShapeType_chainSegmentShape = 4
|
31
26
|
ShapeType_shapeTypeCount = 5
|
32
27
|
JointType_distanceJoint = 0
|
33
|
-
|
34
|
-
|
35
|
-
|
28
|
+
JointType_filterJoint = 1
|
29
|
+
JointType_motorJoint = 2
|
30
|
+
JointType_mouseJoint = 3
|
36
31
|
JointType_prismaticJoint = 4
|
37
32
|
JointType_revoluteJoint = 5
|
38
33
|
JointType_weldJoint = 6
|
@@ -188,7 +183,8 @@ module Box2D
|
|
188
183
|
typedef :pointer, :b2TaskCallback
|
189
184
|
typedef :pointer, :b2EnqueueTaskCallback
|
190
185
|
typedef :pointer, :b2FinishTaskCallback
|
191
|
-
typedef :
|
186
|
+
typedef :pointer, :b2FrictionCallback
|
187
|
+
typedef :pointer, :b2RestitutionCallback
|
192
188
|
typedef :int, :b2BodyType
|
193
189
|
typedef :int, :b2ShapeType
|
194
190
|
typedef :int, :b2JointType
|
@@ -196,6 +192,7 @@ module Box2D
|
|
196
192
|
typedef :pointer, :b2PreSolveFcn
|
197
193
|
typedef :pointer, :b2OverlapResultFcn
|
198
194
|
typedef :pointer, :b2CastResultFcn
|
195
|
+
typedef :pointer, :b2PlaneResultFcn
|
199
196
|
typedef :int, :b2HexColor
|
200
197
|
|
201
198
|
# Struct
|
@@ -241,15 +238,15 @@ module Box2D
|
|
241
238
|
layout(
|
242
239
|
:gravity, Vec2,
|
243
240
|
:restitutionThreshold, :float,
|
244
|
-
:contactPushSpeed, :float,
|
245
241
|
:hitEventThreshold, :float,
|
246
242
|
:contactHertz, :float,
|
247
243
|
:contactDampingRatio, :float,
|
244
|
+
:maxContactPushSpeed, :float,
|
248
245
|
:jointHertz, :float,
|
249
246
|
:jointDampingRatio, :float,
|
250
247
|
:maximumLinearSpeed, :float,
|
251
|
-
:
|
252
|
-
:
|
248
|
+
:frictionCallback, :pointer,
|
249
|
+
:restitutionCallback, :pointer,
|
253
250
|
:enableSleep, :bool,
|
254
251
|
:enableContinuous, :bool,
|
255
252
|
:workerCount, :int,
|
@@ -263,24 +260,24 @@ module Box2D
|
|
263
260
|
def gravity=(v) self[:gravity] = v end
|
264
261
|
def restitutionThreshold = self[:restitutionThreshold]
|
265
262
|
def restitutionThreshold=(v) self[:restitutionThreshold] = v end
|
266
|
-
def contactPushSpeed = self[:contactPushSpeed]
|
267
|
-
def contactPushSpeed=(v) self[:contactPushSpeed] = v end
|
268
263
|
def hitEventThreshold = self[:hitEventThreshold]
|
269
264
|
def hitEventThreshold=(v) self[:hitEventThreshold] = v end
|
270
265
|
def contactHertz = self[:contactHertz]
|
271
266
|
def contactHertz=(v) self[:contactHertz] = v end
|
272
267
|
def contactDampingRatio = self[:contactDampingRatio]
|
273
268
|
def contactDampingRatio=(v) self[:contactDampingRatio] = v end
|
269
|
+
def maxContactPushSpeed = self[:maxContactPushSpeed]
|
270
|
+
def maxContactPushSpeed=(v) self[:maxContactPushSpeed] = v end
|
274
271
|
def jointHertz = self[:jointHertz]
|
275
272
|
def jointHertz=(v) self[:jointHertz] = v end
|
276
273
|
def jointDampingRatio = self[:jointDampingRatio]
|
277
274
|
def jointDampingRatio=(v) self[:jointDampingRatio] = v end
|
278
275
|
def maximumLinearSpeed = self[:maximumLinearSpeed]
|
279
276
|
def maximumLinearSpeed=(v) self[:maximumLinearSpeed] = v end
|
280
|
-
def
|
281
|
-
def
|
282
|
-
def
|
283
|
-
def
|
277
|
+
def frictionCallback = self[:frictionCallback]
|
278
|
+
def frictionCallback=(v) self[:frictionCallback] = v end
|
279
|
+
def restitutionCallback = self[:restitutionCallback]
|
280
|
+
def restitutionCallback=(v) self[:restitutionCallback] = v end
|
284
281
|
def enableSleep = self[:enableSleep]
|
285
282
|
def enableSleep=(v) self[:enableSleep] = v end
|
286
283
|
def enableContinuous = self[:enableContinuous]
|
@@ -297,19 +294,19 @@ module Box2D
|
|
297
294
|
def userData=(v) self[:userData] = v end
|
298
295
|
def internalValue = self[:internalValue]
|
299
296
|
def internalValue=(v) self[:internalValue] = v end
|
300
|
-
def self.create_as(_gravity_, _restitutionThreshold_,
|
297
|
+
def self.create_as(_gravity_, _restitutionThreshold_, _hitEventThreshold_, _contactHertz_, _contactDampingRatio_, _maxContactPushSpeed_, _jointHertz_, _jointDampingRatio_, _maximumLinearSpeed_, _frictionCallback_, _restitutionCallback_, _enableSleep_, _enableContinuous_, _workerCount_, _enqueueTask_, _finishTask_, _userTaskContext_, _userData_, _internalValue_)
|
301
298
|
instance = WorldDef.new
|
302
299
|
instance[:gravity] = _gravity_
|
303
300
|
instance[:restitutionThreshold] = _restitutionThreshold_
|
304
|
-
instance[:contactPushSpeed] = _contactPushSpeed_
|
305
301
|
instance[:hitEventThreshold] = _hitEventThreshold_
|
306
302
|
instance[:contactHertz] = _contactHertz_
|
307
303
|
instance[:contactDampingRatio] = _contactDampingRatio_
|
304
|
+
instance[:maxContactPushSpeed] = _maxContactPushSpeed_
|
308
305
|
instance[:jointHertz] = _jointHertz_
|
309
306
|
instance[:jointDampingRatio] = _jointDampingRatio_
|
310
307
|
instance[:maximumLinearSpeed] = _maximumLinearSpeed_
|
311
|
-
instance[:
|
312
|
-
instance[:
|
308
|
+
instance[:frictionCallback] = _frictionCallback_
|
309
|
+
instance[:restitutionCallback] = _restitutionCallback_
|
313
310
|
instance[:enableSleep] = _enableSleep_
|
314
311
|
instance[:enableContinuous] = _enableContinuous_
|
315
312
|
instance[:workerCount] = _workerCount_
|
@@ -333,6 +330,7 @@ module Box2D
|
|
333
330
|
:angularDamping, :float,
|
334
331
|
:gravityScale, :float,
|
335
332
|
:sleepThreshold, :float,
|
333
|
+
:name, :pointer,
|
336
334
|
:userData, :pointer,
|
337
335
|
:enableSleep, :bool,
|
338
336
|
:isAwake, :bool,
|
@@ -360,6 +358,8 @@ module Box2D
|
|
360
358
|
def gravityScale=(v) self[:gravityScale] = v end
|
361
359
|
def sleepThreshold = self[:sleepThreshold]
|
362
360
|
def sleepThreshold=(v) self[:sleepThreshold] = v end
|
361
|
+
def name = self[:name]
|
362
|
+
def name=(v) self[:name] = v end
|
363
363
|
def userData = self[:userData]
|
364
364
|
def userData=(v) self[:userData] = v end
|
365
365
|
def enableSleep = self[:enableSleep]
|
@@ -376,7 +376,7 @@ module Box2D
|
|
376
376
|
def allowFastRotation=(v) self[:allowFastRotation] = v end
|
377
377
|
def internalValue = self[:internalValue]
|
378
378
|
def internalValue=(v) self[:internalValue] = v end
|
379
|
-
def self.create_as(_type_, _position_, _rotation_, _linearVelocity_, _angularVelocity_, _linearDamping_, _angularDamping_, _gravityScale_, _sleepThreshold_, _userData_, _enableSleep_, _isAwake_, _fixedRotation_, _isBullet_, _isEnabled_, _allowFastRotation_, _internalValue_)
|
379
|
+
def self.create_as(_type_, _position_, _rotation_, _linearVelocity_, _angularVelocity_, _linearDamping_, _angularDamping_, _gravityScale_, _sleepThreshold_, _name_, _userData_, _enableSleep_, _isAwake_, _fixedRotation_, _isBullet_, _isEnabled_, _allowFastRotation_, _internalValue_)
|
380
380
|
instance = BodyDef.new
|
381
381
|
instance[:type] = _type_
|
382
382
|
instance[:position] = _position_
|
@@ -387,6 +387,7 @@ module Box2D
|
|
387
387
|
instance[:angularDamping] = _angularDamping_
|
388
388
|
instance[:gravityScale] = _gravityScale_
|
389
389
|
instance[:sleepThreshold] = _sleepThreshold_
|
390
|
+
instance[:name] = _name_
|
390
391
|
instance[:userData] = _userData_
|
391
392
|
instance[:enableSleep] = _enableSleep_
|
392
393
|
instance[:isAwake] = _isAwake_
|
@@ -437,15 +438,45 @@ module Box2D
|
|
437
438
|
end
|
438
439
|
end
|
439
440
|
|
440
|
-
class
|
441
|
+
class SurfaceMaterial < FFI::Struct
|
441
442
|
layout(
|
442
|
-
:userData, :pointer,
|
443
443
|
:friction, :float,
|
444
444
|
:restitution, :float,
|
445
445
|
:rollingResistance, :float,
|
446
|
+
:tangentSpeed, :float,
|
447
|
+
:userMaterialId, :int,
|
448
|
+
:customColor, :uint,
|
449
|
+
)
|
450
|
+
def friction = self[:friction]
|
451
|
+
def friction=(v) self[:friction] = v end
|
452
|
+
def restitution = self[:restitution]
|
453
|
+
def restitution=(v) self[:restitution] = v end
|
454
|
+
def rollingResistance = self[:rollingResistance]
|
455
|
+
def rollingResistance=(v) self[:rollingResistance] = v end
|
456
|
+
def tangentSpeed = self[:tangentSpeed]
|
457
|
+
def tangentSpeed=(v) self[:tangentSpeed] = v end
|
458
|
+
def userMaterialId = self[:userMaterialId]
|
459
|
+
def userMaterialId=(v) self[:userMaterialId] = v end
|
460
|
+
def customColor = self[:customColor]
|
461
|
+
def customColor=(v) self[:customColor] = v end
|
462
|
+
def self.create_as(_friction_, _restitution_, _rollingResistance_, _tangentSpeed_, _userMaterialId_, _customColor_)
|
463
|
+
instance = SurfaceMaterial.new
|
464
|
+
instance[:friction] = _friction_
|
465
|
+
instance[:restitution] = _restitution_
|
466
|
+
instance[:rollingResistance] = _rollingResistance_
|
467
|
+
instance[:tangentSpeed] = _tangentSpeed_
|
468
|
+
instance[:userMaterialId] = _userMaterialId_
|
469
|
+
instance[:customColor] = _customColor_
|
470
|
+
instance
|
471
|
+
end
|
472
|
+
end
|
473
|
+
|
474
|
+
class ShapeDef < FFI::Struct
|
475
|
+
layout(
|
476
|
+
:userData, :pointer,
|
477
|
+
:material, SurfaceMaterial,
|
446
478
|
:density, :float,
|
447
479
|
:filter, Filter,
|
448
|
-
:customColor, :uint,
|
449
480
|
:isSensor, :bool,
|
450
481
|
:enableSensorEvents, :bool,
|
451
482
|
:enableContactEvents, :bool,
|
@@ -457,18 +488,12 @@ module Box2D
|
|
457
488
|
)
|
458
489
|
def userData = self[:userData]
|
459
490
|
def userData=(v) self[:userData] = v end
|
460
|
-
def
|
461
|
-
def
|
462
|
-
def restitution = self[:restitution]
|
463
|
-
def restitution=(v) self[:restitution] = v end
|
464
|
-
def rollingResistance = self[:rollingResistance]
|
465
|
-
def rollingResistance=(v) self[:rollingResistance] = v end
|
491
|
+
def material = self[:material]
|
492
|
+
def material=(v) self[:material] = v end
|
466
493
|
def density = self[:density]
|
467
494
|
def density=(v) self[:density] = v end
|
468
495
|
def filter = self[:filter]
|
469
496
|
def filter=(v) self[:filter] = v end
|
470
|
-
def customColor = self[:customColor]
|
471
|
-
def customColor=(v) self[:customColor] = v end
|
472
497
|
def isSensor = self[:isSensor]
|
473
498
|
def isSensor=(v) self[:isSensor] = v end
|
474
499
|
def enableSensorEvents = self[:enableSensorEvents]
|
@@ -485,15 +510,12 @@ module Box2D
|
|
485
510
|
def updateBodyMass=(v) self[:updateBodyMass] = v end
|
486
511
|
def internalValue = self[:internalValue]
|
487
512
|
def internalValue=(v) self[:internalValue] = v end
|
488
|
-
def self.create_as(_userData_,
|
513
|
+
def self.create_as(_userData_, _material_, _density_, _filter_, _isSensor_, _enableSensorEvents_, _enableContactEvents_, _enableHitEvents_, _enablePreSolveEvents_, _invokeContactCreation_, _updateBodyMass_, _internalValue_)
|
489
514
|
instance = ShapeDef.new
|
490
515
|
instance[:userData] = _userData_
|
491
|
-
instance[:
|
492
|
-
instance[:restitution] = _restitution_
|
493
|
-
instance[:rollingResistance] = _rollingResistance_
|
516
|
+
instance[:material] = _material_
|
494
517
|
instance[:density] = _density_
|
495
518
|
instance[:filter] = _filter_
|
496
|
-
instance[:customColor] = _customColor_
|
497
519
|
instance[:isSensor] = _isSensor_
|
498
520
|
instance[:enableSensorEvents] = _enableSensorEvents_
|
499
521
|
instance[:enableContactEvents] = _enableContactEvents_
|
@@ -511,11 +533,11 @@ module Box2D
|
|
511
533
|
:userData, :pointer,
|
512
534
|
:points, :pointer,
|
513
535
|
:count, :int,
|
514
|
-
:
|
515
|
-
:
|
536
|
+
:materials, :pointer,
|
537
|
+
:materialCount, :int,
|
516
538
|
:filter, Filter,
|
517
|
-
:customColor, :uint,
|
518
539
|
:isLoop, :bool,
|
540
|
+
:enableSensorEvents, :bool,
|
519
541
|
:internalValue, :int,
|
520
542
|
)
|
521
543
|
def userData = self[:userData]
|
@@ -524,28 +546,28 @@ module Box2D
|
|
524
546
|
def points=(v) self[:points] = v end
|
525
547
|
def count = self[:count]
|
526
548
|
def count=(v) self[:count] = v end
|
527
|
-
def
|
528
|
-
def
|
529
|
-
def
|
530
|
-
def
|
549
|
+
def materials = self[:materials]
|
550
|
+
def materials=(v) self[:materials] = v end
|
551
|
+
def materialCount = self[:materialCount]
|
552
|
+
def materialCount=(v) self[:materialCount] = v end
|
531
553
|
def filter = self[:filter]
|
532
554
|
def filter=(v) self[:filter] = v end
|
533
|
-
def customColor = self[:customColor]
|
534
|
-
def customColor=(v) self[:customColor] = v end
|
535
555
|
def isLoop = self[:isLoop]
|
536
556
|
def isLoop=(v) self[:isLoop] = v end
|
557
|
+
def enableSensorEvents = self[:enableSensorEvents]
|
558
|
+
def enableSensorEvents=(v) self[:enableSensorEvents] = v end
|
537
559
|
def internalValue = self[:internalValue]
|
538
560
|
def internalValue=(v) self[:internalValue] = v end
|
539
|
-
def self.create_as(_userData_, _points_, _count_,
|
561
|
+
def self.create_as(_userData_, _points_, _count_, _materials_, _materialCount_, _filter_, _isLoop_, _enableSensorEvents_, _internalValue_)
|
540
562
|
instance = ChainDef.new
|
541
563
|
instance[:userData] = _userData_
|
542
564
|
instance[:points] = _points_
|
543
565
|
instance[:count] = _count_
|
544
|
-
instance[:
|
545
|
-
instance[:
|
566
|
+
instance[:materials] = _materials_
|
567
|
+
instance[:materialCount] = _materialCount_
|
546
568
|
instance[:filter] = _filter_
|
547
|
-
instance[:customColor] = _customColor_
|
548
569
|
instance[:isLoop] = _isLoop_
|
570
|
+
instance[:enableSensorEvents] = _enableSensorEvents_
|
549
571
|
instance[:internalValue] = _internalValue_
|
550
572
|
instance
|
551
573
|
end
|
@@ -557,24 +579,24 @@ module Box2D
|
|
557
579
|
:pairs, :float,
|
558
580
|
:collide, :float,
|
559
581
|
:solve, :float,
|
560
|
-
:
|
582
|
+
:mergeIslands, :float,
|
583
|
+
:prepareStages, :float,
|
561
584
|
:solveConstraints, :float,
|
562
|
-
:prepareTasks, :float,
|
563
|
-
:solverTasks, :float,
|
564
585
|
:prepareConstraints, :float,
|
565
586
|
:integrateVelocities, :float,
|
566
587
|
:warmStart, :float,
|
567
|
-
:
|
588
|
+
:solveImpulses, :float,
|
568
589
|
:integratePositions, :float,
|
569
|
-
:
|
590
|
+
:relaxImpulses, :float,
|
570
591
|
:applyRestitution, :float,
|
571
592
|
:storeImpulses, :float,
|
572
|
-
:finalizeBodies, :float,
|
573
593
|
:splitIslands, :float,
|
574
|
-
:
|
594
|
+
:transforms, :float,
|
575
595
|
:hitEvents, :float,
|
576
|
-
:
|
577
|
-
:
|
596
|
+
:refit, :float,
|
597
|
+
:bullets, :float,
|
598
|
+
:sleepIslands, :float,
|
599
|
+
:sensors, :float,
|
578
600
|
)
|
579
601
|
def step = self[:step]
|
580
602
|
def step=(v) self[:step] = v end
|
@@ -584,66 +606,66 @@ module Box2D
|
|
584
606
|
def collide=(v) self[:collide] = v end
|
585
607
|
def solve = self[:solve]
|
586
608
|
def solve=(v) self[:solve] = v end
|
587
|
-
def
|
588
|
-
def
|
609
|
+
def mergeIslands = self[:mergeIslands]
|
610
|
+
def mergeIslands=(v) self[:mergeIslands] = v end
|
611
|
+
def prepareStages = self[:prepareStages]
|
612
|
+
def prepareStages=(v) self[:prepareStages] = v end
|
589
613
|
def solveConstraints = self[:solveConstraints]
|
590
614
|
def solveConstraints=(v) self[:solveConstraints] = v end
|
591
|
-
def prepareTasks = self[:prepareTasks]
|
592
|
-
def prepareTasks=(v) self[:prepareTasks] = v end
|
593
|
-
def solverTasks = self[:solverTasks]
|
594
|
-
def solverTasks=(v) self[:solverTasks] = v end
|
595
615
|
def prepareConstraints = self[:prepareConstraints]
|
596
616
|
def prepareConstraints=(v) self[:prepareConstraints] = v end
|
597
617
|
def integrateVelocities = self[:integrateVelocities]
|
598
618
|
def integrateVelocities=(v) self[:integrateVelocities] = v end
|
599
619
|
def warmStart = self[:warmStart]
|
600
620
|
def warmStart=(v) self[:warmStart] = v end
|
601
|
-
def
|
602
|
-
def
|
621
|
+
def solveImpulses = self[:solveImpulses]
|
622
|
+
def solveImpulses=(v) self[:solveImpulses] = v end
|
603
623
|
def integratePositions = self[:integratePositions]
|
604
624
|
def integratePositions=(v) self[:integratePositions] = v end
|
605
|
-
def
|
606
|
-
def
|
625
|
+
def relaxImpulses = self[:relaxImpulses]
|
626
|
+
def relaxImpulses=(v) self[:relaxImpulses] = v end
|
607
627
|
def applyRestitution = self[:applyRestitution]
|
608
628
|
def applyRestitution=(v) self[:applyRestitution] = v end
|
609
629
|
def storeImpulses = self[:storeImpulses]
|
610
630
|
def storeImpulses=(v) self[:storeImpulses] = v end
|
611
|
-
def finalizeBodies = self[:finalizeBodies]
|
612
|
-
def finalizeBodies=(v) self[:finalizeBodies] = v end
|
613
631
|
def splitIslands = self[:splitIslands]
|
614
632
|
def splitIslands=(v) self[:splitIslands] = v end
|
615
|
-
def
|
616
|
-
def
|
633
|
+
def transforms = self[:transforms]
|
634
|
+
def transforms=(v) self[:transforms] = v end
|
617
635
|
def hitEvents = self[:hitEvents]
|
618
636
|
def hitEvents=(v) self[:hitEvents] = v end
|
619
|
-
def
|
620
|
-
def
|
621
|
-
def
|
622
|
-
def
|
623
|
-
def
|
637
|
+
def refit = self[:refit]
|
638
|
+
def refit=(v) self[:refit] = v end
|
639
|
+
def bullets = self[:bullets]
|
640
|
+
def bullets=(v) self[:bullets] = v end
|
641
|
+
def sleepIslands = self[:sleepIslands]
|
642
|
+
def sleepIslands=(v) self[:sleepIslands] = v end
|
643
|
+
def sensors = self[:sensors]
|
644
|
+
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_)
|
624
646
|
instance = Profile.new
|
625
647
|
instance[:step] = _step_
|
626
648
|
instance[:pairs] = _pairs_
|
627
649
|
instance[:collide] = _collide_
|
628
650
|
instance[:solve] = _solve_
|
629
|
-
instance[:
|
651
|
+
instance[:mergeIslands] = _mergeIslands_
|
652
|
+
instance[:prepareStages] = _prepareStages_
|
630
653
|
instance[:solveConstraints] = _solveConstraints_
|
631
|
-
instance[:prepareTasks] = _prepareTasks_
|
632
|
-
instance[:solverTasks] = _solverTasks_
|
633
654
|
instance[:prepareConstraints] = _prepareConstraints_
|
634
655
|
instance[:integrateVelocities] = _integrateVelocities_
|
635
656
|
instance[:warmStart] = _warmStart_
|
636
|
-
instance[:
|
657
|
+
instance[:solveImpulses] = _solveImpulses_
|
637
658
|
instance[:integratePositions] = _integratePositions_
|
638
|
-
instance[:
|
659
|
+
instance[:relaxImpulses] = _relaxImpulses_
|
639
660
|
instance[:applyRestitution] = _applyRestitution_
|
640
661
|
instance[:storeImpulses] = _storeImpulses_
|
641
|
-
instance[:finalizeBodies] = _finalizeBodies_
|
642
662
|
instance[:splitIslands] = _splitIslands_
|
643
|
-
instance[:
|
663
|
+
instance[:transforms] = _transforms_
|
644
664
|
instance[:hitEvents] = _hitEvents_
|
645
|
-
instance[:
|
646
|
-
instance[:
|
665
|
+
instance[:refit] = _refit_
|
666
|
+
instance[:bullets] = _bullets_
|
667
|
+
instance[:sleepIslands] = _sleepIslands_
|
668
|
+
instance[:sensors] = _sensors_
|
647
669
|
instance
|
648
670
|
end
|
649
671
|
end
|
@@ -872,7 +894,7 @@ module Box2D
|
|
872
894
|
end
|
873
895
|
end
|
874
896
|
|
875
|
-
class
|
897
|
+
class FilterJointDef < FFI::Struct
|
876
898
|
layout(
|
877
899
|
:bodyIdA, BodyId,
|
878
900
|
:bodyIdB, BodyId,
|
@@ -888,7 +910,7 @@ module Box2D
|
|
888
910
|
def internalValue = self[:internalValue]
|
889
911
|
def internalValue=(v) self[:internalValue] = v end
|
890
912
|
def self.create_as(_bodyIdA_, _bodyIdB_, _userData_, _internalValue_)
|
891
|
-
instance =
|
913
|
+
instance = FilterJointDef.new
|
892
914
|
instance[:bodyIdA] = _bodyIdA_
|
893
915
|
instance[:bodyIdB] = _bodyIdB_
|
894
916
|
instance[:userData] = _userData_
|
@@ -1446,47 +1468,50 @@ module Box2D
|
|
1446
1468
|
|
1447
1469
|
class DebugDraw < FFI::Struct
|
1448
1470
|
layout(
|
1449
|
-
:
|
1450
|
-
:
|
1451
|
-
:
|
1452
|
-
:
|
1453
|
-
:
|
1454
|
-
:
|
1455
|
-
:
|
1456
|
-
:
|
1457
|
-
:
|
1471
|
+
:DrawPolygonFcn, :pointer,
|
1472
|
+
:DrawSolidPolygonFcn, :pointer,
|
1473
|
+
:DrawCircleFcn, :pointer,
|
1474
|
+
:DrawSolidCircleFcn, :pointer,
|
1475
|
+
:DrawSolidCapsuleFcn, :pointer,
|
1476
|
+
:DrawSegmentFcn, :pointer,
|
1477
|
+
:DrawTransformFcn, :pointer,
|
1478
|
+
:DrawPointFcn, :pointer,
|
1479
|
+
:DrawStringFcn, :pointer,
|
1458
1480
|
:drawingBounds, AABB,
|
1459
1481
|
:useDrawingBounds, :bool,
|
1460
1482
|
:drawShapes, :bool,
|
1461
1483
|
:drawJoints, :bool,
|
1462
1484
|
:drawJointExtras, :bool,
|
1463
|
-
:
|
1485
|
+
:drawBounds, :bool,
|
1464
1486
|
:drawMass, :bool,
|
1487
|
+
:drawBodyNames, :bool,
|
1465
1488
|
:drawContacts, :bool,
|
1466
1489
|
:drawGraphColors, :bool,
|
1467
1490
|
:drawContactNormals, :bool,
|
1468
1491
|
:drawContactImpulses, :bool,
|
1492
|
+
:drawContactFeatures, :bool,
|
1469
1493
|
:drawFrictionImpulses, :bool,
|
1494
|
+
:drawIslands, :bool,
|
1470
1495
|
:context, :pointer,
|
1471
1496
|
)
|
1472
|
-
def
|
1473
|
-
def
|
1474
|
-
def
|
1475
|
-
def
|
1476
|
-
def
|
1477
|
-
def
|
1478
|
-
def
|
1479
|
-
def
|
1480
|
-
def
|
1481
|
-
def
|
1482
|
-
def
|
1483
|
-
def
|
1484
|
-
def
|
1485
|
-
def
|
1486
|
-
def
|
1487
|
-
def
|
1488
|
-
def
|
1489
|
-
def
|
1497
|
+
def DrawPolygonFcn = self[:DrawPolygonFcn]
|
1498
|
+
def DrawPolygonFcn=(v) self[:DrawPolygonFcn] = v end
|
1499
|
+
def DrawSolidPolygonFcn = self[:DrawSolidPolygonFcn]
|
1500
|
+
def DrawSolidPolygonFcn=(v) self[:DrawSolidPolygonFcn] = v end
|
1501
|
+
def DrawCircleFcn = self[:DrawCircleFcn]
|
1502
|
+
def DrawCircleFcn=(v) self[:DrawCircleFcn] = v end
|
1503
|
+
def DrawSolidCircleFcn = self[:DrawSolidCircleFcn]
|
1504
|
+
def DrawSolidCircleFcn=(v) self[:DrawSolidCircleFcn] = v end
|
1505
|
+
def DrawSolidCapsuleFcn = self[:DrawSolidCapsuleFcn]
|
1506
|
+
def DrawSolidCapsuleFcn=(v) self[:DrawSolidCapsuleFcn] = v end
|
1507
|
+
def DrawSegmentFcn = self[:DrawSegmentFcn]
|
1508
|
+
def DrawSegmentFcn=(v) self[:DrawSegmentFcn] = v end
|
1509
|
+
def DrawTransformFcn = self[:DrawTransformFcn]
|
1510
|
+
def DrawTransformFcn=(v) self[:DrawTransformFcn] = v end
|
1511
|
+
def DrawPointFcn = self[:DrawPointFcn]
|
1512
|
+
def DrawPointFcn=(v) self[:DrawPointFcn] = v end
|
1513
|
+
def DrawStringFcn = self[:DrawStringFcn]
|
1514
|
+
def DrawStringFcn=(v) self[:DrawStringFcn] = v end
|
1490
1515
|
def drawingBounds = self[:drawingBounds]
|
1491
1516
|
def drawingBounds=(v) self[:drawingBounds] = v end
|
1492
1517
|
def useDrawingBounds = self[:useDrawingBounds]
|
@@ -1497,10 +1522,12 @@ module Box2D
|
|
1497
1522
|
def drawJoints=(v) self[:drawJoints] = v end
|
1498
1523
|
def drawJointExtras = self[:drawJointExtras]
|
1499
1524
|
def drawJointExtras=(v) self[:drawJointExtras] = v end
|
1500
|
-
def
|
1501
|
-
def
|
1525
|
+
def drawBounds = self[:drawBounds]
|
1526
|
+
def drawBounds=(v) self[:drawBounds] = v end
|
1502
1527
|
def drawMass = self[:drawMass]
|
1503
1528
|
def drawMass=(v) self[:drawMass] = v end
|
1529
|
+
def drawBodyNames = self[:drawBodyNames]
|
1530
|
+
def drawBodyNames=(v) self[:drawBodyNames] = v end
|
1504
1531
|
def drawContacts = self[:drawContacts]
|
1505
1532
|
def drawContacts=(v) self[:drawContacts] = v end
|
1506
1533
|
def drawGraphColors = self[:drawGraphColors]
|
@@ -1509,33 +1536,40 @@ module Box2D
|
|
1509
1536
|
def drawContactNormals=(v) self[:drawContactNormals] = v end
|
1510
1537
|
def drawContactImpulses = self[:drawContactImpulses]
|
1511
1538
|
def drawContactImpulses=(v) self[:drawContactImpulses] = v end
|
1539
|
+
def drawContactFeatures = self[:drawContactFeatures]
|
1540
|
+
def drawContactFeatures=(v) self[:drawContactFeatures] = v end
|
1512
1541
|
def drawFrictionImpulses = self[:drawFrictionImpulses]
|
1513
1542
|
def drawFrictionImpulses=(v) self[:drawFrictionImpulses] = v end
|
1543
|
+
def drawIslands = self[:drawIslands]
|
1544
|
+
def drawIslands=(v) self[:drawIslands] = v end
|
1514
1545
|
def context = self[:context]
|
1515
1546
|
def context=(v) self[:context] = v end
|
1516
|
-
def self.create_as(
|
1547
|
+
def self.create_as(_DrawPolygonFcn_, _DrawSolidPolygonFcn_, _DrawCircleFcn_, _DrawSolidCircleFcn_, _DrawSolidCapsuleFcn_, _DrawSegmentFcn_, _DrawTransformFcn_, _DrawPointFcn_, _DrawStringFcn_, _drawingBounds_, _useDrawingBounds_, _drawShapes_, _drawJoints_, _drawJointExtras_, _drawBounds_, _drawMass_, _drawBodyNames_, _drawContacts_, _drawGraphColors_, _drawContactNormals_, _drawContactImpulses_, _drawContactFeatures_, _drawFrictionImpulses_, _drawIslands_, _context_)
|
1517
1548
|
instance = DebugDraw.new
|
1518
|
-
instance[:
|
1519
|
-
instance[:
|
1520
|
-
instance[:
|
1521
|
-
instance[:
|
1522
|
-
instance[:
|
1523
|
-
instance[:
|
1524
|
-
instance[:
|
1525
|
-
instance[:
|
1526
|
-
instance[:
|
1549
|
+
instance[:DrawPolygonFcn] = _DrawPolygonFcn_
|
1550
|
+
instance[:DrawSolidPolygonFcn] = _DrawSolidPolygonFcn_
|
1551
|
+
instance[:DrawCircleFcn] = _DrawCircleFcn_
|
1552
|
+
instance[:DrawSolidCircleFcn] = _DrawSolidCircleFcn_
|
1553
|
+
instance[:DrawSolidCapsuleFcn] = _DrawSolidCapsuleFcn_
|
1554
|
+
instance[:DrawSegmentFcn] = _DrawSegmentFcn_
|
1555
|
+
instance[:DrawTransformFcn] = _DrawTransformFcn_
|
1556
|
+
instance[:DrawPointFcn] = _DrawPointFcn_
|
1557
|
+
instance[:DrawStringFcn] = _DrawStringFcn_
|
1527
1558
|
instance[:drawingBounds] = _drawingBounds_
|
1528
1559
|
instance[:useDrawingBounds] = _useDrawingBounds_
|
1529
1560
|
instance[:drawShapes] = _drawShapes_
|
1530
1561
|
instance[:drawJoints] = _drawJoints_
|
1531
1562
|
instance[:drawJointExtras] = _drawJointExtras_
|
1532
|
-
instance[:
|
1563
|
+
instance[:drawBounds] = _drawBounds_
|
1533
1564
|
instance[:drawMass] = _drawMass_
|
1565
|
+
instance[:drawBodyNames] = _drawBodyNames_
|
1534
1566
|
instance[:drawContacts] = _drawContacts_
|
1535
1567
|
instance[:drawGraphColors] = _drawGraphColors_
|
1536
1568
|
instance[:drawContactNormals] = _drawContactNormals_
|
1537
1569
|
instance[:drawContactImpulses] = _drawContactImpulses_
|
1570
|
+
instance[:drawContactFeatures] = _drawContactFeatures_
|
1538
1571
|
instance[:drawFrictionImpulses] = _drawFrictionImpulses_
|
1572
|
+
instance[:drawIslands] = _drawIslands_
|
1539
1573
|
instance[:context] = _context_
|
1540
1574
|
instance
|
1541
1575
|
end
|
@@ -1550,12 +1584,13 @@ module Box2D
|
|
1550
1584
|
[:DefaultBodyDef, :b2DefaultBodyDef, [], BodyDef.by_value],
|
1551
1585
|
[:DefaultFilter, :b2DefaultFilter, [], Filter.by_value],
|
1552
1586
|
[:DefaultQueryFilter, :b2DefaultQueryFilter, [], QueryFilter.by_value],
|
1587
|
+
[:DefaultSurfaceMaterial, :b2DefaultSurfaceMaterial, [], SurfaceMaterial.by_value],
|
1553
1588
|
[:DefaultShapeDef, :b2DefaultShapeDef, [], ShapeDef.by_value],
|
1554
1589
|
[:DefaultChainDef, :b2DefaultChainDef, [], ChainDef.by_value],
|
1555
1590
|
[:DefaultDistanceJointDef, :b2DefaultDistanceJointDef, [], DistanceJointDef.by_value],
|
1556
1591
|
[:DefaultMotorJointDef, :b2DefaultMotorJointDef, [], MotorJointDef.by_value],
|
1557
1592
|
[:DefaultMouseJointDef, :b2DefaultMouseJointDef, [], MouseJointDef.by_value],
|
1558
|
-
[:
|
1593
|
+
[:DefaultFilterJointDef, :b2DefaultFilterJointDef, [], FilterJointDef.by_value],
|
1559
1594
|
[:DefaultPrismaticJointDef, :b2DefaultPrismaticJointDef, [], PrismaticJointDef.by_value],
|
1560
1595
|
[:DefaultRevoluteJointDef, :b2DefaultRevoluteJointDef, [], RevoluteJointDef.by_value],
|
1561
1596
|
[:DefaultWeldJointDef, :b2DefaultWeldJointDef, [], WeldJointDef.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.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- vaiorabbit
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-
|
10
|
+
date: 2025-05-11 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: ffi
|
@@ -38,7 +38,6 @@ files:
|
|
38
38
|
- lib/box2d.rb
|
39
39
|
- lib/box2d_base.rb
|
40
40
|
- lib/box2d_collision.rb
|
41
|
-
- lib/box2d_collision_inline.rb
|
42
41
|
- lib/box2d_helper.rb
|
43
42
|
- lib/box2d_id.rb
|
44
43
|
- lib/box2d_id_inline.rb
|
@@ -69,7 +68,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
69
68
|
- !ruby/object:Gem::Version
|
70
69
|
version: '0'
|
71
70
|
requirements: []
|
72
|
-
rubygems_version: 3.6.
|
71
|
+
rubygems_version: 3.6.5
|
73
72
|
specification_version: 4
|
74
73
|
summary: Ruby bindings for Box2D
|
75
74
|
test_files: []
|