glam 0.1.0
Port of glam-rs: fixed-point vector, matrix and quaternion math for provable games
Port of glam-rs 0.33.8 to Cairo on top of the
fixed Q32.32 scalar: Vec2/3/4, Mat2/3/4, Quat, Affine2/3, BVec*, IVec*,
UVec*. Same module, type and method names as glam-rs.
Progress: docs/PORTING_STATUS.md.
Compatible with Cairo 2.19.4.
Sierra gas (l2 gas, what a transaction pays) and prover cost (steps, range checks) of one call, net of the test overhead (X__op - X__base, see scripts/bench.py), measured with scarb 2.19.4, starknet-foundry 0.61.0 (.tool-versions). Source of truth: gas/*.snap; this region is generated by scripts/gas_tables.py, do not edit it.
Vec2add
2 600
22
4
mul_scalar
4 280
36
8
dot
1 880
16
4
perp_dot
1 880
16
4
length
2 220
18
6
normalize
6 940
57
16
rotate
4 680
40
8
from_angle
31 300
243
62
to_angle
28 120
210
46
Vec3add
3 440
29
6
mul_scalar
5 960
50
12
dot
2 080
18
4
cross
6 560
56
12
length
3 340
28
6
normalize
8 720
72
20
distance
3 640
31
6
lerp
6 860
59
12
reflect
9 680
83
18
angle_between
38 980
307
70
Vec4add
4 280
36
8
mul_scalar
7 640
64
16
dot
3 200
28
4
length
3 540
30
6
normalize
10 500
87
24
lerp
8 840
76
16
Mat2mul_vec2
4 680
40
8
mul_mat2
8 440
72
16
determinant
1 880
16
4
inverse
13 310
105
24
transpose
400
4
0
from_angle
31 700
247
62
Mat3mul_vec3
7 160
62
12
mul_mat3
19 640
170
36
determinant
3 800
34
4
inverse
39 530
328
80
transpose
900
9
0
from_quat
20 660
176
42
from_axis_angle
50 680
409
100
from_rotation_z
32 200
252
62
Mat4mul_vec4
10 040
88
16
mul_mat4
36 480
320
64
transform_point3
7 760
68
12
project_point3
20 590
171
32
determinant
16 380
143
28
inverse
102 610
868
208
transpose
2 520
24
0
from_quat
21 360
183
42
from_rotation_translation
21 360
183
42
look_at_rh
43 890
370
82
Quatmul_quat
10 040
88
16
mul_vec3
9 360
84
12
conjugate
1 000
10
0
normalize
10 500
87
24
slerp
122 180
923
225
lerp
24 120
196
47
from_axis_angle
40 350
312
78
from_rotation_arc
52 200
178
44
from_mat3
19 770
163
42
to_axis_angle
40 100
297
69
Affine2transform_point2
5 080
44
8
transform_vector2
4 680
40
8
mul_affine2
12 600
108
24
inverse
20 630
167
40
from_angle_translation
31 900
249
62
Affine3transform_point3
7 760
68
12
transform_vector3
7 160
62
12
mul_affine3
26 480
230
48
inverse
48 490
408
92
inverse_rigid
8 360
74
12
from_rotation_translation
20 960
179
42
look_to_rh
42 770
363
76
EulerRot, worst case: generic order)Quat::from_euler
110 800
874
214
Quat::to_euler
117 530
883
181
Mat3::from_euler
114 170
897
218
Mat3::to_euler
94 160
689
139
Mat4::from_euler
114 870
904
218
glam::camera)rh::proj::opengl::perspective
50 060
403
98
rh::proj::vulkan::perspective
48 780
393
94
rh::proj::vulkan::perspective_infinite_reverse
42 830
343
81
rh::proj::opengl::orthographic
22 440
189
48
rh::proj::opengl::frustum
24 040
202
52
rh::view::look_at_mat4
38 760
329
82
rh::view::look_to_mat4
28 740
247
56
Version 0.1.0
Uploaded 11 hours ago
License MIT
Cairo version ^2.19.4
Size 305.3 KB
Run the following command in your project dir
scarb add glam@0.1.0
Or add the following line to your Scarb.toml
glam = "0.1.0"