box2d-bindings 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/ChangeLog +35 -0
- data/LICENSE.txt +21 -0
- data/README.md +50 -0
- data/lib/box2d.rb +50 -0
- data/lib/box2d_base.rb +95 -0
- data/lib/box2d_collision.rb +832 -0
- data/lib/box2d_collision_inline.rb +47 -0
- data/lib/box2d_helper.rb +67 -0
- data/lib/box2d_id.rb +146 -0
- data/lib/box2d_id_inline.rb +53 -0
- data/lib/box2d_main.rb +337 -0
- data/lib/box2d_math_functions.rb +156 -0
- data/lib/box2d_math_inline_functions.rb +104 -0
- data/lib/box2d_types.rb +1583 -0
- 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 +75 -0
data/lib/box2d_types.rb
ADDED
@@ -0,0 +1,1583 @@
|
|
1
|
+
# Ruby-Box2D : Yet another Box2D wrapper for Ruby
|
2
|
+
#
|
3
|
+
# * https://github.com/vaiorabbit/box2d-bindings
|
4
|
+
#
|
5
|
+
# [NOTICE] Autogenerated. Do not edit.
|
6
|
+
|
7
|
+
require 'ffi'
|
8
|
+
|
9
|
+
module Box2D
|
10
|
+
extend FFI::Library
|
11
|
+
# Define/Macro
|
12
|
+
|
13
|
+
DEFAULT_CATEGORY_BITS = 0x0001
|
14
|
+
|
15
|
+
# Enum
|
16
|
+
|
17
|
+
MixingRule_mixAverage = 0
|
18
|
+
MixingRule_mixGeometricMean = 1
|
19
|
+
MixingRule_mixMultiply = 2
|
20
|
+
MixingRule_mixMinimum = 3
|
21
|
+
MixingRule_mixMaximum = 4
|
22
|
+
BodyType_staticBody = 0
|
23
|
+
BodyType_kinematicBody = 1
|
24
|
+
BodyType_dynamicBody = 2
|
25
|
+
BodyType_bodyTypeCount = 3
|
26
|
+
ShapeType_circleShape = 0
|
27
|
+
ShapeType_capsuleShape = 1
|
28
|
+
ShapeType_segmentShape = 2
|
29
|
+
ShapeType_polygonShape = 3
|
30
|
+
ShapeType_chainSegmentShape = 4
|
31
|
+
ShapeType_shapeTypeCount = 5
|
32
|
+
JointType_distanceJoint = 0
|
33
|
+
JointType_motorJoint = 1
|
34
|
+
JointType_mouseJoint = 2
|
35
|
+
JointType_nullJoint = 3
|
36
|
+
JointType_prismaticJoint = 4
|
37
|
+
JointType_revoluteJoint = 5
|
38
|
+
JointType_weldJoint = 6
|
39
|
+
JointType_wheelJoint = 7
|
40
|
+
HexColor_colorAliceBlue = 15792383
|
41
|
+
HexColor_colorAntiqueWhite = 16444375
|
42
|
+
HexColor_colorAqua = 65535
|
43
|
+
HexColor_colorAquamarine = 8388564
|
44
|
+
HexColor_colorAzure = 15794175
|
45
|
+
HexColor_colorBeige = 16119260
|
46
|
+
HexColor_colorBisque = 16770244
|
47
|
+
HexColor_colorBlack = 0
|
48
|
+
HexColor_colorBlanchedAlmond = 16772045
|
49
|
+
HexColor_colorBlue = 255
|
50
|
+
HexColor_colorBlueViolet = 9055202
|
51
|
+
HexColor_colorBrown = 10824234
|
52
|
+
HexColor_colorBurlywood = 14596231
|
53
|
+
HexColor_colorCadetBlue = 6266528
|
54
|
+
HexColor_colorChartreuse = 8388352
|
55
|
+
HexColor_colorChocolate = 13789470
|
56
|
+
HexColor_colorCoral = 16744272
|
57
|
+
HexColor_colorCornflowerBlue = 6591981
|
58
|
+
HexColor_colorCornsilk = 16775388
|
59
|
+
HexColor_colorCrimson = 14423100
|
60
|
+
HexColor_colorCyan = 65535
|
61
|
+
HexColor_colorDarkBlue = 139
|
62
|
+
HexColor_colorDarkCyan = 35723
|
63
|
+
HexColor_colorDarkGoldenRod = 12092939
|
64
|
+
HexColor_colorDarkGray = 11119017
|
65
|
+
HexColor_colorDarkGreen = 25600
|
66
|
+
HexColor_colorDarkKhaki = 12433259
|
67
|
+
HexColor_colorDarkMagenta = 9109643
|
68
|
+
HexColor_colorDarkOliveGreen = 5597999
|
69
|
+
HexColor_colorDarkOrange = 16747520
|
70
|
+
HexColor_colorDarkOrchid = 10040012
|
71
|
+
HexColor_colorDarkRed = 9109504
|
72
|
+
HexColor_colorDarkSalmon = 15308410
|
73
|
+
HexColor_colorDarkSeaGreen = 9419919
|
74
|
+
HexColor_colorDarkSlateBlue = 4734347
|
75
|
+
HexColor_colorDarkSlateGray = 3100495
|
76
|
+
HexColor_colorDarkTurquoise = 52945
|
77
|
+
HexColor_colorDarkViolet = 9699539
|
78
|
+
HexColor_colorDeepPink = 16716947
|
79
|
+
HexColor_colorDeepSkyBlue = 49151
|
80
|
+
HexColor_colorDimGray = 6908265
|
81
|
+
HexColor_colorDodgerBlue = 2003199
|
82
|
+
HexColor_colorFireBrick = 11674146
|
83
|
+
HexColor_colorFloralWhite = 16775920
|
84
|
+
HexColor_colorForestGreen = 2263842
|
85
|
+
HexColor_colorFuchsia = 16711935
|
86
|
+
HexColor_colorGainsboro = 14474460
|
87
|
+
HexColor_colorGhostWhite = 16316671
|
88
|
+
HexColor_colorGold = 16766720
|
89
|
+
HexColor_colorGoldenRod = 14329120
|
90
|
+
HexColor_colorGray = 8421504
|
91
|
+
HexColor_colorGreen = 32768
|
92
|
+
HexColor_colorGreenYellow = 11403055
|
93
|
+
HexColor_colorHoneyDew = 15794160
|
94
|
+
HexColor_colorHotPink = 16738740
|
95
|
+
HexColor_colorIndianRed = 13458524
|
96
|
+
HexColor_colorIndigo = 4915330
|
97
|
+
HexColor_colorIvory = 16777200
|
98
|
+
HexColor_colorKhaki = 15787660
|
99
|
+
HexColor_colorLavender = 15132410
|
100
|
+
HexColor_colorLavenderBlush = 16773365
|
101
|
+
HexColor_colorLawnGreen = 8190976
|
102
|
+
HexColor_colorLemonChiffon = 16775885
|
103
|
+
HexColor_colorLightBlue = 11393254
|
104
|
+
HexColor_colorLightCoral = 15761536
|
105
|
+
HexColor_colorLightCyan = 14745599
|
106
|
+
HexColor_colorLightGoldenRodYellow = 16448210
|
107
|
+
HexColor_colorLightGray = 13882323
|
108
|
+
HexColor_colorLightGreen = 9498256
|
109
|
+
HexColor_colorLightPink = 16758465
|
110
|
+
HexColor_colorLightSalmon = 16752762
|
111
|
+
HexColor_colorLightSeaGreen = 2142890
|
112
|
+
HexColor_colorLightSkyBlue = 8900346
|
113
|
+
HexColor_colorLightSlateGray = 7833753
|
114
|
+
HexColor_colorLightSteelBlue = 11584734
|
115
|
+
HexColor_colorLightYellow = 16777184
|
116
|
+
HexColor_colorLime = 65280
|
117
|
+
HexColor_colorLimeGreen = 3329330
|
118
|
+
HexColor_colorLinen = 16445670
|
119
|
+
HexColor_colorMagenta = 16711935
|
120
|
+
HexColor_colorMaroon = 8388608
|
121
|
+
HexColor_colorMediumAquaMarine = 6737322
|
122
|
+
HexColor_colorMediumBlue = 205
|
123
|
+
HexColor_colorMediumOrchid = 12211667
|
124
|
+
HexColor_colorMediumPurple = 9662683
|
125
|
+
HexColor_colorMediumSeaGreen = 3978097
|
126
|
+
HexColor_colorMediumSlateBlue = 8087790
|
127
|
+
HexColor_colorMediumSpringGreen = 64154
|
128
|
+
HexColor_colorMediumTurquoise = 4772300
|
129
|
+
HexColor_colorMediumVioletRed = 13047173
|
130
|
+
HexColor_colorMidnightBlue = 1644912
|
131
|
+
HexColor_colorMintCream = 16121850
|
132
|
+
HexColor_colorMistyRose = 16770273
|
133
|
+
HexColor_colorMoccasin = 16770229
|
134
|
+
HexColor_colorNavajoWhite = 16768685
|
135
|
+
HexColor_colorNavy = 128
|
136
|
+
HexColor_colorOldLace = 16643558
|
137
|
+
HexColor_colorOlive = 8421376
|
138
|
+
HexColor_colorOliveDrab = 7048739
|
139
|
+
HexColor_colorOrange = 16753920
|
140
|
+
HexColor_colorOrangeRed = 16729344
|
141
|
+
HexColor_colorOrchid = 14315734
|
142
|
+
HexColor_colorPaleGoldenRod = 15657130
|
143
|
+
HexColor_colorPaleGreen = 10025880
|
144
|
+
HexColor_colorPaleTurquoise = 11529966
|
145
|
+
HexColor_colorPaleVioletRed = 14381203
|
146
|
+
HexColor_colorPapayaWhip = 16773077
|
147
|
+
HexColor_colorPeachPuff = 16767673
|
148
|
+
HexColor_colorPeru = 13468991
|
149
|
+
HexColor_colorPink = 16761035
|
150
|
+
HexColor_colorPlum = 14524637
|
151
|
+
HexColor_colorPowderBlue = 11591910
|
152
|
+
HexColor_colorPurple = 8388736
|
153
|
+
HexColor_colorRebeccaPurple = 6697881
|
154
|
+
HexColor_colorRed = 16711680
|
155
|
+
HexColor_colorRosyBrown = 12357519
|
156
|
+
HexColor_colorRoyalBlue = 4286945
|
157
|
+
HexColor_colorSaddleBrown = 9127187
|
158
|
+
HexColor_colorSalmon = 16416882
|
159
|
+
HexColor_colorSandyBrown = 16032864
|
160
|
+
HexColor_colorSeaGreen = 3050327
|
161
|
+
HexColor_colorSeaShell = 16774638
|
162
|
+
HexColor_colorSienna = 10506797
|
163
|
+
HexColor_colorSilver = 12632256
|
164
|
+
HexColor_colorSkyBlue = 8900331
|
165
|
+
HexColor_colorSlateBlue = 6970061
|
166
|
+
HexColor_colorSlateGray = 7372944
|
167
|
+
HexColor_colorSnow = 16775930
|
168
|
+
HexColor_colorSpringGreen = 65407
|
169
|
+
HexColor_colorSteelBlue = 4620980
|
170
|
+
HexColor_colorTan = 13808780
|
171
|
+
HexColor_colorTeal = 32896
|
172
|
+
HexColor_colorThistle = 14204888
|
173
|
+
HexColor_colorTomato = 16737095
|
174
|
+
HexColor_colorTurquoise = 4251856
|
175
|
+
HexColor_colorViolet = 15631086
|
176
|
+
HexColor_colorWheat = 16113331
|
177
|
+
HexColor_colorWhite = 16777215
|
178
|
+
HexColor_colorWhiteSmoke = 16119285
|
179
|
+
HexColor_colorYellow = 16776960
|
180
|
+
HexColor_colorYellowGreen = 10145074
|
181
|
+
HexColor_colorBox2DRed = 14430514
|
182
|
+
HexColor_colorBox2DBlue = 3190463
|
183
|
+
HexColor_colorBox2DGreen = 9226532
|
184
|
+
HexColor_colorBox2DYellow = 16772748
|
185
|
+
|
186
|
+
# Typedef
|
187
|
+
|
188
|
+
typedef :pointer, :b2TaskCallback
|
189
|
+
typedef :pointer, :b2EnqueueTaskCallback
|
190
|
+
typedef :pointer, :b2FinishTaskCallback
|
191
|
+
typedef :int, :b2MixingRule
|
192
|
+
typedef :int, :b2BodyType
|
193
|
+
typedef :int, :b2ShapeType
|
194
|
+
typedef :int, :b2JointType
|
195
|
+
typedef :pointer, :b2CustomFilterFcn
|
196
|
+
typedef :pointer, :b2PreSolveFcn
|
197
|
+
typedef :pointer, :b2OverlapResultFcn
|
198
|
+
typedef :pointer, :b2CastResultFcn
|
199
|
+
typedef :int, :b2HexColor
|
200
|
+
|
201
|
+
# Struct
|
202
|
+
|
203
|
+
class RayResult < FFI::Struct
|
204
|
+
layout(
|
205
|
+
:shapeId, ShapeId,
|
206
|
+
:point, Vec2,
|
207
|
+
:normal, Vec2,
|
208
|
+
:fraction, :float,
|
209
|
+
:nodeVisits, :int,
|
210
|
+
:leafVisits, :int,
|
211
|
+
:hit, :bool,
|
212
|
+
)
|
213
|
+
def shapeId = self[:shapeId]
|
214
|
+
def shapeId=(v) self[:shapeId] = v end
|
215
|
+
def point = self[:point]
|
216
|
+
def point=(v) self[:point] = v end
|
217
|
+
def normal = self[:normal]
|
218
|
+
def normal=(v) self[:normal] = v end
|
219
|
+
def fraction = self[:fraction]
|
220
|
+
def fraction=(v) self[:fraction] = v end
|
221
|
+
def nodeVisits = self[:nodeVisits]
|
222
|
+
def nodeVisits=(v) self[:nodeVisits] = v end
|
223
|
+
def leafVisits = self[:leafVisits]
|
224
|
+
def leafVisits=(v) self[:leafVisits] = v end
|
225
|
+
def hit = self[:hit]
|
226
|
+
def hit=(v) self[:hit] = v end
|
227
|
+
def self.create_as(_shapeId_, _point_, _normal_, _fraction_, _nodeVisits_, _leafVisits_, _hit_)
|
228
|
+
instance = RayResult.new
|
229
|
+
instance[:shapeId] = _shapeId_
|
230
|
+
instance[:point] = _point_
|
231
|
+
instance[:normal] = _normal_
|
232
|
+
instance[:fraction] = _fraction_
|
233
|
+
instance[:nodeVisits] = _nodeVisits_
|
234
|
+
instance[:leafVisits] = _leafVisits_
|
235
|
+
instance[:hit] = _hit_
|
236
|
+
instance
|
237
|
+
end
|
238
|
+
end
|
239
|
+
|
240
|
+
class WorldDef < FFI::Struct
|
241
|
+
layout(
|
242
|
+
:gravity, Vec2,
|
243
|
+
:restitutionThreshold, :float,
|
244
|
+
:contactPushSpeed, :float,
|
245
|
+
:hitEventThreshold, :float,
|
246
|
+
:contactHertz, :float,
|
247
|
+
:contactDampingRatio, :float,
|
248
|
+
:jointHertz, :float,
|
249
|
+
:jointDampingRatio, :float,
|
250
|
+
:maximumLinearSpeed, :float,
|
251
|
+
:frictionMixingRule, :int,
|
252
|
+
:restitutionMixingRule, :int,
|
253
|
+
:enableSleep, :bool,
|
254
|
+
:enableContinuous, :bool,
|
255
|
+
:workerCount, :int,
|
256
|
+
:enqueueTask, :pointer,
|
257
|
+
:finishTask, :pointer,
|
258
|
+
:userTaskContext, :pointer,
|
259
|
+
:userData, :pointer,
|
260
|
+
:internalValue, :int,
|
261
|
+
)
|
262
|
+
def gravity = self[:gravity]
|
263
|
+
def gravity=(v) self[:gravity] = v end
|
264
|
+
def restitutionThreshold = self[:restitutionThreshold]
|
265
|
+
def restitutionThreshold=(v) self[:restitutionThreshold] = v end
|
266
|
+
def contactPushSpeed = self[:contactPushSpeed]
|
267
|
+
def contactPushSpeed=(v) self[:contactPushSpeed] = v end
|
268
|
+
def hitEventThreshold = self[:hitEventThreshold]
|
269
|
+
def hitEventThreshold=(v) self[:hitEventThreshold] = v end
|
270
|
+
def contactHertz = self[:contactHertz]
|
271
|
+
def contactHertz=(v) self[:contactHertz] = v end
|
272
|
+
def contactDampingRatio = self[:contactDampingRatio]
|
273
|
+
def contactDampingRatio=(v) self[:contactDampingRatio] = v end
|
274
|
+
def jointHertz = self[:jointHertz]
|
275
|
+
def jointHertz=(v) self[:jointHertz] = v end
|
276
|
+
def jointDampingRatio = self[:jointDampingRatio]
|
277
|
+
def jointDampingRatio=(v) self[:jointDampingRatio] = v end
|
278
|
+
def maximumLinearSpeed = self[:maximumLinearSpeed]
|
279
|
+
def maximumLinearSpeed=(v) self[:maximumLinearSpeed] = v end
|
280
|
+
def frictionMixingRule = self[:frictionMixingRule]
|
281
|
+
def frictionMixingRule=(v) self[:frictionMixingRule] = v end
|
282
|
+
def restitutionMixingRule = self[:restitutionMixingRule]
|
283
|
+
def restitutionMixingRule=(v) self[:restitutionMixingRule] = v end
|
284
|
+
def enableSleep = self[:enableSleep]
|
285
|
+
def enableSleep=(v) self[:enableSleep] = v end
|
286
|
+
def enableContinuous = self[:enableContinuous]
|
287
|
+
def enableContinuous=(v) self[:enableContinuous] = v end
|
288
|
+
def workerCount = self[:workerCount]
|
289
|
+
def workerCount=(v) self[:workerCount] = v end
|
290
|
+
def enqueueTask = self[:enqueueTask]
|
291
|
+
def enqueueTask=(v) self[:enqueueTask] = v end
|
292
|
+
def finishTask = self[:finishTask]
|
293
|
+
def finishTask=(v) self[:finishTask] = v end
|
294
|
+
def userTaskContext = self[:userTaskContext]
|
295
|
+
def userTaskContext=(v) self[:userTaskContext] = v end
|
296
|
+
def userData = self[:userData]
|
297
|
+
def userData=(v) self[:userData] = v end
|
298
|
+
def internalValue = self[:internalValue]
|
299
|
+
def internalValue=(v) self[:internalValue] = v end
|
300
|
+
def self.create_as(_gravity_, _restitutionThreshold_, _contactPushSpeed_, _hitEventThreshold_, _contactHertz_, _contactDampingRatio_, _jointHertz_, _jointDampingRatio_, _maximumLinearSpeed_, _frictionMixingRule_, _restitutionMixingRule_, _enableSleep_, _enableContinuous_, _workerCount_, _enqueueTask_, _finishTask_, _userTaskContext_, _userData_, _internalValue_)
|
301
|
+
instance = WorldDef.new
|
302
|
+
instance[:gravity] = _gravity_
|
303
|
+
instance[:restitutionThreshold] = _restitutionThreshold_
|
304
|
+
instance[:contactPushSpeed] = _contactPushSpeed_
|
305
|
+
instance[:hitEventThreshold] = _hitEventThreshold_
|
306
|
+
instance[:contactHertz] = _contactHertz_
|
307
|
+
instance[:contactDampingRatio] = _contactDampingRatio_
|
308
|
+
instance[:jointHertz] = _jointHertz_
|
309
|
+
instance[:jointDampingRatio] = _jointDampingRatio_
|
310
|
+
instance[:maximumLinearSpeed] = _maximumLinearSpeed_
|
311
|
+
instance[:frictionMixingRule] = _frictionMixingRule_
|
312
|
+
instance[:restitutionMixingRule] = _restitutionMixingRule_
|
313
|
+
instance[:enableSleep] = _enableSleep_
|
314
|
+
instance[:enableContinuous] = _enableContinuous_
|
315
|
+
instance[:workerCount] = _workerCount_
|
316
|
+
instance[:enqueueTask] = _enqueueTask_
|
317
|
+
instance[:finishTask] = _finishTask_
|
318
|
+
instance[:userTaskContext] = _userTaskContext_
|
319
|
+
instance[:userData] = _userData_
|
320
|
+
instance[:internalValue] = _internalValue_
|
321
|
+
instance
|
322
|
+
end
|
323
|
+
end
|
324
|
+
|
325
|
+
class BodyDef < FFI::Struct
|
326
|
+
layout(
|
327
|
+
:type, :int,
|
328
|
+
:position, Vec2,
|
329
|
+
:rotation, Rot,
|
330
|
+
:linearVelocity, Vec2,
|
331
|
+
:angularVelocity, :float,
|
332
|
+
:linearDamping, :float,
|
333
|
+
:angularDamping, :float,
|
334
|
+
:gravityScale, :float,
|
335
|
+
:sleepThreshold, :float,
|
336
|
+
:userData, :pointer,
|
337
|
+
:enableSleep, :bool,
|
338
|
+
:isAwake, :bool,
|
339
|
+
:fixedRotation, :bool,
|
340
|
+
:isBullet, :bool,
|
341
|
+
:isEnabled, :bool,
|
342
|
+
:allowFastRotation, :bool,
|
343
|
+
:internalValue, :int,
|
344
|
+
)
|
345
|
+
def type = self[:type]
|
346
|
+
def type=(v) self[:type] = v end
|
347
|
+
def position = self[:position]
|
348
|
+
def position=(v) self[:position] = v end
|
349
|
+
def rotation = self[:rotation]
|
350
|
+
def rotation=(v) self[:rotation] = v end
|
351
|
+
def linearVelocity = self[:linearVelocity]
|
352
|
+
def linearVelocity=(v) self[:linearVelocity] = v end
|
353
|
+
def angularVelocity = self[:angularVelocity]
|
354
|
+
def angularVelocity=(v) self[:angularVelocity] = v end
|
355
|
+
def linearDamping = self[:linearDamping]
|
356
|
+
def linearDamping=(v) self[:linearDamping] = v end
|
357
|
+
def angularDamping = self[:angularDamping]
|
358
|
+
def angularDamping=(v) self[:angularDamping] = v end
|
359
|
+
def gravityScale = self[:gravityScale]
|
360
|
+
def gravityScale=(v) self[:gravityScale] = v end
|
361
|
+
def sleepThreshold = self[:sleepThreshold]
|
362
|
+
def sleepThreshold=(v) self[:sleepThreshold] = v end
|
363
|
+
def userData = self[:userData]
|
364
|
+
def userData=(v) self[:userData] = v end
|
365
|
+
def enableSleep = self[:enableSleep]
|
366
|
+
def enableSleep=(v) self[:enableSleep] = v end
|
367
|
+
def isAwake = self[:isAwake]
|
368
|
+
def isAwake=(v) self[:isAwake] = v end
|
369
|
+
def fixedRotation = self[:fixedRotation]
|
370
|
+
def fixedRotation=(v) self[:fixedRotation] = v end
|
371
|
+
def isBullet = self[:isBullet]
|
372
|
+
def isBullet=(v) self[:isBullet] = v end
|
373
|
+
def isEnabled = self[:isEnabled]
|
374
|
+
def isEnabled=(v) self[:isEnabled] = v end
|
375
|
+
def allowFastRotation = self[:allowFastRotation]
|
376
|
+
def allowFastRotation=(v) self[:allowFastRotation] = v end
|
377
|
+
def internalValue = self[:internalValue]
|
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_)
|
380
|
+
instance = BodyDef.new
|
381
|
+
instance[:type] = _type_
|
382
|
+
instance[:position] = _position_
|
383
|
+
instance[:rotation] = _rotation_
|
384
|
+
instance[:linearVelocity] = _linearVelocity_
|
385
|
+
instance[:angularVelocity] = _angularVelocity_
|
386
|
+
instance[:linearDamping] = _linearDamping_
|
387
|
+
instance[:angularDamping] = _angularDamping_
|
388
|
+
instance[:gravityScale] = _gravityScale_
|
389
|
+
instance[:sleepThreshold] = _sleepThreshold_
|
390
|
+
instance[:userData] = _userData_
|
391
|
+
instance[:enableSleep] = _enableSleep_
|
392
|
+
instance[:isAwake] = _isAwake_
|
393
|
+
instance[:fixedRotation] = _fixedRotation_
|
394
|
+
instance[:isBullet] = _isBullet_
|
395
|
+
instance[:isEnabled] = _isEnabled_
|
396
|
+
instance[:allowFastRotation] = _allowFastRotation_
|
397
|
+
instance[:internalValue] = _internalValue_
|
398
|
+
instance
|
399
|
+
end
|
400
|
+
end
|
401
|
+
|
402
|
+
class Filter < FFI::Struct
|
403
|
+
layout(
|
404
|
+
:categoryBits, :ulong_long,
|
405
|
+
:maskBits, :ulong_long,
|
406
|
+
:groupIndex, :int,
|
407
|
+
)
|
408
|
+
def categoryBits = self[:categoryBits]
|
409
|
+
def categoryBits=(v) self[:categoryBits] = v end
|
410
|
+
def maskBits = self[:maskBits]
|
411
|
+
def maskBits=(v) self[:maskBits] = v end
|
412
|
+
def groupIndex = self[:groupIndex]
|
413
|
+
def groupIndex=(v) self[:groupIndex] = v end
|
414
|
+
def self.create_as(_categoryBits_, _maskBits_, _groupIndex_)
|
415
|
+
instance = Filter.new
|
416
|
+
instance[:categoryBits] = _categoryBits_
|
417
|
+
instance[:maskBits] = _maskBits_
|
418
|
+
instance[:groupIndex] = _groupIndex_
|
419
|
+
instance
|
420
|
+
end
|
421
|
+
end
|
422
|
+
|
423
|
+
class QueryFilter < FFI::Struct
|
424
|
+
layout(
|
425
|
+
:categoryBits, :ulong_long,
|
426
|
+
:maskBits, :ulong_long,
|
427
|
+
)
|
428
|
+
def categoryBits = self[:categoryBits]
|
429
|
+
def categoryBits=(v) self[:categoryBits] = v end
|
430
|
+
def maskBits = self[:maskBits]
|
431
|
+
def maskBits=(v) self[:maskBits] = v end
|
432
|
+
def self.create_as(_categoryBits_, _maskBits_)
|
433
|
+
instance = QueryFilter.new
|
434
|
+
instance[:categoryBits] = _categoryBits_
|
435
|
+
instance[:maskBits] = _maskBits_
|
436
|
+
instance
|
437
|
+
end
|
438
|
+
end
|
439
|
+
|
440
|
+
class ShapeDef < FFI::Struct
|
441
|
+
layout(
|
442
|
+
:userData, :pointer,
|
443
|
+
:friction, :float,
|
444
|
+
:restitution, :float,
|
445
|
+
:rollingResistance, :float,
|
446
|
+
:density, :float,
|
447
|
+
:filter, Filter,
|
448
|
+
:customColor, :uint,
|
449
|
+
:isSensor, :bool,
|
450
|
+
:enableSensorEvents, :bool,
|
451
|
+
:enableContactEvents, :bool,
|
452
|
+
:enableHitEvents, :bool,
|
453
|
+
:enablePreSolveEvents, :bool,
|
454
|
+
:invokeContactCreation, :bool,
|
455
|
+
:updateBodyMass, :bool,
|
456
|
+
:internalValue, :int,
|
457
|
+
)
|
458
|
+
def userData = self[:userData]
|
459
|
+
def userData=(v) self[:userData] = v end
|
460
|
+
def friction = self[:friction]
|
461
|
+
def friction=(v) self[:friction] = v end
|
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
|
466
|
+
def density = self[:density]
|
467
|
+
def density=(v) self[:density] = v end
|
468
|
+
def filter = self[:filter]
|
469
|
+
def filter=(v) self[:filter] = v end
|
470
|
+
def customColor = self[:customColor]
|
471
|
+
def customColor=(v) self[:customColor] = v end
|
472
|
+
def isSensor = self[:isSensor]
|
473
|
+
def isSensor=(v) self[:isSensor] = v end
|
474
|
+
def enableSensorEvents = self[:enableSensorEvents]
|
475
|
+
def enableSensorEvents=(v) self[:enableSensorEvents] = v end
|
476
|
+
def enableContactEvents = self[:enableContactEvents]
|
477
|
+
def enableContactEvents=(v) self[:enableContactEvents] = v end
|
478
|
+
def enableHitEvents = self[:enableHitEvents]
|
479
|
+
def enableHitEvents=(v) self[:enableHitEvents] = v end
|
480
|
+
def enablePreSolveEvents = self[:enablePreSolveEvents]
|
481
|
+
def enablePreSolveEvents=(v) self[:enablePreSolveEvents] = v end
|
482
|
+
def invokeContactCreation = self[:invokeContactCreation]
|
483
|
+
def invokeContactCreation=(v) self[:invokeContactCreation] = v end
|
484
|
+
def updateBodyMass = self[:updateBodyMass]
|
485
|
+
def updateBodyMass=(v) self[:updateBodyMass] = v end
|
486
|
+
def internalValue = self[:internalValue]
|
487
|
+
def internalValue=(v) self[:internalValue] = v end
|
488
|
+
def self.create_as(_userData_, _friction_, _restitution_, _rollingResistance_, _density_, _filter_, _customColor_, _isSensor_, _enableSensorEvents_, _enableContactEvents_, _enableHitEvents_, _enablePreSolveEvents_, _invokeContactCreation_, _updateBodyMass_, _internalValue_)
|
489
|
+
instance = ShapeDef.new
|
490
|
+
instance[:userData] = _userData_
|
491
|
+
instance[:friction] = _friction_
|
492
|
+
instance[:restitution] = _restitution_
|
493
|
+
instance[:rollingResistance] = _rollingResistance_
|
494
|
+
instance[:density] = _density_
|
495
|
+
instance[:filter] = _filter_
|
496
|
+
instance[:customColor] = _customColor_
|
497
|
+
instance[:isSensor] = _isSensor_
|
498
|
+
instance[:enableSensorEvents] = _enableSensorEvents_
|
499
|
+
instance[:enableContactEvents] = _enableContactEvents_
|
500
|
+
instance[:enableHitEvents] = _enableHitEvents_
|
501
|
+
instance[:enablePreSolveEvents] = _enablePreSolveEvents_
|
502
|
+
instance[:invokeContactCreation] = _invokeContactCreation_
|
503
|
+
instance[:updateBodyMass] = _updateBodyMass_
|
504
|
+
instance[:internalValue] = _internalValue_
|
505
|
+
instance
|
506
|
+
end
|
507
|
+
end
|
508
|
+
|
509
|
+
class ChainDef < FFI::Struct
|
510
|
+
layout(
|
511
|
+
:userData, :pointer,
|
512
|
+
:points, :pointer,
|
513
|
+
:count, :int,
|
514
|
+
:friction, :float,
|
515
|
+
:restitution, :float,
|
516
|
+
:filter, Filter,
|
517
|
+
:customColor, :uint,
|
518
|
+
:isLoop, :bool,
|
519
|
+
:internalValue, :int,
|
520
|
+
)
|
521
|
+
def userData = self[:userData]
|
522
|
+
def userData=(v) self[:userData] = v end
|
523
|
+
def points = self[:points]
|
524
|
+
def points=(v) self[:points] = v end
|
525
|
+
def count = self[:count]
|
526
|
+
def count=(v) self[:count] = v end
|
527
|
+
def friction = self[:friction]
|
528
|
+
def friction=(v) self[:friction] = v end
|
529
|
+
def restitution = self[:restitution]
|
530
|
+
def restitution=(v) self[:restitution] = v end
|
531
|
+
def filter = self[:filter]
|
532
|
+
def filter=(v) self[:filter] = v end
|
533
|
+
def customColor = self[:customColor]
|
534
|
+
def customColor=(v) self[:customColor] = v end
|
535
|
+
def isLoop = self[:isLoop]
|
536
|
+
def isLoop=(v) self[:isLoop] = v end
|
537
|
+
def internalValue = self[:internalValue]
|
538
|
+
def internalValue=(v) self[:internalValue] = v end
|
539
|
+
def self.create_as(_userData_, _points_, _count_, _friction_, _restitution_, _filter_, _customColor_, _isLoop_, _internalValue_)
|
540
|
+
instance = ChainDef.new
|
541
|
+
instance[:userData] = _userData_
|
542
|
+
instance[:points] = _points_
|
543
|
+
instance[:count] = _count_
|
544
|
+
instance[:friction] = _friction_
|
545
|
+
instance[:restitution] = _restitution_
|
546
|
+
instance[:filter] = _filter_
|
547
|
+
instance[:customColor] = _customColor_
|
548
|
+
instance[:isLoop] = _isLoop_
|
549
|
+
instance[:internalValue] = _internalValue_
|
550
|
+
instance
|
551
|
+
end
|
552
|
+
end
|
553
|
+
|
554
|
+
class Profile < FFI::Struct
|
555
|
+
layout(
|
556
|
+
:step, :float,
|
557
|
+
:pairs, :float,
|
558
|
+
:collide, :float,
|
559
|
+
:solve, :float,
|
560
|
+
:buildIslands, :float,
|
561
|
+
:solveConstraints, :float,
|
562
|
+
:prepareTasks, :float,
|
563
|
+
:solverTasks, :float,
|
564
|
+
:prepareConstraints, :float,
|
565
|
+
:integrateVelocities, :float,
|
566
|
+
:warmStart, :float,
|
567
|
+
:solveVelocities, :float,
|
568
|
+
:integratePositions, :float,
|
569
|
+
:relaxVelocities, :float,
|
570
|
+
:applyRestitution, :float,
|
571
|
+
:storeImpulses, :float,
|
572
|
+
:finalizeBodies, :float,
|
573
|
+
:splitIslands, :float,
|
574
|
+
:sleepIslands, :float,
|
575
|
+
:hitEvents, :float,
|
576
|
+
:broadphase, :float,
|
577
|
+
:continuous, :float,
|
578
|
+
)
|
579
|
+
def step = self[:step]
|
580
|
+
def step=(v) self[:step] = v end
|
581
|
+
def pairs = self[:pairs]
|
582
|
+
def pairs=(v) self[:pairs] = v end
|
583
|
+
def collide = self[:collide]
|
584
|
+
def collide=(v) self[:collide] = v end
|
585
|
+
def solve = self[:solve]
|
586
|
+
def solve=(v) self[:solve] = v end
|
587
|
+
def buildIslands = self[:buildIslands]
|
588
|
+
def buildIslands=(v) self[:buildIslands] = v end
|
589
|
+
def solveConstraints = self[:solveConstraints]
|
590
|
+
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
|
+
def prepareConstraints = self[:prepareConstraints]
|
596
|
+
def prepareConstraints=(v) self[:prepareConstraints] = v end
|
597
|
+
def integrateVelocities = self[:integrateVelocities]
|
598
|
+
def integrateVelocities=(v) self[:integrateVelocities] = v end
|
599
|
+
def warmStart = self[:warmStart]
|
600
|
+
def warmStart=(v) self[:warmStart] = v end
|
601
|
+
def solveVelocities = self[:solveVelocities]
|
602
|
+
def solveVelocities=(v) self[:solveVelocities] = v end
|
603
|
+
def integratePositions = self[:integratePositions]
|
604
|
+
def integratePositions=(v) self[:integratePositions] = v end
|
605
|
+
def relaxVelocities = self[:relaxVelocities]
|
606
|
+
def relaxVelocities=(v) self[:relaxVelocities] = v end
|
607
|
+
def applyRestitution = self[:applyRestitution]
|
608
|
+
def applyRestitution=(v) self[:applyRestitution] = v end
|
609
|
+
def storeImpulses = self[:storeImpulses]
|
610
|
+
def storeImpulses=(v) self[:storeImpulses] = v end
|
611
|
+
def finalizeBodies = self[:finalizeBodies]
|
612
|
+
def finalizeBodies=(v) self[:finalizeBodies] = v end
|
613
|
+
def splitIslands = self[:splitIslands]
|
614
|
+
def splitIslands=(v) self[:splitIslands] = v end
|
615
|
+
def sleepIslands = self[:sleepIslands]
|
616
|
+
def sleepIslands=(v) self[:sleepIslands] = v end
|
617
|
+
def hitEvents = self[:hitEvents]
|
618
|
+
def hitEvents=(v) self[:hitEvents] = v end
|
619
|
+
def broadphase = self[:broadphase]
|
620
|
+
def broadphase=(v) self[:broadphase] = v end
|
621
|
+
def continuous = self[:continuous]
|
622
|
+
def continuous=(v) self[:continuous] = v end
|
623
|
+
def self.create_as(_step_, _pairs_, _collide_, _solve_, _buildIslands_, _solveConstraints_, _prepareTasks_, _solverTasks_, _prepareConstraints_, _integrateVelocities_, _warmStart_, _solveVelocities_, _integratePositions_, _relaxVelocities_, _applyRestitution_, _storeImpulses_, _finalizeBodies_, _splitIslands_, _sleepIslands_, _hitEvents_, _broadphase_, _continuous_)
|
624
|
+
instance = Profile.new
|
625
|
+
instance[:step] = _step_
|
626
|
+
instance[:pairs] = _pairs_
|
627
|
+
instance[:collide] = _collide_
|
628
|
+
instance[:solve] = _solve_
|
629
|
+
instance[:buildIslands] = _buildIslands_
|
630
|
+
instance[:solveConstraints] = _solveConstraints_
|
631
|
+
instance[:prepareTasks] = _prepareTasks_
|
632
|
+
instance[:solverTasks] = _solverTasks_
|
633
|
+
instance[:prepareConstraints] = _prepareConstraints_
|
634
|
+
instance[:integrateVelocities] = _integrateVelocities_
|
635
|
+
instance[:warmStart] = _warmStart_
|
636
|
+
instance[:solveVelocities] = _solveVelocities_
|
637
|
+
instance[:integratePositions] = _integratePositions_
|
638
|
+
instance[:relaxVelocities] = _relaxVelocities_
|
639
|
+
instance[:applyRestitution] = _applyRestitution_
|
640
|
+
instance[:storeImpulses] = _storeImpulses_
|
641
|
+
instance[:finalizeBodies] = _finalizeBodies_
|
642
|
+
instance[:splitIslands] = _splitIslands_
|
643
|
+
instance[:sleepIslands] = _sleepIslands_
|
644
|
+
instance[:hitEvents] = _hitEvents_
|
645
|
+
instance[:broadphase] = _broadphase_
|
646
|
+
instance[:continuous] = _continuous_
|
647
|
+
instance
|
648
|
+
end
|
649
|
+
end
|
650
|
+
|
651
|
+
class Counters < FFI::Struct
|
652
|
+
layout(
|
653
|
+
:bodyCount, :int,
|
654
|
+
:shapeCount, :int,
|
655
|
+
:contactCount, :int,
|
656
|
+
:jointCount, :int,
|
657
|
+
:islandCount, :int,
|
658
|
+
:stackUsed, :int,
|
659
|
+
:staticTreeHeight, :int,
|
660
|
+
:treeHeight, :int,
|
661
|
+
:byteCount, :int,
|
662
|
+
:taskCount, :int,
|
663
|
+
:colorCounts, [:int, 12],
|
664
|
+
)
|
665
|
+
def bodyCount = self[:bodyCount]
|
666
|
+
def bodyCount=(v) self[:bodyCount] = v end
|
667
|
+
def shapeCount = self[:shapeCount]
|
668
|
+
def shapeCount=(v) self[:shapeCount] = v end
|
669
|
+
def contactCount = self[:contactCount]
|
670
|
+
def contactCount=(v) self[:contactCount] = v end
|
671
|
+
def jointCount = self[:jointCount]
|
672
|
+
def jointCount=(v) self[:jointCount] = v end
|
673
|
+
def islandCount = self[:islandCount]
|
674
|
+
def islandCount=(v) self[:islandCount] = v end
|
675
|
+
def stackUsed = self[:stackUsed]
|
676
|
+
def stackUsed=(v) self[:stackUsed] = v end
|
677
|
+
def staticTreeHeight = self[:staticTreeHeight]
|
678
|
+
def staticTreeHeight=(v) self[:staticTreeHeight] = v end
|
679
|
+
def treeHeight = self[:treeHeight]
|
680
|
+
def treeHeight=(v) self[:treeHeight] = v end
|
681
|
+
def byteCount = self[:byteCount]
|
682
|
+
def byteCount=(v) self[:byteCount] = v end
|
683
|
+
def taskCount = self[:taskCount]
|
684
|
+
def taskCount=(v) self[:taskCount] = v end
|
685
|
+
def colorCounts = self[:colorCounts]
|
686
|
+
def colorCounts=(v) self[:colorCounts] = v end
|
687
|
+
def self.create_as(_bodyCount_, _shapeCount_, _contactCount_, _jointCount_, _islandCount_, _stackUsed_, _staticTreeHeight_, _treeHeight_, _byteCount_, _taskCount_, _colorCounts_)
|
688
|
+
instance = Counters.new
|
689
|
+
instance[:bodyCount] = _bodyCount_
|
690
|
+
instance[:shapeCount] = _shapeCount_
|
691
|
+
instance[:contactCount] = _contactCount_
|
692
|
+
instance[:jointCount] = _jointCount_
|
693
|
+
instance[:islandCount] = _islandCount_
|
694
|
+
instance[:stackUsed] = _stackUsed_
|
695
|
+
instance[:staticTreeHeight] = _staticTreeHeight_
|
696
|
+
instance[:treeHeight] = _treeHeight_
|
697
|
+
instance[:byteCount] = _byteCount_
|
698
|
+
instance[:taskCount] = _taskCount_
|
699
|
+
instance[:colorCounts] = _colorCounts_
|
700
|
+
instance
|
701
|
+
end
|
702
|
+
end
|
703
|
+
|
704
|
+
class DistanceJointDef < FFI::Struct
|
705
|
+
layout(
|
706
|
+
:bodyIdA, BodyId,
|
707
|
+
:bodyIdB, BodyId,
|
708
|
+
:localAnchorA, Vec2,
|
709
|
+
:localAnchorB, Vec2,
|
710
|
+
:length, :float,
|
711
|
+
:enableSpring, :bool,
|
712
|
+
:hertz, :float,
|
713
|
+
:dampingRatio, :float,
|
714
|
+
:enableLimit, :bool,
|
715
|
+
:minLength, :float,
|
716
|
+
:maxLength, :float,
|
717
|
+
:enableMotor, :bool,
|
718
|
+
:maxMotorForce, :float,
|
719
|
+
:motorSpeed, :float,
|
720
|
+
:collideConnected, :bool,
|
721
|
+
:userData, :pointer,
|
722
|
+
:internalValue, :int,
|
723
|
+
)
|
724
|
+
def bodyIdA = self[:bodyIdA]
|
725
|
+
def bodyIdA=(v) self[:bodyIdA] = v end
|
726
|
+
def bodyIdB = self[:bodyIdB]
|
727
|
+
def bodyIdB=(v) self[:bodyIdB] = v end
|
728
|
+
def localAnchorA = self[:localAnchorA]
|
729
|
+
def localAnchorA=(v) self[:localAnchorA] = v end
|
730
|
+
def localAnchorB = self[:localAnchorB]
|
731
|
+
def localAnchorB=(v) self[:localAnchorB] = v end
|
732
|
+
def length = self[:length]
|
733
|
+
def length=(v) self[:length] = v end
|
734
|
+
def enableSpring = self[:enableSpring]
|
735
|
+
def enableSpring=(v) self[:enableSpring] = v end
|
736
|
+
def hertz = self[:hertz]
|
737
|
+
def hertz=(v) self[:hertz] = v end
|
738
|
+
def dampingRatio = self[:dampingRatio]
|
739
|
+
def dampingRatio=(v) self[:dampingRatio] = v end
|
740
|
+
def enableLimit = self[:enableLimit]
|
741
|
+
def enableLimit=(v) self[:enableLimit] = v end
|
742
|
+
def minLength = self[:minLength]
|
743
|
+
def minLength=(v) self[:minLength] = v end
|
744
|
+
def maxLength = self[:maxLength]
|
745
|
+
def maxLength=(v) self[:maxLength] = v end
|
746
|
+
def enableMotor = self[:enableMotor]
|
747
|
+
def enableMotor=(v) self[:enableMotor] = v end
|
748
|
+
def maxMotorForce = self[:maxMotorForce]
|
749
|
+
def maxMotorForce=(v) self[:maxMotorForce] = v end
|
750
|
+
def motorSpeed = self[:motorSpeed]
|
751
|
+
def motorSpeed=(v) self[:motorSpeed] = v end
|
752
|
+
def collideConnected = self[:collideConnected]
|
753
|
+
def collideConnected=(v) self[:collideConnected] = v end
|
754
|
+
def userData = self[:userData]
|
755
|
+
def userData=(v) self[:userData] = v end
|
756
|
+
def internalValue = self[:internalValue]
|
757
|
+
def internalValue=(v) self[:internalValue] = v end
|
758
|
+
def self.create_as(_bodyIdA_, _bodyIdB_, _localAnchorA_, _localAnchorB_, _length_, _enableSpring_, _hertz_, _dampingRatio_, _enableLimit_, _minLength_, _maxLength_, _enableMotor_, _maxMotorForce_, _motorSpeed_, _collideConnected_, _userData_, _internalValue_)
|
759
|
+
instance = DistanceJointDef.new
|
760
|
+
instance[:bodyIdA] = _bodyIdA_
|
761
|
+
instance[:bodyIdB] = _bodyIdB_
|
762
|
+
instance[:localAnchorA] = _localAnchorA_
|
763
|
+
instance[:localAnchorB] = _localAnchorB_
|
764
|
+
instance[:length] = _length_
|
765
|
+
instance[:enableSpring] = _enableSpring_
|
766
|
+
instance[:hertz] = _hertz_
|
767
|
+
instance[:dampingRatio] = _dampingRatio_
|
768
|
+
instance[:enableLimit] = _enableLimit_
|
769
|
+
instance[:minLength] = _minLength_
|
770
|
+
instance[:maxLength] = _maxLength_
|
771
|
+
instance[:enableMotor] = _enableMotor_
|
772
|
+
instance[:maxMotorForce] = _maxMotorForce_
|
773
|
+
instance[:motorSpeed] = _motorSpeed_
|
774
|
+
instance[:collideConnected] = _collideConnected_
|
775
|
+
instance[:userData] = _userData_
|
776
|
+
instance[:internalValue] = _internalValue_
|
777
|
+
instance
|
778
|
+
end
|
779
|
+
end
|
780
|
+
|
781
|
+
class MotorJointDef < FFI::Struct
|
782
|
+
layout(
|
783
|
+
:bodyIdA, BodyId,
|
784
|
+
:bodyIdB, BodyId,
|
785
|
+
:linearOffset, Vec2,
|
786
|
+
:angularOffset, :float,
|
787
|
+
:maxForce, :float,
|
788
|
+
:maxTorque, :float,
|
789
|
+
:correctionFactor, :float,
|
790
|
+
:collideConnected, :bool,
|
791
|
+
:userData, :pointer,
|
792
|
+
:internalValue, :int,
|
793
|
+
)
|
794
|
+
def bodyIdA = self[:bodyIdA]
|
795
|
+
def bodyIdA=(v) self[:bodyIdA] = v end
|
796
|
+
def bodyIdB = self[:bodyIdB]
|
797
|
+
def bodyIdB=(v) self[:bodyIdB] = v end
|
798
|
+
def linearOffset = self[:linearOffset]
|
799
|
+
def linearOffset=(v) self[:linearOffset] = v end
|
800
|
+
def angularOffset = self[:angularOffset]
|
801
|
+
def angularOffset=(v) self[:angularOffset] = v end
|
802
|
+
def maxForce = self[:maxForce]
|
803
|
+
def maxForce=(v) self[:maxForce] = v end
|
804
|
+
def maxTorque = self[:maxTorque]
|
805
|
+
def maxTorque=(v) self[:maxTorque] = v end
|
806
|
+
def correctionFactor = self[:correctionFactor]
|
807
|
+
def correctionFactor=(v) self[:correctionFactor] = v end
|
808
|
+
def collideConnected = self[:collideConnected]
|
809
|
+
def collideConnected=(v) self[:collideConnected] = v end
|
810
|
+
def userData = self[:userData]
|
811
|
+
def userData=(v) self[:userData] = v end
|
812
|
+
def internalValue = self[:internalValue]
|
813
|
+
def internalValue=(v) self[:internalValue] = v end
|
814
|
+
def self.create_as(_bodyIdA_, _bodyIdB_, _linearOffset_, _angularOffset_, _maxForce_, _maxTorque_, _correctionFactor_, _collideConnected_, _userData_, _internalValue_)
|
815
|
+
instance = MotorJointDef.new
|
816
|
+
instance[:bodyIdA] = _bodyIdA_
|
817
|
+
instance[:bodyIdB] = _bodyIdB_
|
818
|
+
instance[:linearOffset] = _linearOffset_
|
819
|
+
instance[:angularOffset] = _angularOffset_
|
820
|
+
instance[:maxForce] = _maxForce_
|
821
|
+
instance[:maxTorque] = _maxTorque_
|
822
|
+
instance[:correctionFactor] = _correctionFactor_
|
823
|
+
instance[:collideConnected] = _collideConnected_
|
824
|
+
instance[:userData] = _userData_
|
825
|
+
instance[:internalValue] = _internalValue_
|
826
|
+
instance
|
827
|
+
end
|
828
|
+
end
|
829
|
+
|
830
|
+
class MouseJointDef < FFI::Struct
|
831
|
+
layout(
|
832
|
+
:bodyIdA, BodyId,
|
833
|
+
:bodyIdB, BodyId,
|
834
|
+
:target, Vec2,
|
835
|
+
:hertz, :float,
|
836
|
+
:dampingRatio, :float,
|
837
|
+
:maxForce, :float,
|
838
|
+
:collideConnected, :bool,
|
839
|
+
:userData, :pointer,
|
840
|
+
:internalValue, :int,
|
841
|
+
)
|
842
|
+
def bodyIdA = self[:bodyIdA]
|
843
|
+
def bodyIdA=(v) self[:bodyIdA] = v end
|
844
|
+
def bodyIdB = self[:bodyIdB]
|
845
|
+
def bodyIdB=(v) self[:bodyIdB] = v end
|
846
|
+
def target = self[:target]
|
847
|
+
def target=(v) self[:target] = v end
|
848
|
+
def hertz = self[:hertz]
|
849
|
+
def hertz=(v) self[:hertz] = v end
|
850
|
+
def dampingRatio = self[:dampingRatio]
|
851
|
+
def dampingRatio=(v) self[:dampingRatio] = v end
|
852
|
+
def maxForce = self[:maxForce]
|
853
|
+
def maxForce=(v) self[:maxForce] = v end
|
854
|
+
def collideConnected = self[:collideConnected]
|
855
|
+
def collideConnected=(v) self[:collideConnected] = v end
|
856
|
+
def userData = self[:userData]
|
857
|
+
def userData=(v) self[:userData] = v end
|
858
|
+
def internalValue = self[:internalValue]
|
859
|
+
def internalValue=(v) self[:internalValue] = v end
|
860
|
+
def self.create_as(_bodyIdA_, _bodyIdB_, _target_, _hertz_, _dampingRatio_, _maxForce_, _collideConnected_, _userData_, _internalValue_)
|
861
|
+
instance = MouseJointDef.new
|
862
|
+
instance[:bodyIdA] = _bodyIdA_
|
863
|
+
instance[:bodyIdB] = _bodyIdB_
|
864
|
+
instance[:target] = _target_
|
865
|
+
instance[:hertz] = _hertz_
|
866
|
+
instance[:dampingRatio] = _dampingRatio_
|
867
|
+
instance[:maxForce] = _maxForce_
|
868
|
+
instance[:collideConnected] = _collideConnected_
|
869
|
+
instance[:userData] = _userData_
|
870
|
+
instance[:internalValue] = _internalValue_
|
871
|
+
instance
|
872
|
+
end
|
873
|
+
end
|
874
|
+
|
875
|
+
class NullJointDef < FFI::Struct
|
876
|
+
layout(
|
877
|
+
:bodyIdA, BodyId,
|
878
|
+
:bodyIdB, BodyId,
|
879
|
+
:userData, :pointer,
|
880
|
+
:internalValue, :int,
|
881
|
+
)
|
882
|
+
def bodyIdA = self[:bodyIdA]
|
883
|
+
def bodyIdA=(v) self[:bodyIdA] = v end
|
884
|
+
def bodyIdB = self[:bodyIdB]
|
885
|
+
def bodyIdB=(v) self[:bodyIdB] = v end
|
886
|
+
def userData = self[:userData]
|
887
|
+
def userData=(v) self[:userData] = v end
|
888
|
+
def internalValue = self[:internalValue]
|
889
|
+
def internalValue=(v) self[:internalValue] = v end
|
890
|
+
def self.create_as(_bodyIdA_, _bodyIdB_, _userData_, _internalValue_)
|
891
|
+
instance = NullJointDef.new
|
892
|
+
instance[:bodyIdA] = _bodyIdA_
|
893
|
+
instance[:bodyIdB] = _bodyIdB_
|
894
|
+
instance[:userData] = _userData_
|
895
|
+
instance[:internalValue] = _internalValue_
|
896
|
+
instance
|
897
|
+
end
|
898
|
+
end
|
899
|
+
|
900
|
+
class PrismaticJointDef < FFI::Struct
|
901
|
+
layout(
|
902
|
+
:bodyIdA, BodyId,
|
903
|
+
:bodyIdB, BodyId,
|
904
|
+
:localAnchorA, Vec2,
|
905
|
+
:localAnchorB, Vec2,
|
906
|
+
:localAxisA, Vec2,
|
907
|
+
:referenceAngle, :float,
|
908
|
+
:enableSpring, :bool,
|
909
|
+
:hertz, :float,
|
910
|
+
:dampingRatio, :float,
|
911
|
+
:enableLimit, :bool,
|
912
|
+
:lowerTranslation, :float,
|
913
|
+
:upperTranslation, :float,
|
914
|
+
:enableMotor, :bool,
|
915
|
+
:maxMotorForce, :float,
|
916
|
+
:motorSpeed, :float,
|
917
|
+
:collideConnected, :bool,
|
918
|
+
:userData, :pointer,
|
919
|
+
:internalValue, :int,
|
920
|
+
)
|
921
|
+
def bodyIdA = self[:bodyIdA]
|
922
|
+
def bodyIdA=(v) self[:bodyIdA] = v end
|
923
|
+
def bodyIdB = self[:bodyIdB]
|
924
|
+
def bodyIdB=(v) self[:bodyIdB] = v end
|
925
|
+
def localAnchorA = self[:localAnchorA]
|
926
|
+
def localAnchorA=(v) self[:localAnchorA] = v end
|
927
|
+
def localAnchorB = self[:localAnchorB]
|
928
|
+
def localAnchorB=(v) self[:localAnchorB] = v end
|
929
|
+
def localAxisA = self[:localAxisA]
|
930
|
+
def localAxisA=(v) self[:localAxisA] = v end
|
931
|
+
def referenceAngle = self[:referenceAngle]
|
932
|
+
def referenceAngle=(v) self[:referenceAngle] = v end
|
933
|
+
def enableSpring = self[:enableSpring]
|
934
|
+
def enableSpring=(v) self[:enableSpring] = v end
|
935
|
+
def hertz = self[:hertz]
|
936
|
+
def hertz=(v) self[:hertz] = v end
|
937
|
+
def dampingRatio = self[:dampingRatio]
|
938
|
+
def dampingRatio=(v) self[:dampingRatio] = v end
|
939
|
+
def enableLimit = self[:enableLimit]
|
940
|
+
def enableLimit=(v) self[:enableLimit] = v end
|
941
|
+
def lowerTranslation = self[:lowerTranslation]
|
942
|
+
def lowerTranslation=(v) self[:lowerTranslation] = v end
|
943
|
+
def upperTranslation = self[:upperTranslation]
|
944
|
+
def upperTranslation=(v) self[:upperTranslation] = v end
|
945
|
+
def enableMotor = self[:enableMotor]
|
946
|
+
def enableMotor=(v) self[:enableMotor] = v end
|
947
|
+
def maxMotorForce = self[:maxMotorForce]
|
948
|
+
def maxMotorForce=(v) self[:maxMotorForce] = v end
|
949
|
+
def motorSpeed = self[:motorSpeed]
|
950
|
+
def motorSpeed=(v) self[:motorSpeed] = v end
|
951
|
+
def collideConnected = self[:collideConnected]
|
952
|
+
def collideConnected=(v) self[:collideConnected] = v end
|
953
|
+
def userData = self[:userData]
|
954
|
+
def userData=(v) self[:userData] = v end
|
955
|
+
def internalValue = self[:internalValue]
|
956
|
+
def internalValue=(v) self[:internalValue] = v end
|
957
|
+
def self.create_as(_bodyIdA_, _bodyIdB_, _localAnchorA_, _localAnchorB_, _localAxisA_, _referenceAngle_, _enableSpring_, _hertz_, _dampingRatio_, _enableLimit_, _lowerTranslation_, _upperTranslation_, _enableMotor_, _maxMotorForce_, _motorSpeed_, _collideConnected_, _userData_, _internalValue_)
|
958
|
+
instance = PrismaticJointDef.new
|
959
|
+
instance[:bodyIdA] = _bodyIdA_
|
960
|
+
instance[:bodyIdB] = _bodyIdB_
|
961
|
+
instance[:localAnchorA] = _localAnchorA_
|
962
|
+
instance[:localAnchorB] = _localAnchorB_
|
963
|
+
instance[:localAxisA] = _localAxisA_
|
964
|
+
instance[:referenceAngle] = _referenceAngle_
|
965
|
+
instance[:enableSpring] = _enableSpring_
|
966
|
+
instance[:hertz] = _hertz_
|
967
|
+
instance[:dampingRatio] = _dampingRatio_
|
968
|
+
instance[:enableLimit] = _enableLimit_
|
969
|
+
instance[:lowerTranslation] = _lowerTranslation_
|
970
|
+
instance[:upperTranslation] = _upperTranslation_
|
971
|
+
instance[:enableMotor] = _enableMotor_
|
972
|
+
instance[:maxMotorForce] = _maxMotorForce_
|
973
|
+
instance[:motorSpeed] = _motorSpeed_
|
974
|
+
instance[:collideConnected] = _collideConnected_
|
975
|
+
instance[:userData] = _userData_
|
976
|
+
instance[:internalValue] = _internalValue_
|
977
|
+
instance
|
978
|
+
end
|
979
|
+
end
|
980
|
+
|
981
|
+
class RevoluteJointDef < FFI::Struct
|
982
|
+
layout(
|
983
|
+
:bodyIdA, BodyId,
|
984
|
+
:bodyIdB, BodyId,
|
985
|
+
:localAnchorA, Vec2,
|
986
|
+
:localAnchorB, Vec2,
|
987
|
+
:referenceAngle, :float,
|
988
|
+
:enableSpring, :bool,
|
989
|
+
:hertz, :float,
|
990
|
+
:dampingRatio, :float,
|
991
|
+
:enableLimit, :bool,
|
992
|
+
:lowerAngle, :float,
|
993
|
+
:upperAngle, :float,
|
994
|
+
:enableMotor, :bool,
|
995
|
+
:maxMotorTorque, :float,
|
996
|
+
:motorSpeed, :float,
|
997
|
+
:drawSize, :float,
|
998
|
+
:collideConnected, :bool,
|
999
|
+
:userData, :pointer,
|
1000
|
+
:internalValue, :int,
|
1001
|
+
)
|
1002
|
+
def bodyIdA = self[:bodyIdA]
|
1003
|
+
def bodyIdA=(v) self[:bodyIdA] = v end
|
1004
|
+
def bodyIdB = self[:bodyIdB]
|
1005
|
+
def bodyIdB=(v) self[:bodyIdB] = v end
|
1006
|
+
def localAnchorA = self[:localAnchorA]
|
1007
|
+
def localAnchorA=(v) self[:localAnchorA] = v end
|
1008
|
+
def localAnchorB = self[:localAnchorB]
|
1009
|
+
def localAnchorB=(v) self[:localAnchorB] = v end
|
1010
|
+
def referenceAngle = self[:referenceAngle]
|
1011
|
+
def referenceAngle=(v) self[:referenceAngle] = v end
|
1012
|
+
def enableSpring = self[:enableSpring]
|
1013
|
+
def enableSpring=(v) self[:enableSpring] = v end
|
1014
|
+
def hertz = self[:hertz]
|
1015
|
+
def hertz=(v) self[:hertz] = v end
|
1016
|
+
def dampingRatio = self[:dampingRatio]
|
1017
|
+
def dampingRatio=(v) self[:dampingRatio] = v end
|
1018
|
+
def enableLimit = self[:enableLimit]
|
1019
|
+
def enableLimit=(v) self[:enableLimit] = v end
|
1020
|
+
def lowerAngle = self[:lowerAngle]
|
1021
|
+
def lowerAngle=(v) self[:lowerAngle] = v end
|
1022
|
+
def upperAngle = self[:upperAngle]
|
1023
|
+
def upperAngle=(v) self[:upperAngle] = v end
|
1024
|
+
def enableMotor = self[:enableMotor]
|
1025
|
+
def enableMotor=(v) self[:enableMotor] = v end
|
1026
|
+
def maxMotorTorque = self[:maxMotorTorque]
|
1027
|
+
def maxMotorTorque=(v) self[:maxMotorTorque] = v end
|
1028
|
+
def motorSpeed = self[:motorSpeed]
|
1029
|
+
def motorSpeed=(v) self[:motorSpeed] = v end
|
1030
|
+
def drawSize = self[:drawSize]
|
1031
|
+
def drawSize=(v) self[:drawSize] = v end
|
1032
|
+
def collideConnected = self[:collideConnected]
|
1033
|
+
def collideConnected=(v) self[:collideConnected] = v end
|
1034
|
+
def userData = self[:userData]
|
1035
|
+
def userData=(v) self[:userData] = v end
|
1036
|
+
def internalValue = self[:internalValue]
|
1037
|
+
def internalValue=(v) self[:internalValue] = v end
|
1038
|
+
def self.create_as(_bodyIdA_, _bodyIdB_, _localAnchorA_, _localAnchorB_, _referenceAngle_, _enableSpring_, _hertz_, _dampingRatio_, _enableLimit_, _lowerAngle_, _upperAngle_, _enableMotor_, _maxMotorTorque_, _motorSpeed_, _drawSize_, _collideConnected_, _userData_, _internalValue_)
|
1039
|
+
instance = RevoluteJointDef.new
|
1040
|
+
instance[:bodyIdA] = _bodyIdA_
|
1041
|
+
instance[:bodyIdB] = _bodyIdB_
|
1042
|
+
instance[:localAnchorA] = _localAnchorA_
|
1043
|
+
instance[:localAnchorB] = _localAnchorB_
|
1044
|
+
instance[:referenceAngle] = _referenceAngle_
|
1045
|
+
instance[:enableSpring] = _enableSpring_
|
1046
|
+
instance[:hertz] = _hertz_
|
1047
|
+
instance[:dampingRatio] = _dampingRatio_
|
1048
|
+
instance[:enableLimit] = _enableLimit_
|
1049
|
+
instance[:lowerAngle] = _lowerAngle_
|
1050
|
+
instance[:upperAngle] = _upperAngle_
|
1051
|
+
instance[:enableMotor] = _enableMotor_
|
1052
|
+
instance[:maxMotorTorque] = _maxMotorTorque_
|
1053
|
+
instance[:motorSpeed] = _motorSpeed_
|
1054
|
+
instance[:drawSize] = _drawSize_
|
1055
|
+
instance[:collideConnected] = _collideConnected_
|
1056
|
+
instance[:userData] = _userData_
|
1057
|
+
instance[:internalValue] = _internalValue_
|
1058
|
+
instance
|
1059
|
+
end
|
1060
|
+
end
|
1061
|
+
|
1062
|
+
class WeldJointDef < FFI::Struct
|
1063
|
+
layout(
|
1064
|
+
:bodyIdA, BodyId,
|
1065
|
+
:bodyIdB, BodyId,
|
1066
|
+
:localAnchorA, Vec2,
|
1067
|
+
:localAnchorB, Vec2,
|
1068
|
+
:referenceAngle, :float,
|
1069
|
+
:linearHertz, :float,
|
1070
|
+
:angularHertz, :float,
|
1071
|
+
:linearDampingRatio, :float,
|
1072
|
+
:angularDampingRatio, :float,
|
1073
|
+
:collideConnected, :bool,
|
1074
|
+
:userData, :pointer,
|
1075
|
+
:internalValue, :int,
|
1076
|
+
)
|
1077
|
+
def bodyIdA = self[:bodyIdA]
|
1078
|
+
def bodyIdA=(v) self[:bodyIdA] = v end
|
1079
|
+
def bodyIdB = self[:bodyIdB]
|
1080
|
+
def bodyIdB=(v) self[:bodyIdB] = v end
|
1081
|
+
def localAnchorA = self[:localAnchorA]
|
1082
|
+
def localAnchorA=(v) self[:localAnchorA] = v end
|
1083
|
+
def localAnchorB = self[:localAnchorB]
|
1084
|
+
def localAnchorB=(v) self[:localAnchorB] = v end
|
1085
|
+
def referenceAngle = self[:referenceAngle]
|
1086
|
+
def referenceAngle=(v) self[:referenceAngle] = v end
|
1087
|
+
def linearHertz = self[:linearHertz]
|
1088
|
+
def linearHertz=(v) self[:linearHertz] = v end
|
1089
|
+
def angularHertz = self[:angularHertz]
|
1090
|
+
def angularHertz=(v) self[:angularHertz] = v end
|
1091
|
+
def linearDampingRatio = self[:linearDampingRatio]
|
1092
|
+
def linearDampingRatio=(v) self[:linearDampingRatio] = v end
|
1093
|
+
def angularDampingRatio = self[:angularDampingRatio]
|
1094
|
+
def angularDampingRatio=(v) self[:angularDampingRatio] = v end
|
1095
|
+
def collideConnected = self[:collideConnected]
|
1096
|
+
def collideConnected=(v) self[:collideConnected] = v end
|
1097
|
+
def userData = self[:userData]
|
1098
|
+
def userData=(v) self[:userData] = v end
|
1099
|
+
def internalValue = self[:internalValue]
|
1100
|
+
def internalValue=(v) self[:internalValue] = v end
|
1101
|
+
def self.create_as(_bodyIdA_, _bodyIdB_, _localAnchorA_, _localAnchorB_, _referenceAngle_, _linearHertz_, _angularHertz_, _linearDampingRatio_, _angularDampingRatio_, _collideConnected_, _userData_, _internalValue_)
|
1102
|
+
instance = WeldJointDef.new
|
1103
|
+
instance[:bodyIdA] = _bodyIdA_
|
1104
|
+
instance[:bodyIdB] = _bodyIdB_
|
1105
|
+
instance[:localAnchorA] = _localAnchorA_
|
1106
|
+
instance[:localAnchorB] = _localAnchorB_
|
1107
|
+
instance[:referenceAngle] = _referenceAngle_
|
1108
|
+
instance[:linearHertz] = _linearHertz_
|
1109
|
+
instance[:angularHertz] = _angularHertz_
|
1110
|
+
instance[:linearDampingRatio] = _linearDampingRatio_
|
1111
|
+
instance[:angularDampingRatio] = _angularDampingRatio_
|
1112
|
+
instance[:collideConnected] = _collideConnected_
|
1113
|
+
instance[:userData] = _userData_
|
1114
|
+
instance[:internalValue] = _internalValue_
|
1115
|
+
instance
|
1116
|
+
end
|
1117
|
+
end
|
1118
|
+
|
1119
|
+
class WheelJointDef < FFI::Struct
|
1120
|
+
layout(
|
1121
|
+
:bodyIdA, BodyId,
|
1122
|
+
:bodyIdB, BodyId,
|
1123
|
+
:localAnchorA, Vec2,
|
1124
|
+
:localAnchorB, Vec2,
|
1125
|
+
:localAxisA, Vec2,
|
1126
|
+
:enableSpring, :bool,
|
1127
|
+
:hertz, :float,
|
1128
|
+
:dampingRatio, :float,
|
1129
|
+
:enableLimit, :bool,
|
1130
|
+
:lowerTranslation, :float,
|
1131
|
+
:upperTranslation, :float,
|
1132
|
+
:enableMotor, :bool,
|
1133
|
+
:maxMotorTorque, :float,
|
1134
|
+
:motorSpeed, :float,
|
1135
|
+
:collideConnected, :bool,
|
1136
|
+
:userData, :pointer,
|
1137
|
+
:internalValue, :int,
|
1138
|
+
)
|
1139
|
+
def bodyIdA = self[:bodyIdA]
|
1140
|
+
def bodyIdA=(v) self[:bodyIdA] = v end
|
1141
|
+
def bodyIdB = self[:bodyIdB]
|
1142
|
+
def bodyIdB=(v) self[:bodyIdB] = v end
|
1143
|
+
def localAnchorA = self[:localAnchorA]
|
1144
|
+
def localAnchorA=(v) self[:localAnchorA] = v end
|
1145
|
+
def localAnchorB = self[:localAnchorB]
|
1146
|
+
def localAnchorB=(v) self[:localAnchorB] = v end
|
1147
|
+
def localAxisA = self[:localAxisA]
|
1148
|
+
def localAxisA=(v) self[:localAxisA] = v end
|
1149
|
+
def enableSpring = self[:enableSpring]
|
1150
|
+
def enableSpring=(v) self[:enableSpring] = v end
|
1151
|
+
def hertz = self[:hertz]
|
1152
|
+
def hertz=(v) self[:hertz] = v end
|
1153
|
+
def dampingRatio = self[:dampingRatio]
|
1154
|
+
def dampingRatio=(v) self[:dampingRatio] = v end
|
1155
|
+
def enableLimit = self[:enableLimit]
|
1156
|
+
def enableLimit=(v) self[:enableLimit] = v end
|
1157
|
+
def lowerTranslation = self[:lowerTranslation]
|
1158
|
+
def lowerTranslation=(v) self[:lowerTranslation] = v end
|
1159
|
+
def upperTranslation = self[:upperTranslation]
|
1160
|
+
def upperTranslation=(v) self[:upperTranslation] = v end
|
1161
|
+
def enableMotor = self[:enableMotor]
|
1162
|
+
def enableMotor=(v) self[:enableMotor] = v end
|
1163
|
+
def maxMotorTorque = self[:maxMotorTorque]
|
1164
|
+
def maxMotorTorque=(v) self[:maxMotorTorque] = v end
|
1165
|
+
def motorSpeed = self[:motorSpeed]
|
1166
|
+
def motorSpeed=(v) self[:motorSpeed] = v end
|
1167
|
+
def collideConnected = self[:collideConnected]
|
1168
|
+
def collideConnected=(v) self[:collideConnected] = v end
|
1169
|
+
def userData = self[:userData]
|
1170
|
+
def userData=(v) self[:userData] = v end
|
1171
|
+
def internalValue = self[:internalValue]
|
1172
|
+
def internalValue=(v) self[:internalValue] = v end
|
1173
|
+
def self.create_as(_bodyIdA_, _bodyIdB_, _localAnchorA_, _localAnchorB_, _localAxisA_, _enableSpring_, _hertz_, _dampingRatio_, _enableLimit_, _lowerTranslation_, _upperTranslation_, _enableMotor_, _maxMotorTorque_, _motorSpeed_, _collideConnected_, _userData_, _internalValue_)
|
1174
|
+
instance = WheelJointDef.new
|
1175
|
+
instance[:bodyIdA] = _bodyIdA_
|
1176
|
+
instance[:bodyIdB] = _bodyIdB_
|
1177
|
+
instance[:localAnchorA] = _localAnchorA_
|
1178
|
+
instance[:localAnchorB] = _localAnchorB_
|
1179
|
+
instance[:localAxisA] = _localAxisA_
|
1180
|
+
instance[:enableSpring] = _enableSpring_
|
1181
|
+
instance[:hertz] = _hertz_
|
1182
|
+
instance[:dampingRatio] = _dampingRatio_
|
1183
|
+
instance[:enableLimit] = _enableLimit_
|
1184
|
+
instance[:lowerTranslation] = _lowerTranslation_
|
1185
|
+
instance[:upperTranslation] = _upperTranslation_
|
1186
|
+
instance[:enableMotor] = _enableMotor_
|
1187
|
+
instance[:maxMotorTorque] = _maxMotorTorque_
|
1188
|
+
instance[:motorSpeed] = _motorSpeed_
|
1189
|
+
instance[:collideConnected] = _collideConnected_
|
1190
|
+
instance[:userData] = _userData_
|
1191
|
+
instance[:internalValue] = _internalValue_
|
1192
|
+
instance
|
1193
|
+
end
|
1194
|
+
end
|
1195
|
+
|
1196
|
+
class ExplosionDef < FFI::Struct
|
1197
|
+
layout(
|
1198
|
+
:maskBits, :ulong_long,
|
1199
|
+
:position, Vec2,
|
1200
|
+
:radius, :float,
|
1201
|
+
:falloff, :float,
|
1202
|
+
:impulsePerLength, :float,
|
1203
|
+
)
|
1204
|
+
def maskBits = self[:maskBits]
|
1205
|
+
def maskBits=(v) self[:maskBits] = v end
|
1206
|
+
def position = self[:position]
|
1207
|
+
def position=(v) self[:position] = v end
|
1208
|
+
def radius = self[:radius]
|
1209
|
+
def radius=(v) self[:radius] = v end
|
1210
|
+
def falloff = self[:falloff]
|
1211
|
+
def falloff=(v) self[:falloff] = v end
|
1212
|
+
def impulsePerLength = self[:impulsePerLength]
|
1213
|
+
def impulsePerLength=(v) self[:impulsePerLength] = v end
|
1214
|
+
def self.create_as(_maskBits_, _position_, _radius_, _falloff_, _impulsePerLength_)
|
1215
|
+
instance = ExplosionDef.new
|
1216
|
+
instance[:maskBits] = _maskBits_
|
1217
|
+
instance[:position] = _position_
|
1218
|
+
instance[:radius] = _radius_
|
1219
|
+
instance[:falloff] = _falloff_
|
1220
|
+
instance[:impulsePerLength] = _impulsePerLength_
|
1221
|
+
instance
|
1222
|
+
end
|
1223
|
+
end
|
1224
|
+
|
1225
|
+
class SensorBeginTouchEvent < FFI::Struct
|
1226
|
+
layout(
|
1227
|
+
:sensorShapeId, ShapeId,
|
1228
|
+
:visitorShapeId, ShapeId,
|
1229
|
+
)
|
1230
|
+
def sensorShapeId = self[:sensorShapeId]
|
1231
|
+
def sensorShapeId=(v) self[:sensorShapeId] = v end
|
1232
|
+
def visitorShapeId = self[:visitorShapeId]
|
1233
|
+
def visitorShapeId=(v) self[:visitorShapeId] = v end
|
1234
|
+
def self.create_as(_sensorShapeId_, _visitorShapeId_)
|
1235
|
+
instance = SensorBeginTouchEvent.new
|
1236
|
+
instance[:sensorShapeId] = _sensorShapeId_
|
1237
|
+
instance[:visitorShapeId] = _visitorShapeId_
|
1238
|
+
instance
|
1239
|
+
end
|
1240
|
+
end
|
1241
|
+
|
1242
|
+
class SensorEndTouchEvent < FFI::Struct
|
1243
|
+
layout(
|
1244
|
+
:sensorShapeId, ShapeId,
|
1245
|
+
:visitorShapeId, ShapeId,
|
1246
|
+
)
|
1247
|
+
def sensorShapeId = self[:sensorShapeId]
|
1248
|
+
def sensorShapeId=(v) self[:sensorShapeId] = v end
|
1249
|
+
def visitorShapeId = self[:visitorShapeId]
|
1250
|
+
def visitorShapeId=(v) self[:visitorShapeId] = v end
|
1251
|
+
def self.create_as(_sensorShapeId_, _visitorShapeId_)
|
1252
|
+
instance = SensorEndTouchEvent.new
|
1253
|
+
instance[:sensorShapeId] = _sensorShapeId_
|
1254
|
+
instance[:visitorShapeId] = _visitorShapeId_
|
1255
|
+
instance
|
1256
|
+
end
|
1257
|
+
end
|
1258
|
+
|
1259
|
+
class SensorEvents < FFI::Struct
|
1260
|
+
layout(
|
1261
|
+
:beginEvents, :pointer,
|
1262
|
+
:endEvents, :pointer,
|
1263
|
+
:beginCount, :int,
|
1264
|
+
:endCount, :int,
|
1265
|
+
)
|
1266
|
+
def beginEvents = self[:beginEvents]
|
1267
|
+
def beginEvents=(v) self[:beginEvents] = v end
|
1268
|
+
def endEvents = self[:endEvents]
|
1269
|
+
def endEvents=(v) self[:endEvents] = v end
|
1270
|
+
def beginCount = self[:beginCount]
|
1271
|
+
def beginCount=(v) self[:beginCount] = v end
|
1272
|
+
def endCount = self[:endCount]
|
1273
|
+
def endCount=(v) self[:endCount] = v end
|
1274
|
+
def self.create_as(_beginEvents_, _endEvents_, _beginCount_, _endCount_)
|
1275
|
+
instance = SensorEvents.new
|
1276
|
+
instance[:beginEvents] = _beginEvents_
|
1277
|
+
instance[:endEvents] = _endEvents_
|
1278
|
+
instance[:beginCount] = _beginCount_
|
1279
|
+
instance[:endCount] = _endCount_
|
1280
|
+
instance
|
1281
|
+
end
|
1282
|
+
end
|
1283
|
+
|
1284
|
+
class ContactBeginTouchEvent < FFI::Struct
|
1285
|
+
layout(
|
1286
|
+
:shapeIdA, ShapeId,
|
1287
|
+
:shapeIdB, ShapeId,
|
1288
|
+
:manifold, Manifold,
|
1289
|
+
)
|
1290
|
+
def shapeIdA = self[:shapeIdA]
|
1291
|
+
def shapeIdA=(v) self[:shapeIdA] = v end
|
1292
|
+
def shapeIdB = self[:shapeIdB]
|
1293
|
+
def shapeIdB=(v) self[:shapeIdB] = v end
|
1294
|
+
def manifold = self[:manifold]
|
1295
|
+
def manifold=(v) self[:manifold] = v end
|
1296
|
+
def self.create_as(_shapeIdA_, _shapeIdB_, _manifold_)
|
1297
|
+
instance = ContactBeginTouchEvent.new
|
1298
|
+
instance[:shapeIdA] = _shapeIdA_
|
1299
|
+
instance[:shapeIdB] = _shapeIdB_
|
1300
|
+
instance[:manifold] = _manifold_
|
1301
|
+
instance
|
1302
|
+
end
|
1303
|
+
end
|
1304
|
+
|
1305
|
+
class ContactEndTouchEvent < FFI::Struct
|
1306
|
+
layout(
|
1307
|
+
:shapeIdA, ShapeId,
|
1308
|
+
:shapeIdB, ShapeId,
|
1309
|
+
)
|
1310
|
+
def shapeIdA = self[:shapeIdA]
|
1311
|
+
def shapeIdA=(v) self[:shapeIdA] = v end
|
1312
|
+
def shapeIdB = self[:shapeIdB]
|
1313
|
+
def shapeIdB=(v) self[:shapeIdB] = v end
|
1314
|
+
def self.create_as(_shapeIdA_, _shapeIdB_)
|
1315
|
+
instance = ContactEndTouchEvent.new
|
1316
|
+
instance[:shapeIdA] = _shapeIdA_
|
1317
|
+
instance[:shapeIdB] = _shapeIdB_
|
1318
|
+
instance
|
1319
|
+
end
|
1320
|
+
end
|
1321
|
+
|
1322
|
+
class ContactHitEvent < FFI::Struct
|
1323
|
+
layout(
|
1324
|
+
:shapeIdA, ShapeId,
|
1325
|
+
:shapeIdB, ShapeId,
|
1326
|
+
:point, Vec2,
|
1327
|
+
:normal, Vec2,
|
1328
|
+
:approachSpeed, :float,
|
1329
|
+
)
|
1330
|
+
def shapeIdA = self[:shapeIdA]
|
1331
|
+
def shapeIdA=(v) self[:shapeIdA] = v end
|
1332
|
+
def shapeIdB = self[:shapeIdB]
|
1333
|
+
def shapeIdB=(v) self[:shapeIdB] = v end
|
1334
|
+
def point = self[:point]
|
1335
|
+
def point=(v) self[:point] = v end
|
1336
|
+
def normal = self[:normal]
|
1337
|
+
def normal=(v) self[:normal] = v end
|
1338
|
+
def approachSpeed = self[:approachSpeed]
|
1339
|
+
def approachSpeed=(v) self[:approachSpeed] = v end
|
1340
|
+
def self.create_as(_shapeIdA_, _shapeIdB_, _point_, _normal_, _approachSpeed_)
|
1341
|
+
instance = ContactHitEvent.new
|
1342
|
+
instance[:shapeIdA] = _shapeIdA_
|
1343
|
+
instance[:shapeIdB] = _shapeIdB_
|
1344
|
+
instance[:point] = _point_
|
1345
|
+
instance[:normal] = _normal_
|
1346
|
+
instance[:approachSpeed] = _approachSpeed_
|
1347
|
+
instance
|
1348
|
+
end
|
1349
|
+
end
|
1350
|
+
|
1351
|
+
class ContactEvents < FFI::Struct
|
1352
|
+
layout(
|
1353
|
+
:beginEvents, :pointer,
|
1354
|
+
:endEvents, :pointer,
|
1355
|
+
:hitEvents, :pointer,
|
1356
|
+
:beginCount, :int,
|
1357
|
+
:endCount, :int,
|
1358
|
+
:hitCount, :int,
|
1359
|
+
)
|
1360
|
+
def beginEvents = self[:beginEvents]
|
1361
|
+
def beginEvents=(v) self[:beginEvents] = v end
|
1362
|
+
def endEvents = self[:endEvents]
|
1363
|
+
def endEvents=(v) self[:endEvents] = v end
|
1364
|
+
def hitEvents = self[:hitEvents]
|
1365
|
+
def hitEvents=(v) self[:hitEvents] = v end
|
1366
|
+
def beginCount = self[:beginCount]
|
1367
|
+
def beginCount=(v) self[:beginCount] = v end
|
1368
|
+
def endCount = self[:endCount]
|
1369
|
+
def endCount=(v) self[:endCount] = v end
|
1370
|
+
def hitCount = self[:hitCount]
|
1371
|
+
def hitCount=(v) self[:hitCount] = v end
|
1372
|
+
def self.create_as(_beginEvents_, _endEvents_, _hitEvents_, _beginCount_, _endCount_, _hitCount_)
|
1373
|
+
instance = ContactEvents.new
|
1374
|
+
instance[:beginEvents] = _beginEvents_
|
1375
|
+
instance[:endEvents] = _endEvents_
|
1376
|
+
instance[:hitEvents] = _hitEvents_
|
1377
|
+
instance[:beginCount] = _beginCount_
|
1378
|
+
instance[:endCount] = _endCount_
|
1379
|
+
instance[:hitCount] = _hitCount_
|
1380
|
+
instance
|
1381
|
+
end
|
1382
|
+
end
|
1383
|
+
|
1384
|
+
class BodyMoveEvent < FFI::Struct
|
1385
|
+
layout(
|
1386
|
+
:transform, Transform,
|
1387
|
+
:bodyId, BodyId,
|
1388
|
+
:userData, :pointer,
|
1389
|
+
:fellAsleep, :bool,
|
1390
|
+
)
|
1391
|
+
def transform = self[:transform]
|
1392
|
+
def transform=(v) self[:transform] = v end
|
1393
|
+
def bodyId = self[:bodyId]
|
1394
|
+
def bodyId=(v) self[:bodyId] = v end
|
1395
|
+
def userData = self[:userData]
|
1396
|
+
def userData=(v) self[:userData] = v end
|
1397
|
+
def fellAsleep = self[:fellAsleep]
|
1398
|
+
def fellAsleep=(v) self[:fellAsleep] = v end
|
1399
|
+
def self.create_as(_transform_, _bodyId_, _userData_, _fellAsleep_)
|
1400
|
+
instance = BodyMoveEvent.new
|
1401
|
+
instance[:transform] = _transform_
|
1402
|
+
instance[:bodyId] = _bodyId_
|
1403
|
+
instance[:userData] = _userData_
|
1404
|
+
instance[:fellAsleep] = _fellAsleep_
|
1405
|
+
instance
|
1406
|
+
end
|
1407
|
+
end
|
1408
|
+
|
1409
|
+
class BodyEvents < FFI::Struct
|
1410
|
+
layout(
|
1411
|
+
:moveEvents, :pointer,
|
1412
|
+
:moveCount, :int,
|
1413
|
+
)
|
1414
|
+
def moveEvents = self[:moveEvents]
|
1415
|
+
def moveEvents=(v) self[:moveEvents] = v end
|
1416
|
+
def moveCount = self[:moveCount]
|
1417
|
+
def moveCount=(v) self[:moveCount] = v end
|
1418
|
+
def self.create_as(_moveEvents_, _moveCount_)
|
1419
|
+
instance = BodyEvents.new
|
1420
|
+
instance[:moveEvents] = _moveEvents_
|
1421
|
+
instance[:moveCount] = _moveCount_
|
1422
|
+
instance
|
1423
|
+
end
|
1424
|
+
end
|
1425
|
+
|
1426
|
+
class ContactData < FFI::Struct
|
1427
|
+
layout(
|
1428
|
+
:shapeIdA, ShapeId,
|
1429
|
+
:shapeIdB, ShapeId,
|
1430
|
+
:manifold, Manifold,
|
1431
|
+
)
|
1432
|
+
def shapeIdA = self[:shapeIdA]
|
1433
|
+
def shapeIdA=(v) self[:shapeIdA] = v end
|
1434
|
+
def shapeIdB = self[:shapeIdB]
|
1435
|
+
def shapeIdB=(v) self[:shapeIdB] = v end
|
1436
|
+
def manifold = self[:manifold]
|
1437
|
+
def manifold=(v) self[:manifold] = v end
|
1438
|
+
def self.create_as(_shapeIdA_, _shapeIdB_, _manifold_)
|
1439
|
+
instance = ContactData.new
|
1440
|
+
instance[:shapeIdA] = _shapeIdA_
|
1441
|
+
instance[:shapeIdB] = _shapeIdB_
|
1442
|
+
instance[:manifold] = _manifold_
|
1443
|
+
instance
|
1444
|
+
end
|
1445
|
+
end
|
1446
|
+
|
1447
|
+
class DebugDraw < FFI::Struct
|
1448
|
+
layout(
|
1449
|
+
:DrawPolygon, :pointer,
|
1450
|
+
:DrawSolidPolygon, :pointer,
|
1451
|
+
:DrawCircle, :pointer,
|
1452
|
+
:DrawSolidCircle, :pointer,
|
1453
|
+
:DrawSolidCapsule, :pointer,
|
1454
|
+
:DrawSegment, :pointer,
|
1455
|
+
:DrawTransform, :pointer,
|
1456
|
+
:DrawPoint, :pointer,
|
1457
|
+
:DrawString, :pointer,
|
1458
|
+
:drawingBounds, AABB,
|
1459
|
+
:useDrawingBounds, :bool,
|
1460
|
+
:drawShapes, :bool,
|
1461
|
+
:drawJoints, :bool,
|
1462
|
+
:drawJointExtras, :bool,
|
1463
|
+
:drawAABBs, :bool,
|
1464
|
+
:drawMass, :bool,
|
1465
|
+
:drawContacts, :bool,
|
1466
|
+
:drawGraphColors, :bool,
|
1467
|
+
:drawContactNormals, :bool,
|
1468
|
+
:drawContactImpulses, :bool,
|
1469
|
+
:drawFrictionImpulses, :bool,
|
1470
|
+
:context, :pointer,
|
1471
|
+
)
|
1472
|
+
def DrawPolygon = self[:DrawPolygon]
|
1473
|
+
def DrawPolygon=(v) self[:DrawPolygon] = v end
|
1474
|
+
def DrawSolidPolygon = self[:DrawSolidPolygon]
|
1475
|
+
def DrawSolidPolygon=(v) self[:DrawSolidPolygon] = v end
|
1476
|
+
def DrawCircle = self[:DrawCircle]
|
1477
|
+
def DrawCircle=(v) self[:DrawCircle] = v end
|
1478
|
+
def DrawSolidCircle = self[:DrawSolidCircle]
|
1479
|
+
def DrawSolidCircle=(v) self[:DrawSolidCircle] = v end
|
1480
|
+
def DrawSolidCapsule = self[:DrawSolidCapsule]
|
1481
|
+
def DrawSolidCapsule=(v) self[:DrawSolidCapsule] = v end
|
1482
|
+
def DrawSegment = self[:DrawSegment]
|
1483
|
+
def DrawSegment=(v) self[:DrawSegment] = v end
|
1484
|
+
def DrawTransform = self[:DrawTransform]
|
1485
|
+
def DrawTransform=(v) self[:DrawTransform] = v end
|
1486
|
+
def DrawPoint = self[:DrawPoint]
|
1487
|
+
def DrawPoint=(v) self[:DrawPoint] = v end
|
1488
|
+
def DrawString = self[:DrawString]
|
1489
|
+
def DrawString=(v) self[:DrawString] = v end
|
1490
|
+
def drawingBounds = self[:drawingBounds]
|
1491
|
+
def drawingBounds=(v) self[:drawingBounds] = v end
|
1492
|
+
def useDrawingBounds = self[:useDrawingBounds]
|
1493
|
+
def useDrawingBounds=(v) self[:useDrawingBounds] = v end
|
1494
|
+
def drawShapes = self[:drawShapes]
|
1495
|
+
def drawShapes=(v) self[:drawShapes] = v end
|
1496
|
+
def drawJoints = self[:drawJoints]
|
1497
|
+
def drawJoints=(v) self[:drawJoints] = v end
|
1498
|
+
def drawJointExtras = self[:drawJointExtras]
|
1499
|
+
def drawJointExtras=(v) self[:drawJointExtras] = v end
|
1500
|
+
def drawAABBs = self[:drawAABBs]
|
1501
|
+
def drawAABBs=(v) self[:drawAABBs] = v end
|
1502
|
+
def drawMass = self[:drawMass]
|
1503
|
+
def drawMass=(v) self[:drawMass] = v end
|
1504
|
+
def drawContacts = self[:drawContacts]
|
1505
|
+
def drawContacts=(v) self[:drawContacts] = v end
|
1506
|
+
def drawGraphColors = self[:drawGraphColors]
|
1507
|
+
def drawGraphColors=(v) self[:drawGraphColors] = v end
|
1508
|
+
def drawContactNormals = self[:drawContactNormals]
|
1509
|
+
def drawContactNormals=(v) self[:drawContactNormals] = v end
|
1510
|
+
def drawContactImpulses = self[:drawContactImpulses]
|
1511
|
+
def drawContactImpulses=(v) self[:drawContactImpulses] = v end
|
1512
|
+
def drawFrictionImpulses = self[:drawFrictionImpulses]
|
1513
|
+
def drawFrictionImpulses=(v) self[:drawFrictionImpulses] = v end
|
1514
|
+
def context = self[:context]
|
1515
|
+
def context=(v) self[:context] = v end
|
1516
|
+
def self.create_as(_DrawPolygon_, _DrawSolidPolygon_, _DrawCircle_, _DrawSolidCircle_, _DrawSolidCapsule_, _DrawSegment_, _DrawTransform_, _DrawPoint_, _DrawString_, _drawingBounds_, _useDrawingBounds_, _drawShapes_, _drawJoints_, _drawJointExtras_, _drawAABBs_, _drawMass_, _drawContacts_, _drawGraphColors_, _drawContactNormals_, _drawContactImpulses_, _drawFrictionImpulses_, _context_)
|
1517
|
+
instance = DebugDraw.new
|
1518
|
+
instance[:DrawPolygon] = _DrawPolygon_
|
1519
|
+
instance[:DrawSolidPolygon] = _DrawSolidPolygon_
|
1520
|
+
instance[:DrawCircle] = _DrawCircle_
|
1521
|
+
instance[:DrawSolidCircle] = _DrawSolidCircle_
|
1522
|
+
instance[:DrawSolidCapsule] = _DrawSolidCapsule_
|
1523
|
+
instance[:DrawSegment] = _DrawSegment_
|
1524
|
+
instance[:DrawTransform] = _DrawTransform_
|
1525
|
+
instance[:DrawPoint] = _DrawPoint_
|
1526
|
+
instance[:DrawString] = _DrawString_
|
1527
|
+
instance[:drawingBounds] = _drawingBounds_
|
1528
|
+
instance[:useDrawingBounds] = _useDrawingBounds_
|
1529
|
+
instance[:drawShapes] = _drawShapes_
|
1530
|
+
instance[:drawJoints] = _drawJoints_
|
1531
|
+
instance[:drawJointExtras] = _drawJointExtras_
|
1532
|
+
instance[:drawAABBs] = _drawAABBs_
|
1533
|
+
instance[:drawMass] = _drawMass_
|
1534
|
+
instance[:drawContacts] = _drawContacts_
|
1535
|
+
instance[:drawGraphColors] = _drawGraphColors_
|
1536
|
+
instance[:drawContactNormals] = _drawContactNormals_
|
1537
|
+
instance[:drawContactImpulses] = _drawContactImpulses_
|
1538
|
+
instance[:drawFrictionImpulses] = _drawFrictionImpulses_
|
1539
|
+
instance[:context] = _context_
|
1540
|
+
instance
|
1541
|
+
end
|
1542
|
+
end
|
1543
|
+
|
1544
|
+
|
1545
|
+
# Function
|
1546
|
+
|
1547
|
+
def self.setup_types_symbols(method_naming: :original)
|
1548
|
+
entries = [
|
1549
|
+
[:DefaultWorldDef, :b2DefaultWorldDef, [], WorldDef.by_value],
|
1550
|
+
[:DefaultBodyDef, :b2DefaultBodyDef, [], BodyDef.by_value],
|
1551
|
+
[:DefaultFilter, :b2DefaultFilter, [], Filter.by_value],
|
1552
|
+
[:DefaultQueryFilter, :b2DefaultQueryFilter, [], QueryFilter.by_value],
|
1553
|
+
[:DefaultShapeDef, :b2DefaultShapeDef, [], ShapeDef.by_value],
|
1554
|
+
[:DefaultChainDef, :b2DefaultChainDef, [], ChainDef.by_value],
|
1555
|
+
[:DefaultDistanceJointDef, :b2DefaultDistanceJointDef, [], DistanceJointDef.by_value],
|
1556
|
+
[:DefaultMotorJointDef, :b2DefaultMotorJointDef, [], MotorJointDef.by_value],
|
1557
|
+
[:DefaultMouseJointDef, :b2DefaultMouseJointDef, [], MouseJointDef.by_value],
|
1558
|
+
[:DefaultNullJointDef, :b2DefaultNullJointDef, [], NullJointDef.by_value],
|
1559
|
+
[:DefaultPrismaticJointDef, :b2DefaultPrismaticJointDef, [], PrismaticJointDef.by_value],
|
1560
|
+
[:DefaultRevoluteJointDef, :b2DefaultRevoluteJointDef, [], RevoluteJointDef.by_value],
|
1561
|
+
[:DefaultWeldJointDef, :b2DefaultWeldJointDef, [], WeldJointDef.by_value],
|
1562
|
+
[:DefaultWheelJointDef, :b2DefaultWheelJointDef, [], WheelJointDef.by_value],
|
1563
|
+
[:DefaultExplosionDef, :b2DefaultExplosionDef, [], ExplosionDef.by_value],
|
1564
|
+
[:DefaultDebugDraw, :b2DefaultDebugDraw, [], DebugDraw.by_value],
|
1565
|
+
]
|
1566
|
+
entries.each do |entry|
|
1567
|
+
api_name = if method_naming == :snake_case
|
1568
|
+
snake_case_name = entry[0].to_s.gsub(/([A-Z]+)([A-Z0-9][a-z])/, '\1_\2').gsub(/([a-z\d])([A-Z0-9])/, '\1_\2').downcase
|
1569
|
+
snake_case_name.gsub!('vector_3', 'vector3_') if snake_case_name.include?('vector_3')
|
1570
|
+
snake_case_name.gsub!('vector_2', 'vector2_') if snake_case_name.include?('vector_2')
|
1571
|
+
snake_case_name.chop! if snake_case_name.end_with?('_')
|
1572
|
+
snake_case_name.to_sym
|
1573
|
+
else
|
1574
|
+
entry[0]
|
1575
|
+
end
|
1576
|
+
attach_function api_name, entry[1], entry[2], entry[3]
|
1577
|
+
rescue FFI::NotFoundError => e
|
1578
|
+
warn "[Warning] Failed to import #{entry[0]} (#{e})."
|
1579
|
+
end
|
1580
|
+
end
|
1581
|
+
|
1582
|
+
end
|
1583
|
+
|