glamx 0.4.1

Physics-oriented extensions of glam (Rot2, Pose2, Pose3, SdpMatrix, symmetric eigen): port of Dimforge glamx on the fixed Q32.32 scalar

Readme

glamx

Pure Cairo port of Dimforge's glamx 0.3.1 on the fixed Q32.32 scalar and glam: Rot2, Rot3, Pose2, Pose3, SdpMatrix2, SdpMatrix3 and SymmetricEigen3.

[dependencies]
glamx = "0.4.1"

Compatible with Cairo 2.19.4. It depends on glam_core and fixed (not on the glam facade). glamx values interoperate with glam facade users: glam::vec3::Vec3, glam::quat::Quat, glam::mat4::Mat4 and the other facade types are the glam_core types glamx takes and returns.

Gas

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.

Pose3

op l2 gas steps range checks mul_pose3 18 480 164 28 inv_mul 20 700 182 34 inverse 10 360 94 12 transform_point 10 260 93 12 transform_vector 9 360 84 12 inverse_transform_point 11 580 102 18 nlerp 34 910 284 59 to_mat4 21 360 183 42

Pose2

op l2 gas steps range checks mul 8 840 76 16 inv_mul 9 920 84 20 inverse 5 180 45 8 transform_point 5 080 44 8 transform_vector 4 680 40 8

Rot2

op l2 gas steps range checks mul 4 680 40 8 mul_vec2 4 680 40 8 inverse 400 4 0 from_angle 31 300 243 62 angle 29 630 207 44 normalize 8 940 75 18 lerp 4 880 42 8 slerp 71 960 536 126

SdpMatrix3

op l2 gas steps range checks mul_vec 7 160 62 12 mul_mat 19 640 170 36 add 5 960 50 12 quadform 21 130 183 24 inverse_regular 27 650 226 56 from_rotated_diagonal 35 550 299 66

SymmetricEigen3

op l2 gas steps range checks new (generic) 550 950 4 578 961 new (diagonal) 57 960 484 62 eigenvalues (generic) 507 470 4 205 873

The committed snapshots are measured by scripts/bench.py and checked in CI.

Metadata

Version 0.4.1

Uploaded 1 month ago

License MIT

Cairo version ^2.19.4

Size 97.8 KB

Installation

Run the following command in your project dir

scarb add glamx@0.4.1

Or add the following line to your Scarb.toml

glamx = "0.4.1"

Monthly downloads

Links

Owners