|
Move Vectormath main
C++20 game and graphics mathematics
|
+X is right, +Y is up, and +Z is the conventional forward axis.Handedness.Vector * Matrix applies a matrix using Move's row-vector convention.Compose(first, second) applies first and then second.Mat4 and the homogeneous fourth column is (0, 0, 0, 1).Point3 is a location. Point minus point is a displacement; adding two points is unavailable.Direction3 is always finite, unit length, and nonzero.Normal3 is a unit surface/plane covector and is distinct from direction.Rotation3 stores a unit quaternion. General, possibly non-unit quaternion algebra uses Quat.Try... and reports failure.RigidTransform3 is rotation plus translation and is closed under composition and inversion.TrsTransform3 is an authoring/decomposition value. Arbitrary TRS composition can create shear, so its general composition result is affine.AffineTransform3 represents a linear transformation plus translation and is closed under composition. Inversion can fail for singular inputs.TransformPoint applies translation. TransformVector does not.TryTransformNormal uses inverse-transpose/covector semantics and preserves the transformed positive half-space under reflections.TryTransformOrientedSurfaceNormal transforms the cross product of an ordered tangent pair and therefore differs by a sign under reflection.Radians<T> and Degrees<T> wrappers.EulerOrder; the order names the sequence applied to a local vector.Nlerp and Slerp take the shortest quaternion arc and clamp the amount to [0,1]. Their Unclamped variants expose extrapolation.IsNearlyEquivalent(Rotation3,
Rotation3) treats q and -q as the same rotation.Handedness, ClipDepth, and DepthDirection.[0,1] and [-1,1] normalized-device depth are supported.TryProjectPoint returns normalized-device coordinates and exposes invalid homogeneous division.TryMakeViewportRay begins at the near plane and works for perspective or orthographic projections. TryMakePerspectiveViewportRay accepts the camera origin when an eye-origin ray is desired.Direction3.Vec2f stays compact and scalar-backed so array loops can vectorize across values. Vec3f and Vec4f may retain SIMD-native storage.MV_MATH_FORCE_SCALAR=1, or use XMake's force_scalar option, to select the portable scalar backend consistently for a target graph.