nalgebra is some kind of abbreviation for n-dimensional linear algebra
n is a finite strictly positive integer.
Trivial math functions like
add show up on my benchmarks!#
Please make sure:
- You compiled your project and its dependencies in release mode, i.e.,
cargo build --release.
- You did not enable incremental compilation. This prevents some optimization that may cause a 30x slow-down! We observed this running the nphysics examples in particular.
All matrices of nalgebra are stored in column-major order. This means that any two consecutive elements of a single matrix column will be contiguous in memory as well. For example the matrix:
is arranged in memory the same way as the array
[ 11, 21, 31, 12, 22, 32, 13,
23, 33 ].
Because nalgebra relies on a lot of generics, some error messages might be hard to understand. Please, open an issue or create a post on the users forum to get help. We take the quality of error messages seriously, so providing details about how you got them can be useful to improve them in the future.
How do I convert a
Vector3<f32> to a
::convert(...) function. For example:
Conversions with this function will work for most structures as long as it
preserves the fundamental algebraic properties objects. If some algebraic
properties may be lost during conversion, use
Yes, serialization and deserialization are supported using
serde. Just enable the serde-serialize feature for
nalgebra on your project's
It is common within the computer-graphics community to work only with 4x4 matrices for transformations and 3D vectors for translations and positions. nalgebra on the other hand has different types for rotations, isometries, points, unit quaternions, etc. This wide variety of types:
- adds extra semantics so that the user constantly knows exactly what kind of algebraic object are being manipulated.
- allows them to be used safely in a generic context because their intrinsic properties are always known.
- allows optimizations, e.g., for transformation matrices inversion.
Thus, instead of working with raw matrices, higher-level types should be preferred and only the end-result of all operations should be transformed into a raw matrix to be usable by, e.g., a shader.