Welcome to the rtg-math reference docs.
Please note that the .region* portion of the api is undocumented as it is still considered wip.
A selection of the math routines most commonly needed for realtime graphics in lisp
Welcome to the rtg-math reference docs.
Please note that the .region* portion of the api is undocumented as it is still considered wip.
( DECF PLACE &OPTIONAL DELTA ) ( INCF PLACE &OPTIONAL DELTA ) ( * &REST (VEC2S VEC2) ) ( *S (VECTOR-A VEC2) (A SINGLE-FLOAT) ) Component-wise multiplication of the vector by the scalar
( + &REST (VEC2S VEC2) ) ( +S (VEC2 VEC2) (SCALAR SINGLE-FLOAT) ) Component-wise add of single-float to vec2
( - (VEC2 VEC2) &REST (VEC2S VEC2) ) ( -S (VEC2 VEC2) (SCALAR SINGLE-FLOAT) ) Component-wise subtraction of single-float from vec2
( / (VECTOR-A VEC2) (VECTOR-B VEC2) ) Component-wise division of the two vec2
( /S (VECTOR-A VEC2) (A SINGLE-FLOAT) ) Component-wise division of the vector by the scalar
( 0P (VECTOR-A VEC2) ) Checks if the length of the vector is zero. As this is a floating point number it checks to see if the length is below a threshold set in the base-maths package
Note: Old, float epsilons are tricky, I have a ticket open to review this
( = (VECTOR-A VEC2) (VECTOR-B VEC2) ) Returns T if the two vectors are equal. Otherwise it returns nil.
( ABS (VECTOR-A VEC2) ) ( ABSOLUTE-DOT (VECTOR-A VEC2) (VECTOR-B VEC2) ) Return the absolute dot product of the vector-a and vector-b.
( ANGLE-BETWEEN (VEC-A VEC2) (VEC-B VEC2) ) Returns the angle between two vec2s.
Equivilent to (abs (v2:angle-from a b))
( ANGLE-FROM (VEC-FROM VEC2) (VEC-TO VEC2) ) Returns the signed angle between the two vec2s.
Positive angles are counter-clockwise
( BEZIER (A1 VEC2) (A2 VEC2) (B1 VEC2) (B2 VEC2) (AMMOUNT SINGLE-FLOAT) ) {TODO}
( COPY-VEC2 (VEC2 VEC2) ) Returns a fresh vec2 which is v2:= to the orignal vector
( CROSS (VEC-A VEC2) (VEC-B VEC2) ) Calculates the cross-product of 2 vec2s. This results in a single-float which is 2 times the area of the triangle.
( DISTANCE (VECTOR-A VEC2) (VECTOR-B VEC2) ) Return the distance between 2 points defined by vectors
vector-a & vector-b. If comparing distances, use
c-distance-squared as it desnt require a sqrt and thus is
faster.
If simply comparing distances then prefer the distance-squared function as
the sqrt required here is (relatively) slow.
( DISTANCE-SQUARED (VECTOR-A VEC2) (VECTOR-B VEC2) ) Finds the squared distance between 2 points defined by vec2s
vector-a & vector-b
distance is the square root of this value. The sqrt function is
(relatively) slow so if all thats needs doing is to compare distances
then prefer the distance-squared function
( DOT (VECTOR-A VEC2) (VECTOR-B VEC2) ) Return the dot product of vector-a and vector-b.
( FACE-FOREWARD (VECTOR-A VEC2) (VECTOR-B VEC2) ) ( FROM-ANGLE (ANGLE SINGLE-FLOAT) ) ( FROM-COMPLEX (C COMPLEX) ) ( LENGTH (VECTOR-A VEC2) ) Returns the length of the vec2
If you only need to compare relative lengths then prefer the length-squared function as sqrt is a (relatively) slow operation.
( LENGTH-SQUARED (VECTOR-A VEC2) ) Return the squared length of the vec2
length is the square root of this value. The sqrt function is
(relatively slow so if all thats needs doing is to compare lengths then
prefer the length-squared function
( LERP (VECTOR-A VEC2) (VECTOR-B VEC2) (AMMOUNT SINGLE-FLOAT) ) Linearly interpolates between the two vec2s by the single-float amount
( MAKE (X SINGLE-FLOAT) (Y SINGLE-FLOAT) ) This takes 2 single-floats and give back a vec2.
( NEGATE (VECTOR-A VEC2) ) Return a vector that is the negated version of the vector passed in
( NORMALIZE (VECTOR-A VEC2) ) This normalizes the given vec2.
( PERP-DOT (VEC-A VEC2) (VEC-B VEC2) ) {TODO}
( ROTATE (VEC VEC2) (ANGLE SINGLE-FLOAT) ) Creates a new vec2 which is equivilent to the original once rotated
counterclockwise by angle radians.
( SPLINE X KNOTS ) {TODO}
( UNITP (VECTOR-A VEC2) ) Checks if the vector is of unit length. As this is a floating point number it checks to see if the length is within the range of 1 + or - and threshold set in base-maths
Note: Old, float epsilons are tricky, I have a ticket open to review this
( DECF PLACE &OPTIONAL DELTA ) ( INCF PLACE &OPTIONAL DELTA ) ( * &REST (VEC3S VEC3) ) ( *S (VECTOR-A VEC3) (A SINGLE-FLOAT) ) Component-wise multiplication of the vector by the scalar
( + &REST (VEC3S VEC3) ) ( +S (VEC3 VEC3) (SCALAR SINGLE-FLOAT) ) Component-wise add of single-float to vec3
( - (VEC3 VEC3) &REST (VEC3S VEC3) ) ( -S (VEC3 VEC3) (SCALAR SINGLE-FLOAT) ) Component-wise subtraction of single-float from vec3
( / (VECTOR-A VEC3) (VECTOR-B VEC3) ) Component-wise division of the two vec3
( /S (VECTOR-A VEC3) (A SINGLE-FLOAT) ) Component-wise division of the vector by the scalar
( 0P (VECTOR-A VEC3) ) Checks if the length of the vector is zero. As this is a floating point number it checks to see if the length is below a threshold set in the base-maths package
Note: Old, float epsilons are tricky, I have a ticket open to review this
( = (VECTOR-A VEC3) (VECTOR-B VEC3) ) Returns either t if the two vectors are equal. Otherwise it returns nil.
( ABS (VECTOR-A VEC3) ) ( ABSOLUTE-DOT (VECTOR-A VEC3) (VECTOR-B VEC3) ) Return the absolute dot product of the vector-a and vector-b.
( BEZIER (A1 VEC3) (A2 VEC3) (B1 VEC3) (B2 VEC3) (AMMOUNT SINGLE-FLOAT) ) {TODO}
( COPY-VEC3 (VEC3 VEC3) ) Returns a fresh vec3 which is v3:= to the orignal vector
( CROSS (VEC-A VEC3) (VEC-B VEC3) ) ( DISTANCE (VECTOR-A VEC3) (VECTOR-B VEC3) ) Return the distance between 2 points defined by vectors
vector-a & vector-b. If comparing distances, use
c-distance-squared as it desnt require a sqrt and thus is
faster.
If simply comparing distances then prefer the distance-squared function as
the sqrt required here is (relatively) slow.
( DISTANCE-SQUARED (VECTOR-A VEC3) (VECTOR-B VEC3) ) Finds the squared distance between 2 points defined by vec3s
vector-a & vector-b
distance is the square root of this value. The sqrt function is
(relatively) slow so if all thats needs doing is to compare distances
then prefer the distance-squared function
( DOT (VECTOR-A VEC3) (VECTOR-B VEC3) ) Return the dot product of vector-a and vector-b.
( FACE-FOREWARD (VECTOR-A VEC3) (VECTOR-B VEC3) ) ( LENGTH (VECTOR-A VEC3) ) Returns the length of the vec3
If you only need to compare relative lengths then prefer the length-squared function as sqrt is a (relatively) slow operation.
( LENGTH-SQUARED (VECTOR-A VEC3) ) Return the squared length of the vec3
length is the square root of this value. The sqrt function is
(relatively slow so if all thats needs doing is to compare lengths then
prefer the length-squared function
( LERP (VECTOR-A VEC3) (VECTOR-B VEC3) (AMMOUNT SINGLE-FLOAT) ) Linearly interpolates between the two vec3s by the single-float amount
( MAKE (X SINGLE-FLOAT) (Y SINGLE-FLOAT) (Z SINGLE-FLOAT) ) Make a vec3 from 3 single-floats
( NEGATE (VECTOR-A VEC3) ) Return a vector that is the negated version of the vector passed in
( NORMALIZE (VECTOR-A VEC3) ) This normalizes the given vec3.
( ROTATE (VEC VEC3) (ROTATION VEC3) ) Creates a new vec3 which is equivilent to the original once rotated
in each axis by the radians in the rotation vec3 provided.
( SPLINE X KNOTS ) {TODO}
( UNITP (VECTOR-A VEC3) ) Checks if the vector is of unit length. As this is a floating point number it checks to see if the length is within the range of 1 + or - and threshold set in base-maths
Note: Old, float epsilons are tricky, I have a ticket open to review this
( DECF PLACE &OPTIONAL DELTA ) ( INCF PLACE &OPTIONAL DELTA ) ( * &REST (VEC4S VEC4) ) ( *S (VECTOR-A VEC4) (A SINGLE-FLOAT) ) Component-wise multiplication of the vector by the scalar
( + &REST (VEC4S VEC4) ) ( +S (VEC4 VEC4) (SCALAR SINGLE-FLOAT) ) Component-wise add of single-float to vec4
( - (VEC4 VEC4) &REST (VEC4S VEC4) ) ( -S (VEC4 VEC4) (SCALAR SINGLE-FLOAT) ) Component-wise subtraction of single-float from vec4
( / (VECTOR-A VEC4) (VECTOR-B VEC4) ) Component-wise division of the two vec4
( /S (VECTOR-A VEC4) (A SINGLE-FLOAT) ) Component-wise division of the vector by the scalar
( 0P (VECTOR-A VEC4) ) Checks if the length of the vector is zero. As this is a floating point number it checks to see if the length is below a threshold set in the base-maths package
Note: Old, float epsilons are tricky, I have a ticket open to review this
( = (VECTOR-A VEC4) (VECTOR-B VEC4) ) Returns either t if the two vectors are equal. Otherwise it returns nil.
( ABS (VECTOR-A VEC4) ) ( ABSOLUTE-DOT (VECTOR-A VEC4) (VECTOR-B VEC4) ) Return the absolute dot product of the vector-a and vector-b.
( BEZIER (A1 VEC4) (A2 VEC4) (B1 VEC4) (B2 VEC4) (AMMOUNT SINGLE-FLOAT) ) {TODO}
( COPY-VEC4 (VEC4 VEC4) ) Returns a fresh vec4 which is v4:= to the orignal vector
( DISTANCE (VECTOR-A VEC4) (VECTOR-B VEC4) ) Return the distance between 2 points defined by vectors
vector-a & vector-b. If comparing distances, use
c-distance-squared as it desnt require a sqrt and thus is
faster.
If simply comparing distances then prefer the distance-squared function as
the sqrt required here is (relatively) slow.
( DISTANCE-SQUARED (VECTOR-A VEC4) (VECTOR-B VEC4) ) Finds the squared distance between 2 points defined by vec4s
vector-a & vector-b
distance is the square root of this value. The sqrt function is
(relatively) slow so if all thats needs doing is to compare distances
then prefer the distance-squared function
( DOT (VECTOR-A VEC4) (VECTOR-B VEC4) ) Return the dot product of vector-a and vector-b.
( FACE-FOREWARD (VECTOR-A VEC4) (VECTOR-B VEC4) ) ( LENGTH (VECTOR-A VEC4) ) Returns the length of the vec4
If you only need to compare relative lengths then prefer the length-squared function as sqrt is a (relatively) slow operation.
( LENGTH-SQUARED (VECTOR-A VEC4) ) Return the squared length of the vec4
length is the square root of this value. The sqrt function is
(relatively slow so if all thats needs doing is to compare lengths then
prefer the length-squared function
( LERP (VECTOR-A VEC4) (VECTOR-B VEC4) (AMMOUNT SINGLE-FLOAT) ) Linearly interpolates between the two vec4s by the single-float amount
( MAKE (X SINGLE-FLOAT) (Y SINGLE-FLOAT) (Z SINGLE-FLOAT) (W SINGLE-FLOAT) ) Make a vec4 from 4 single-floats
( NEGATE (VECTOR-A VEC4) ) Return a vector that is the negated version of the vector passed in
( NORMALIZE (VECTOR-A VEC4) ) This normalizes the given vec4.
( SPLINE X KNOTS ) {TODO}
( UNITP (VECTOR-A VEC4) ) Checks if the vector is of unit length. As this is a floating point number it checks to see if the length is within the range of 1 + or - and threshold set in base-maths
Note: Old, float epsilons are tricky, I have a ticket open to review this
( * (ACCUM-VEC VEC2) &REST (VEC2S VEC2) ) ( *S (VEC2 VEC2) (A SINGLE-FLOAT) ) Destructively performs component-wise multiplication of the vec2 by
the scalar
( + (ACCUM-VEC VEC2) &REST (VEC2S VEC2) ) ( +S (VEC2 VEC2) (SCALAR SINGLE-FLOAT) ) Destructive Component-wise add of single-float into the given vec2
( - (ACCUM-VEC VEC2) &REST (VEC2S VEC2) ) ( -S (VEC2 VEC2) (SCALAR SINGLE-FLOAT) ) Destructive Component-wise subtraction of single-float from the given vec2
( / (VEC2-A VEC2) (VEC2-B VEC2) ) ( /S (VEC2 VEC2) (A SINGLE-FLOAT) ) Destructively performs component-wise division of the vec2 by
the scalar
( NEGATE (VECTOR-A VEC2) ) Destructively negates the given vector
( NORMALIZE (VECTOR-A VEC2) ) Destructively normalizes the vector
( ROTATE (VEC VEC2) (ANGLE SINGLE-FLOAT) ) Rotates the give vec2 counterclockwise by angle radians.
( SET-COMPONENTS (X SINGLE-FLOAT) (Y SINGLE-FLOAT) (VEC VEC2) ) Destructively updates of the components of the given vec2 to the new single-floats provided.
( * (ACCUM-VEC VEC3) &REST (VEC3S VEC3) ) ( *S (VEC3 VEC3) (A SINGLE-FLOAT) ) Destructively performs component-wise multiplication of the vec3 by
the scalar
( + (ACCUM-VEC VEC3) &REST (VEC3S VEC3) ) ( +S (VEC3 VEC3) (SCALAR SINGLE-FLOAT) ) Destructive Component-wise add of single-float into the given vec3
( - (ACCUM-VEC VEC3) &REST (VEC3S VEC3) ) ( -S (VEC3 VEC3) (SCALAR SINGLE-FLOAT) ) Destructive Component-wise subtraction of single-float from the given vec3
( / (VEC3-A VEC3) (VEC3-B VEC3) ) ( /S (VEC3 VEC3) (A SINGLE-FLOAT) ) Destructively performs component-wise division of the vec3 by
the scalar
( NEGATE (VECTOR-A VEC3) ) Destructively negates the given vector
( NORMALIZE (VECTOR-A VEC3) ) Destructively normalizes the vector
( ROTATE (VEC VEC3) (ROTATION VEC3) ) Rotates the given vec3 counterclockwise by the radians in the rotation vec3 provided.
( SET-COMPONENTS (X SINGLE-FLOAT) (Y SINGLE-FLOAT) (Z SINGLE-FLOAT) (VEC VEC3) ) Destructively updates of the components of the given vec3 to the new single-floats provided.
( * (ACCUM-VEC VEC4) &REST (VEC4S VEC4) ) ( *S (VEC4 VEC4) (A SINGLE-FLOAT) ) Destructively performs component-wise multiplication of the vec4 by
the scalar
( + (ACCUM-VEC VEC4) &REST (VEC4S VEC4) ) ( +S (VEC4 VEC4) (SCALAR SINGLE-FLOAT) ) Destructive Component-wise add of single-float into the given vec2
( - (ACCUM-VEC VEC4) &REST (VEC4S VEC4) ) ( -S (VEC4 VEC4) (SCALAR SINGLE-FLOAT) ) Destructive Component-wise subtraction of single-float from the given vec2
( / (VEC4-A VEC4) (VEC4-B VEC4) ) ( /S (VEC4 VEC4) (A SINGLE-FLOAT) ) Destructively performs component-wise division of the vec4 by
the scalar
( NEGATE (VECTOR-A VEC4) ) Destructively negates the given vector
( NORMALIZE (VECTOR-A VEC4) ) Destructively normalizes the vector
( SET-COMPONENTS (X SINGLE-FLOAT) (Y SINGLE-FLOAT) (Z SINGLE-FLOAT) (W SINGLE-FLOAT) (VEC VEC4) ) Destructively updates of the components of the given vec2 to the new single-floats provided.
( DECF PLACE &OPTIONAL DELTA ) Decrements the vector in 'place' by another vector of the same kind
( INCF PLACE &OPTIONAL DELTA ) Increments the vector in 'place' by another vector of the same kind
( * VEC-A SCALAR-OR-VEC ) Adds two vectors together and returns the result as a new vector of the same type
( + &REST VECS ) ( +S VEC SCALAR ) ( - &REST VECS ) ( -S VEC SCALAR ) ( / VEC-A SCALAR-OR-VEC ) ( /= &REST VECS ) Returns either t if the two vectors are equal. Otherwise it returns nil.
( 0P VEC-A ) Returns t if the vector is of zero length
( = &REST VECS ) Returns either t if the vectors are equal. Otherwise it returns nil.
( ABSOLUTE-DOT VEC-A VEC-B ) Adds two vectors together and returns the result as a new vector of the same type
( BEZIER A1 A2 B1 B2 AMMOUNT ) {TODO}
( CROSS VEC-A VEC-B ) Calculates the cross-product of 2 vectors, i.e. the vector that lies perpendicular to them both. The resulting vector will not be normalized.
( DISTANCE VEC-A VEC-B ) Return the distance between 2 points defined by vectors vector-a & vector-b. If comparing distances, use c-distance-squared as it desnt require a sqrt and thus is faster.
( DISTANCE-SQUARED VEC-A VEC-B ) Returns the squared distance between 2 points defined by vectors vector-a & vector-b
( DOT VEC-A VEC-B ) Returns the dot product of the 2 given vectors.
( FACE-FOREWARD VEC-A VEC-B ) ( LENGTH VEC-A ) Returns the length of a vector If you only need to compare relative lengths then definately stick to length-squared as the sqrt is a slow operation.
( LENGTH-SQUARED VEC-A ) Finds the squared distance between 2 points defined by vectors vector-a & vector-b
( LERP VECTOR-A VECTOR-B AMMOUNT ) Linearly interpolates between the two vectors by the given amount. Returns a new vector of the same kind.
( MERGE-INTO-VECTOR &REST VECTORS ) Takes a list of vectors and combines them into a new vector
( MIX VECTOR-A VECTOR-B AMMOUNT ) Linearly interpolates between the two vectors by the given amount. Returns a new vector of the same kind.
( NEGATE VEC ) Negates the given vector. Returns a new vector of the same kind.
( NORMALIZE VEC-A ) Normalizes the vector. Returns a new vector of the same kind.
( PERP-DOT VEC-A VEC-B ) {TODO}
( SWIZZLE VEC PATTERN ) ( S~ VEC PATTERN ) ( UNITP VEC-A ) Returns T is the given vector has a length eql to 1
( W VEC ) Returns the w component of the vector
( X VEC ) Returns the x component of the vector
( Y VEC ) Returns the y component of the vector
( Z VEC ) Returns the z component of the vector
( * &REST (MATRICES MAT2) ) ( *S (MAT-A MAT2) (SCALAR SINGLE-FLOAT) ) Multiplies the components of the mat2 by the scalar
provided
( *V (MAT-A MAT2) (VEC-A VEC2) ) ( + (MAT-A MAT2) (MAT-B MAT2) ) Adds the 2 matrices component wise and returns the result as
a new mat2
( - (MAT-A MAT2) (MAT-B MAT2) ) Subtracts the 2 matrices component wise and returns the result
as a new mat2
( 0! ) Return a mat2 where all components are zero
( 0P (MAT-A MAT2) ) Returns T if this is a zero matrix
As contents of the matrix are floats the values have an error bound as defined in base-maths
Note: Old, float epsilons are tricky, I have a ticket open to review this
( = (MAT-A MAT2) (MAT-B MAT2) ) Returns T if all elements of both matrices provided are equal
( ADJOINT (MAT-A MAT2) ) Returns the adjoint of the provided matrix
( COPY-MAT2 (MAT2 MAT2) ) Returns a fresh mat2 which is m2:= to the orignal matrix
( FROM-COLUMNS (COL-1 VEC2) (COL-2 VEC2) ) ( FROM-ROWS (ROW-1 VEC2) (ROW-2 VEC2) ) ( GET-COLUMN (MAT-A MAT2) (COL-NUM (INTEGER 0 1)) ) Return the specified column of the matrix as a vec2
( GET-COLUMNS (MAT-A MAT2) ) Return the columns of the matrix as 2 vec2s
( GET-ROW (MAT-A MAT2) (ROW-NUM (INTEGER 0 1)) ) Return the specified row of the matrix as a vec2
( GET-ROWS (MAT-A MAT2) ) Return the rows of the matrix as 2 vec2s
( IDENTITY ) Return a mat2 identity matrix
( IDENTITYP (MAT-A MAT2) ) Returns T if this is an identity matrix
As contents of the matrix are floats the values have an error bound as defined in base-maths
Note: Old, float epsilons are tricky, I have a ticket open to review this
( MAKE (A SINGLE-FLOAT) (B SINGLE-FLOAT) (C SINGLE-FLOAT) (D SINGLE-FLOAT) ) Make a mat2. Data must be provided in row major order
( MELM (MAT-A MAT2) (ROW (INTEGER 0 1)) (COL (INTEGER 0 1)) ) Provides access to data in the matrix by row and column number. The actual data is stored in a 1d list in column major order, but this abstraction means we only have to think in row major order which is how most mathematical texts and online tutorials choose to show matrices
( MROW*VEC2 (VEC VEC2) (MAT-A MAT2) ) {TODO}
( NEGATE (MAT-A MAT2) ) Negates the components of the mat2
( ROTATION-FROM-EULER (ANGLE SINGLE-FLOAT) ) Creates a rotation mat2 which represents a anticlockwise rotation.
The angle is specified in radians
( SCALE (SCALE-VEC2 VEC2) ) Returns a matrix which will scale by the amounts specified
( TRACE (MAT-A MAT2) ) Returns the trace of the matrix (That is the diagonal values)
( TRANSPOSE (MAT-A MAT2) ) Returns the transpose of the provided matrix
( * &REST (MATRICES MAT3) ) ( *S (MAT-A MAT3) (SCALAR SINGLE-FLOAT) ) Multiplies the components of the mat3 by the scalar
provided
( *V (MAT-A MAT3) (VEC-A VEC3) ) ( + (MAT-A MAT3) (MAT-B MAT3) ) Adds the 2 matrices component wise and returns the result as
a new mat3
( - (MAT-A MAT3) (MAT-B MAT3) ) Subtracts the 2 matrices component wise and returns the result
as a new mat3
( 0! ) ( 0P (MAT-A MAT3) ) Returns T if this is a zero matrix
As contents of the matrix are floats the values have an error bound as defined in base-maths
Note: Old, float epsilons are tricky, I have a ticket open to review this
( = (MAT-A MAT3) (MAT-B MAT3) ) Returns T if all elements of both matrices provided are equal
( ADJOINT (MAT-A MAT3) ) Returns the adjoint of the provided matrix
( AFFINE-INVERSE (MAT-A MAT3) ) returns the inverse of the mat3
( COPY-MAT3 (MAT3 MAT3) ) Returns a fresh mat3 which is m3:= to the orignal matrix
( DETERMINANT (MAT-A MAT3) ) Returns the determinant of the mat3 (uses the cramer method)
( FROM-COLUMNS (COL-1 VEC3) (COL-2 VEC3) (COL-3 VEC3) ) ( FROM-DIRECTION (UP3 VEC3) (DIR3 VEC3) ) Creates a mat3 that would rotate the vector (v! 0 0 -1) to point in the given
direction.
( FROM-ROWS (ROW-1 VEC3) (ROW-2 VEC3) (ROW-3 VEC3) ) ( GET-AXIS-ANGLE (MAT-A MAT3) ) Gets one possible axis-angle pair that will generate this mat3.
Assumes that this is a rotation matrix. It is critical that this is true (and elements are between -1f0 and 1f0) as otherwise you will at best get a runtime error, and most likely a silently incorrect result.
( GET-COLUMN (MAT-A MAT3) (COL-NUM (INTEGER 0 3)) ) Return the specified column of the matrix as a vec3
( GET-COLUMNS (MAT-A MAT3) ) Return the columns of the matrix as 3 vec3s
( GET-FIXED-ANGLES (MAT-A MAT3) ) Gets one set of possible z-y-x fixed angles that will generate
this mat3.
Assumes that this is a rotation matrix. It is critical that this is true (and elements are between -1f0 and 1f0) as otherwise you will at best get a runtime error, and most likely a silently incorrect result.
( GET-ROW (MAT-A MAT3) (ROW-NUM (INTEGER 0 3)) ) Return the specified row of the matrix as a vec3
( GET-ROWS (MAT-A MAT3) ) Return the rows of the matrix as 3 vec3s
( IDENTITY ) Return a mat3 identity matrix
( IDENTITYP (MAT-A MAT3) ) Returns T if this is an identity matrix
As contents of the matrix are floats the values have an error bound as defined in base-maths
Note: Old, float epsilons are tricky, I have a ticket open to review this
( LOOK-AT (UP3 VEC3) (FROM3 VEC3) (TO3 VEC3) ) Creates a mat3 that would rotate the vector (v! 0 0 -1) to point in the
direction from from3 to to3
( MAKE (A SINGLE-FLOAT) (B SINGLE-FLOAT) (C SINGLE-FLOAT) (D SINGLE-FLOAT)
(E SINGLE-FLOAT) (F SINGLE-FLOAT) (G SINGLE-FLOAT) (H SINGLE-FLOAT)
(I SINGLE-FLOAT) ) Make a mat3. Data must be provided in row major order
( MELM (MAT-A MAT3) (ROW (INTEGER 0 2)) (COL (INTEGER 0 2)) ) Provides access to data in the matrix by row and column number. The actual data is stored in a 1d list in column major order, but this abstraction means we only have to think in row major order which is how most mathematical texts and online tutorials choose to show matrices
( MROW*VEC3 (VEC VEC3) (MAT-A MAT3) ) {TODO}
( NEGATE (MAT-A MAT3) ) Negates the components of the mat3
( POINT-AT (UP VEC3) (FROM3 VEC3) (TO3 VEC3) ) Create the mat3 rotation portion to a 'world to view' 'look-at' matrix
( ROTATION-FROM-AXIS-ANGLE (AXIS3 VEC3) (ANGLE SINGLE-FLOAT) ) Returns a mat3 which will rotate a point about the axis
specified by the angle provided
( ROTATION-FROM-EULER (VEC3-A VEC3) ) Creates a rotation mat3 which represents a anticlockwise rotation.
The angle is specified in radians
( ROTATION-X (ANGLE SINGLE-FLOAT) ) Returns a mat3 which would rotate a point around the x axis
by the specified amount
( ROTATION-Y (ANGLE SINGLE-FLOAT) ) Returns a mat3 which would rotate a point around the y axis
by the specified amount
( ROTATION-Z (ANGLE SINGLE-FLOAT) ) Returns a mat3 which would rotate a point around the z axis
by the specified amount
( SCALE (SCALE-VEC3 VEC3) ) Returns a matrix which will scale by the amounts specified
( TRACE (MAT-A MAT3) ) Returns the trace of the matrix (That is the diagonal values)
( TRANSPOSE (MAT-A MAT3) ) Returns the transpose of the provided matrix
( * &REST (MATRICES MAT4) ) ( *S (MAT-A MAT4) (SCALAR SINGLE-FLOAT) ) Multiplies the components of the mat4 by the scalar
provided
( *V (MAT-A MAT4) (VEC4 VEC4) ) ( *V3 (MAT-A MAT4) (VEC3 VEC3) ) ( + (MAT-A MAT4) (MAT-B MAT4) ) Adds the 2 matrices component wise and returns the result as
a new mat4
( - (MAT-A MAT4) (MAT-B MAT4) ) Subtracts the 2 matrices component wise and returns the result
as a new mat4
( 0! ) Return a mat4 where every component is 0
( 0P (MAT-A MAT4) ) Returns T if this is a zero matrix
As contents of the matrix are floats the values have an error bound as defined in base-maths
Note: Old, float epsilons are tricky, I have a ticket open to review this
( = (MAT-A MAT4) (MAT-B MAT4) ) Returns T if all elements of both matrices provided are equal
( ADJOINT (MAT-A MAT4) ) Returns the adjoint of the provided matrix
( AFFINE-INVERSE (MAT-A MAT4) ) returns the inverse of the mat4
( COPY-MAT4 (MAT4 MAT4) ) Returns a fresh mat4 which is m4:= to the orignal matrix
( DETERMINANT (MAT-A MAT4) ) Returns the determinant of the mat4
( FROM-COLUMNS (COL-1 VEC4) (COL-2 VEC4) (COL-3 VEC4) (COL-4 VEC4) ) ( FROM-COLUMNS-V3 (COL-1 VEC3) (COL-2 VEC3) (COL-3 VEC3) ) ( FROM-DIRECTION (UP3 VEC3) (DIR3 VEC3) ) Creates a mat4 that would rotate the vector (v! 0 0 -1) to face in the given
direction.
( FROM-MAT3 (M-A MAT3) ) ( FROM-ROWS (ROW-1 VEC4) (ROW-2 VEC4) (ROW-3 VEC4) (ROW-4 VEC4) ) ( FROM-ROWS-V3 (ROW-1 VEC3) (ROW-2 VEC3) (ROW-3 VEC3) ) ( GET-AXIS-ANGLE (MAT-A MAT4) ) Gets one possible axis-angle pair that will generate this mat4.
Assumes that this is a rotation matrix. It is critical that this is true (and elements are between -1f0 and 1f0) as otherwise you will at best get a runtime error, and most likely a silently incorrect result.
( GET-COLUMN (MAT-A MAT4) (COL-NUM (INTEGER 0 3)) ) Return the specified column of the matrix as a vec4
( GET-COLUMNS (MAT-A MAT4) ) Return the columns of the matrix as 4 vec4s
( GET-FIXED-ANGLES (MAT-A MAT4) ) Gets one set of possible z-y-x fixed angles that will generate
this mat4.
Assumes that this is a rotation matrix. It is critical that this is true (and elements are between -1f0 and 1f0) as otherwise you will at best get a runtime error, and most likely a silently incorrect result.
( GET-ROW (MAT-A MAT4) (ROW-NUM (INTEGER 0 3)) ) Return the specified row of the matrix as a vec4
( GET-ROWS (MAT-A MAT4) ) Return the rows of the matrix as 4 vec4s
( IDENTITY ) Return a mat4 identity matrix
( IDENTITYP (MAT-A MAT4) ) Returns T if this is an identity matrix
As contents of the matrix are floats the values have an error bound as defined in base-maths
Note: Old, float epsilons are tricky, I have a ticket open to review this
( INVERSE (MATRIX MAT4) ) Inverts the matrix.
( LOOK-AT (UP3 VEC3) (FROM3 VEC3) (TO3 VEC3) ) Creates a mat4 that would rotate the vector (v! 0 0 -1) to point in the
direction from from3 to to3
( MAKE (A SINGLE-FLOAT) (B SINGLE-FLOAT) (C SINGLE-FLOAT) (D SINGLE-FLOAT)
(E SINGLE-FLOAT) (F SINGLE-FLOAT) (G SINGLE-FLOAT) (H SINGLE-FLOAT)
(I SINGLE-FLOAT) (J SINGLE-FLOAT) (K SINGLE-FLOAT) (L SINGLE-FLOAT)
(M SINGLE-FLOAT) (N SINGLE-FLOAT) (O SINGLE-FLOAT) (P SINGLE-FLOAT) ) Make a mat4. Data must be provided in row major order
( MELM (MAT-A MAT4) (ROW (INTEGER 0 3)) (COL (INTEGER 0 3)) ) Provides access to data in the matrix by row and column number. The actual data is stored in a 1d list in column major order, but this abstraction means we only have to think in row major order which is how most mathematical texts and online tutorials choose to show matrices
( MINOR (MAT-A MAT4) (ROW-0 (INTEGER 0 3)) (ROW-1 (INTEGER 0 3)) (ROW-2 (INTEGER 0 3))
(COL-0 (INTEGER 0 3)) (COL-1 (INTEGER 0 3)) (COL-2 (INTEGER 0 3)) ) Returns the minor of the matrix
( MROW*VEC4 (VEC VEC4) (MAT-A MAT4) ) {TODO}
( NEGATE (MAT-A MAT4) ) Negates the components of the mat4
( POINT-AT (UP VEC3) (FROM3 VEC3) (TO3 VEC3) ) Create the mat4 rotation portion to a 'world to view' 'look-at' matrix
( ROTATION-FROM-AXIS-ANGLE (AXIS3 VEC3) (ANGLE SINGLE-FLOAT) ) Returns a mat4 which will rotate a point about the axis
specified by the angle provided
( ROTATION-FROM-EULER (VEC3-A VEC3) ) Creates a rotation mat4 which represents a anticlockwise rotation.
The angle is specified in radians
( ROTATION-FROM-MAT3 (M-A MAT3) ) ( ROTATION-X (ANGLE SINGLE-FLOAT) ) Returns a mat4 which would rotate a point around the x axis
by the specified amount
( ROTATION-Y (ANGLE SINGLE-FLOAT) ) Returns a mat4 which would rotate a point around the y axis
by the specified amount
( ROTATION-Z (ANGLE SINGLE-FLOAT) ) Returns a mat4 which would rotate a point around the z axis
by the specified amount
( SCALE (SCALE-VEC3 VEC3) ) Returns a matrix which will scale by the amounts specified
( TO-MAT3 (MAT4 MAT4) ) ( TRACE (MAT-A MAT4) ) Returns the trace of the matrix (That is the diagonal values)
( TRANSLATION (VEC-A (SIMPLE-ARRAY SINGLE-FLOAT)) ) ( TRANSPOSE (M-A MAT4) ) Returns the transpose of the provided matrix
( * (ACCUM-MAT MAT2) &REST (MAT2S MAT2) ) ( *S (MAT-TO-MUTATE MAT2) (SCALAR SINGLE-FLOAT) ) ( *V (MAT-A MAT2) (VEC2-TO-MUTATE VEC2) ) ( + (MAT-ACCUM MAT2) (MAT-B MAT2) ) Add the second mat2 component wise to the first and return
the first
( - (MAT-ACCUM MAT2) (MAT-B MAT2) ) Subtracts the second mat2 component wise from the first and return
the first
( ADJOINT (MAT-TO-MUTATE MAT2) ) Mutates the given mat2 to be it's own adjoint
( MROW*VEC2 (VEC2-TO-MUTATE VEC2) (MAT-A MAT2) ) {TODO}
( NEGATE (MAT-TO-NEGATE MAT2) ) Negates the components of the mat2
( SET-COMPONENTS (C00 SINGLE-FLOAT) (C01 SINGLE-FLOAT) (C10 SINGLE-FLOAT) (C11 SINGLE-FLOAT)
(MAT2-TO-MUTATE MAT2) ) Destructively updates of the components of the given mat2 to the new single-floats provided.
( SET-FROM-COLUMNS (MAT-TO-MUTATE MAT2) (COL-1 VEC2) (COL-2 VEC2) ) ( SET-FROM-ROWS (MAT-TO-MUTATE MAT2) (ROW-1 VEC2) (ROW-2 VEC2) ) ( SET-FROM-SCALE (MAT-TO-MUTATE MAT2) (SCALE-VEC2 VEC2) ) Mutates the given mat2 to be a which will scale by the amounts specified
( SET-ROTATION-FROM-EULER (MAT-TO-MUTATE MAT2) (ANGLE SINGLE-FLOAT) ) Destructively modifies the mat2 to be a rotation matrix
whos rotation angle comes from the single-float provided.
( TRANSPOSE (MAT-TO-TRANSPOSE MAT2) ) Mutates the given mat2 to be it's own transpose
( * (ACCUM-MAT MAT3) &REST (MAT3S MAT3) ) ( *S (MAT-TO-MUTATE MAT3) (SCALAR SINGLE-FLOAT) ) Multiplies the components of the mat4 by the scalar
provided
( *V (MAT-A MAT3) (VEC3-TO-MUTATE VEC3) ) ( + (MAT-ACCUM MAT3) (MAT-B MAT3) ) Add the second mat3 component wise to the first and return
the first
( - (MAT-ACCUM MAT3) (MAT-B MAT3) ) Subtracts the second mat3 component wise from the first and return
the first
( ADJOINT (MAT-TO-MUTATE MAT3) ) Mutates the given mat3 to be it's own adjoint
( AFFINE-INVERSE (MAT-TO-INVERT MAT3) ) Mutates the given mat3 to be it's own inverse
( MROW*VEC3 (VEC3-TO-MUTATE VEC3) (MAT-A MAT3) ) {TODO}
( NEGATE (MAT-TO-NEGATE MAT3) ) Negates the components of the mat3
( SET-COMPONENTS (C00 SINGLE-FLOAT) (C01 SINGLE-FLOAT) (C02 SINGLE-FLOAT) (C10 SINGLE-FLOAT)
(C11 SINGLE-FLOAT) (C12 SINGLE-FLOAT) (C20 SINGLE-FLOAT) (C21 SINGLE-FLOAT)
(C22 SINGLE-FLOAT) (MAT3-TO-MUTATE MAT3) ) Destructively updates of the components of the given mat3 to the new single-floats provided.
( SET-FROM-COLUMNS (MAT-TO-MUTATE MAT3) (COL-1 VEC3) (COL-2 VEC3) (COL-3 VEC3) ) ( SET-FROM-ROTATION-X (MAT-TO-MUTATE MAT3) (ANGLE SINGLE-FLOAT) ) Destructively updates of the components of the given mat3 making
it a matrix which would rotate a point around the x axis by the
specified amount
( SET-FROM-ROTATION-Y (MAT-TO-MUTATE MAT3) (ANGLE SINGLE-FLOAT) ) Destructively updates of the components of the given mat3 making
it a matrix which would rotate a point around the y axis by the
specified amount
( SET-FROM-ROTATION-Z (MAT-TO-MUTATE MAT3) (ANGLE SINGLE-FLOAT) ) Destructively updates of the components of the given mat3 making
it a matrix which would rotate a point around the z axis by the
specified amount
( SET-FROM-ROWS (MAT-TO-MUTATE MAT3) (ROW-1 VEC3) (ROW-2 VEC3) (ROW-3 VEC3) ) ( SET-FROM-SCALE (MAT-TO-MUTATE MAT3) (SCALE-VEC3 VEC3) ) Mutates the given mat3 to be a matrix which will scale by the amounts
specified
( SET-ROTATION-FROM-AXIS-ANGLE (MAT-TO-MUTATE MAT3) (AXIS3 VEC3) (ANGLE SINGLE-FLOAT) ) Destructively updates of the components of the given mat3 making
it a matrix which will rotate a point about the axis specified by
the angle provided
( SET-ROTATION-FROM-EULER (MAT-TO-MUTATE MAT3) (VEC3-A VEC3) ) ( TRANSPOSE (MAT-TO-TRANSPOSE MAT3) ) Mutates the given mat3 to be it's own transpose
( * (ACCUM-MAT MAT4) &REST (MAT4S MAT4) ) ( *S (MAT-TO-MUTATE MAT4) (SCALAR SINGLE-FLOAT) ) Destructively performs component-wise multiplication of the vec3 by
the scalar
( *V (MAT-A MAT4) (VEC4-TO-MUTATE VEC4) ) ( *V3 (MAT-A MAT4) (VEC3-TO-MUTATE VEC3) ) ( + (MAT-ACCUM MAT4) (MAT-B MAT4) ) Add the second mat4 component wise to the first and return
the first
( - (MAT-ACCUM MAT4) (MAT-B MAT4) ) Subtracts the second mat4 component wise from the first and return
the first
( ADJOINT (MAT-TO-MUTATE MAT4) ) Mutates the given mat4 to be it's own adjoint
( AFFINE-INVERSE (MAT-TO-INVERT MAT4) ) Mutates the given mat4 to be it's own inverse
( MROW*VEC4 (VEC4-TO-MUTATE VEC4) (MAT-A MAT4) ) {TODO}
( NEGATE (MAT-TO-NEGATE MAT4) ) Negates the components of the mat4
( SET-COMPONENTS (C00 SINGLE-FLOAT) (C01 SINGLE-FLOAT) (C02 SINGLE-FLOAT) (C03 SINGLE-FLOAT)
(C10 SINGLE-FLOAT) (C11 SINGLE-FLOAT) (C12 SINGLE-FLOAT) (C13 SINGLE-FLOAT)
(C20 SINGLE-FLOAT) (C21 SINGLE-FLOAT) (C22 SINGLE-FLOAT) (C23 SINGLE-FLOAT)
(C30 SINGLE-FLOAT) (C31 SINGLE-FLOAT) (C32 SINGLE-FLOAT) (C33 SINGLE-FLOAT)
(MAT4-TO-MUTATE MAT4) ) Destructively updates of the components of the given mat4 to the new single-floats provided.
( SET-FROM-COLUMNS (MAT-TO-MUTATE MAT4) (COL-1 VEC4) (COL-2 VEC4) (COL-3 VEC4) (COL-4 VEC4) ) ( SET-FROM-COLUMNS-V3 (MAT-TO-MUTATE MAT4) (COL-1 VEC3) (COL-2 VEC3) (COL-3 VEC3) ) ( SET-FROM-MAT3 (MAT-TO-MUTATE MAT4) (M-A MAT3) ) ( SET-FROM-ROTATION-X (MAT-TO-MUTATE MAT4) (ANGLE SINGLE-FLOAT) ) Destructively updates of the components of the given mat4 making
it a matrix which would rotate a point around the x axis by the
specified amount
( SET-FROM-ROTATION-Y (MAT-TO-MUTATE MAT4) (ANGLE SINGLE-FLOAT) ) Destructively updates of the components of the given mat4 making
it a matrix which would rotate a point around the y axis by the
specified amount
( SET-FROM-ROTATION-Z (MAT-TO-MUTATE MAT4) (ANGLE SINGLE-FLOAT) ) Destructively updates of the components of the given mat4 making
it a matrix which would rotate a point around the z axis by the
specified amount
( SET-FROM-ROWS (MAT-TO-MUTATE MAT4) (ROW-1 VEC4) (ROW-2 VEC4) (ROW-3 VEC4) (ROW-4 VEC4) ) ( SET-FROM-ROWS-V3 (MAT-TO-MUTATE MAT4) (ROW-1 VEC3) (ROW-2 VEC3) (ROW-3 VEC3) ) ( SET-FROM-SCALE (MAT-TO-MUTATE MAT4) (SCALE-VEC3 VEC3) ) Mutates the given mat4 to be a matrix which will scale by the amounts
specified
( SET-FROM-TRANSLATION (MAT-TO-MUTATE MAT4) (VEC-A (SIMPLE-ARRAY SINGLE-FLOAT)) ) Destructively updates of the components of the given mat4 making
it a matrix which which will translate a point by the specified amount
( SET-ROTATION-FROM-AXIS-ANGLE (MAT-TO-MUTATE MAT4) (AXIS3 VEC3) (ANGLE SINGLE-FLOAT) ) Destructively updates of the components of the given mat4 making
it a matrix which will rotate a point about the axis specified by
the angle provided
( SET-ROTATION-FROM-EULER (MAT-TO-MUTATE MAT4) (VEC3-A VEC3) ) ( TRANSPOSE (MAT-TO-TRANSPOSE MAT4) ) Mutates the given mat4 to be it's own transpose
( * MATRIX-A MAT-VEC-OR-SCALAR ) Takes any number of matrices (of the same kind) and multiplies them together returning a new matrix of the same kind.
( + &REST MATRICES ) Takes any number of matrices (of the same kind) and performs component-wise addition them together returning a new matrix of the same kind.
( - &REST MATRICES ) Takes any number of matrices (of the same kind) and performs component-wise negation of them returning a new matrix of the same kind.
( /= &REST MATRICES ) Returns either t if the matrices are equal. Otherwise it returns nil.
( 0P MATRIX ) Returns T if all the components of the matrix = 0
( 1+ MATRIX-A MATRIX-B ) Returns a new matrix which is equal to the given matrix with every component incremented by 1
( 1- MATRIX-A MATRIX-B ) Returns a new matrix which is equal to the given matrix with every component decremented by 1
( = &REST MATRICES ) Returns either t if the matrices are equal. Otherwise it returns nil.
( AFFINE-INVERSE MATRIX-A ) Returns a new matrix which is the inverse of the one given.
( DETERMINANT MATRIX-A ) Returns the determinant of the given matrix
( ELM MATRIX ROW COL ) DEPRECATED: Please use melm
( ELT MATRIX ROW COL ) DEPRECATED: Please use melm
( GET-COLUMN MATRIX-A COL-NUM ) Returns the specifed column of the matrix as vector
( GET-COLUMNS MATRIX-A ) Returns the columns of the matrix as a list of vectors
( GET-ROW MATRIX-A ROW-NUM ) Returns the specifed row of the matrix as vector
( GET-ROWS MATRIX-A ) Returns the rows of the matrix as a list of vectors
( INVERSE MATRIX-A ) Returns the inverse of the given matrix
( NEGATE MATRIX-A ) Returns a fresh matrix with all the components negated
( TO-STRING MAT ) {TODO}
( TRACE MATRIX-A ) Returns the trace of the given matrix as a vector
( TRANSPOSE MATRIX-A ) Returns the transpose of the given matrix
( UNITP MATRIX ) Returns T if the matrix is the unit matrix.
( * (QUAT-A QUATERNION) (QUAT-B QUATERNION) ) Multiplies (and thus combines) the two quaternions given, returning a
new quaternion
( *S (QUAT-A QUATERNION) (SCALAR SINGLE-FLOAT) ) Component-wise multiplication of the quaternion by the scalar
( + &REST (QUATS QUATERNION) ) Component-wise addition of any number of quaternions.
( - (QUAT QUATERNION) &REST (QUATS QUATERNION) ) Takes any number of quaternion and performs component-wise subtraction on
them returning a new quaternion
( /= (Q1 QUATERNION) (Q2 QUATERNION) ) Component-wise comparison of two quaternions. Returns T if any components are not equal (by =)
( 0! ) Returns a new quaternion where every component is 0
( 0P (QUAT QUATERNION) ) Returns T if all the components of the given quaternion are 0
( = (Q1 QUATERNION) (Q2 QUATERNION) ) Returns T if the two quaternions given are component-wise equal (by cl:=)
( APPROX-SLERP (START-QUAT QUATERNION) (END-QUAT QUATERNION) (POS SINGLE-FLOAT) ) A faster and less accurate version of slerp for quaternions
( CONJUGATE (QUAT QUATERNION) ) Returns the conjugate of the given quaternion
( COPY (QUAT QUATERNION) ) Returns a fresh quaternion which is = to the one given
( DOT (QUAT-A QUATERNION) (QUAT-B QUATERNION) ) return the dot product of the quat-a and quat-b.
( FROM-AXIES (X-AXIES VEC3) (Y-AXIES VEC3) (Z-AXIES VEC3) ) {TODO}
( FROM-AXIS-ANGLE (AXIS-VEC3 VEC3) (ANGLE SINGLE-FLOAT) ) Returns a new quaternion which represents a rotation around the given
axis by the given angle
( FROM-DIRECTION (UP3 VEC3) (DIR3 VEC3) ) Creates a quaternion that would rotate the vector (v! 0 0 -1) to face in the
given direction.
( FROM-FIXED-ANGLES (X-ROT SINGLE-FLOAT) (Y-ROT SINGLE-FLOAT) (Z-ROT SINGLE-FLOAT) ) Creates a quaternion that represents a rotation around the given axies by the
given angles
( FROM-FIXED-ANGLES-V3 (ANGLES VEC3) ) Creates a quaternion that represents a rotation around the given axies by the
angles given in the vec3
( FROM-MAT3 (MAT3 MAT3) ) Creates quaternion that represents the same rotation the mat3 does.
( GET-AXIS-ANGLE (QUAT QUATERNION) ) Gets one possible axis-angle pair that will generate this quaternion
Assumes that this is a normalized quaternion. It is critical that this is true as otherwise you will at best get a runtime error, and most likely a silently incorrect result.
( IDENTITY ) Returns a fresh identity quaternion
( IDENTITY-P (QUAT QUATERNION) ) Returns T if the given quaternion is the identity quaternion
( INVERSE (QUAT QUATERNION) ) Returns a new quaternion that is the inverse of the one given
( LERP (START-QUAT QUATERNION) (END-QUAT QUATERNION) (POS SINGLE-FLOAT) ) Linearaly interpolate between two quaternions. Note that this will always take the shortest path.
( LOOK-AT (UP3 VEC3) (FROM3 VEC3) (TO3 VEC3) ) Creates a quaternion that would rotate the vector (v! 0 0 -1) to point in
the direction from from3 to to3
( MAGNITUDE (QUAT QUATERNION) ) Returns the magnitude of the quaternion
( MAKE (W SINGLE-FLOAT) (X SINGLE-FLOAT) (Y SINGLE-FLOAT) (Z SINGLE-FLOAT) ) Make a quaternion from 4 single-floats
( NORM (QUAT QUATERNION) ) Returns the 'norm' of the quaternion
Note: This is not the normalized verison of the quaternion, that is performed
by the normalize function.
( NORMALIZE (QUAT QUATERNION) ) Returns a fresh, normalized version of the given vector.
( POINT-AT (UP3 VEC3) (FROM3 VEC3) (TO3 VEC3) ) Creates a quaternion that
( Q! (W SINGLE-FLOAT) (X SINGLE-FLOAT) (Y SINGLE-FLOAT) (Z SINGLE-FLOAT) ) Make a quaternion from 4 single-floats
( QCONJUGATE (QUAT QUATERNION) ) Deprecated: Please use conjugate
( ROTATE (VEC3 VEC3) (QUAT QUATERNION) ) Rotates the given vec3 using the quaternion.
Assumes the quaternion is normalized.
( SLERP (START-QUAT QUATERNION) (END-QUAT QUATERNION) (POS SINGLE-FLOAT) ) Spherically interpolate between two quaternions. Note that this will always take the shortest path.
( TO-DIRECTION (QUAT QUATERNION) ) Returns a new vec3 is equal to (v! 0 0 -1) having been rotated by the
given quaternion
( TO-DIRECTION-VEC4 (QUAT QUATERNION) ) Returns a new vec4 is equal to (v! 0 0 -1 0) having been rotated by the
given quaternion
( TO-MAT3 (QUAT QUATERNION) ) Returns a new mat3 which represents the same rotation as the given quaternion
( TO-MAT4 (QUAT QUATERNION) ) Returns a new mat4 which represents the same rotation as the given quaternion (and zero translation)
( UNITP (QUAT QUATERNION) ) Returns T if this is a unit quaternion.
( W (QUAT QUATERNION) ) Returns the w component of the quaternion
( X (QUAT QUATERNION) ) Returns the x component of the quaternion
( Y (QUAT QUATERNION) ) Returns the y component of the quaternion
( Z (QUAT QUATERNION) ) Returns the z component of the quaternion
( * (QUAT-TO-MUTATE QUATERNION) (QUAT-B QUATERNION) ) Destructively multiplies (and thus combines) the second quaternion into the
first.
( + (ACCUM-QUAT QUATERNION) &REST (QUATERNIONS QUATERNION) ) Destructively performs component-wise addition of the quaternions, the
first quaternion is mutated.
( - (ACCUM-QUAT QUATERNION) &REST (QUATERNIONS QUATERNION) ) Destructively performs component-wise substraction of the quaternions, the
first quaternion is mutated.
( CONJUGATE (QUAT-TO-MUTATE QUATERNION) ) Destructively replaces the given quaternion with it's conjugate
( FROM-AXIS-ANGLE (QUAT-TO-MUTATE QUATERNION) (AXIS-VEC3 VEC3) (ANGLE SINGLE-FLOAT) ) Turns the given quaternion into one which represents a rotation around the
given axis by the given angle
( FROM-FIXED-ANGLES (QUAT-TO-MUTATE QUATERNION) (X-ROT SINGLE-FLOAT) (Y-ROT SINGLE-FLOAT)
(Z-ROT SINGLE-FLOAT) ) Turns the given quaternion into one which represents a rotation around the
given axies by the given angles.
( FROM-MAT3 (QUAT-TO-MUTATE QUATERNION) (MAT3 MAT3) ) Destructively updates of the components of the given quaternion making
it represent the rotation from the given mat3.
Assumes that this is a rotation matrix. It is critical that this is true (and elements are between -1f0 and 1f0) as otherwise you will at best get a runtime error, and most likely a silently incorrect result.
( NORMALIZE (QUAT-TO-MUTATE QUATERNION) ) Destructively replaces the given quaternion with the normalized version of
itself.
( ROTATE (VEC3-TO-MUTATE VEC3) (QUAT QUATERNION) ) Destructively rotates the vec3 using the quaternion returning the
mutated vec3.
ssumes quaternion is normalized.
( TO-MAT3 (MAT-TO-MUTATE MAT3) (QUAT QUATERNION) ) Given a quaternion and a mat3 to mutate this function will mutate the mat3 such that it represents the same rotation as the quaternion does.
( TO-MAT4 (MAT-TO-MUTATE MAT4) (QUAT QUATERNION) ) Given a quaternion and a mat4 to mutate this function will mutate the mat4 such that it represents the same rotation as the quaternion does.
( CARTESIAN->POLAR VEC2 ) Takes a polar coord vector with the layout (θ r) and and converts it to
a cartesian vec2
Notes: r - length of υ θ - angle between υ and y axis θ>0 means counter-clockwise rotation
( POLAR->CARTESIAN ANGLE-LENGTH-V2 ) ( CARTESIAN->SPHERICAL VEC3 ) Takes a cartesian vector3 and converts it to a spherical coord vector with the layout (θ φ ρ).
Notes: θ - angle between υ and x axis (rotating around z) φ - angle between υ and z axis ρ - distance from origin (lengh of υ)
( SPHERICAL->CARTESIAN SPHERICAL-COORD-V3 ) Takes a spherical coord vector with the layout (θ φ ρ) and converts it to a cartesian vector3.
Notes: θ - angle between υ and x axis (rotating around z) φ - angle between υ and z axis ρ - distance from origin (lengh of υ)
( ORTHOGRAPHIC (FRAME-WIDTH SINGLE-FLOAT) (FRAME-HEIGHT SINGLE-FLOAT) (NEAR SINGLE-FLOAT)
(FAR SINGLE-FLOAT) ) Creates a new orthographic projection matrix (mat4)
( ORTHOGRAPHIC-V2 (FRAME-SIZE-V2 VEC2) (NEAR SINGLE-FLOAT) (FAR SINGLE-FLOAT) ) Creates a new orthographic projection matrix (mat4) with the frame size
specified by a vec2
( PERSPECTIVE (WIDTH SINGLE-FLOAT) (HEIGHT SINGLE-FLOAT) (NEAR SINGLE-FLOAT)
(FAR SINGLE-FLOAT) (FOV-DEGREES SINGLE-FLOAT) ) Creates a perspective matrix (mat4) with the field of view being
specified in degrees.
The fact that the primary function form takes degress is unusual
in rtg-math. We keep it this way for backwards compatibility. For
the version specified in radians see perspective-radian-fov
( PERSPECTIVE-RADIAN-FOV (WIDTH SINGLE-FLOAT) (HEIGHT SINGLE-FLOAT) (NEAR SINGLE-FLOAT)
(FAR SINGLE-FLOAT) (FOV SINGLE-FLOAT) ) Creates a perspective matrix (mat4).
( PERSPECTIVE-V2 (FRAME-SIZE-V2 VEC2) (NEAR SINGLE-FLOAT) (FAR SINGLE-FLOAT)
(FOV-DEGREES SINGLE-FLOAT) ) Creates a perspective matrix (mat4) with the frame size specified using a vec2 and the field of view being specified in degrees.
This variant of perspective that is provided as some libraries will provide
the framesize as a vec2 so it felt right to support that rather
that force unpacking.
The fact that the primary function form takes degress is unusual
in rtg-math. We keep it this way for backwards compatibility. For
the version specified in radians see perspective-radian-fov
( PERSPECTIVE-V2-RADIAN-FOV (FRAME-SIZE-V2 VEC2) (NEAR SINGLE-FLOAT) (FAR SINGLE-FLOAT)
(FOV-DEGREES SINGLE-FLOAT) ) Creates a perspective matrix (mat4) with the frame size specified using
a vec2
This variant of perspective that is provided as some libraries will provide
the framesize as a vec2 so it felt right to support that rather
that force unpacking.
( ORTHOGRAPHIC (MAT4-TO-MUTATE MAT4) (FRAME-WIDTH SINGLE-FLOAT) (FRAME-HEIGHT SINGLE-FLOAT)
(NEAR SINGLE-FLOAT) (FAR SINGLE-FLOAT) ) Creates a mat4 and mutates it to be an orthographic projection matrix
( ORTHOGRAPHIC-V2 (MAT4-TO-MUTATE MAT4) (FRAME-SIZE-V2 VEC2) (NEAR SINGLE-FLOAT)
(FAR SINGLE-FLOAT) ) ( PERSPECTIVE (MAT-TO-MUTATE MAT4) (WIDTH SINGLE-FLOAT) (HEIGHT SINGLE-FLOAT)
(NEAR SINGLE-FLOAT) (FAR SINGLE-FLOAT) (FOV-DEGREES SINGLE-FLOAT) ) Takes a mat4 and mutates it to be a perspective matrix with the field of view
being specified in degrees.
The fact that the primary function form takes degress is unusual
in rtg-math. We keep it this way for backwards compatibility. For
the version specified in radians see perspective-radian-fov
( PERSPECTIVE-RADIAN-FOV (MAT-TO-MUTATE MAT4) (WIDTH SINGLE-FLOAT) (HEIGHT SINGLE-FLOAT)
(NEAR SINGLE-FLOAT) (FAR SINGLE-FLOAT) (FOV SINGLE-FLOAT) ) Takes a mat4 and mutates it to be a perspective matrix
( PERSPECTIVE-V2 (MAT-TO-MUTATE MAT4) (FRAME-SIZE-V2 VEC2) (NEAR SINGLE-FLOAT)
(FAR SINGLE-FLOAT) (FOV-DEGREES SINGLE-FLOAT) ) Takes a mat4 and mutates it to be a perspective matrix with the frame size
specified using a vec2 and the field of view being specified in degrees.
This variant of perspective that is provided as some libraries will provide
the framesize as a vec2 so it felt right to support that rather
that force unpacking.
The fact that the primary function form takes degress is unusual
in rtg-math. We keep it this way for backwards compatibility. For
the version specified in radians see perspective-radian-fov
( PERSPECTIVE-V2-RADIAN-FOV (MAT-TO-MUTATE MAT4) (FRAME-SIZE-V2 VEC2) (NEAR SINGLE-FLOAT)
(FAR SINGLE-FLOAT) (FOV-DEGREES SINGLE-FLOAT) ) Takes a mat4 and mutates it to be a perspective matrix with the frame size
specified using a vec2
This variant of perspective that is provided as some libraries will provide
the framesize as a vec2 so it felt right to support that rather
that force unpacking.
LINE3 ( CLOSEST-LINE-POINTS (LINE3-A LINE3) (LINE3-B LINE3) ) ( CLOSEST-POINT (LINE3 LINE3) (POINT-V3 VEC3) ) ( DIRECTION (LINE3 LINE3) ) ( DISTANCE-SQUARED-TO-LINE3 (LINE3-A LINE3) (LINE3-B LINE3) ) ( DISTANCE-SQUARED-TO-POINT (LINE3 LINE3) (POINT-V3 VEC3) ) ( DISTANCE-TO-LINE3 (LINE3-A LINE3) (LINE3-B LINE3) ) ( DISTANCE-TO-POINT (LINE3 LINE3) (POINT-V3 VEC3) ) ( MAKE (ORIGIN-V3 VEC3) (DIRECTION-V3 VEC3) ) ( ORIGIN (LINE3 LINE3) ) ( TRANSFORM-M3 (MATRIX3 MAT3) (LINE3 LINE3) ) ( TRANSFORM-Q (QUAT QUATERNION) (LINE3 LINE3) ) RAY3 ( /= (RAY3-A RAY3) (RAY3-B RAY3) ) ( = (RAY3-A RAY3) (RAY3-B RAY3) ) ( CLOSEST-POINT (RAY3 RAY3) (POINT-V3 VEC3) ) ( CLOSEST-RAY-POINTS (RAY3-A RAY3) (RAY3-B RAY3) ) ( DIRECTION (RAY3 RAY3) ) ( DISTANCE-SQUARED-TO-LINE3 (RAY3 RAY3) (LINE3 LINE3) ) ( DISTANCE-SQUARED-TO-POINT (RAY3 RAY3) (POINT-V3 VEC3) ) ( DISTANCE-SQUARED-TO-RAY3 (RAY3-A RAY3) (RAY3-B RAY3) ) ( DISTANCE-TO-LINE3 (RAY3 RAY3) (LINE3 LINE3) ) ( DISTANCE-TO-POINT (RAY3 RAY3) (POINT-V3 VEC3) ) ( DISTANCE-TO-RAY3 (RAY3-A RAY3) (RAY3-B RAY3) ) ( MAKE (ORIGIN-V3 VEC3) (DIRECTION-V3 VEC3) ) ( ORIGIN (RAY3 RAY3) ) ( TRANSFORM-M3 (MATRIX3 MAT3) (RAY3 RAY3) ) ( TRANSFORM-Q (QUAT QUATERNION) (RAY3 RAY3) ) ( /= (LINE-SEG3-A LINE-SEGMENT3) (LINE-SEG3-B LINE-SEGMENT3) ) ( = (LINE-SEG3-A LINE-SEGMENT3) (LINE-SEG3-B LINE-SEGMENT3) ) ( CLOSEST-LINE-POINTS (LINE-SEG3 LINE-SEGMENT3) (LINE3 LINE3) ) ( CLOSEST-LINE-SEGMENT-POINTS (LINE-SEG-A LINE-SEGMENT3) (LINE-SEG-B LINE-SEGMENT3) ) ( CLOSEST-POINT (LINE-SEG3 LINE-SEGMENT3) (POINT-V3 VEC3) ) ( CLOSEST-RAY-POINTS (LINE-SEG-A LINE-SEGMENT3) (RAY3 RAY3) ) ( DIRECTION (LINE-SEG3 LINE-SEGMENT3) ) ( DISTANCE-SQUARED-TO-LINE-SEG3 (LINE-SEG-A LINE-SEGMENT3) (LINE-SEG-B LINE-SEGMENT3) ) ( DISTANCE-SQUARED-TO-LINE3 (LINE-SEG3 LINE-SEGMENT3) (LINE3 LINE3) ) ( DISTANCE-SQUARED-TO-POINT (LINE-SEG3 LINE-SEGMENT3) (POINT-V3 VEC3) ) ( DISTANCE-SQUARED-TO-RAY3 (LINE-SEG3 LINE-SEGMENT3) (RAY3 RAY3) ) ( DISTANCE-TO-LINE-SEG3 (LINE-SEG-A LINE-SEGMENT3) (LINE-SEG-B LINE-SEGMENT3) ) ( DISTANCE-TO-LINE3 (LINE-SEG3 LINE-SEGMENT3) (LINE3 LINE3) ) ( DISTANCE-TO-POINT (LINE-SEG3 LINE-SEGMENT3) (POINT-V3 VEC3) ) ( DISTANCE-TO-RAY3 (LINE-SEG3 LINE-SEGMENT3) (RAY3 RAY3) ) ( END-POINT0 (LINE-SEG3 LINE-SEGMENT3) ) ( END-POINT1 (LINE-SEG3 LINE-SEGMENT3) ) ( LENGTH (LINE-SEG3 LINE-SEGMENT3) ) ( LENGTH-SQUARED (LINE-SEG3 LINE-SEGMENT3) ) ( MAKE (END-POINT0 VEC3) (END-POINT1 VEC3) ) ( MAKE-FROM-POINT-OFFSET (POINT-V3 VEC3) (OFFSET-V3 VEC3) ) ( TRANSFORM-M3 (MATRIX3 MAT3) (LINE-SEG3 LINE-SEGMENT3) ) ( TRANSFORM-Q (QUAT QUATERNION) (LINE-SEG3 LINE-SEGMENT3) ) ( MERGE-POINT (AAB AXIS-ALIGNED-BOX) (POINT-V3 VEC3) ) AXIS-ALIGNED-BOX ( /= (AAB-0 AXIS-ALIGNED-BOX) (AAB-1 AXIS-ALIGNED-BOX) ) ( = (AAB-0 AXIS-ALIGNED-BOX) (AAB-1 AXIS-ALIGNED-BOX) ) ( ADD-POINT (AAB AXIS-ALIGNED-BOX) (POINT-V3 VEC3) ) ( FROM-AABS &REST (AABS AXIS-ALIGNED-BOX) ) ( FROM-POINTS (LIST-OF-VEC3 LIST) ) ( INTERSECTS-P (AAB-0 AXIS-ALIGNED-BOX) (AAB-1 AXIS-ALIGNED-BOX) ) ( INTERSECTS-WITH-LINE-SEGMENT-P (AAB AXIS-ALIGNED-BOX) (LINE-SEG3 LINE-SEGMENT3) ) ( INTERSECTS-WITH-LINE3-P (AAB AXIS-ALIGNED-BOX) (LINE3 LINE3) ) ( INTERSECTS-WITH-RAY3-P (AAB AXIS-ALIGNED-BOX) (RAY3 RAY3) ) ( MAKE (MINIMA VEC3) (MAXIMA VEC3) ) ( MAXIMA (AAB AXIS-ALIGNED-BOX) ) ( MINIMA (AAB AXIS-ALIGNED-BOX) ) ( CLOSEST-POINT REG-A VEC3 ) ( CLOSEST-POINTS REG-A REG-B ) ( DISTANCE REG-A REG-B ) ( DISTANCE-SQUARED REG-A REG-B ) ( INTERSECTS-P REG-A REG-B ) +INV-PI+ (/ 1 pi) as a single-float. This is the older naming, it is now prefered
to use inv-pi-f
+ONE-DEGREE-IN-RADIANS+ The number of degrees in 1 radian as a single-float
+PI+ pi as a single-float. This is the older naming, it is now prefered
to use pi-f
0.5PI (/ pi 2) as a double-float
0.5PI-F (/ pi 2) as a single-float
2PI (* PI 2) as a double-float
2PI-F (* PI 2) as a single-float
INV-PI (/ 1 pi) as adouble-float`
INV-PI-F (/ 1 pi) as asingle-float`
PI-F pi as a single-float
( CLAMP (MIN SINGLE-FLOAT) (MAX SINGLE-FLOAT) (VAL-F SINGLE-FLOAT) ) Force a single-float to be constrained to the given range.
( DEGREES RADIANS ) Converts a quantity, specified in radians into degrees.
( DEGREES-F RADIANS ) Converts a quantity, specified in radians as a single-float into degrees.
( INV-SQRT (X (SINGLE-FLOAT 0.0 3.4028235e38)) ) Calculates the inverse square root of a number
( LERP (START SINGLE-FLOAT) (END SINGLE-FLOAT) (AMOUNT SINGLE-FLOAT) ) Performs a linear interpolation between 'start' and 'end' by the
given amount
( M! &REST COMPONENTS ) ( MIX (START SINGLE-FLOAT) (END SINGLE-FLOAT) (AMOUNT SINGLE-FLOAT) ) Performs a linear interpolation between 'start' and 'end' by the
given amount
( Q! (W SINGLE-FLOAT) (X SINGLE-FLOAT) (Y SINGLE-FLOAT) (Z SINGLE-FLOAT) ) Make a quaternion from 4 single-floats
( RADIANS DEGREES ) Converts a quantity, specified in degrees into radians.
( RADIANS-F DEGREES ) Converts a quantity, specified in degrees as a single-float into radians.
( SATURATE (VAL-F SINGLE-FLOAT) ) clamps the given single-float between 0.0 and 1.0
( SMOOTHSTEP (A SINGLE-FLOAT) (B SINGLE-FLOAT) (X SINGLE-FLOAT) ) Performs smooth Hermite interpolation between 0 and 1 when 'a' < 'x' < 'b'
( SPLINE X KNOTS ) {TODO}
( S~ VEC PATTERN ) ( V! &REST COMPONENTS ) Create a vec2, vec3 or vec4. The kind of vector returned by this function depends on what is passed as the arguments.
It can take any number of the following..
so long as the total number of components is 2, 3 or 4. So any of the following examples are valid:
( V!BOOL &REST COMPONENTS ) Create a vector of 2, 3 or 4 booleans out of booleans or other boolean vectors
( V!BYTE &REST COMPONENTS ) a vector of 2, 3 or 4 bytes out of bytes or other byte vectors
( V!DOUBLE &REST COMPONENTS ) Create a vector of 2, 3 or 4 doubles out of doubles or other double vectors
( V!INT &REST COMPONENTS ) Create a vector of 2, 3 or 4 ints out of ints or other int vectors
( V!INT8 &REST COMPONENTS ) Create a vector of 2, 3 or 4 int8s out of int8s or other int8 vectors
( V!UBYTE &REST COMPONENTS ) Create a vector of 2, 3 or 4 ubytes out of ubytes or other ubyte vectors
( V!UINT &REST COMPONENTS ) Create a vector of 2, 3 or 4 uints out of uints or other uint vectors
( V!UINT8 &REST COMPONENTS ) Create a vector of 2, 3 or 4 uint8s out of uint8s or other uint8 vectors
( V2! X &OPTIONAL Y ) Create vec2 from 1 or 2 floats or ints
( V2!BYTE X &OPTIONAL Y ) Create vector of two bytes from 1 or 2 bytes
( V2!DOUBLE X &OPTIONAL Y ) Create vector of two doubles from 1 or 2 doubles
( V2!INT X &OPTIONAL Y ) Create vector of two ints from 1 or 2 ints
( V2!INT8 X &OPTIONAL Y ) Create vector of two int8s from 1 or 2 int8s
( V2!SHORT X &OPTIONAL Y ) Create vector of two shorts from 1 or 2 shorts
( V2!UBYTE X &OPTIONAL Y ) Create vector of two ubytes from 1 or 2 ubytes
( V2!UINT X &OPTIONAL Y ) Create vector of two uints from 1 or 2 uints
( V2!UINT8 X &OPTIONAL Y ) Create vector of two uint8s from 1 or 2 uint8s
( V2!USHORT X &OPTIONAL Y ) Create vector of two ushorts from 1 or 2 ushorts
( V3! X &OPTIONAL Y Z ) Create a vec3 from 1, 2 or 3 floats or ints.
( V3!BYTE X &OPTIONAL Y Z ) Creates a vector of 3 bytes from 1, 2 or 3 bytes
( V3!DOUBLE X &OPTIONAL Y Z ) Creates a vector of 3 doubles from 1, 2 or 3 doubles
( V3!INT X &OPTIONAL Y Z ) Creates a vector of 3 ints from 1, 2 or 3 ints
( V3!INT8 X &OPTIONAL Y Z ) Creates a vector of 3 int8s from 1, 2 or 3 int8s
( V3!SHORT X &OPTIONAL Y Z ) Creates a vector of 3 shorts from 1, 2 or 3 shorts
( V3!UBYTE X &OPTIONAL Y Z ) Creates a vector of 3 ubytes from 1, 2 or 3 ubytes
( V3!UINT X &OPTIONAL Y Z ) Creates a vector of 3 uints from 1, 2 or 3 uints
( V3!UINT8 X &OPTIONAL Y Z ) Creates a vector of 3 uint8s from 1, 2 or 3 uint8s
( V3!USHORT X &OPTIONAL Y Z ) Creates a vector of 3 ushorts from 1, 2 or 3 ushorts
( V4! X &OPTIONAL Y Z W ) Create a vec4 from 1, 2, 3 or 4 floats or ints
( V4!BYTE X &OPTIONAL Y Z W ) Creates a vector of 4 bytes from 1, 2, 3 or 4 bytes
( V4!DOUBLE X &OPTIONAL Y Z W ) Creates a vector of 4 doubles from 1, 2, 3 or 4 doubles
( V4!INT X &OPTIONAL Y Z W ) Creates a vector of 4 ints from 1, 2, 3 or 4 ints
( V4!INT8 X &OPTIONAL Y Z W ) Creates a vector of 4 int8s from 1, 2, 3 or 4 int8s
( V4!SHORT X &OPTIONAL Y Z W ) Creates a vector of 4 shorts from 1, 2, 3 or 4 shorts
( V4!UBYTE X &OPTIONAL Y Z W ) Creates a vector of 4 ubytes from 1, 2, 3 or 4 ubytes
( V4!UINT X &OPTIONAL Y Z W ) Creates a vector of 4 uints from 1, 2, 3 or 4 uints
( V4!UINT8 X &OPTIONAL Y Z W ) Creates a vector of 4 uint8s from 1, 2, 3 or 4 uint8s
( V4!USHORT X &OPTIONAL Y Z W ) Creates a vector of 4 ushorts from 1, 2, 3 or 4 ushorts
( W VEC ) Returns the w component of the vector
( X VEC ) Returns the x component of the vector
( Y VEC ) Returns the y component of the vector
( Z VEC ) Returns the z component of the vector
AXIS-ALIGNED-BOX LINE-SEGMENT3 LINE3 RAY3 INT8-VEC2 A simple-array of 2 (signed-byte 8)s
INT8-VEC3 A simple-array of 3 (signed-byte 8)s
INT8-VEC4 A simple-array of 4 (signed-byte 8)s
IVEC2 A simple-array of 2 (signed-byte 32)s
IVEC3 A simple-array of 3 (signed-byte 32)s
IVEC4 A simple-array of 4 (signed-byte 32)s
MAT2 A simple-array of 4 single-floats
MAT3 A simple-array of 9 single-floats
MAT4 A simple-array of 16 single-floats
QUATERNION UINT8-VEC2 A simple-array of 2 (unsigned-byte 8)s
UINT8-VEC3 A simple-array of 3 (unsigned-byte 8)s
UINT8-VEC4 A simple-array of 4 (unsigned-byte 8)s
UVEC2 A simple-array of 2 (unsigned-byte 32)s
UVEC3 A simple-array of 3 (unsigned-byte 32)s
UVEC4 A simple-array of 4 (unsigned-byte 32)s
VEC2 A simple-array of 2 single-floats
VEC3 A simple-array of 3 single-floats
VEC4 A simple-array of 4 single-floats