raylib-bindings 0.0.2 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
data/lib/raymath.rb CHANGED
@@ -1,342 +1,345 @@
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
- :Vector2Zero,
44
- :Vector2One,
45
- :Vector2Add,
46
- :Vector2AddValue,
47
- :Vector2Subtract,
48
- :Vector2SubtractValue,
49
- :Vector2Length,
50
- :Vector2LengthSqr,
51
- :Vector2DotProduct,
52
- :Vector2Distance,
53
- :Vector2Angle,
54
- :Vector2Scale,
55
- :Vector2Multiply,
56
- :Vector2Negate,
57
- :Vector2Divide,
58
- :Vector2Normalize,
59
- :Vector2Lerp,
60
- :Vector2Reflect,
61
- :Vector2Rotate,
62
- :Vector2MoveTowards,
63
- :Vector3Zero,
64
- :Vector3One,
65
- :Vector3Add,
66
- :Vector3AddValue,
67
- :Vector3Subtract,
68
- :Vector3SubtractValue,
69
- :Vector3Scale,
70
- :Vector3Multiply,
71
- :Vector3CrossProduct,
72
- :Vector3Perpendicular,
73
- :Vector3Length,
74
- :Vector3LengthSqr,
75
- :Vector3DotProduct,
76
- :Vector3Distance,
77
- :Vector3Angle,
78
- :Vector3Negate,
79
- :Vector3Divide,
80
- :Vector3Normalize,
81
- :Vector3OrthoNormalize,
82
- :Vector3Transform,
83
- :Vector3RotateByQuaternion,
84
- :Vector3Lerp,
85
- :Vector3Reflect,
86
- :Vector3Min,
87
- :Vector3Max,
88
- :Vector3Barycenter,
89
- :Vector3Unproject,
90
- :Vector3ToFloatV,
91
- :MatrixDeterminant,
92
- :MatrixTrace,
93
- :MatrixTranspose,
94
- :MatrixInvert,
95
- :MatrixNormalize,
96
- :MatrixIdentity,
97
- :MatrixAdd,
98
- :MatrixSubtract,
99
- :MatrixMultiply,
100
- :MatrixTranslate,
101
- :MatrixRotate,
102
- :MatrixRotateX,
103
- :MatrixRotateY,
104
- :MatrixRotateZ,
105
- :MatrixRotateXYZ,
106
- :MatrixRotateZYX,
107
- :MatrixScale,
108
- :MatrixFrustum,
109
- :MatrixPerspective,
110
- :MatrixOrtho,
111
- :MatrixLookAt,
112
- :MatrixToFloatV,
113
- :QuaternionAdd,
114
- :QuaternionAddValue,
115
- :QuaternionSubtract,
116
- :QuaternionSubtractValue,
117
- :QuaternionIdentity,
118
- :QuaternionLength,
119
- :QuaternionNormalize,
120
- :QuaternionInvert,
121
- :QuaternionMultiply,
122
- :QuaternionScale,
123
- :QuaternionDivide,
124
- :QuaternionLerp,
125
- :QuaternionNlerp,
126
- :QuaternionSlerp,
127
- :QuaternionFromVector3ToVector3,
128
- :QuaternionFromMatrix,
129
- :QuaternionToMatrix,
130
- :QuaternionFromAxisAngle,
131
- :QuaternionToAxisAngle,
132
- :QuaternionFromEuler,
133
- :QuaternionToEuler,
134
- :QuaternionTransform,
135
- ]
136
- args = {
137
- :Clamp => [:float, :float, :float],
138
- :Lerp => [:float, :float, :float],
139
- :Normalize => [:float, :float, :float],
140
- :Remap => [:float, :float, :float, :float, :float],
141
- :Vector2Zero => [],
142
- :Vector2One => [],
143
- :Vector2Add => [Vector2.by_value, Vector2.by_value],
144
- :Vector2AddValue => [Vector2.by_value, :float],
145
- :Vector2Subtract => [Vector2.by_value, Vector2.by_value],
146
- :Vector2SubtractValue => [Vector2.by_value, :float],
147
- :Vector2Length => [Vector2.by_value],
148
- :Vector2LengthSqr => [Vector2.by_value],
149
- :Vector2DotProduct => [Vector2.by_value, Vector2.by_value],
150
- :Vector2Distance => [Vector2.by_value, Vector2.by_value],
151
- :Vector2Angle => [Vector2.by_value, Vector2.by_value],
152
- :Vector2Scale => [Vector2.by_value, :float],
153
- :Vector2Multiply => [Vector2.by_value, Vector2.by_value],
154
- :Vector2Negate => [Vector2.by_value],
155
- :Vector2Divide => [Vector2.by_value, Vector2.by_value],
156
- :Vector2Normalize => [Vector2.by_value],
157
- :Vector2Lerp => [Vector2.by_value, Vector2.by_value, :float],
158
- :Vector2Reflect => [Vector2.by_value, Vector2.by_value],
159
- :Vector2Rotate => [Vector2.by_value, :float],
160
- :Vector2MoveTowards => [Vector2.by_value, Vector2.by_value, :float],
161
- :Vector3Zero => [],
162
- :Vector3One => [],
163
- :Vector3Add => [Vector3.by_value, Vector3.by_value],
164
- :Vector3AddValue => [Vector3.by_value, :float],
165
- :Vector3Subtract => [Vector3.by_value, Vector3.by_value],
166
- :Vector3SubtractValue => [Vector3.by_value, :float],
167
- :Vector3Scale => [Vector3.by_value, :float],
168
- :Vector3Multiply => [Vector3.by_value, Vector3.by_value],
169
- :Vector3CrossProduct => [Vector3.by_value, Vector3.by_value],
170
- :Vector3Perpendicular => [Vector3.by_value],
171
- :Vector3Length => [Vector3.by_value],
172
- :Vector3LengthSqr => [Vector3.by_value],
173
- :Vector3DotProduct => [Vector3.by_value, Vector3.by_value],
174
- :Vector3Distance => [Vector3.by_value, Vector3.by_value],
175
- :Vector3Angle => [Vector3.by_value, Vector3.by_value],
176
- :Vector3Negate => [Vector3.by_value],
177
- :Vector3Divide => [Vector3.by_value, Vector3.by_value],
178
- :Vector3Normalize => [Vector3.by_value],
179
- :Vector3OrthoNormalize => [:pointer, :pointer],
180
- :Vector3Transform => [Vector3.by_value, Matrix.by_value],
181
- :Vector3RotateByQuaternion => [Vector3.by_value, Quaternion.by_value],
182
- :Vector3Lerp => [Vector3.by_value, Vector3.by_value, :float],
183
- :Vector3Reflect => [Vector3.by_value, Vector3.by_value],
184
- :Vector3Min => [Vector3.by_value, Vector3.by_value],
185
- :Vector3Max => [Vector3.by_value, Vector3.by_value],
186
- :Vector3Barycenter => [Vector3.by_value, Vector3.by_value, Vector3.by_value, Vector3.by_value],
187
- :Vector3Unproject => [Vector3.by_value, Matrix.by_value, Matrix.by_value],
188
- :Vector3ToFloatV => [Vector3.by_value],
189
- :MatrixDeterminant => [Matrix.by_value],
190
- :MatrixTrace => [Matrix.by_value],
191
- :MatrixTranspose => [Matrix.by_value],
192
- :MatrixInvert => [Matrix.by_value],
193
- :MatrixNormalize => [Matrix.by_value],
194
- :MatrixIdentity => [],
195
- :MatrixAdd => [Matrix.by_value, Matrix.by_value],
196
- :MatrixSubtract => [Matrix.by_value, Matrix.by_value],
197
- :MatrixMultiply => [Matrix.by_value, Matrix.by_value],
198
- :MatrixTranslate => [:float, :float, :float],
199
- :MatrixRotate => [Vector3.by_value, :float],
200
- :MatrixRotateX => [:float],
201
- :MatrixRotateY => [:float],
202
- :MatrixRotateZ => [:float],
203
- :MatrixRotateXYZ => [Vector3.by_value],
204
- :MatrixRotateZYX => [Vector3.by_value],
205
- :MatrixScale => [:float, :float, :float],
206
- :MatrixFrustum => [:double, :double, :double, :double, :double, :double],
207
- :MatrixPerspective => [:double, :double, :double, :double],
208
- :MatrixOrtho => [:double, :double, :double, :double, :double, :double],
209
- :MatrixLookAt => [Vector3.by_value, Vector3.by_value, Vector3.by_value],
210
- :MatrixToFloatV => [Matrix.by_value],
211
- :QuaternionAdd => [Quaternion.by_value, Quaternion.by_value],
212
- :QuaternionAddValue => [Quaternion.by_value, :float],
213
- :QuaternionSubtract => [Quaternion.by_value, Quaternion.by_value],
214
- :QuaternionSubtractValue => [Quaternion.by_value, :float],
215
- :QuaternionIdentity => [],
216
- :QuaternionLength => [Quaternion.by_value],
217
- :QuaternionNormalize => [Quaternion.by_value],
218
- :QuaternionInvert => [Quaternion.by_value],
219
- :QuaternionMultiply => [Quaternion.by_value, Quaternion.by_value],
220
- :QuaternionScale => [Quaternion.by_value, :float],
221
- :QuaternionDivide => [Quaternion.by_value, Quaternion.by_value],
222
- :QuaternionLerp => [Quaternion.by_value, Quaternion.by_value, :float],
223
- :QuaternionNlerp => [Quaternion.by_value, Quaternion.by_value, :float],
224
- :QuaternionSlerp => [Quaternion.by_value, Quaternion.by_value, :float],
225
- :QuaternionFromVector3ToVector3 => [Vector3.by_value, Vector3.by_value],
226
- :QuaternionFromMatrix => [Matrix.by_value],
227
- :QuaternionToMatrix => [Quaternion.by_value],
228
- :QuaternionFromAxisAngle => [Vector3.by_value, :float],
229
- :QuaternionToAxisAngle => [Quaternion.by_value, :pointer, :pointer],
230
- :QuaternionFromEuler => [:float, :float, :float],
231
- :QuaternionToEuler => [Quaternion.by_value],
232
- :QuaternionTransform => [Quaternion.by_value, Matrix.by_value],
233
- }
234
- retvals = {
235
- :Clamp => :float,
236
- :Lerp => :float,
237
- :Normalize => :float,
238
- :Remap => :float,
239
- :Vector2Zero => Vector2.by_value,
240
- :Vector2One => Vector2.by_value,
241
- :Vector2Add => Vector2.by_value,
242
- :Vector2AddValue => Vector2.by_value,
243
- :Vector2Subtract => Vector2.by_value,
244
- :Vector2SubtractValue => Vector2.by_value,
245
- :Vector2Length => :float,
246
- :Vector2LengthSqr => :float,
247
- :Vector2DotProduct => :float,
248
- :Vector2Distance => :float,
249
- :Vector2Angle => :float,
250
- :Vector2Scale => Vector2.by_value,
251
- :Vector2Multiply => Vector2.by_value,
252
- :Vector2Negate => Vector2.by_value,
253
- :Vector2Divide => Vector2.by_value,
254
- :Vector2Normalize => Vector2.by_value,
255
- :Vector2Lerp => Vector2.by_value,
256
- :Vector2Reflect => Vector2.by_value,
257
- :Vector2Rotate => Vector2.by_value,
258
- :Vector2MoveTowards => Vector2.by_value,
259
- :Vector3Zero => Vector3.by_value,
260
- :Vector3One => Vector3.by_value,
261
- :Vector3Add => Vector3.by_value,
262
- :Vector3AddValue => Vector3.by_value,
263
- :Vector3Subtract => Vector3.by_value,
264
- :Vector3SubtractValue => Vector3.by_value,
265
- :Vector3Scale => Vector3.by_value,
266
- :Vector3Multiply => Vector3.by_value,
267
- :Vector3CrossProduct => Vector3.by_value,
268
- :Vector3Perpendicular => Vector3.by_value,
269
- :Vector3Length => :float,
270
- :Vector3LengthSqr => :float,
271
- :Vector3DotProduct => :float,
272
- :Vector3Distance => :float,
273
- :Vector3Angle => :float,
274
- :Vector3Negate => Vector3.by_value,
275
- :Vector3Divide => Vector3.by_value,
276
- :Vector3Normalize => Vector3.by_value,
277
- :Vector3OrthoNormalize => :void,
278
- :Vector3Transform => Vector3.by_value,
279
- :Vector3RotateByQuaternion => Vector3.by_value,
280
- :Vector3Lerp => Vector3.by_value,
281
- :Vector3Reflect => Vector3.by_value,
282
- :Vector3Min => Vector3.by_value,
283
- :Vector3Max => Vector3.by_value,
284
- :Vector3Barycenter => Vector3.by_value,
285
- :Vector3Unproject => Vector3.by_value,
286
- :Vector3ToFloatV => Float3.by_value,
287
- :MatrixDeterminant => :float,
288
- :MatrixTrace => :float,
289
- :MatrixTranspose => Matrix.by_value,
290
- :MatrixInvert => Matrix.by_value,
291
- :MatrixNormalize => Matrix.by_value,
292
- :MatrixIdentity => Matrix.by_value,
293
- :MatrixAdd => Matrix.by_value,
294
- :MatrixSubtract => Matrix.by_value,
295
- :MatrixMultiply => Matrix.by_value,
296
- :MatrixTranslate => Matrix.by_value,
297
- :MatrixRotate => Matrix.by_value,
298
- :MatrixRotateX => Matrix.by_value,
299
- :MatrixRotateY => Matrix.by_value,
300
- :MatrixRotateZ => Matrix.by_value,
301
- :MatrixRotateXYZ => Matrix.by_value,
302
- :MatrixRotateZYX => Matrix.by_value,
303
- :MatrixScale => Matrix.by_value,
304
- :MatrixFrustum => Matrix.by_value,
305
- :MatrixPerspective => Matrix.by_value,
306
- :MatrixOrtho => Matrix.by_value,
307
- :MatrixLookAt => Matrix.by_value,
308
- :MatrixToFloatV => Float16.by_value,
309
- :QuaternionAdd => Quaternion.by_value,
310
- :QuaternionAddValue => Quaternion.by_value,
311
- :QuaternionSubtract => Quaternion.by_value,
312
- :QuaternionSubtractValue => Quaternion.by_value,
313
- :QuaternionIdentity => Quaternion.by_value,
314
- :QuaternionLength => :float,
315
- :QuaternionNormalize => Quaternion.by_value,
316
- :QuaternionInvert => Quaternion.by_value,
317
- :QuaternionMultiply => Quaternion.by_value,
318
- :QuaternionScale => Quaternion.by_value,
319
- :QuaternionDivide => Quaternion.by_value,
320
- :QuaternionLerp => Quaternion.by_value,
321
- :QuaternionNlerp => Quaternion.by_value,
322
- :QuaternionSlerp => Quaternion.by_value,
323
- :QuaternionFromVector3ToVector3 => Quaternion.by_value,
324
- :QuaternionFromMatrix => Quaternion.by_value,
325
- :QuaternionToMatrix => Matrix.by_value,
326
- :QuaternionFromAxisAngle => Quaternion.by_value,
327
- :QuaternionToAxisAngle => :void,
328
- :QuaternionFromEuler => Quaternion.by_value,
329
- :QuaternionToEuler => Vector3.by_value,
330
- :QuaternionTransform => Quaternion.by_value,
331
- }
332
- symbols.each do |sym|
333
- begin
334
- attach_function sym, args[sym], retvals[sym]
335
- rescue FFI::NotFoundError => error
336
- $stderr.puts("[Warning] Failed to import #{sym} (#{error}).")
337
- end
338
- end
339
- end
340
-
341
- end
342
-
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
+ :Vector2Zero,
44
+ :Vector2One,
45
+ :Vector2Add,
46
+ :Vector2AddValue,
47
+ :Vector2Subtract,
48
+ :Vector2SubtractValue,
49
+ :Vector2Length,
50
+ :Vector2LengthSqr,
51
+ :Vector2DotProduct,
52
+ :Vector2Distance,
53
+ :Vector2Angle,
54
+ :Vector2Scale,
55
+ :Vector2Multiply,
56
+ :Vector2Negate,
57
+ :Vector2Divide,
58
+ :Vector2Normalize,
59
+ :Vector2Transform,
60
+ :Vector2Lerp,
61
+ :Vector2Reflect,
62
+ :Vector2Rotate,
63
+ :Vector2MoveTowards,
64
+ :Vector3Zero,
65
+ :Vector3One,
66
+ :Vector3Add,
67
+ :Vector3AddValue,
68
+ :Vector3Subtract,
69
+ :Vector3SubtractValue,
70
+ :Vector3Scale,
71
+ :Vector3Multiply,
72
+ :Vector3CrossProduct,
73
+ :Vector3Perpendicular,
74
+ :Vector3Length,
75
+ :Vector3LengthSqr,
76
+ :Vector3DotProduct,
77
+ :Vector3Distance,
78
+ :Vector3Angle,
79
+ :Vector3Negate,
80
+ :Vector3Divide,
81
+ :Vector3Normalize,
82
+ :Vector3OrthoNormalize,
83
+ :Vector3Transform,
84
+ :Vector3RotateByQuaternion,
85
+ :Vector3Lerp,
86
+ :Vector3Reflect,
87
+ :Vector3Min,
88
+ :Vector3Max,
89
+ :Vector3Barycenter,
90
+ :Vector3Unproject,
91
+ :Vector3ToFloatV,
92
+ :MatrixDeterminant,
93
+ :MatrixTrace,
94
+ :MatrixTranspose,
95
+ :MatrixInvert,
96
+ :MatrixNormalize,
97
+ :MatrixIdentity,
98
+ :MatrixAdd,
99
+ :MatrixSubtract,
100
+ :MatrixMultiply,
101
+ :MatrixTranslate,
102
+ :MatrixRotate,
103
+ :MatrixRotateX,
104
+ :MatrixRotateY,
105
+ :MatrixRotateZ,
106
+ :MatrixRotateXYZ,
107
+ :MatrixRotateZYX,
108
+ :MatrixScale,
109
+ :MatrixFrustum,
110
+ :MatrixPerspective,
111
+ :MatrixOrtho,
112
+ :MatrixLookAt,
113
+ :MatrixToFloatV,
114
+ :QuaternionAdd,
115
+ :QuaternionAddValue,
116
+ :QuaternionSubtract,
117
+ :QuaternionSubtractValue,
118
+ :QuaternionIdentity,
119
+ :QuaternionLength,
120
+ :QuaternionNormalize,
121
+ :QuaternionInvert,
122
+ :QuaternionMultiply,
123
+ :QuaternionScale,
124
+ :QuaternionDivide,
125
+ :QuaternionLerp,
126
+ :QuaternionNlerp,
127
+ :QuaternionSlerp,
128
+ :QuaternionFromVector3ToVector3,
129
+ :QuaternionFromMatrix,
130
+ :QuaternionToMatrix,
131
+ :QuaternionFromAxisAngle,
132
+ :QuaternionToAxisAngle,
133
+ :QuaternionFromEuler,
134
+ :QuaternionToEuler,
135
+ :QuaternionTransform,
136
+ ]
137
+ args = {
138
+ :Clamp => [:float, :float, :float],
139
+ :Lerp => [:float, :float, :float],
140
+ :Normalize => [:float, :float, :float],
141
+ :Remap => [:float, :float, :float, :float, :float],
142
+ :Vector2Zero => [],
143
+ :Vector2One => [],
144
+ :Vector2Add => [Vector2.by_value, Vector2.by_value],
145
+ :Vector2AddValue => [Vector2.by_value, :float],
146
+ :Vector2Subtract => [Vector2.by_value, Vector2.by_value],
147
+ :Vector2SubtractValue => [Vector2.by_value, :float],
148
+ :Vector2Length => [Vector2.by_value],
149
+ :Vector2LengthSqr => [Vector2.by_value],
150
+ :Vector2DotProduct => [Vector2.by_value, Vector2.by_value],
151
+ :Vector2Distance => [Vector2.by_value, Vector2.by_value],
152
+ :Vector2Angle => [Vector2.by_value, Vector2.by_value],
153
+ :Vector2Scale => [Vector2.by_value, :float],
154
+ :Vector2Multiply => [Vector2.by_value, Vector2.by_value],
155
+ :Vector2Negate => [Vector2.by_value],
156
+ :Vector2Divide => [Vector2.by_value, Vector2.by_value],
157
+ :Vector2Normalize => [Vector2.by_value],
158
+ :Vector2Transform => [Vector2.by_value, Matrix.by_value],
159
+ :Vector2Lerp => [Vector2.by_value, Vector2.by_value, :float],
160
+ :Vector2Reflect => [Vector2.by_value, Vector2.by_value],
161
+ :Vector2Rotate => [Vector2.by_value, :float],
162
+ :Vector2MoveTowards => [Vector2.by_value, Vector2.by_value, :float],
163
+ :Vector3Zero => [],
164
+ :Vector3One => [],
165
+ :Vector3Add => [Vector3.by_value, Vector3.by_value],
166
+ :Vector3AddValue => [Vector3.by_value, :float],
167
+ :Vector3Subtract => [Vector3.by_value, Vector3.by_value],
168
+ :Vector3SubtractValue => [Vector3.by_value, :float],
169
+ :Vector3Scale => [Vector3.by_value, :float],
170
+ :Vector3Multiply => [Vector3.by_value, Vector3.by_value],
171
+ :Vector3CrossProduct => [Vector3.by_value, Vector3.by_value],
172
+ :Vector3Perpendicular => [Vector3.by_value],
173
+ :Vector3Length => [Vector3.by_value],
174
+ :Vector3LengthSqr => [Vector3.by_value],
175
+ :Vector3DotProduct => [Vector3.by_value, Vector3.by_value],
176
+ :Vector3Distance => [Vector3.by_value, Vector3.by_value],
177
+ :Vector3Angle => [Vector3.by_value, Vector3.by_value],
178
+ :Vector3Negate => [Vector3.by_value],
179
+ :Vector3Divide => [Vector3.by_value, Vector3.by_value],
180
+ :Vector3Normalize => [Vector3.by_value],
181
+ :Vector3OrthoNormalize => [:pointer, :pointer],
182
+ :Vector3Transform => [Vector3.by_value, Matrix.by_value],
183
+ :Vector3RotateByQuaternion => [Vector3.by_value, Quaternion.by_value],
184
+ :Vector3Lerp => [Vector3.by_value, Vector3.by_value, :float],
185
+ :Vector3Reflect => [Vector3.by_value, Vector3.by_value],
186
+ :Vector3Min => [Vector3.by_value, Vector3.by_value],
187
+ :Vector3Max => [Vector3.by_value, Vector3.by_value],
188
+ :Vector3Barycenter => [Vector3.by_value, Vector3.by_value, Vector3.by_value, Vector3.by_value],
189
+ :Vector3Unproject => [Vector3.by_value, Matrix.by_value, Matrix.by_value],
190
+ :Vector3ToFloatV => [Vector3.by_value],
191
+ :MatrixDeterminant => [Matrix.by_value],
192
+ :MatrixTrace => [Matrix.by_value],
193
+ :MatrixTranspose => [Matrix.by_value],
194
+ :MatrixInvert => [Matrix.by_value],
195
+ :MatrixNormalize => [Matrix.by_value],
196
+ :MatrixIdentity => [],
197
+ :MatrixAdd => [Matrix.by_value, Matrix.by_value],
198
+ :MatrixSubtract => [Matrix.by_value, Matrix.by_value],
199
+ :MatrixMultiply => [Matrix.by_value, Matrix.by_value],
200
+ :MatrixTranslate => [:float, :float, :float],
201
+ :MatrixRotate => [Vector3.by_value, :float],
202
+ :MatrixRotateX => [:float],
203
+ :MatrixRotateY => [:float],
204
+ :MatrixRotateZ => [:float],
205
+ :MatrixRotateXYZ => [Vector3.by_value],
206
+ :MatrixRotateZYX => [Vector3.by_value],
207
+ :MatrixScale => [:float, :float, :float],
208
+ :MatrixFrustum => [:double, :double, :double, :double, :double, :double],
209
+ :MatrixPerspective => [:double, :double, :double, :double],
210
+ :MatrixOrtho => [:double, :double, :double, :double, :double, :double],
211
+ :MatrixLookAt => [Vector3.by_value, Vector3.by_value, Vector3.by_value],
212
+ :MatrixToFloatV => [Matrix.by_value],
213
+ :QuaternionAdd => [Quaternion.by_value, Quaternion.by_value],
214
+ :QuaternionAddValue => [Quaternion.by_value, :float],
215
+ :QuaternionSubtract => [Quaternion.by_value, Quaternion.by_value],
216
+ :QuaternionSubtractValue => [Quaternion.by_value, :float],
217
+ :QuaternionIdentity => [],
218
+ :QuaternionLength => [Quaternion.by_value],
219
+ :QuaternionNormalize => [Quaternion.by_value],
220
+ :QuaternionInvert => [Quaternion.by_value],
221
+ :QuaternionMultiply => [Quaternion.by_value, Quaternion.by_value],
222
+ :QuaternionScale => [Quaternion.by_value, :float],
223
+ :QuaternionDivide => [Quaternion.by_value, Quaternion.by_value],
224
+ :QuaternionLerp => [Quaternion.by_value, Quaternion.by_value, :float],
225
+ :QuaternionNlerp => [Quaternion.by_value, Quaternion.by_value, :float],
226
+ :QuaternionSlerp => [Quaternion.by_value, Quaternion.by_value, :float],
227
+ :QuaternionFromVector3ToVector3 => [Vector3.by_value, Vector3.by_value],
228
+ :QuaternionFromMatrix => [Matrix.by_value],
229
+ :QuaternionToMatrix => [Quaternion.by_value],
230
+ :QuaternionFromAxisAngle => [Vector3.by_value, :float],
231
+ :QuaternionToAxisAngle => [Quaternion.by_value, :pointer, :pointer],
232
+ :QuaternionFromEuler => [:float, :float, :float],
233
+ :QuaternionToEuler => [Quaternion.by_value],
234
+ :QuaternionTransform => [Quaternion.by_value, Matrix.by_value],
235
+ }
236
+ retvals = {
237
+ :Clamp => :float,
238
+ :Lerp => :float,
239
+ :Normalize => :float,
240
+ :Remap => :float,
241
+ :Vector2Zero => Vector2.by_value,
242
+ :Vector2One => Vector2.by_value,
243
+ :Vector2Add => Vector2.by_value,
244
+ :Vector2AddValue => Vector2.by_value,
245
+ :Vector2Subtract => Vector2.by_value,
246
+ :Vector2SubtractValue => Vector2.by_value,
247
+ :Vector2Length => :float,
248
+ :Vector2LengthSqr => :float,
249
+ :Vector2DotProduct => :float,
250
+ :Vector2Distance => :float,
251
+ :Vector2Angle => :float,
252
+ :Vector2Scale => Vector2.by_value,
253
+ :Vector2Multiply => Vector2.by_value,
254
+ :Vector2Negate => Vector2.by_value,
255
+ :Vector2Divide => Vector2.by_value,
256
+ :Vector2Normalize => Vector2.by_value,
257
+ :Vector2Transform => Vector2.by_value,
258
+ :Vector2Lerp => Vector2.by_value,
259
+ :Vector2Reflect => Vector2.by_value,
260
+ :Vector2Rotate => Vector2.by_value,
261
+ :Vector2MoveTowards => Vector2.by_value,
262
+ :Vector3Zero => Vector3.by_value,
263
+ :Vector3One => Vector3.by_value,
264
+ :Vector3Add => Vector3.by_value,
265
+ :Vector3AddValue => Vector3.by_value,
266
+ :Vector3Subtract => Vector3.by_value,
267
+ :Vector3SubtractValue => Vector3.by_value,
268
+ :Vector3Scale => Vector3.by_value,
269
+ :Vector3Multiply => Vector3.by_value,
270
+ :Vector3CrossProduct => Vector3.by_value,
271
+ :Vector3Perpendicular => Vector3.by_value,
272
+ :Vector3Length => :float,
273
+ :Vector3LengthSqr => :float,
274
+ :Vector3DotProduct => :float,
275
+ :Vector3Distance => :float,
276
+ :Vector3Angle => :float,
277
+ :Vector3Negate => Vector3.by_value,
278
+ :Vector3Divide => Vector3.by_value,
279
+ :Vector3Normalize => Vector3.by_value,
280
+ :Vector3OrthoNormalize => :void,
281
+ :Vector3Transform => Vector3.by_value,
282
+ :Vector3RotateByQuaternion => Vector3.by_value,
283
+ :Vector3Lerp => Vector3.by_value,
284
+ :Vector3Reflect => Vector3.by_value,
285
+ :Vector3Min => Vector3.by_value,
286
+ :Vector3Max => Vector3.by_value,
287
+ :Vector3Barycenter => Vector3.by_value,
288
+ :Vector3Unproject => Vector3.by_value,
289
+ :Vector3ToFloatV => Float3.by_value,
290
+ :MatrixDeterminant => :float,
291
+ :MatrixTrace => :float,
292
+ :MatrixTranspose => Matrix.by_value,
293
+ :MatrixInvert => Matrix.by_value,
294
+ :MatrixNormalize => Matrix.by_value,
295
+ :MatrixIdentity => Matrix.by_value,
296
+ :MatrixAdd => Matrix.by_value,
297
+ :MatrixSubtract => Matrix.by_value,
298
+ :MatrixMultiply => Matrix.by_value,
299
+ :MatrixTranslate => Matrix.by_value,
300
+ :MatrixRotate => Matrix.by_value,
301
+ :MatrixRotateX => Matrix.by_value,
302
+ :MatrixRotateY => Matrix.by_value,
303
+ :MatrixRotateZ => Matrix.by_value,
304
+ :MatrixRotateXYZ => Matrix.by_value,
305
+ :MatrixRotateZYX => Matrix.by_value,
306
+ :MatrixScale => Matrix.by_value,
307
+ :MatrixFrustum => Matrix.by_value,
308
+ :MatrixPerspective => Matrix.by_value,
309
+ :MatrixOrtho => Matrix.by_value,
310
+ :MatrixLookAt => Matrix.by_value,
311
+ :MatrixToFloatV => Float16.by_value,
312
+ :QuaternionAdd => Quaternion.by_value,
313
+ :QuaternionAddValue => Quaternion.by_value,
314
+ :QuaternionSubtract => Quaternion.by_value,
315
+ :QuaternionSubtractValue => Quaternion.by_value,
316
+ :QuaternionIdentity => Quaternion.by_value,
317
+ :QuaternionLength => :float,
318
+ :QuaternionNormalize => Quaternion.by_value,
319
+ :QuaternionInvert => Quaternion.by_value,
320
+ :QuaternionMultiply => Quaternion.by_value,
321
+ :QuaternionScale => Quaternion.by_value,
322
+ :QuaternionDivide => Quaternion.by_value,
323
+ :QuaternionLerp => Quaternion.by_value,
324
+ :QuaternionNlerp => Quaternion.by_value,
325
+ :QuaternionSlerp => Quaternion.by_value,
326
+ :QuaternionFromVector3ToVector3 => Quaternion.by_value,
327
+ :QuaternionFromMatrix => Quaternion.by_value,
328
+ :QuaternionToMatrix => Matrix.by_value,
329
+ :QuaternionFromAxisAngle => Quaternion.by_value,
330
+ :QuaternionToAxisAngle => :void,
331
+ :QuaternionFromEuler => Quaternion.by_value,
332
+ :QuaternionToEuler => Vector3.by_value,
333
+ :QuaternionTransform => Quaternion.by_value,
334
+ }
335
+ symbols.each do |sym|
336
+ begin
337
+ attach_function sym, args[sym], retvals[sym]
338
+ rescue FFI::NotFoundError => error
339
+ $stderr.puts("[Warning] Failed to import #{sym} (#{error}).")
340
+ end
341
+ end
342
+ end
343
+
344
+ end
345
+