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