Box3D
Safe HaskellNone
LanguageGHC2021

Box3D.MathFunctions

Description

Low-level bindings to the exported (non-inline) functions of box3d/math_functions.h.

Box3D implements most of its vector math as static inline helpers, which have no linkable symbols and are therefore out of scope for FFI. Only the handful of functions marked B3_API are bound here: the validators (handy as ABI oracles for the Box3D.MathTypes Storable instances) and a couple of by-value constructors.

Synopsis

Documentation

isValidVec3 :: Vec3 -> IO Bool Source #

Is this a valid (finite, non-NaN) vector?

isValidQuat :: Quat -> IO Bool Source #

Is this a valid, normalized quaternion?

isValidTransform :: Transform -> IO Bool Source #

Is this a valid rigid transform?

isValidMatrix3 :: Matrix3 -> IO Bool Source #

Is this a valid 3x3 matrix?

isValidAABB :: AABB -> IO Bool Source #

Is this a valid, bounded AABB?

isValidPlane :: Plane -> IO Bool Source #

Is this a valid plane (finite, unit normal)?

computeCosSin :: Float -> IO CosSin Source #

Compute a deterministic cosine/sine pair for the given angle in radians.

computeQuatBetweenUnitVectors :: Vec3 -> Vec3 -> IO Quat Source #

Compute the shortest-arc rotation between two unit vectors.