raylib-bindings 0.1.4 → 0.3.0

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.
data/lib/raymath.rb CHANGED
@@ -1,713 +1,709 @@
1
- # Yet another raylib wrapper for Ruby
2
- #
3
- # * https://github.com/vaiorabbit/raylib-bindings
4
- #
5
- # [NOTICE] Autogenerated. Do not edit.
6
-
7
- require 'ffi'
8
-
9
- module Raylib
10
- extend FFI::Library
11
-
12
- # Define/Macro
13
-
14
- EPSILON = 0.000001
15
-
16
- # Typedef
17
-
18
-
19
- # Struct
20
-
21
- # NOTE: Helper types to be used instead of array return types for *ToFloat functions
22
- class Float3 < FFI::Struct
23
- layout(
24
- :v, [:float, 3],
25
- )
26
- end
27
-
28
- class Float16 < FFI::Struct
29
- layout(
30
- :v, [:float, 16],
31
- )
32
- end
33
-
34
-
35
- # Function
36
-
37
- def self.setup_raymath_symbols(output_error = false)
38
- entries = [
39
-
40
- # Clamp :
41
- # @param value [float]
42
- # @param min [float]
43
- # @param max [float]
44
- # @return [float]
45
- [:Clamp, :Clamp, [:float, :float, :float], :float],
46
-
47
- # Lerp :
48
- # @param start [float]
49
- # @param end [float]
50
- # @param amount [float]
51
- # @return [float]
52
- [:Lerp, :Lerp, [:float, :float, :float], :float],
53
-
54
- # Normalize :
55
- # @param value [float]
56
- # @param start [float]
57
- # @param end [float]
58
- # @return [float]
59
- [:Normalize, :Normalize, [:float, :float, :float], :float],
60
-
61
- # Remap :
62
- # @param value [float]
63
- # @param inputStart [float]
64
- # @param inputEnd [float]
65
- # @param outputStart [float]
66
- # @param outputEnd [float]
67
- # @return [float]
68
- [:Remap, :Remap, [:float, :float, :float, :float, :float], :float],
69
-
70
- # Wrap :
71
- # @param value [float]
72
- # @param min [float]
73
- # @param max [float]
74
- # @return [float]
75
- [:Wrap, :Wrap, [:float, :float, :float], :float],
76
-
77
- # FloatEquals :
78
- # @param x [float]
79
- # @param y [float]
80
- # @return [int]
81
- [:FloatEquals, :FloatEquals, [:float, :float], :int],
82
-
83
- # Vector2Zero :
84
- # @return [Vector2]
85
- [:Vector2Zero, :Vector2Zero, [], Vector2.by_value],
86
-
87
- # Vector2One :
88
- # @return [Vector2]
89
- [:Vector2One, :Vector2One, [], Vector2.by_value],
90
-
91
- # Vector2Add :
92
- # @param v1 [Vector2]
93
- # @param v2 [Vector2]
94
- # @return [Vector2]
95
- [:Vector2Add, :Vector2Add, [Vector2.by_value, Vector2.by_value], Vector2.by_value],
96
-
97
- # Vector2AddValue :
98
- # @param v [Vector2]
99
- # @param add [float]
100
- # @return [Vector2]
101
- [:Vector2AddValue, :Vector2AddValue, [Vector2.by_value, :float], Vector2.by_value],
102
-
103
- # Vector2Subtract :
104
- # @param v1 [Vector2]
105
- # @param v2 [Vector2]
106
- # @return [Vector2]
107
- [:Vector2Subtract, :Vector2Subtract, [Vector2.by_value, Vector2.by_value], Vector2.by_value],
108
-
109
- # Vector2SubtractValue :
110
- # @param v [Vector2]
111
- # @param sub [float]
112
- # @return [Vector2]
113
- [:Vector2SubtractValue, :Vector2SubtractValue, [Vector2.by_value, :float], Vector2.by_value],
114
-
115
- # Vector2Length :
116
- # @param v [Vector2]
117
- # @return [float]
118
- [:Vector2Length, :Vector2Length, [Vector2.by_value], :float],
119
-
120
- # Vector2LengthSqr :
121
- # @param v [Vector2]
122
- # @return [float]
123
- [:Vector2LengthSqr, :Vector2LengthSqr, [Vector2.by_value], :float],
124
-
125
- # Vector2DotProduct :
126
- # @param v1 [Vector2]
127
- # @param v2 [Vector2]
128
- # @return [float]
129
- [:Vector2DotProduct, :Vector2DotProduct, [Vector2.by_value, Vector2.by_value], :float],
130
-
131
- # Vector2Distance :
132
- # @param v1 [Vector2]
133
- # @param v2 [Vector2]
134
- # @return [float]
135
- [:Vector2Distance, :Vector2Distance, [Vector2.by_value, Vector2.by_value], :float],
136
-
137
- # Vector2DistanceSqr :
138
- # @param v1 [Vector2]
139
- # @param v2 [Vector2]
140
- # @return [float]
141
- [:Vector2DistanceSqr, :Vector2DistanceSqr, [Vector2.by_value, Vector2.by_value], :float],
142
-
143
- # Vector2Angle :
144
- # @param v1 [Vector2]
145
- # @param v2 [Vector2]
146
- # @return [float]
147
- [:Vector2Angle, :Vector2Angle, [Vector2.by_value, Vector2.by_value], :float],
148
-
149
- # Vector2Scale :
150
- # @param v [Vector2]
151
- # @param scale [float]
152
- # @return [Vector2]
153
- [:Vector2Scale, :Vector2Scale, [Vector2.by_value, :float], Vector2.by_value],
154
-
155
- # Vector2Multiply :
156
- # @param v1 [Vector2]
157
- # @param v2 [Vector2]
158
- # @return [Vector2]
159
- [:Vector2Multiply, :Vector2Multiply, [Vector2.by_value, Vector2.by_value], Vector2.by_value],
160
-
161
- # Vector2Negate :
162
- # @param v [Vector2]
163
- # @return [Vector2]
164
- [:Vector2Negate, :Vector2Negate, [Vector2.by_value], Vector2.by_value],
165
-
166
- # Vector2Divide :
167
- # @param v1 [Vector2]
168
- # @param v2 [Vector2]
169
- # @return [Vector2]
170
- [:Vector2Divide, :Vector2Divide, [Vector2.by_value, Vector2.by_value], Vector2.by_value],
171
-
172
- # Vector2Normalize :
173
- # @param v [Vector2]
174
- # @return [Vector2]
175
- [:Vector2Normalize, :Vector2Normalize, [Vector2.by_value], Vector2.by_value],
176
-
177
- # Vector2Transform :
178
- # @param v [Vector2]
179
- # @param mat [Matrix]
180
- # @return [Vector2]
181
- [:Vector2Transform, :Vector2Transform, [Vector2.by_value, Matrix.by_value], Vector2.by_value],
182
-
183
- # Vector2Lerp :
184
- # @param v1 [Vector2]
185
- # @param v2 [Vector2]
186
- # @param amount [float]
187
- # @return [Vector2]
188
- [:Vector2Lerp, :Vector2Lerp, [Vector2.by_value, Vector2.by_value, :float], Vector2.by_value],
189
-
190
- # Vector2Reflect :
191
- # @param v [Vector2]
192
- # @param normal [Vector2]
193
- # @return [Vector2]
194
- [:Vector2Reflect, :Vector2Reflect, [Vector2.by_value, Vector2.by_value], Vector2.by_value],
195
-
196
- # Vector2Rotate :
197
- # @param v [Vector2]
198
- # @param angle [float]
199
- # @return [Vector2]
200
- [:Vector2Rotate, :Vector2Rotate, [Vector2.by_value, :float], Vector2.by_value],
201
-
202
- # Vector2MoveTowards :
203
- # @param v [Vector2]
204
- # @param target [Vector2]
205
- # @param maxDistance [float]
206
- # @return [Vector2]
207
- [:Vector2MoveTowards, :Vector2MoveTowards, [Vector2.by_value, Vector2.by_value, :float], Vector2.by_value],
208
-
209
- # Vector2Invert :
210
- # @param v [Vector2]
211
- # @return [Vector2]
212
- [:Vector2Invert, :Vector2Invert, [Vector2.by_value], Vector2.by_value],
213
-
214
- # Vector2Clamp :
215
- # @param v [Vector2]
216
- # @param min [Vector2]
217
- # @param max [Vector2]
218
- # @return [Vector2]
219
- [:Vector2Clamp, :Vector2Clamp, [Vector2.by_value, Vector2.by_value, Vector2.by_value], Vector2.by_value],
220
-
221
- # Vector2ClampValue :
222
- # @param v [Vector2]
223
- # @param min [float]
224
- # @param max [float]
225
- # @return [Vector2]
226
- [:Vector2ClampValue, :Vector2ClampValue, [Vector2.by_value, :float, :float], Vector2.by_value],
227
-
228
- # Vector2Equals :
229
- # @param p [Vector2]
230
- # @param q [Vector2]
231
- # @return [int]
232
- [:Vector2Equals, :Vector2Equals, [Vector2.by_value, Vector2.by_value], :int],
233
-
234
- # Vector3Zero :
235
- # @return [Vector3]
236
- [:Vector3Zero, :Vector3Zero, [], Vector3.by_value],
237
-
238
- # Vector3One :
239
- # @return [Vector3]
240
- [:Vector3One, :Vector3One, [], Vector3.by_value],
241
-
242
- # Vector3Add :
243
- # @param v1 [Vector3]
244
- # @param v2 [Vector3]
245
- # @return [Vector3]
246
- [:Vector3Add, :Vector3Add, [Vector3.by_value, Vector3.by_value], Vector3.by_value],
247
-
248
- # Vector3AddValue :
249
- # @param v [Vector3]
250
- # @param add [float]
251
- # @return [Vector3]
252
- [:Vector3AddValue, :Vector3AddValue, [Vector3.by_value, :float], Vector3.by_value],
253
-
254
- # Vector3Subtract :
255
- # @param v1 [Vector3]
256
- # @param v2 [Vector3]
257
- # @return [Vector3]
258
- [:Vector3Subtract, :Vector3Subtract, [Vector3.by_value, Vector3.by_value], Vector3.by_value],
259
-
260
- # Vector3SubtractValue :
261
- # @param v [Vector3]
262
- # @param sub [float]
263
- # @return [Vector3]
264
- [:Vector3SubtractValue, :Vector3SubtractValue, [Vector3.by_value, :float], Vector3.by_value],
265
-
266
- # Vector3Scale :
267
- # @param v [Vector3]
268
- # @param scalar [float]
269
- # @return [Vector3]
270
- [:Vector3Scale, :Vector3Scale, [Vector3.by_value, :float], Vector3.by_value],
271
-
272
- # Vector3Multiply :
273
- # @param v1 [Vector3]
274
- # @param v2 [Vector3]
275
- # @return [Vector3]
276
- [:Vector3Multiply, :Vector3Multiply, [Vector3.by_value, Vector3.by_value], Vector3.by_value],
277
-
278
- # Vector3CrossProduct :
279
- # @param v1 [Vector3]
280
- # @param v2 [Vector3]
281
- # @return [Vector3]
282
- [:Vector3CrossProduct, :Vector3CrossProduct, [Vector3.by_value, Vector3.by_value], Vector3.by_value],
283
-
284
- # Vector3Perpendicular :
285
- # @param v [Vector3]
286
- # @return [Vector3]
287
- [:Vector3Perpendicular, :Vector3Perpendicular, [Vector3.by_value], Vector3.by_value],
288
-
289
- # Vector3Length :
290
- # @param v [const Vector3]
291
- # @return [float]
292
- [:Vector3Length, :Vector3Length, [Vector3.by_value], :float],
293
-
294
- # Vector3LengthSqr :
295
- # @param v [const Vector3]
296
- # @return [float]
297
- [:Vector3LengthSqr, :Vector3LengthSqr, [Vector3.by_value], :float],
298
-
299
- # Vector3DotProduct :
300
- # @param v1 [Vector3]
301
- # @param v2 [Vector3]
302
- # @return [float]
303
- [:Vector3DotProduct, :Vector3DotProduct, [Vector3.by_value, Vector3.by_value], :float],
304
-
305
- # Vector3Distance :
306
- # @param v1 [Vector3]
307
- # @param v2 [Vector3]
308
- # @return [float]
309
- [:Vector3Distance, :Vector3Distance, [Vector3.by_value, Vector3.by_value], :float],
310
-
311
- # Vector3DistanceSqr :
312
- # @param v1 [Vector3]
313
- # @param v2 [Vector3]
314
- # @return [float]
315
- [:Vector3DistanceSqr, :Vector3DistanceSqr, [Vector3.by_value, Vector3.by_value], :float],
316
-
317
- # Vector3Angle :
318
- # @param v1 [Vector3]
319
- # @param v2 [Vector3]
320
- # @return [float]
321
- [:Vector3Angle, :Vector3Angle, [Vector3.by_value, Vector3.by_value], :float],
322
-
323
- # Vector3Negate :
324
- # @param v [Vector3]
325
- # @return [Vector3]
326
- [:Vector3Negate, :Vector3Negate, [Vector3.by_value], Vector3.by_value],
327
-
328
- # Vector3Divide :
329
- # @param v1 [Vector3]
330
- # @param v2 [Vector3]
331
- # @return [Vector3]
332
- [:Vector3Divide, :Vector3Divide, [Vector3.by_value, Vector3.by_value], Vector3.by_value],
333
-
334
- # Vector3Normalize :
335
- # @param v [Vector3]
336
- # @return [Vector3]
337
- [:Vector3Normalize, :Vector3Normalize, [Vector3.by_value], Vector3.by_value],
338
-
339
- # Vector3OrthoNormalize :
340
- # @param v1 [Vector3 *]
341
- # @param v2 [Vector3 *]
342
- # @return [void]
343
- [:Vector3OrthoNormalize, :Vector3OrthoNormalize, [:pointer, :pointer], :void],
344
-
345
- # Vector3Transform :
346
- # @param v [Vector3]
347
- # @param mat [Matrix]
348
- # @return [Vector3]
349
- [:Vector3Transform, :Vector3Transform, [Vector3.by_value, Matrix.by_value], Vector3.by_value],
350
-
351
- # Vector3RotateByQuaternion :
352
- # @param v [Vector3]
353
- # @param q [Quaternion]
354
- # @return [Vector3]
355
- [:Vector3RotateByQuaternion, :Vector3RotateByQuaternion, [Vector3.by_value, Quaternion.by_value], Vector3.by_value],
356
-
357
- # Vector3RotateByAxisAngle :
358
- # @param v [Vector3]
359
- # @param axis [Vector3]
360
- # @param angle [float]
361
- # @return [Vector3]
362
- [:Vector3RotateByAxisAngle, :Vector3RotateByAxisAngle, [Vector3.by_value, Vector3.by_value, :float], Vector3.by_value],
363
-
364
- # Vector3Lerp :
365
- # @param v1 [Vector3]
366
- # @param v2 [Vector3]
367
- # @param amount [float]
368
- # @return [Vector3]
369
- [:Vector3Lerp, :Vector3Lerp, [Vector3.by_value, Vector3.by_value, :float], Vector3.by_value],
370
-
371
- # Vector3Reflect :
372
- # @param v [Vector3]
373
- # @param normal [Vector3]
374
- # @return [Vector3]
375
- [:Vector3Reflect, :Vector3Reflect, [Vector3.by_value, Vector3.by_value], Vector3.by_value],
376
-
377
- # Vector3Min :
378
- # @param v1 [Vector3]
379
- # @param v2 [Vector3]
380
- # @return [Vector3]
381
- [:Vector3Min, :Vector3Min, [Vector3.by_value, Vector3.by_value], Vector3.by_value],
382
-
383
- # Vector3Max :
384
- # @param v1 [Vector3]
385
- # @param v2 [Vector3]
386
- # @return [Vector3]
387
- [:Vector3Max, :Vector3Max, [Vector3.by_value, Vector3.by_value], Vector3.by_value],
388
-
389
- # Vector3Barycenter :
390
- # @param p [Vector3]
391
- # @param a [Vector3]
392
- # @param b [Vector3]
393
- # @param c [Vector3]
394
- # @return [Vector3]
395
- [:Vector3Barycenter, :Vector3Barycenter, [Vector3.by_value, Vector3.by_value, Vector3.by_value, Vector3.by_value], Vector3.by_value],
396
-
397
- # Vector3Unproject :
398
- # @param source [Vector3]
399
- # @param projection [Matrix]
400
- # @param view [Matrix]
401
- # @return [Vector3]
402
- [:Vector3Unproject, :Vector3Unproject, [Vector3.by_value, Matrix.by_value, Matrix.by_value], Vector3.by_value],
403
-
404
- # Vector3ToFloatV :
405
- # @param v [Vector3]
406
- # @return [float3]
407
- [:Vector3ToFloatV, :Vector3ToFloatV, [Vector3.by_value], Float3.by_value],
408
-
409
- # Vector3Invert :
410
- # @param v [Vector3]
411
- # @return [Vector3]
412
- [:Vector3Invert, :Vector3Invert, [Vector3.by_value], Vector3.by_value],
413
-
414
- # Vector3Clamp :
415
- # @param v [Vector3]
416
- # @param min [Vector3]
417
- # @param max [Vector3]
418
- # @return [Vector3]
419
- [:Vector3Clamp, :Vector3Clamp, [Vector3.by_value, Vector3.by_value, Vector3.by_value], Vector3.by_value],
420
-
421
- # Vector3ClampValue :
422
- # @param v [Vector3]
423
- # @param min [float]
424
- # @param max [float]
425
- # @return [Vector3]
426
- [:Vector3ClampValue, :Vector3ClampValue, [Vector3.by_value, :float, :float], Vector3.by_value],
427
-
428
- # Vector3Equals :
429
- # @param p [Vector3]
430
- # @param q [Vector3]
431
- # @return [int]
432
- [:Vector3Equals, :Vector3Equals, [Vector3.by_value, Vector3.by_value], :int],
433
-
434
- # Vector3Refract :
435
- # @param v [Vector3]
436
- # @param n [Vector3]
437
- # @param r [float]
438
- # @return [Vector3]
439
- [:Vector3Refract, :Vector3Refract, [Vector3.by_value, Vector3.by_value, :float], Vector3.by_value],
440
-
441
- # MatrixDeterminant :
442
- # @param mat [Matrix]
443
- # @return [float]
444
- [:MatrixDeterminant, :MatrixDeterminant, [Matrix.by_value], :float],
445
-
446
- # MatrixTrace :
447
- # @param mat [Matrix]
448
- # @return [float]
449
- [:MatrixTrace, :MatrixTrace, [Matrix.by_value], :float],
450
-
451
- # MatrixTranspose :
452
- # @param mat [Matrix]
453
- # @return [Matrix]
454
- [:MatrixTranspose, :MatrixTranspose, [Matrix.by_value], Matrix.by_value],
455
-
456
- # MatrixInvert :
457
- # @param mat [Matrix]
458
- # @return [Matrix]
459
- [:MatrixInvert, :MatrixInvert, [Matrix.by_value], Matrix.by_value],
460
-
461
- # MatrixIdentity :
462
- # @return [Matrix]
463
- [:MatrixIdentity, :MatrixIdentity, [], Matrix.by_value],
464
-
465
- # MatrixAdd :
466
- # @param left [Matrix]
467
- # @param right [Matrix]
468
- # @return [Matrix]
469
- [:MatrixAdd, :MatrixAdd, [Matrix.by_value, Matrix.by_value], Matrix.by_value],
470
-
471
- # MatrixSubtract :
472
- # @param left [Matrix]
473
- # @param right [Matrix]
474
- # @return [Matrix]
475
- [:MatrixSubtract, :MatrixSubtract, [Matrix.by_value, Matrix.by_value], Matrix.by_value],
476
-
477
- # MatrixMultiply :
478
- # @param left [Matrix]
479
- # @param right [Matrix]
480
- # @return [Matrix]
481
- [:MatrixMultiply, :MatrixMultiply, [Matrix.by_value, Matrix.by_value], Matrix.by_value],
482
-
483
- # MatrixTranslate :
484
- # @param x [float]
485
- # @param y [float]
486
- # @param z [float]
487
- # @return [Matrix]
488
- [:MatrixTranslate, :MatrixTranslate, [:float, :float, :float], Matrix.by_value],
489
-
490
- # MatrixRotate :
491
- # @param axis [Vector3]
492
- # @param angle [float]
493
- # @return [Matrix]
494
- [:MatrixRotate, :MatrixRotate, [Vector3.by_value, :float], Matrix.by_value],
495
-
496
- # MatrixRotateX :
497
- # @param angle [float]
498
- # @return [Matrix]
499
- [:MatrixRotateX, :MatrixRotateX, [:float], Matrix.by_value],
500
-
501
- # MatrixRotateY :
502
- # @param angle [float]
503
- # @return [Matrix]
504
- [:MatrixRotateY, :MatrixRotateY, [:float], Matrix.by_value],
505
-
506
- # MatrixRotateZ :
507
- # @param angle [float]
508
- # @return [Matrix]
509
- [:MatrixRotateZ, :MatrixRotateZ, [:float], Matrix.by_value],
510
-
511
- # MatrixRotateXYZ :
512
- # @param angle [Vector3]
513
- # @return [Matrix]
514
- [:MatrixRotateXYZ, :MatrixRotateXYZ, [Vector3.by_value], Matrix.by_value],
515
-
516
- # MatrixRotateZYX :
517
- # @param angle [Vector3]
518
- # @return [Matrix]
519
- [:MatrixRotateZYX, :MatrixRotateZYX, [Vector3.by_value], Matrix.by_value],
520
-
521
- # MatrixScale :
522
- # @param x [float]
523
- # @param y [float]
524
- # @param z [float]
525
- # @return [Matrix]
526
- [:MatrixScale, :MatrixScale, [:float, :float, :float], Matrix.by_value],
527
-
528
- # MatrixFrustum :
529
- # @param left [double]
530
- # @param right [double]
531
- # @param bottom [double]
532
- # @param top [double]
533
- # @param near [double]
534
- # @param far [double]
535
- # @return [Matrix]
536
- [:MatrixFrustum, :MatrixFrustum, [:double, :double, :double, :double, :double, :double], Matrix.by_value],
537
-
538
- # MatrixPerspective :
539
- # @param fovy [double]
540
- # @param aspect [double]
541
- # @param near [double]
542
- # @param far [double]
543
- # @return [Matrix]
544
- [:MatrixPerspective, :MatrixPerspective, [:double, :double, :double, :double], Matrix.by_value],
545
-
546
- # MatrixOrtho :
547
- # @param left [double]
548
- # @param right [double]
549
- # @param bottom [double]
550
- # @param top [double]
551
- # @param near [double]
552
- # @param far [double]
553
- # @return [Matrix]
554
- [:MatrixOrtho, :MatrixOrtho, [:double, :double, :double, :double, :double, :double], Matrix.by_value],
555
-
556
- # MatrixLookAt :
557
- # @param eye [Vector3]
558
- # @param target [Vector3]
559
- # @param up [Vector3]
560
- # @return [Matrix]
561
- [:MatrixLookAt, :MatrixLookAt, [Vector3.by_value, Vector3.by_value, Vector3.by_value], Matrix.by_value],
562
-
563
- # MatrixToFloatV :
564
- # @param mat [Matrix]
565
- # @return [float16]
566
- [:MatrixToFloatV, :MatrixToFloatV, [Matrix.by_value], Float16.by_value],
567
-
568
- # QuaternionAdd :
569
- # @param q1 [Quaternion]
570
- # @param q2 [Quaternion]
571
- # @return [Quaternion]
572
- [:QuaternionAdd, :QuaternionAdd, [Quaternion.by_value, Quaternion.by_value], Quaternion.by_value],
573
-
574
- # QuaternionAddValue :
575
- # @param q [Quaternion]
576
- # @param add [float]
577
- # @return [Quaternion]
578
- [:QuaternionAddValue, :QuaternionAddValue, [Quaternion.by_value, :float], Quaternion.by_value],
579
-
580
- # QuaternionSubtract :
581
- # @param q1 [Quaternion]
582
- # @param q2 [Quaternion]
583
- # @return [Quaternion]
584
- [:QuaternionSubtract, :QuaternionSubtract, [Quaternion.by_value, Quaternion.by_value], Quaternion.by_value],
585
-
586
- # QuaternionSubtractValue :
587
- # @param q [Quaternion]
588
- # @param sub [float]
589
- # @return [Quaternion]
590
- [:QuaternionSubtractValue, :QuaternionSubtractValue, [Quaternion.by_value, :float], Quaternion.by_value],
591
-
592
- # QuaternionIdentity :
593
- # @return [Quaternion]
594
- [:QuaternionIdentity, :QuaternionIdentity, [], Quaternion.by_value],
595
-
596
- # QuaternionLength :
597
- # @param q [Quaternion]
598
- # @return [float]
599
- [:QuaternionLength, :QuaternionLength, [Quaternion.by_value], :float],
600
-
601
- # QuaternionNormalize :
602
- # @param q [Quaternion]
603
- # @return [Quaternion]
604
- [:QuaternionNormalize, :QuaternionNormalize, [Quaternion.by_value], Quaternion.by_value],
605
-
606
- # QuaternionInvert :
607
- # @param q [Quaternion]
608
- # @return [Quaternion]
609
- [:QuaternionInvert, :QuaternionInvert, [Quaternion.by_value], Quaternion.by_value],
610
-
611
- # QuaternionMultiply :
612
- # @param q1 [Quaternion]
613
- # @param q2 [Quaternion]
614
- # @return [Quaternion]
615
- [:QuaternionMultiply, :QuaternionMultiply, [Quaternion.by_value, Quaternion.by_value], Quaternion.by_value],
616
-
617
- # QuaternionScale :
618
- # @param q [Quaternion]
619
- # @param mul [float]
620
- # @return [Quaternion]
621
- [:QuaternionScale, :QuaternionScale, [Quaternion.by_value, :float], Quaternion.by_value],
622
-
623
- # QuaternionDivide :
624
- # @param q1 [Quaternion]
625
- # @param q2 [Quaternion]
626
- # @return [Quaternion]
627
- [:QuaternionDivide, :QuaternionDivide, [Quaternion.by_value, Quaternion.by_value], Quaternion.by_value],
628
-
629
- # QuaternionLerp :
630
- # @param q1 [Quaternion]
631
- # @param q2 [Quaternion]
632
- # @param amount [float]
633
- # @return [Quaternion]
634
- [:QuaternionLerp, :QuaternionLerp, [Quaternion.by_value, Quaternion.by_value, :float], Quaternion.by_value],
635
-
636
- # QuaternionNlerp :
637
- # @param q1 [Quaternion]
638
- # @param q2 [Quaternion]
639
- # @param amount [float]
640
- # @return [Quaternion]
641
- [:QuaternionNlerp, :QuaternionNlerp, [Quaternion.by_value, Quaternion.by_value, :float], Quaternion.by_value],
642
-
643
- # QuaternionSlerp :
644
- # @param q1 [Quaternion]
645
- # @param q2 [Quaternion]
646
- # @param amount [float]
647
- # @return [Quaternion]
648
- [:QuaternionSlerp, :QuaternionSlerp, [Quaternion.by_value, Quaternion.by_value, :float], Quaternion.by_value],
649
-
650
- # QuaternionFromVector3ToVector3 :
651
- # @param from [Vector3]
652
- # @param to [Vector3]
653
- # @return [Quaternion]
654
- [:QuaternionFromVector3ToVector3, :QuaternionFromVector3ToVector3, [Vector3.by_value, Vector3.by_value], Quaternion.by_value],
655
-
656
- # QuaternionFromMatrix :
657
- # @param mat [Matrix]
658
- # @return [Quaternion]
659
- [:QuaternionFromMatrix, :QuaternionFromMatrix, [Matrix.by_value], Quaternion.by_value],
660
-
661
- # QuaternionToMatrix :
662
- # @param q [Quaternion]
663
- # @return [Matrix]
664
- [:QuaternionToMatrix, :QuaternionToMatrix, [Quaternion.by_value], Matrix.by_value],
665
-
666
- # QuaternionFromAxisAngle :
667
- # @param axis [Vector3]
668
- # @param angle [float]
669
- # @return [Quaternion]
670
- [:QuaternionFromAxisAngle, :QuaternionFromAxisAngle, [Vector3.by_value, :float], Quaternion.by_value],
671
-
672
- # QuaternionToAxisAngle :
673
- # @param q [Quaternion]
674
- # @param outAxis [Vector3 *]
675
- # @param outAngle [float *]
676
- # @return [void]
677
- [:QuaternionToAxisAngle, :QuaternionToAxisAngle, [Quaternion.by_value, :pointer, :pointer], :void],
678
-
679
- # QuaternionFromEuler :
680
- # @param pitch [float]
681
- # @param yaw [float]
682
- # @param roll [float]
683
- # @return [Quaternion]
684
- [:QuaternionFromEuler, :QuaternionFromEuler, [:float, :float, :float], Quaternion.by_value],
685
-
686
- # QuaternionToEuler :
687
- # @param q [Quaternion]
688
- # @return [Vector3]
689
- [:QuaternionToEuler, :QuaternionToEuler, [Quaternion.by_value], Vector3.by_value],
690
-
691
- # QuaternionTransform :
692
- # @param q [Quaternion]
693
- # @param mat [Matrix]
694
- # @return [Quaternion]
695
- [:QuaternionTransform, :QuaternionTransform, [Quaternion.by_value, Matrix.by_value], Quaternion.by_value],
696
-
697
- # QuaternionEquals :
698
- # @param p [Quaternion]
699
- # @param q [Quaternion]
700
- # @return [int]
701
- [:QuaternionEquals, :QuaternionEquals, [Quaternion.by_value, Quaternion.by_value], :int],
702
- ]
703
- entries.each do |entry|
704
- begin
705
- attach_function entry[0], entry[1], entry[2], entry[3]
706
- rescue FFI::NotFoundError => error
707
- $stderr.puts("[Warning] Failed to import #{entry[0]} (#{error}).") if output_error
708
- end
709
- end
710
- end
711
-
712
- end
713
-
1
+ # Yet another raylib wrapper for Ruby
2
+ #
3
+ # * https://github.com/vaiorabbit/raylib-bindings
4
+ #
5
+ # [NOTICE] Autogenerated. Do not edit.
6
+
7
+ require 'ffi'
8
+
9
+ module Raylib
10
+ extend FFI::Library
11
+
12
+ # Define/Macro
13
+
14
+ EPSILON = 0.000001
15
+
16
+ # Typedef
17
+
18
+
19
+ # Struct
20
+
21
+ # NOTE: Helper types to be used instead of array return types for *ToFloat functions
22
+ class Float3 < FFI::Struct
23
+ layout(
24
+ :v, [:float, 3],
25
+ )
26
+ end
27
+
28
+ class Float16 < FFI::Struct
29
+ layout(
30
+ :v, [:float, 16],
31
+ )
32
+ end
33
+
34
+
35
+ # Function
36
+
37
+ def self.setup_raymath_symbols
38
+ entries = [
39
+
40
+ # Clamp
41
+ # @param value [float]
42
+ # @param min [float]
43
+ # @param max [float]
44
+ # @return [float]
45
+ [:Clamp, :Clamp, [:float, :float, :float], :float],
46
+
47
+ # Lerp
48
+ # @param start [float]
49
+ # @param end [float]
50
+ # @param amount [float]
51
+ # @return [float]
52
+ [:Lerp, :Lerp, [:float, :float, :float], :float],
53
+
54
+ # Normalize
55
+ # @param value [float]
56
+ # @param start [float]
57
+ # @param end [float]
58
+ # @return [float]
59
+ [:Normalize, :Normalize, [:float, :float, :float], :float],
60
+
61
+ # Remap
62
+ # @param value [float]
63
+ # @param inputStart [float]
64
+ # @param inputEnd [float]
65
+ # @param outputStart [float]
66
+ # @param outputEnd [float]
67
+ # @return [float]
68
+ [:Remap, :Remap, [:float, :float, :float, :float, :float], :float],
69
+
70
+ # Wrap
71
+ # @param value [float]
72
+ # @param min [float]
73
+ # @param max [float]
74
+ # @return [float]
75
+ [:Wrap, :Wrap, [:float, :float, :float], :float],
76
+
77
+ # FloatEquals
78
+ # @param x [float]
79
+ # @param y [float]
80
+ # @return [int]
81
+ [:FloatEquals, :FloatEquals, [:float, :float], :int],
82
+
83
+ # Vector2Zero
84
+ # @return [Vector2]
85
+ [:Vector2Zero, :Vector2Zero, [], Vector2.by_value],
86
+
87
+ # Vector2One
88
+ # @return [Vector2]
89
+ [:Vector2One, :Vector2One, [], Vector2.by_value],
90
+
91
+ # Vector2Add
92
+ # @param v1 [Vector2]
93
+ # @param v2 [Vector2]
94
+ # @return [Vector2]
95
+ [:Vector2Add, :Vector2Add, [Vector2.by_value, Vector2.by_value], Vector2.by_value],
96
+
97
+ # Vector2AddValue
98
+ # @param v [Vector2]
99
+ # @param add [float]
100
+ # @return [Vector2]
101
+ [:Vector2AddValue, :Vector2AddValue, [Vector2.by_value, :float], Vector2.by_value],
102
+
103
+ # Vector2Subtract
104
+ # @param v1 [Vector2]
105
+ # @param v2 [Vector2]
106
+ # @return [Vector2]
107
+ [:Vector2Subtract, :Vector2Subtract, [Vector2.by_value, Vector2.by_value], Vector2.by_value],
108
+
109
+ # Vector2SubtractValue
110
+ # @param v [Vector2]
111
+ # @param sub [float]
112
+ # @return [Vector2]
113
+ [:Vector2SubtractValue, :Vector2SubtractValue, [Vector2.by_value, :float], Vector2.by_value],
114
+
115
+ # Vector2Length
116
+ # @param v [Vector2]
117
+ # @return [float]
118
+ [:Vector2Length, :Vector2Length, [Vector2.by_value], :float],
119
+
120
+ # Vector2LengthSqr
121
+ # @param v [Vector2]
122
+ # @return [float]
123
+ [:Vector2LengthSqr, :Vector2LengthSqr, [Vector2.by_value], :float],
124
+
125
+ # Vector2DotProduct
126
+ # @param v1 [Vector2]
127
+ # @param v2 [Vector2]
128
+ # @return [float]
129
+ [:Vector2DotProduct, :Vector2DotProduct, [Vector2.by_value, Vector2.by_value], :float],
130
+
131
+ # Vector2Distance
132
+ # @param v1 [Vector2]
133
+ # @param v2 [Vector2]
134
+ # @return [float]
135
+ [:Vector2Distance, :Vector2Distance, [Vector2.by_value, Vector2.by_value], :float],
136
+
137
+ # Vector2DistanceSqr
138
+ # @param v1 [Vector2]
139
+ # @param v2 [Vector2]
140
+ # @return [float]
141
+ [:Vector2DistanceSqr, :Vector2DistanceSqr, [Vector2.by_value, Vector2.by_value], :float],
142
+
143
+ # Vector2Angle
144
+ # @param v1 [Vector2]
145
+ # @param v2 [Vector2]
146
+ # @return [float]
147
+ [:Vector2Angle, :Vector2Angle, [Vector2.by_value, Vector2.by_value], :float],
148
+
149
+ # Vector2Scale
150
+ # @param v [Vector2]
151
+ # @param scale [float]
152
+ # @return [Vector2]
153
+ [:Vector2Scale, :Vector2Scale, [Vector2.by_value, :float], Vector2.by_value],
154
+
155
+ # Vector2Multiply
156
+ # @param v1 [Vector2]
157
+ # @param v2 [Vector2]
158
+ # @return [Vector2]
159
+ [:Vector2Multiply, :Vector2Multiply, [Vector2.by_value, Vector2.by_value], Vector2.by_value],
160
+
161
+ # Vector2Negate
162
+ # @param v [Vector2]
163
+ # @return [Vector2]
164
+ [:Vector2Negate, :Vector2Negate, [Vector2.by_value], Vector2.by_value],
165
+
166
+ # Vector2Divide
167
+ # @param v1 [Vector2]
168
+ # @param v2 [Vector2]
169
+ # @return [Vector2]
170
+ [:Vector2Divide, :Vector2Divide, [Vector2.by_value, Vector2.by_value], Vector2.by_value],
171
+
172
+ # Vector2Normalize
173
+ # @param v [Vector2]
174
+ # @return [Vector2]
175
+ [:Vector2Normalize, :Vector2Normalize, [Vector2.by_value], Vector2.by_value],
176
+
177
+ # Vector2Transform
178
+ # @param v [Vector2]
179
+ # @param mat [Matrix]
180
+ # @return [Vector2]
181
+ [:Vector2Transform, :Vector2Transform, [Vector2.by_value, Matrix.by_value], Vector2.by_value],
182
+
183
+ # Vector2Lerp
184
+ # @param v1 [Vector2]
185
+ # @param v2 [Vector2]
186
+ # @param amount [float]
187
+ # @return [Vector2]
188
+ [:Vector2Lerp, :Vector2Lerp, [Vector2.by_value, Vector2.by_value, :float], Vector2.by_value],
189
+
190
+ # Vector2Reflect
191
+ # @param v [Vector2]
192
+ # @param normal [Vector2]
193
+ # @return [Vector2]
194
+ [:Vector2Reflect, :Vector2Reflect, [Vector2.by_value, Vector2.by_value], Vector2.by_value],
195
+
196
+ # Vector2Rotate
197
+ # @param v [Vector2]
198
+ # @param angle [float]
199
+ # @return [Vector2]
200
+ [:Vector2Rotate, :Vector2Rotate, [Vector2.by_value, :float], Vector2.by_value],
201
+
202
+ # Vector2MoveTowards
203
+ # @param v [Vector2]
204
+ # @param target [Vector2]
205
+ # @param maxDistance [float]
206
+ # @return [Vector2]
207
+ [:Vector2MoveTowards, :Vector2MoveTowards, [Vector2.by_value, Vector2.by_value, :float], Vector2.by_value],
208
+
209
+ # Vector2Invert
210
+ # @param v [Vector2]
211
+ # @return [Vector2]
212
+ [:Vector2Invert, :Vector2Invert, [Vector2.by_value], Vector2.by_value],
213
+
214
+ # Vector2Clamp
215
+ # @param v [Vector2]
216
+ # @param min [Vector2]
217
+ # @param max [Vector2]
218
+ # @return [Vector2]
219
+ [:Vector2Clamp, :Vector2Clamp, [Vector2.by_value, Vector2.by_value, Vector2.by_value], Vector2.by_value],
220
+
221
+ # Vector2ClampValue
222
+ # @param v [Vector2]
223
+ # @param min [float]
224
+ # @param max [float]
225
+ # @return [Vector2]
226
+ [:Vector2ClampValue, :Vector2ClampValue, [Vector2.by_value, :float, :float], Vector2.by_value],
227
+
228
+ # Vector2Equals
229
+ # @param p [Vector2]
230
+ # @param q [Vector2]
231
+ # @return [int]
232
+ [:Vector2Equals, :Vector2Equals, [Vector2.by_value, Vector2.by_value], :int],
233
+
234
+ # Vector3Zero
235
+ # @return [Vector3]
236
+ [:Vector3Zero, :Vector3Zero, [], Vector3.by_value],
237
+
238
+ # Vector3One
239
+ # @return [Vector3]
240
+ [:Vector3One, :Vector3One, [], Vector3.by_value],
241
+
242
+ # Vector3Add
243
+ # @param v1 [Vector3]
244
+ # @param v2 [Vector3]
245
+ # @return [Vector3]
246
+ [:Vector3Add, :Vector3Add, [Vector3.by_value, Vector3.by_value], Vector3.by_value],
247
+
248
+ # Vector3AddValue
249
+ # @param v [Vector3]
250
+ # @param add [float]
251
+ # @return [Vector3]
252
+ [:Vector3AddValue, :Vector3AddValue, [Vector3.by_value, :float], Vector3.by_value],
253
+
254
+ # Vector3Subtract
255
+ # @param v1 [Vector3]
256
+ # @param v2 [Vector3]
257
+ # @return [Vector3]
258
+ [:Vector3Subtract, :Vector3Subtract, [Vector3.by_value, Vector3.by_value], Vector3.by_value],
259
+
260
+ # Vector3SubtractValue
261
+ # @param v [Vector3]
262
+ # @param sub [float]
263
+ # @return [Vector3]
264
+ [:Vector3SubtractValue, :Vector3SubtractValue, [Vector3.by_value, :float], Vector3.by_value],
265
+
266
+ # Vector3Scale
267
+ # @param v [Vector3]
268
+ # @param scalar [float]
269
+ # @return [Vector3]
270
+ [:Vector3Scale, :Vector3Scale, [Vector3.by_value, :float], Vector3.by_value],
271
+
272
+ # Vector3Multiply
273
+ # @param v1 [Vector3]
274
+ # @param v2 [Vector3]
275
+ # @return [Vector3]
276
+ [:Vector3Multiply, :Vector3Multiply, [Vector3.by_value, Vector3.by_value], Vector3.by_value],
277
+
278
+ # Vector3CrossProduct
279
+ # @param v1 [Vector3]
280
+ # @param v2 [Vector3]
281
+ # @return [Vector3]
282
+ [:Vector3CrossProduct, :Vector3CrossProduct, [Vector3.by_value, Vector3.by_value], Vector3.by_value],
283
+
284
+ # Vector3Perpendicular
285
+ # @param v [Vector3]
286
+ # @return [Vector3]
287
+ [:Vector3Perpendicular, :Vector3Perpendicular, [Vector3.by_value], Vector3.by_value],
288
+
289
+ # Vector3Length
290
+ # @param v [const Vector3]
291
+ # @return [float]
292
+ [:Vector3Length, :Vector3Length, [Vector3.by_value], :float],
293
+
294
+ # Vector3LengthSqr
295
+ # @param v [const Vector3]
296
+ # @return [float]
297
+ [:Vector3LengthSqr, :Vector3LengthSqr, [Vector3.by_value], :float],
298
+
299
+ # Vector3DotProduct
300
+ # @param v1 [Vector3]
301
+ # @param v2 [Vector3]
302
+ # @return [float]
303
+ [:Vector3DotProduct, :Vector3DotProduct, [Vector3.by_value, Vector3.by_value], :float],
304
+
305
+ # Vector3Distance
306
+ # @param v1 [Vector3]
307
+ # @param v2 [Vector3]
308
+ # @return [float]
309
+ [:Vector3Distance, :Vector3Distance, [Vector3.by_value, Vector3.by_value], :float],
310
+
311
+ # Vector3DistanceSqr
312
+ # @param v1 [Vector3]
313
+ # @param v2 [Vector3]
314
+ # @return [float]
315
+ [:Vector3DistanceSqr, :Vector3DistanceSqr, [Vector3.by_value, Vector3.by_value], :float],
316
+
317
+ # Vector3Angle
318
+ # @param v1 [Vector3]
319
+ # @param v2 [Vector3]
320
+ # @return [float]
321
+ [:Vector3Angle, :Vector3Angle, [Vector3.by_value, Vector3.by_value], :float],
322
+
323
+ # Vector3Negate
324
+ # @param v [Vector3]
325
+ # @return [Vector3]
326
+ [:Vector3Negate, :Vector3Negate, [Vector3.by_value], Vector3.by_value],
327
+
328
+ # Vector3Divide
329
+ # @param v1 [Vector3]
330
+ # @param v2 [Vector3]
331
+ # @return [Vector3]
332
+ [:Vector3Divide, :Vector3Divide, [Vector3.by_value, Vector3.by_value], Vector3.by_value],
333
+
334
+ # Vector3Normalize
335
+ # @param v [Vector3]
336
+ # @return [Vector3]
337
+ [:Vector3Normalize, :Vector3Normalize, [Vector3.by_value], Vector3.by_value],
338
+
339
+ # Vector3OrthoNormalize
340
+ # @param v1 [Vector3 *]
341
+ # @param v2 [Vector3 *]
342
+ # @return [void]
343
+ [:Vector3OrthoNormalize, :Vector3OrthoNormalize, [:pointer, :pointer], :void],
344
+
345
+ # Vector3Transform
346
+ # @param v [Vector3]
347
+ # @param mat [Matrix]
348
+ # @return [Vector3]
349
+ [:Vector3Transform, :Vector3Transform, [Vector3.by_value, Matrix.by_value], Vector3.by_value],
350
+
351
+ # Vector3RotateByQuaternion
352
+ # @param v [Vector3]
353
+ # @param q [Quaternion]
354
+ # @return [Vector3]
355
+ [:Vector3RotateByQuaternion, :Vector3RotateByQuaternion, [Vector3.by_value, Quaternion.by_value], Vector3.by_value],
356
+
357
+ # Vector3RotateByAxisAngle
358
+ # @param v [Vector3]
359
+ # @param axis [Vector3]
360
+ # @param angle [float]
361
+ # @return [Vector3]
362
+ [:Vector3RotateByAxisAngle, :Vector3RotateByAxisAngle, [Vector3.by_value, Vector3.by_value, :float], Vector3.by_value],
363
+
364
+ # Vector3Lerp
365
+ # @param v1 [Vector3]
366
+ # @param v2 [Vector3]
367
+ # @param amount [float]
368
+ # @return [Vector3]
369
+ [:Vector3Lerp, :Vector3Lerp, [Vector3.by_value, Vector3.by_value, :float], Vector3.by_value],
370
+
371
+ # Vector3Reflect
372
+ # @param v [Vector3]
373
+ # @param normal [Vector3]
374
+ # @return [Vector3]
375
+ [:Vector3Reflect, :Vector3Reflect, [Vector3.by_value, Vector3.by_value], Vector3.by_value],
376
+
377
+ # Vector3Min
378
+ # @param v1 [Vector3]
379
+ # @param v2 [Vector3]
380
+ # @return [Vector3]
381
+ [:Vector3Min, :Vector3Min, [Vector3.by_value, Vector3.by_value], Vector3.by_value],
382
+
383
+ # Vector3Max
384
+ # @param v1 [Vector3]
385
+ # @param v2 [Vector3]
386
+ # @return [Vector3]
387
+ [:Vector3Max, :Vector3Max, [Vector3.by_value, Vector3.by_value], Vector3.by_value],
388
+
389
+ # Vector3Barycenter
390
+ # @param p [Vector3]
391
+ # @param a [Vector3]
392
+ # @param b [Vector3]
393
+ # @param c [Vector3]
394
+ # @return [Vector3]
395
+ [:Vector3Barycenter, :Vector3Barycenter, [Vector3.by_value, Vector3.by_value, Vector3.by_value, Vector3.by_value], Vector3.by_value],
396
+
397
+ # Vector3Unproject
398
+ # @param source [Vector3]
399
+ # @param projection [Matrix]
400
+ # @param view [Matrix]
401
+ # @return [Vector3]
402
+ [:Vector3Unproject, :Vector3Unproject, [Vector3.by_value, Matrix.by_value, Matrix.by_value], Vector3.by_value],
403
+
404
+ # Vector3ToFloatV
405
+ # @param v [Vector3]
406
+ # @return [float3]
407
+ [:Vector3ToFloatV, :Vector3ToFloatV, [Vector3.by_value], Float3.by_value],
408
+
409
+ # Vector3Invert
410
+ # @param v [Vector3]
411
+ # @return [Vector3]
412
+ [:Vector3Invert, :Vector3Invert, [Vector3.by_value], Vector3.by_value],
413
+
414
+ # Vector3Clamp
415
+ # @param v [Vector3]
416
+ # @param min [Vector3]
417
+ # @param max [Vector3]
418
+ # @return [Vector3]
419
+ [:Vector3Clamp, :Vector3Clamp, [Vector3.by_value, Vector3.by_value, Vector3.by_value], Vector3.by_value],
420
+
421
+ # Vector3ClampValue
422
+ # @param v [Vector3]
423
+ # @param min [float]
424
+ # @param max [float]
425
+ # @return [Vector3]
426
+ [:Vector3ClampValue, :Vector3ClampValue, [Vector3.by_value, :float, :float], Vector3.by_value],
427
+
428
+ # Vector3Equals
429
+ # @param p [Vector3]
430
+ # @param q [Vector3]
431
+ # @return [int]
432
+ [:Vector3Equals, :Vector3Equals, [Vector3.by_value, Vector3.by_value], :int],
433
+
434
+ # Vector3Refract
435
+ # @param v [Vector3]
436
+ # @param n [Vector3]
437
+ # @param r [float]
438
+ # @return [Vector3]
439
+ [:Vector3Refract, :Vector3Refract, [Vector3.by_value, Vector3.by_value, :float], Vector3.by_value],
440
+
441
+ # MatrixDeterminant
442
+ # @param mat [Matrix]
443
+ # @return [float]
444
+ [:MatrixDeterminant, :MatrixDeterminant, [Matrix.by_value], :float],
445
+
446
+ # MatrixTrace
447
+ # @param mat [Matrix]
448
+ # @return [float]
449
+ [:MatrixTrace, :MatrixTrace, [Matrix.by_value], :float],
450
+
451
+ # MatrixTranspose
452
+ # @param mat [Matrix]
453
+ # @return [Matrix]
454
+ [:MatrixTranspose, :MatrixTranspose, [Matrix.by_value], Matrix.by_value],
455
+
456
+ # MatrixInvert
457
+ # @param mat [Matrix]
458
+ # @return [Matrix]
459
+ [:MatrixInvert, :MatrixInvert, [Matrix.by_value], Matrix.by_value],
460
+
461
+ # MatrixIdentity
462
+ # @return [Matrix]
463
+ [:MatrixIdentity, :MatrixIdentity, [], Matrix.by_value],
464
+
465
+ # MatrixAdd
466
+ # @param left [Matrix]
467
+ # @param right [Matrix]
468
+ # @return [Matrix]
469
+ [:MatrixAdd, :MatrixAdd, [Matrix.by_value, Matrix.by_value], Matrix.by_value],
470
+
471
+ # MatrixSubtract
472
+ # @param left [Matrix]
473
+ # @param right [Matrix]
474
+ # @return [Matrix]
475
+ [:MatrixSubtract, :MatrixSubtract, [Matrix.by_value, Matrix.by_value], Matrix.by_value],
476
+
477
+ # MatrixMultiply
478
+ # @param left [Matrix]
479
+ # @param right [Matrix]
480
+ # @return [Matrix]
481
+ [:MatrixMultiply, :MatrixMultiply, [Matrix.by_value, Matrix.by_value], Matrix.by_value],
482
+
483
+ # MatrixTranslate
484
+ # @param x [float]
485
+ # @param y [float]
486
+ # @param z [float]
487
+ # @return [Matrix]
488
+ [:MatrixTranslate, :MatrixTranslate, [:float, :float, :float], Matrix.by_value],
489
+
490
+ # MatrixRotate
491
+ # @param axis [Vector3]
492
+ # @param angle [float]
493
+ # @return [Matrix]
494
+ [:MatrixRotate, :MatrixRotate, [Vector3.by_value, :float], Matrix.by_value],
495
+
496
+ # MatrixRotateX
497
+ # @param angle [float]
498
+ # @return [Matrix]
499
+ [:MatrixRotateX, :MatrixRotateX, [:float], Matrix.by_value],
500
+
501
+ # MatrixRotateY
502
+ # @param angle [float]
503
+ # @return [Matrix]
504
+ [:MatrixRotateY, :MatrixRotateY, [:float], Matrix.by_value],
505
+
506
+ # MatrixRotateZ
507
+ # @param angle [float]
508
+ # @return [Matrix]
509
+ [:MatrixRotateZ, :MatrixRotateZ, [:float], Matrix.by_value],
510
+
511
+ # MatrixRotateXYZ
512
+ # @param angle [Vector3]
513
+ # @return [Matrix]
514
+ [:MatrixRotateXYZ, :MatrixRotateXYZ, [Vector3.by_value], Matrix.by_value],
515
+
516
+ # MatrixRotateZYX
517
+ # @param angle [Vector3]
518
+ # @return [Matrix]
519
+ [:MatrixRotateZYX, :MatrixRotateZYX, [Vector3.by_value], Matrix.by_value],
520
+
521
+ # MatrixScale
522
+ # @param x [float]
523
+ # @param y [float]
524
+ # @param z [float]
525
+ # @return [Matrix]
526
+ [:MatrixScale, :MatrixScale, [:float, :float, :float], Matrix.by_value],
527
+
528
+ # MatrixFrustum
529
+ # @param left [double]
530
+ # @param right [double]
531
+ # @param bottom [double]
532
+ # @param top [double]
533
+ # @param near [double]
534
+ # @param far [double]
535
+ # @return [Matrix]
536
+ [:MatrixFrustum, :MatrixFrustum, [:double, :double, :double, :double, :double, :double], Matrix.by_value],
537
+
538
+ # MatrixPerspective
539
+ # @param fovy [double]
540
+ # @param aspect [double]
541
+ # @param near [double]
542
+ # @param far [double]
543
+ # @return [Matrix]
544
+ [:MatrixPerspective, :MatrixPerspective, [:double, :double, :double, :double], Matrix.by_value],
545
+
546
+ # MatrixOrtho
547
+ # @param left [double]
548
+ # @param right [double]
549
+ # @param bottom [double]
550
+ # @param top [double]
551
+ # @param near [double]
552
+ # @param far [double]
553
+ # @return [Matrix]
554
+ [:MatrixOrtho, :MatrixOrtho, [:double, :double, :double, :double, :double, :double], Matrix.by_value],
555
+
556
+ # MatrixLookAt
557
+ # @param eye [Vector3]
558
+ # @param target [Vector3]
559
+ # @param up [Vector3]
560
+ # @return [Matrix]
561
+ [:MatrixLookAt, :MatrixLookAt, [Vector3.by_value, Vector3.by_value, Vector3.by_value], Matrix.by_value],
562
+
563
+ # MatrixToFloatV
564
+ # @param mat [Matrix]
565
+ # @return [float16]
566
+ [:MatrixToFloatV, :MatrixToFloatV, [Matrix.by_value], Float16.by_value],
567
+
568
+ # QuaternionAdd
569
+ # @param q1 [Quaternion]
570
+ # @param q2 [Quaternion]
571
+ # @return [Quaternion]
572
+ [:QuaternionAdd, :QuaternionAdd, [Quaternion.by_value, Quaternion.by_value], Quaternion.by_value],
573
+
574
+ # QuaternionAddValue
575
+ # @param q [Quaternion]
576
+ # @param add [float]
577
+ # @return [Quaternion]
578
+ [:QuaternionAddValue, :QuaternionAddValue, [Quaternion.by_value, :float], Quaternion.by_value],
579
+
580
+ # QuaternionSubtract
581
+ # @param q1 [Quaternion]
582
+ # @param q2 [Quaternion]
583
+ # @return [Quaternion]
584
+ [:QuaternionSubtract, :QuaternionSubtract, [Quaternion.by_value, Quaternion.by_value], Quaternion.by_value],
585
+
586
+ # QuaternionSubtractValue
587
+ # @param q [Quaternion]
588
+ # @param sub [float]
589
+ # @return [Quaternion]
590
+ [:QuaternionSubtractValue, :QuaternionSubtractValue, [Quaternion.by_value, :float], Quaternion.by_value],
591
+
592
+ # QuaternionIdentity
593
+ # @return [Quaternion]
594
+ [:QuaternionIdentity, :QuaternionIdentity, [], Quaternion.by_value],
595
+
596
+ # QuaternionLength
597
+ # @param q [Quaternion]
598
+ # @return [float]
599
+ [:QuaternionLength, :QuaternionLength, [Quaternion.by_value], :float],
600
+
601
+ # QuaternionNormalize
602
+ # @param q [Quaternion]
603
+ # @return [Quaternion]
604
+ [:QuaternionNormalize, :QuaternionNormalize, [Quaternion.by_value], Quaternion.by_value],
605
+
606
+ # QuaternionInvert
607
+ # @param q [Quaternion]
608
+ # @return [Quaternion]
609
+ [:QuaternionInvert, :QuaternionInvert, [Quaternion.by_value], Quaternion.by_value],
610
+
611
+ # QuaternionMultiply
612
+ # @param q1 [Quaternion]
613
+ # @param q2 [Quaternion]
614
+ # @return [Quaternion]
615
+ [:QuaternionMultiply, :QuaternionMultiply, [Quaternion.by_value, Quaternion.by_value], Quaternion.by_value],
616
+
617
+ # QuaternionScale
618
+ # @param q [Quaternion]
619
+ # @param mul [float]
620
+ # @return [Quaternion]
621
+ [:QuaternionScale, :QuaternionScale, [Quaternion.by_value, :float], Quaternion.by_value],
622
+
623
+ # QuaternionDivide
624
+ # @param q1 [Quaternion]
625
+ # @param q2 [Quaternion]
626
+ # @return [Quaternion]
627
+ [:QuaternionDivide, :QuaternionDivide, [Quaternion.by_value, Quaternion.by_value], Quaternion.by_value],
628
+
629
+ # QuaternionLerp
630
+ # @param q1 [Quaternion]
631
+ # @param q2 [Quaternion]
632
+ # @param amount [float]
633
+ # @return [Quaternion]
634
+ [:QuaternionLerp, :QuaternionLerp, [Quaternion.by_value, Quaternion.by_value, :float], Quaternion.by_value],
635
+
636
+ # QuaternionNlerp
637
+ # @param q1 [Quaternion]
638
+ # @param q2 [Quaternion]
639
+ # @param amount [float]
640
+ # @return [Quaternion]
641
+ [:QuaternionNlerp, :QuaternionNlerp, [Quaternion.by_value, Quaternion.by_value, :float], Quaternion.by_value],
642
+
643
+ # QuaternionSlerp
644
+ # @param q1 [Quaternion]
645
+ # @param q2 [Quaternion]
646
+ # @param amount [float]
647
+ # @return [Quaternion]
648
+ [:QuaternionSlerp, :QuaternionSlerp, [Quaternion.by_value, Quaternion.by_value, :float], Quaternion.by_value],
649
+
650
+ # QuaternionFromVector3ToVector3
651
+ # @param from [Vector3]
652
+ # @param to [Vector3]
653
+ # @return [Quaternion]
654
+ [:QuaternionFromVector3ToVector3, :QuaternionFromVector3ToVector3, [Vector3.by_value, Vector3.by_value], Quaternion.by_value],
655
+
656
+ # QuaternionFromMatrix
657
+ # @param mat [Matrix]
658
+ # @return [Quaternion]
659
+ [:QuaternionFromMatrix, :QuaternionFromMatrix, [Matrix.by_value], Quaternion.by_value],
660
+
661
+ # QuaternionToMatrix
662
+ # @param q [Quaternion]
663
+ # @return [Matrix]
664
+ [:QuaternionToMatrix, :QuaternionToMatrix, [Quaternion.by_value], Matrix.by_value],
665
+
666
+ # QuaternionFromAxisAngle
667
+ # @param axis [Vector3]
668
+ # @param angle [float]
669
+ # @return [Quaternion]
670
+ [:QuaternionFromAxisAngle, :QuaternionFromAxisAngle, [Vector3.by_value, :float], Quaternion.by_value],
671
+
672
+ # QuaternionToAxisAngle
673
+ # @param q [Quaternion]
674
+ # @param outAxis [Vector3 *]
675
+ # @param outAngle [float *]
676
+ # @return [void]
677
+ [:QuaternionToAxisAngle, :QuaternionToAxisAngle, [Quaternion.by_value, :pointer, :pointer], :void],
678
+
679
+ # QuaternionFromEuler
680
+ # @param pitch [float]
681
+ # @param yaw [float]
682
+ # @param roll [float]
683
+ # @return [Quaternion]
684
+ [:QuaternionFromEuler, :QuaternionFromEuler, [:float, :float, :float], Quaternion.by_value],
685
+
686
+ # QuaternionToEuler
687
+ # @param q [Quaternion]
688
+ # @return [Vector3]
689
+ [:QuaternionToEuler, :QuaternionToEuler, [Quaternion.by_value], Vector3.by_value],
690
+
691
+ # QuaternionTransform
692
+ # @param q [Quaternion]
693
+ # @param mat [Matrix]
694
+ # @return [Quaternion]
695
+ [:QuaternionTransform, :QuaternionTransform, [Quaternion.by_value, Matrix.by_value], Quaternion.by_value],
696
+
697
+ # QuaternionEquals
698
+ # @param p [Quaternion]
699
+ # @param q [Quaternion]
700
+ # @return [int]
701
+ [:QuaternionEquals, :QuaternionEquals, [Quaternion.by_value, Quaternion.by_value], :int],
702
+ ]
703
+ entries.each do |entry|
704
+ attach_function entry[0], entry[1], entry[2], entry[3]
705
+ rescue FFI::NotFoundError => e
706
+ warn "[Warning] Failed to import #{entry[0]} (#{e})."
707
+ end
708
+ end
709
+ end