raylib-bindings 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
data/lib/raymath.rb CHANGED
@@ -1,381 +1,382 @@
1
- # Yet another raylib wrapper for Ruby
2
- #
3
- # * https://github.com/vaiorabbit/raylib-bindings
4
- #
5
- # [NOTICE] This is an automatically generated file.
6
-
7
- require 'ffi'
8
-
9
- module Raylib
10
- extend FFI::Library
11
- # Define/Macro
12
-
13
-
14
- # Enum
15
-
16
-
17
- # Typedef
18
-
19
-
20
- # Struct
21
-
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
- symbols = [
39
- :Clamp,
40
- :Lerp,
41
- :Normalize,
42
- :Remap,
43
- :FloatEquals,
44
- :Vector2Zero,
45
- :Vector2One,
46
- :Vector2Add,
47
- :Vector2AddValue,
48
- :Vector2Subtract,
49
- :Vector2SubtractValue,
50
- :Vector2Length,
51
- :Vector2LengthSqr,
52
- :Vector2DotProduct,
53
- :Vector2Distance,
54
- :Vector2DistanceSqr,
55
- :Vector2Angle,
56
- :Vector2Scale,
57
- :Vector2Multiply,
58
- :Vector2Negate,
59
- :Vector2Divide,
60
- :Vector2Normalize,
61
- :Vector2Transform,
62
- :Vector2Lerp,
63
- :Vector2Reflect,
64
- :Vector2Rotate,
65
- :Vector2MoveTowards,
66
- :Vector2Invert,
67
- :Vector2Clamp,
68
- :Vector2ClampValue,
69
- :Vector2Equals,
70
- :Vector3Zero,
71
- :Vector3One,
72
- :Vector3Add,
73
- :Vector3AddValue,
74
- :Vector3Subtract,
75
- :Vector3SubtractValue,
76
- :Vector3Scale,
77
- :Vector3Multiply,
78
- :Vector3CrossProduct,
79
- :Vector3Perpendicular,
80
- :Vector3Length,
81
- :Vector3LengthSqr,
82
- :Vector3DotProduct,
83
- :Vector3Distance,
84
- :Vector3DistanceSqr,
85
- :Vector3Angle,
86
- :Vector3Negate,
87
- :Vector3Divide,
88
- :Vector3Normalize,
89
- :Vector3OrthoNormalize,
90
- :Vector3Transform,
91
- :Vector3RotateByQuaternion,
92
- :Vector3Lerp,
93
- :Vector3Reflect,
94
- :Vector3Min,
95
- :Vector3Max,
96
- :Vector3Barycenter,
97
- :Vector3Unproject,
98
- :Vector3ToFloatV,
99
- :Vector3Invert,
100
- :Vector3Clamp,
101
- :Vector3ClampValue,
102
- :Vector3Equals,
103
- :Vector3Refract,
104
- :MatrixDeterminant,
105
- :MatrixTrace,
106
- :MatrixTranspose,
107
- :MatrixInvert,
108
- :MatrixIdentity,
109
- :MatrixAdd,
110
- :MatrixSubtract,
111
- :MatrixMultiply,
112
- :MatrixTranslate,
113
- :MatrixRotate,
114
- :MatrixRotateX,
115
- :MatrixRotateY,
116
- :MatrixRotateZ,
117
- :MatrixRotateXYZ,
118
- :MatrixRotateZYX,
119
- :MatrixScale,
120
- :MatrixFrustum,
121
- :MatrixPerspective,
122
- :MatrixOrtho,
123
- :MatrixLookAt,
124
- :MatrixToFloatV,
125
- :QuaternionAdd,
126
- :QuaternionAddValue,
127
- :QuaternionSubtract,
128
- :QuaternionSubtractValue,
129
- :QuaternionIdentity,
130
- :QuaternionLength,
131
- :QuaternionNormalize,
132
- :QuaternionInvert,
133
- :QuaternionMultiply,
134
- :QuaternionScale,
135
- :QuaternionDivide,
136
- :QuaternionLerp,
137
- :QuaternionNlerp,
138
- :QuaternionSlerp,
139
- :QuaternionFromVector3ToVector3,
140
- :QuaternionFromMatrix,
141
- :QuaternionToMatrix,
142
- :QuaternionFromAxisAngle,
143
- :QuaternionToAxisAngle,
144
- :QuaternionFromEuler,
145
- :QuaternionToEuler,
146
- :QuaternionTransform,
147
- :QuaternionEquals,
148
- ]
149
- args = {
150
- :Clamp => [:float, :float, :float],
151
- :Lerp => [:float, :float, :float],
152
- :Normalize => [:float, :float, :float],
153
- :Remap => [:float, :float, :float, :float, :float],
154
- :FloatEquals => [:float, :float],
155
- :Vector2Zero => [],
156
- :Vector2One => [],
157
- :Vector2Add => [Vector2.by_value, Vector2.by_value],
158
- :Vector2AddValue => [Vector2.by_value, :float],
159
- :Vector2Subtract => [Vector2.by_value, Vector2.by_value],
160
- :Vector2SubtractValue => [Vector2.by_value, :float],
161
- :Vector2Length => [Vector2.by_value],
162
- :Vector2LengthSqr => [Vector2.by_value],
163
- :Vector2DotProduct => [Vector2.by_value, Vector2.by_value],
164
- :Vector2Distance => [Vector2.by_value, Vector2.by_value],
165
- :Vector2DistanceSqr => [Vector2.by_value, Vector2.by_value],
166
- :Vector2Angle => [Vector2.by_value, Vector2.by_value],
167
- :Vector2Scale => [Vector2.by_value, :float],
168
- :Vector2Multiply => [Vector2.by_value, Vector2.by_value],
169
- :Vector2Negate => [Vector2.by_value],
170
- :Vector2Divide => [Vector2.by_value, Vector2.by_value],
171
- :Vector2Normalize => [Vector2.by_value],
172
- :Vector2Transform => [Vector2.by_value, Matrix.by_value],
173
- :Vector2Lerp => [Vector2.by_value, Vector2.by_value, :float],
174
- :Vector2Reflect => [Vector2.by_value, Vector2.by_value],
175
- :Vector2Rotate => [Vector2.by_value, :float],
176
- :Vector2MoveTowards => [Vector2.by_value, Vector2.by_value, :float],
177
- :Vector2Invert => [Vector2.by_value],
178
- :Vector2Clamp => [Vector2.by_value, Vector2.by_value, Vector2.by_value],
179
- :Vector2ClampValue => [Vector2.by_value, :float, :float],
180
- :Vector2Equals => [Vector2.by_value, Vector2.by_value],
181
- :Vector3Zero => [],
182
- :Vector3One => [],
183
- :Vector3Add => [Vector3.by_value, Vector3.by_value],
184
- :Vector3AddValue => [Vector3.by_value, :float],
185
- :Vector3Subtract => [Vector3.by_value, Vector3.by_value],
186
- :Vector3SubtractValue => [Vector3.by_value, :float],
187
- :Vector3Scale => [Vector3.by_value, :float],
188
- :Vector3Multiply => [Vector3.by_value, Vector3.by_value],
189
- :Vector3CrossProduct => [Vector3.by_value, Vector3.by_value],
190
- :Vector3Perpendicular => [Vector3.by_value],
191
- :Vector3Length => [Vector3.by_value],
192
- :Vector3LengthSqr => [Vector3.by_value],
193
- :Vector3DotProduct => [Vector3.by_value, Vector3.by_value],
194
- :Vector3Distance => [Vector3.by_value, Vector3.by_value],
195
- :Vector3DistanceSqr => [Vector3.by_value, Vector3.by_value],
196
- :Vector3Angle => [Vector3.by_value, Vector3.by_value],
197
- :Vector3Negate => [Vector3.by_value],
198
- :Vector3Divide => [Vector3.by_value, Vector3.by_value],
199
- :Vector3Normalize => [Vector3.by_value],
200
- :Vector3OrthoNormalize => [:pointer, :pointer],
201
- :Vector3Transform => [Vector3.by_value, Matrix.by_value],
202
- :Vector3RotateByQuaternion => [Vector3.by_value, Quaternion.by_value],
203
- :Vector3Lerp => [Vector3.by_value, Vector3.by_value, :float],
204
- :Vector3Reflect => [Vector3.by_value, Vector3.by_value],
205
- :Vector3Min => [Vector3.by_value, Vector3.by_value],
206
- :Vector3Max => [Vector3.by_value, Vector3.by_value],
207
- :Vector3Barycenter => [Vector3.by_value, Vector3.by_value, Vector3.by_value, Vector3.by_value],
208
- :Vector3Unproject => [Vector3.by_value, Matrix.by_value, Matrix.by_value],
209
- :Vector3ToFloatV => [Vector3.by_value],
210
- :Vector3Invert => [Vector3.by_value],
211
- :Vector3Clamp => [Vector3.by_value, Vector3.by_value, Vector3.by_value],
212
- :Vector3ClampValue => [Vector3.by_value, :float, :float],
213
- :Vector3Equals => [Vector3.by_value, Vector3.by_value],
214
- :Vector3Refract => [Vector3.by_value, Vector3.by_value, :float],
215
- :MatrixDeterminant => [Matrix.by_value],
216
- :MatrixTrace => [Matrix.by_value],
217
- :MatrixTranspose => [Matrix.by_value],
218
- :MatrixInvert => [Matrix.by_value],
219
- :MatrixIdentity => [],
220
- :MatrixAdd => [Matrix.by_value, Matrix.by_value],
221
- :MatrixSubtract => [Matrix.by_value, Matrix.by_value],
222
- :MatrixMultiply => [Matrix.by_value, Matrix.by_value],
223
- :MatrixTranslate => [:float, :float, :float],
224
- :MatrixRotate => [Vector3.by_value, :float],
225
- :MatrixRotateX => [:float],
226
- :MatrixRotateY => [:float],
227
- :MatrixRotateZ => [:float],
228
- :MatrixRotateXYZ => [Vector3.by_value],
229
- :MatrixRotateZYX => [Vector3.by_value],
230
- :MatrixScale => [:float, :float, :float],
231
- :MatrixFrustum => [:double, :double, :double, :double, :double, :double],
232
- :MatrixPerspective => [:double, :double, :double, :double],
233
- :MatrixOrtho => [:double, :double, :double, :double, :double, :double],
234
- :MatrixLookAt => [Vector3.by_value, Vector3.by_value, Vector3.by_value],
235
- :MatrixToFloatV => [Matrix.by_value],
236
- :QuaternionAdd => [Quaternion.by_value, Quaternion.by_value],
237
- :QuaternionAddValue => [Quaternion.by_value, :float],
238
- :QuaternionSubtract => [Quaternion.by_value, Quaternion.by_value],
239
- :QuaternionSubtractValue => [Quaternion.by_value, :float],
240
- :QuaternionIdentity => [],
241
- :QuaternionLength => [Quaternion.by_value],
242
- :QuaternionNormalize => [Quaternion.by_value],
243
- :QuaternionInvert => [Quaternion.by_value],
244
- :QuaternionMultiply => [Quaternion.by_value, Quaternion.by_value],
245
- :QuaternionScale => [Quaternion.by_value, :float],
246
- :QuaternionDivide => [Quaternion.by_value, Quaternion.by_value],
247
- :QuaternionLerp => [Quaternion.by_value, Quaternion.by_value, :float],
248
- :QuaternionNlerp => [Quaternion.by_value, Quaternion.by_value, :float],
249
- :QuaternionSlerp => [Quaternion.by_value, Quaternion.by_value, :float],
250
- :QuaternionFromVector3ToVector3 => [Vector3.by_value, Vector3.by_value],
251
- :QuaternionFromMatrix => [Matrix.by_value],
252
- :QuaternionToMatrix => [Quaternion.by_value],
253
- :QuaternionFromAxisAngle => [Vector3.by_value, :float],
254
- :QuaternionToAxisAngle => [Quaternion.by_value, :pointer, :pointer],
255
- :QuaternionFromEuler => [:float, :float, :float],
256
- :QuaternionToEuler => [Quaternion.by_value],
257
- :QuaternionTransform => [Quaternion.by_value, Matrix.by_value],
258
- :QuaternionEquals => [Quaternion.by_value, Quaternion.by_value],
259
- }
260
- retvals = {
261
- :Clamp => :float,
262
- :Lerp => :float,
263
- :Normalize => :float,
264
- :Remap => :float,
265
- :FloatEquals => :int,
266
- :Vector2Zero => Vector2.by_value,
267
- :Vector2One => Vector2.by_value,
268
- :Vector2Add => Vector2.by_value,
269
- :Vector2AddValue => Vector2.by_value,
270
- :Vector2Subtract => Vector2.by_value,
271
- :Vector2SubtractValue => Vector2.by_value,
272
- :Vector2Length => :float,
273
- :Vector2LengthSqr => :float,
274
- :Vector2DotProduct => :float,
275
- :Vector2Distance => :float,
276
- :Vector2DistanceSqr => :float,
277
- :Vector2Angle => :float,
278
- :Vector2Scale => Vector2.by_value,
279
- :Vector2Multiply => Vector2.by_value,
280
- :Vector2Negate => Vector2.by_value,
281
- :Vector2Divide => Vector2.by_value,
282
- :Vector2Normalize => Vector2.by_value,
283
- :Vector2Transform => Vector2.by_value,
284
- :Vector2Lerp => Vector2.by_value,
285
- :Vector2Reflect => Vector2.by_value,
286
- :Vector2Rotate => Vector2.by_value,
287
- :Vector2MoveTowards => Vector2.by_value,
288
- :Vector2Invert => Vector2.by_value,
289
- :Vector2Clamp => Vector2.by_value,
290
- :Vector2ClampValue => Vector2.by_value,
291
- :Vector2Equals => :int,
292
- :Vector3Zero => Vector3.by_value,
293
- :Vector3One => Vector3.by_value,
294
- :Vector3Add => Vector3.by_value,
295
- :Vector3AddValue => Vector3.by_value,
296
- :Vector3Subtract => Vector3.by_value,
297
- :Vector3SubtractValue => Vector3.by_value,
298
- :Vector3Scale => Vector3.by_value,
299
- :Vector3Multiply => Vector3.by_value,
300
- :Vector3CrossProduct => Vector3.by_value,
301
- :Vector3Perpendicular => Vector3.by_value,
302
- :Vector3Length => :float,
303
- :Vector3LengthSqr => :float,
304
- :Vector3DotProduct => :float,
305
- :Vector3Distance => :float,
306
- :Vector3DistanceSqr => :float,
307
- :Vector3Angle => :float,
308
- :Vector3Negate => Vector3.by_value,
309
- :Vector3Divide => Vector3.by_value,
310
- :Vector3Normalize => Vector3.by_value,
311
- :Vector3OrthoNormalize => :void,
312
- :Vector3Transform => Vector3.by_value,
313
- :Vector3RotateByQuaternion => Vector3.by_value,
314
- :Vector3Lerp => Vector3.by_value,
315
- :Vector3Reflect => Vector3.by_value,
316
- :Vector3Min => Vector3.by_value,
317
- :Vector3Max => Vector3.by_value,
318
- :Vector3Barycenter => Vector3.by_value,
319
- :Vector3Unproject => Vector3.by_value,
320
- :Vector3ToFloatV => Float3.by_value,
321
- :Vector3Invert => Vector3.by_value,
322
- :Vector3Clamp => Vector3.by_value,
323
- :Vector3ClampValue => Vector3.by_value,
324
- :Vector3Equals => :int,
325
- :Vector3Refract => Vector3.by_value,
326
- :MatrixDeterminant => :float,
327
- :MatrixTrace => :float,
328
- :MatrixTranspose => Matrix.by_value,
329
- :MatrixInvert => Matrix.by_value,
330
- :MatrixIdentity => Matrix.by_value,
331
- :MatrixAdd => Matrix.by_value,
332
- :MatrixSubtract => Matrix.by_value,
333
- :MatrixMultiply => Matrix.by_value,
334
- :MatrixTranslate => Matrix.by_value,
335
- :MatrixRotate => Matrix.by_value,
336
- :MatrixRotateX => Matrix.by_value,
337
- :MatrixRotateY => Matrix.by_value,
338
- :MatrixRotateZ => Matrix.by_value,
339
- :MatrixRotateXYZ => Matrix.by_value,
340
- :MatrixRotateZYX => Matrix.by_value,
341
- :MatrixScale => Matrix.by_value,
342
- :MatrixFrustum => Matrix.by_value,
343
- :MatrixPerspective => Matrix.by_value,
344
- :MatrixOrtho => Matrix.by_value,
345
- :MatrixLookAt => Matrix.by_value,
346
- :MatrixToFloatV => Float16.by_value,
347
- :QuaternionAdd => Quaternion.by_value,
348
- :QuaternionAddValue => Quaternion.by_value,
349
- :QuaternionSubtract => Quaternion.by_value,
350
- :QuaternionSubtractValue => Quaternion.by_value,
351
- :QuaternionIdentity => Quaternion.by_value,
352
- :QuaternionLength => :float,
353
- :QuaternionNormalize => Quaternion.by_value,
354
- :QuaternionInvert => Quaternion.by_value,
355
- :QuaternionMultiply => Quaternion.by_value,
356
- :QuaternionScale => Quaternion.by_value,
357
- :QuaternionDivide => Quaternion.by_value,
358
- :QuaternionLerp => Quaternion.by_value,
359
- :QuaternionNlerp => Quaternion.by_value,
360
- :QuaternionSlerp => Quaternion.by_value,
361
- :QuaternionFromVector3ToVector3 => Quaternion.by_value,
362
- :QuaternionFromMatrix => Quaternion.by_value,
363
- :QuaternionToMatrix => Matrix.by_value,
364
- :QuaternionFromAxisAngle => Quaternion.by_value,
365
- :QuaternionToAxisAngle => :void,
366
- :QuaternionFromEuler => Quaternion.by_value,
367
- :QuaternionToEuler => Vector3.by_value,
368
- :QuaternionTransform => Quaternion.by_value,
369
- :QuaternionEquals => :int,
370
- }
371
- symbols.each do |sym|
372
- begin
373
- attach_function sym, args[sym], retvals[sym]
374
- rescue FFI::NotFoundError => error
375
- $stderr.puts("[Warning] Failed to import #{sym} (#{error}).")
376
- end
377
- end
378
- end
379
-
380
- end
381
-
1
+ # Yet another raylib wrapper for Ruby
2
+ #
3
+ # * https://github.com/vaiorabbit/raylib-bindings
4
+ #
5
+ # [NOTICE] This is an automatically generated file.
6
+
7
+ require 'ffi'
8
+
9
+ module Raylib
10
+ extend FFI::Library
11
+ # Define/Macro
12
+
13
+ EPSILON = 0.000001
14
+
15
+ # Enum
16
+
17
+
18
+ # Typedef
19
+
20
+
21
+ # Struct
22
+
23
+ class Float3 < FFI::Struct
24
+ layout(
25
+ :v, [:float, 3],
26
+ )
27
+ end
28
+
29
+ class Float16 < FFI::Struct
30
+ layout(
31
+ :v, [:float, 16],
32
+ )
33
+ end
34
+
35
+
36
+ # Function
37
+
38
+ def self.setup_raymath_symbols()
39
+ symbols = [
40
+ :Clamp,
41
+ :Lerp,
42
+ :Normalize,
43
+ :Remap,
44
+ :FloatEquals,
45
+ :Vector2Zero,
46
+ :Vector2One,
47
+ :Vector2Add,
48
+ :Vector2AddValue,
49
+ :Vector2Subtract,
50
+ :Vector2SubtractValue,
51
+ :Vector2Length,
52
+ :Vector2LengthSqr,
53
+ :Vector2DotProduct,
54
+ :Vector2Distance,
55
+ :Vector2DistanceSqr,
56
+ :Vector2Angle,
57
+ :Vector2Scale,
58
+ :Vector2Multiply,
59
+ :Vector2Negate,
60
+ :Vector2Divide,
61
+ :Vector2Normalize,
62
+ :Vector2Transform,
63
+ :Vector2Lerp,
64
+ :Vector2Reflect,
65
+ :Vector2Rotate,
66
+ :Vector2MoveTowards,
67
+ :Vector2Invert,
68
+ :Vector2Clamp,
69
+ :Vector2ClampValue,
70
+ :Vector2Equals,
71
+ :Vector3Zero,
72
+ :Vector3One,
73
+ :Vector3Add,
74
+ :Vector3AddValue,
75
+ :Vector3Subtract,
76
+ :Vector3SubtractValue,
77
+ :Vector3Scale,
78
+ :Vector3Multiply,
79
+ :Vector3CrossProduct,
80
+ :Vector3Perpendicular,
81
+ :Vector3Length,
82
+ :Vector3LengthSqr,
83
+ :Vector3DotProduct,
84
+ :Vector3Distance,
85
+ :Vector3DistanceSqr,
86
+ :Vector3Angle,
87
+ :Vector3Negate,
88
+ :Vector3Divide,
89
+ :Vector3Normalize,
90
+ :Vector3OrthoNormalize,
91
+ :Vector3Transform,
92
+ :Vector3RotateByQuaternion,
93
+ :Vector3Lerp,
94
+ :Vector3Reflect,
95
+ :Vector3Min,
96
+ :Vector3Max,
97
+ :Vector3Barycenter,
98
+ :Vector3Unproject,
99
+ :Vector3ToFloatV,
100
+ :Vector3Invert,
101
+ :Vector3Clamp,
102
+ :Vector3ClampValue,
103
+ :Vector3Equals,
104
+ :Vector3Refract,
105
+ :MatrixDeterminant,
106
+ :MatrixTrace,
107
+ :MatrixTranspose,
108
+ :MatrixInvert,
109
+ :MatrixIdentity,
110
+ :MatrixAdd,
111
+ :MatrixSubtract,
112
+ :MatrixMultiply,
113
+ :MatrixTranslate,
114
+ :MatrixRotate,
115
+ :MatrixRotateX,
116
+ :MatrixRotateY,
117
+ :MatrixRotateZ,
118
+ :MatrixRotateXYZ,
119
+ :MatrixRotateZYX,
120
+ :MatrixScale,
121
+ :MatrixFrustum,
122
+ :MatrixPerspective,
123
+ :MatrixOrtho,
124
+ :MatrixLookAt,
125
+ :MatrixToFloatV,
126
+ :QuaternionAdd,
127
+ :QuaternionAddValue,
128
+ :QuaternionSubtract,
129
+ :QuaternionSubtractValue,
130
+ :QuaternionIdentity,
131
+ :QuaternionLength,
132
+ :QuaternionNormalize,
133
+ :QuaternionInvert,
134
+ :QuaternionMultiply,
135
+ :QuaternionScale,
136
+ :QuaternionDivide,
137
+ :QuaternionLerp,
138
+ :QuaternionNlerp,
139
+ :QuaternionSlerp,
140
+ :QuaternionFromVector3ToVector3,
141
+ :QuaternionFromMatrix,
142
+ :QuaternionToMatrix,
143
+ :QuaternionFromAxisAngle,
144
+ :QuaternionToAxisAngle,
145
+ :QuaternionFromEuler,
146
+ :QuaternionToEuler,
147
+ :QuaternionTransform,
148
+ :QuaternionEquals,
149
+ ]
150
+ args = {
151
+ :Clamp => [:float, :float, :float],
152
+ :Lerp => [:float, :float, :float],
153
+ :Normalize => [:float, :float, :float],
154
+ :Remap => [:float, :float, :float, :float, :float],
155
+ :FloatEquals => [:float, :float],
156
+ :Vector2Zero => [],
157
+ :Vector2One => [],
158
+ :Vector2Add => [Vector2.by_value, Vector2.by_value],
159
+ :Vector2AddValue => [Vector2.by_value, :float],
160
+ :Vector2Subtract => [Vector2.by_value, Vector2.by_value],
161
+ :Vector2SubtractValue => [Vector2.by_value, :float],
162
+ :Vector2Length => [Vector2.by_value],
163
+ :Vector2LengthSqr => [Vector2.by_value],
164
+ :Vector2DotProduct => [Vector2.by_value, Vector2.by_value],
165
+ :Vector2Distance => [Vector2.by_value, Vector2.by_value],
166
+ :Vector2DistanceSqr => [Vector2.by_value, Vector2.by_value],
167
+ :Vector2Angle => [Vector2.by_value, Vector2.by_value],
168
+ :Vector2Scale => [Vector2.by_value, :float],
169
+ :Vector2Multiply => [Vector2.by_value, Vector2.by_value],
170
+ :Vector2Negate => [Vector2.by_value],
171
+ :Vector2Divide => [Vector2.by_value, Vector2.by_value],
172
+ :Vector2Normalize => [Vector2.by_value],
173
+ :Vector2Transform => [Vector2.by_value, Matrix.by_value],
174
+ :Vector2Lerp => [Vector2.by_value, Vector2.by_value, :float],
175
+ :Vector2Reflect => [Vector2.by_value, Vector2.by_value],
176
+ :Vector2Rotate => [Vector2.by_value, :float],
177
+ :Vector2MoveTowards => [Vector2.by_value, Vector2.by_value, :float],
178
+ :Vector2Invert => [Vector2.by_value],
179
+ :Vector2Clamp => [Vector2.by_value, Vector2.by_value, Vector2.by_value],
180
+ :Vector2ClampValue => [Vector2.by_value, :float, :float],
181
+ :Vector2Equals => [Vector2.by_value, Vector2.by_value],
182
+ :Vector3Zero => [],
183
+ :Vector3One => [],
184
+ :Vector3Add => [Vector3.by_value, Vector3.by_value],
185
+ :Vector3AddValue => [Vector3.by_value, :float],
186
+ :Vector3Subtract => [Vector3.by_value, Vector3.by_value],
187
+ :Vector3SubtractValue => [Vector3.by_value, :float],
188
+ :Vector3Scale => [Vector3.by_value, :float],
189
+ :Vector3Multiply => [Vector3.by_value, Vector3.by_value],
190
+ :Vector3CrossProduct => [Vector3.by_value, Vector3.by_value],
191
+ :Vector3Perpendicular => [Vector3.by_value],
192
+ :Vector3Length => [Vector3.by_value],
193
+ :Vector3LengthSqr => [Vector3.by_value],
194
+ :Vector3DotProduct => [Vector3.by_value, Vector3.by_value],
195
+ :Vector3Distance => [Vector3.by_value, Vector3.by_value],
196
+ :Vector3DistanceSqr => [Vector3.by_value, Vector3.by_value],
197
+ :Vector3Angle => [Vector3.by_value, Vector3.by_value],
198
+ :Vector3Negate => [Vector3.by_value],
199
+ :Vector3Divide => [Vector3.by_value, Vector3.by_value],
200
+ :Vector3Normalize => [Vector3.by_value],
201
+ :Vector3OrthoNormalize => [:pointer, :pointer],
202
+ :Vector3Transform => [Vector3.by_value, Matrix.by_value],
203
+ :Vector3RotateByQuaternion => [Vector3.by_value, Quaternion.by_value],
204
+ :Vector3Lerp => [Vector3.by_value, Vector3.by_value, :float],
205
+ :Vector3Reflect => [Vector3.by_value, Vector3.by_value],
206
+ :Vector3Min => [Vector3.by_value, Vector3.by_value],
207
+ :Vector3Max => [Vector3.by_value, Vector3.by_value],
208
+ :Vector3Barycenter => [Vector3.by_value, Vector3.by_value, Vector3.by_value, Vector3.by_value],
209
+ :Vector3Unproject => [Vector3.by_value, Matrix.by_value, Matrix.by_value],
210
+ :Vector3ToFloatV => [Vector3.by_value],
211
+ :Vector3Invert => [Vector3.by_value],
212
+ :Vector3Clamp => [Vector3.by_value, Vector3.by_value, Vector3.by_value],
213
+ :Vector3ClampValue => [Vector3.by_value, :float, :float],
214
+ :Vector3Equals => [Vector3.by_value, Vector3.by_value],
215
+ :Vector3Refract => [Vector3.by_value, Vector3.by_value, :float],
216
+ :MatrixDeterminant => [Matrix.by_value],
217
+ :MatrixTrace => [Matrix.by_value],
218
+ :MatrixTranspose => [Matrix.by_value],
219
+ :MatrixInvert => [Matrix.by_value],
220
+ :MatrixIdentity => [],
221
+ :MatrixAdd => [Matrix.by_value, Matrix.by_value],
222
+ :MatrixSubtract => [Matrix.by_value, Matrix.by_value],
223
+ :MatrixMultiply => [Matrix.by_value, Matrix.by_value],
224
+ :MatrixTranslate => [:float, :float, :float],
225
+ :MatrixRotate => [Vector3.by_value, :float],
226
+ :MatrixRotateX => [:float],
227
+ :MatrixRotateY => [:float],
228
+ :MatrixRotateZ => [:float],
229
+ :MatrixRotateXYZ => [Vector3.by_value],
230
+ :MatrixRotateZYX => [Vector3.by_value],
231
+ :MatrixScale => [:float, :float, :float],
232
+ :MatrixFrustum => [:double, :double, :double, :double, :double, :double],
233
+ :MatrixPerspective => [:double, :double, :double, :double],
234
+ :MatrixOrtho => [:double, :double, :double, :double, :double, :double],
235
+ :MatrixLookAt => [Vector3.by_value, Vector3.by_value, Vector3.by_value],
236
+ :MatrixToFloatV => [Matrix.by_value],
237
+ :QuaternionAdd => [Quaternion.by_value, Quaternion.by_value],
238
+ :QuaternionAddValue => [Quaternion.by_value, :float],
239
+ :QuaternionSubtract => [Quaternion.by_value, Quaternion.by_value],
240
+ :QuaternionSubtractValue => [Quaternion.by_value, :float],
241
+ :QuaternionIdentity => [],
242
+ :QuaternionLength => [Quaternion.by_value],
243
+ :QuaternionNormalize => [Quaternion.by_value],
244
+ :QuaternionInvert => [Quaternion.by_value],
245
+ :QuaternionMultiply => [Quaternion.by_value, Quaternion.by_value],
246
+ :QuaternionScale => [Quaternion.by_value, :float],
247
+ :QuaternionDivide => [Quaternion.by_value, Quaternion.by_value],
248
+ :QuaternionLerp => [Quaternion.by_value, Quaternion.by_value, :float],
249
+ :QuaternionNlerp => [Quaternion.by_value, Quaternion.by_value, :float],
250
+ :QuaternionSlerp => [Quaternion.by_value, Quaternion.by_value, :float],
251
+ :QuaternionFromVector3ToVector3 => [Vector3.by_value, Vector3.by_value],
252
+ :QuaternionFromMatrix => [Matrix.by_value],
253
+ :QuaternionToMatrix => [Quaternion.by_value],
254
+ :QuaternionFromAxisAngle => [Vector3.by_value, :float],
255
+ :QuaternionToAxisAngle => [Quaternion.by_value, :pointer, :pointer],
256
+ :QuaternionFromEuler => [:float, :float, :float],
257
+ :QuaternionToEuler => [Quaternion.by_value],
258
+ :QuaternionTransform => [Quaternion.by_value, Matrix.by_value],
259
+ :QuaternionEquals => [Quaternion.by_value, Quaternion.by_value],
260
+ }
261
+ retvals = {
262
+ :Clamp => :float,
263
+ :Lerp => :float,
264
+ :Normalize => :float,
265
+ :Remap => :float,
266
+ :FloatEquals => :int,
267
+ :Vector2Zero => Vector2.by_value,
268
+ :Vector2One => Vector2.by_value,
269
+ :Vector2Add => Vector2.by_value,
270
+ :Vector2AddValue => Vector2.by_value,
271
+ :Vector2Subtract => Vector2.by_value,
272
+ :Vector2SubtractValue => Vector2.by_value,
273
+ :Vector2Length => :float,
274
+ :Vector2LengthSqr => :float,
275
+ :Vector2DotProduct => :float,
276
+ :Vector2Distance => :float,
277
+ :Vector2DistanceSqr => :float,
278
+ :Vector2Angle => :float,
279
+ :Vector2Scale => Vector2.by_value,
280
+ :Vector2Multiply => Vector2.by_value,
281
+ :Vector2Negate => Vector2.by_value,
282
+ :Vector2Divide => Vector2.by_value,
283
+ :Vector2Normalize => Vector2.by_value,
284
+ :Vector2Transform => Vector2.by_value,
285
+ :Vector2Lerp => Vector2.by_value,
286
+ :Vector2Reflect => Vector2.by_value,
287
+ :Vector2Rotate => Vector2.by_value,
288
+ :Vector2MoveTowards => Vector2.by_value,
289
+ :Vector2Invert => Vector2.by_value,
290
+ :Vector2Clamp => Vector2.by_value,
291
+ :Vector2ClampValue => Vector2.by_value,
292
+ :Vector2Equals => :int,
293
+ :Vector3Zero => Vector3.by_value,
294
+ :Vector3One => Vector3.by_value,
295
+ :Vector3Add => Vector3.by_value,
296
+ :Vector3AddValue => Vector3.by_value,
297
+ :Vector3Subtract => Vector3.by_value,
298
+ :Vector3SubtractValue => Vector3.by_value,
299
+ :Vector3Scale => Vector3.by_value,
300
+ :Vector3Multiply => Vector3.by_value,
301
+ :Vector3CrossProduct => Vector3.by_value,
302
+ :Vector3Perpendicular => Vector3.by_value,
303
+ :Vector3Length => :float,
304
+ :Vector3LengthSqr => :float,
305
+ :Vector3DotProduct => :float,
306
+ :Vector3Distance => :float,
307
+ :Vector3DistanceSqr => :float,
308
+ :Vector3Angle => :float,
309
+ :Vector3Negate => Vector3.by_value,
310
+ :Vector3Divide => Vector3.by_value,
311
+ :Vector3Normalize => Vector3.by_value,
312
+ :Vector3OrthoNormalize => :void,
313
+ :Vector3Transform => Vector3.by_value,
314
+ :Vector3RotateByQuaternion => Vector3.by_value,
315
+ :Vector3Lerp => Vector3.by_value,
316
+ :Vector3Reflect => Vector3.by_value,
317
+ :Vector3Min => Vector3.by_value,
318
+ :Vector3Max => Vector3.by_value,
319
+ :Vector3Barycenter => Vector3.by_value,
320
+ :Vector3Unproject => Vector3.by_value,
321
+ :Vector3ToFloatV => Float3.by_value,
322
+ :Vector3Invert => Vector3.by_value,
323
+ :Vector3Clamp => Vector3.by_value,
324
+ :Vector3ClampValue => Vector3.by_value,
325
+ :Vector3Equals => :int,
326
+ :Vector3Refract => Vector3.by_value,
327
+ :MatrixDeterminant => :float,
328
+ :MatrixTrace => :float,
329
+ :MatrixTranspose => Matrix.by_value,
330
+ :MatrixInvert => Matrix.by_value,
331
+ :MatrixIdentity => Matrix.by_value,
332
+ :MatrixAdd => Matrix.by_value,
333
+ :MatrixSubtract => Matrix.by_value,
334
+ :MatrixMultiply => Matrix.by_value,
335
+ :MatrixTranslate => Matrix.by_value,
336
+ :MatrixRotate => Matrix.by_value,
337
+ :MatrixRotateX => Matrix.by_value,
338
+ :MatrixRotateY => Matrix.by_value,
339
+ :MatrixRotateZ => Matrix.by_value,
340
+ :MatrixRotateXYZ => Matrix.by_value,
341
+ :MatrixRotateZYX => Matrix.by_value,
342
+ :MatrixScale => Matrix.by_value,
343
+ :MatrixFrustum => Matrix.by_value,
344
+ :MatrixPerspective => Matrix.by_value,
345
+ :MatrixOrtho => Matrix.by_value,
346
+ :MatrixLookAt => Matrix.by_value,
347
+ :MatrixToFloatV => Float16.by_value,
348
+ :QuaternionAdd => Quaternion.by_value,
349
+ :QuaternionAddValue => Quaternion.by_value,
350
+ :QuaternionSubtract => Quaternion.by_value,
351
+ :QuaternionSubtractValue => Quaternion.by_value,
352
+ :QuaternionIdentity => Quaternion.by_value,
353
+ :QuaternionLength => :float,
354
+ :QuaternionNormalize => Quaternion.by_value,
355
+ :QuaternionInvert => Quaternion.by_value,
356
+ :QuaternionMultiply => Quaternion.by_value,
357
+ :QuaternionScale => Quaternion.by_value,
358
+ :QuaternionDivide => Quaternion.by_value,
359
+ :QuaternionLerp => Quaternion.by_value,
360
+ :QuaternionNlerp => Quaternion.by_value,
361
+ :QuaternionSlerp => Quaternion.by_value,
362
+ :QuaternionFromVector3ToVector3 => Quaternion.by_value,
363
+ :QuaternionFromMatrix => Quaternion.by_value,
364
+ :QuaternionToMatrix => Matrix.by_value,
365
+ :QuaternionFromAxisAngle => Quaternion.by_value,
366
+ :QuaternionToAxisAngle => :void,
367
+ :QuaternionFromEuler => Quaternion.by_value,
368
+ :QuaternionToEuler => Vector3.by_value,
369
+ :QuaternionTransform => Quaternion.by_value,
370
+ :QuaternionEquals => :int,
371
+ }
372
+ symbols.each do |sym|
373
+ begin
374
+ attach_function sym, args[sym], retvals[sym]
375
+ rescue FFI::NotFoundError => error
376
+ $stderr.puts("[Warning] Failed to import #{sym} (#{error}).")
377
+ end
378
+ end
379
+ end
380
+
381
+ end
382
+