Documentation ¶
Index ¶
- Constants
- Variables
- func Mat2Add(out, a, b []float64) []float64
- func Mat2Adjoint(out, a []float64) []float64
- func Mat2Clone(a []float64) []float64
- func Mat2Copy(out, a []float64) []float64
- func Mat2Create() []float64
- func Mat2Determinant(a []float64) float64
- func Mat2Equals(a, b []float64) bool
- func Mat2ExactEquals(a, b []float64) bool
- func Mat2Frob(a []float64) float64
- func Mat2FromRotation(out []float64, rad float64) []float64
- func Mat2FromScaling(out, v []float64) []float64
- func Mat2FromValues(m00, m01, m10, m11 float64) []float64
- func Mat2Identity(out []float64) []float64
- func Mat2Invert(out, a []float64) []float64
- func Mat2LDU(L, D, U, a []float64) [][]float64
- func Mat2Multiply(out, a, b []float64) []float64
- func Mat2MultiplyScalar(out, a []float64, b float64) []float64
- func Mat2MultiplyScalarAndAdd(out, a, b []float64, scale float64) []float64
- func Mat2Rotate(out, a []float64, rad float64) []float64
- func Mat2Scale(out, a, v []float64) []float64
- func Mat2Set(out []float64, m00, m01, m10, m11 float64) []float64
- func Mat2Str(a []float64) string
- func Mat2Subtract(out, a, b []float64) []float64
- func Mat2Transpose(out, a []float64) []float64
- func Mat2dAdd(out, a, b []float64) []float64
- func Mat2dClone(a []float64) []float64
- func Mat2dCopy(out, a []float64) []float64
- func Mat2dCreate() []float64
- func Mat2dDeterminant(a []float64) float64
- func Mat2dEquals(a, b []float64) bool
- func Mat2dExactEquals(a, b []float64) bool
- func Mat2dFrob(a []float64) float64
- func Mat2dFromRotation(out []float64, rad float64) []float64
- func Mat2dFromScaling(out, v []float64) []float64
- func Mat2dFromTranslation(out, v []float64) []float64
- func Mat2dFromValues(a, b, c, d, tx, ty float64) []float64
- func Mat2dIdentity(out []float64) []float64
- func Mat2dInvert(out, a []float64) []float64
- func Mat2dMultiply(out, a, b []float64) []float64
- func Mat2dMultiplyScalar(out, a []float64, b float64) []float64
- func Mat2dMultiplyScalarAndAdd(out, a, b []float64, scale float64) []float64
- func Mat2dRotate(out, a []float64, rad float64) []float64
- func Mat2dScale(out, a, v []float64) []float64
- func Mat2dSet(out []float64, a, b, c, d, tx, ty float64) []float64
- func Mat2dStr(a []float64) string
- func Mat2dSubtract(out, a, b []float64) []float64
- func Mat2dTranslate(out, a, v []float64) []float64
- func Mat3Add(out, a, b []float64) []float64
- func Mat3Adjoint(out, a []float64) []float64
- func Mat3Clone(a []float64) []float64
- func Mat3Copy(out, a []float64) []float64
- func Mat3Create() []float64
- func Mat3Determinant(a []float64) float64
- func Mat3Equals(a, b []float64) bool
- func Mat3ExactEquals(a, b []float64) bool
- func Mat3Frob(a []float64) float64
- func Mat3FromMat2d(out, a []float64) []float64
- func Mat3FromMat4(out, a []float64) []float64
- func Mat3FromQuat(out, q []float64) []float64
- func Mat3FromRotation(out []float64, rad float64) []float64
- func Mat3FromScaling(out, v []float64) []float64
- func Mat3FromTranslation(out, v []float64) []float64
- func Mat3FromValues(m00, m01, m02, m10, m11, m12, m20, m21, m22 float64) []float64
- func Mat3Identity(out []float64) []float64
- func Mat3Invert(out, a []float64) []float64
- func Mat3Multiply(out, a, b []float64) []float64
- func Mat3MultiplyScalar(out, a []float64, b float64) []float64
- func Mat3MultiplyScalarAndAdd(out, a, b []float64, scale float64) []float64
- func Mat3NormalFromMat4(out, a []float64) []float64
- func Mat3Projection(out []float64, width, height float64) []float64
- func Mat3Rotate(out, a []float64, rad float64) []float64
- func Mat3Scale(out, a, v []float64) []float64
- func Mat3Set(out []float64, m00, m01, m02, m10, m11, m12, m20, m21, m22 float64) []float64
- func Mat3Str(a []float64) string
- func Mat3Subtract(out, a, b []float64) []float64
- func Mat3Translate(out, a, v []float64) []float64
- func Mat3Transpose(out, a []float64) []float64
- func Mat4Add(out, a, b []float64) []float64
- func Mat4Adjoint(out, a []float64) []float64
- func Mat4Clone(a []float64) []float64
- func Mat4Copy(out, a []float64) []float64
- func Mat4Create() []float64
- func Mat4Determinant(a []float64) float64
- func Mat4Equals(a, b []float64) bool
- func Mat4ExactEquals(a, b []float64) bool
- func Mat4Frob(a []float64) float64
- func Mat4FromQuat(out, q []float64) []float64
- func Mat4FromQuat2(out, a []float64) []float64
- func Mat4FromRotation(out []float64, rad float64, axis []float64) []float64
- func Mat4FromRotationTranslation(out, q, v []float64) []float64
- func Mat4FromRotationTranslationScale(out, q, v, s []float64) []float64
- func Mat4FromRotationTranslationScaleOrigin(out, q, v, s, o []float64) []float64
- func Mat4FromScaling(out, v []float64) []float64
- func Mat4FromTranslation(out, v []float64) []float64
- func Mat4FromValues(...) []float64
- func Mat4FromXRotation(out []float64, rad float64) []float64
- func Mat4FromYRotation(out []float64, rad float64) []float64
- func Mat4FromZRotation(out []float64, rad float64) []float64
- func Mat4Frustum(out []float64, left, right, bottom, top, near, far float64) []float64
- func Mat4GetRotation(out, mat []float64) []float64
- func Mat4GetScaling(out, mat []float64) []float64
- func Mat4GetTranslation(out, mat []float64) []float64
- func Mat4Identity(out []float64) []float64
- func Mat4Invert(out, a []float64) []float64
- func Mat4LookAt(out, eye, center, up []float64) []float64
- func Mat4Multiply(out, a, b []float64) []float64
- func Mat4MultiplyScalar(out, a []float64, b float64) []float64
- func Mat4MultiplyScalarAndAdd(out, a, b []float64, scale float64) []float64
- func Mat4Ortho(out []float64, left, right, bottom, top, near, far float64) []float64
- func Mat4Perspective(out []float64, fovy, aspect, near, far float64) []float64
- func Mat4PerspectiveFromFieldOfView(out []float64, fov *Fov, near, far float64) []float64
- func Mat4Rotate(out, a []float64, rad float64, axis []float64) []float64
- func Mat4RotateX(out, a []float64, rad float64) []float64
- func Mat4RotateY(out, a []float64, rad float64) []float64
- func Mat4RotateZ(out, a []float64, rad float64) []float64
- func Mat4Scale(out, a, v []float64) []float64
- func Mat4Set(out []float64, ...) []float64
- func Mat4Str(a []float64) string
- func Mat4Subtract(out, a, b []float64) []float64
- func Mat4TargetTo(out, eye, target, up []float64) []float64
- func Mat4Translate(out, a, v []float64) []float64
- func Mat4Transpose(out, a []float64) []float64
- func NewMat3() []float64
- func NewMat4() []float64
- func NewQuat() []float64
- func NewVec2() []float64
- func NewVec3() []float64
- func NewVec4() []float64
- func Quat2Add(out, a, b []float64) []float64
- func Quat2Clone(a []float64) []float64
- func Quat2Conjugate(out, a []float64) []float64
- func Quat2Copy(out, a []float64) []float64
- func Quat2Create() []float64
- func Quat2Equals(a, b []float64) bool
- func Quat2ExactEquals(a, b []float64) bool
- func Quat2FromMat4(out, a []float64) []float64
- func Quat2FromRotation(out, q []float64) []float64
- func Quat2FromRotationTranslation(out, q, t []float64) []float64
- func Quat2FromRotationTranslationValues(x1, y1, z1, w1, x2, y2, z2 float64) []float64
- func Quat2FromTranslation(out, t []float64) []float64
- func Quat2FromValues(x1, y1, z1, w1, x2, y2, z2, w2 float64) []float64
- func Quat2GetDual(out, a []float64) []float64
- func Quat2GetTranslation(out, a []float64) []float64
- func Quat2Identity(out []float64) []float64
- func Quat2Invert(out, a []float64) []float64
- func Quat2Lerp(out, a, b []float64, t float64) []float64
- func Quat2Multiply(out, a, b []float64) []float64
- func Quat2Normalize(out, a []float64) []float64
- func Quat2RotateAroundAxis(out, a, axis []float64, rad float64) []float64
- func Quat2RotateByQuatAppend(out, a, q []float64) []float64
- func Quat2RotateByQuatPrepend(out, q, a []float64) []float64
- func Quat2RotateX(out, a []float64, rad float64) []float64
- func Quat2RotateY(out, a []float64, rad float64) []float64
- func Quat2RotateZ(out, a []float64, rad float64) []float64
- func Quat2Scale(out, a []float64, b float64) []float64
- func Quat2Set(out []float64, x1, y1, z1, w1, x2, y2, z2, w2 float64) []float64
- func Quat2SetDual(out, q []float64) []float64
- func Quat2Str(a []float64) string
- func Quat2Translate(out, a, v []float64) []float64
- func QuatCalculateW(out, a []float64) []float64
- func QuatConjugate(out, a []float64) []float64
- func QuatCreate() []float64
- func QuatExp(out, a []float64) []float64
- func QuatFromEuler(out []float64, x, y, z float64) []float64
- func QuatFromMat3(out, m []float64) []float64
- func QuatGetAngle(a, b []float64) float64
- func QuatGetAxisAngle(out, q []float64) float64
- func QuatIdentity(out []float64) []float64
- func QuatInvert(out, a []float64) []float64
- func QuatLn(out, a []float64) []float64
- func QuatMultiply(out, a, b []float64) []float64
- func QuatPow(out, a []float64, b float64) []float64
- func QuatRandom(out []float64) []float64
- func QuatRotateX(out, a []float64, rad float64) []float64
- func QuatRotateY(out, a []float64, rad float64) []float64
- func QuatRotateZ(out, a []float64, rad float64) []float64
- func QuatRotationTo(out, a, b []float64) []float64
- func QuatSetAxisAngle(out, axis []float64, rad float64) []float64
- func QuatSlerp(out, a, b []float64, t float64) []float64
- func QuatStr(a []float64) string
- func ToRadian(a float64) float64
- func Vec2Add(out, a, b []float64) []float64
- func Vec2Angle(a, b []float64) float64
- func Vec2Ceil(out, a []float64) []float64
- func Vec2Clone(a []float64) []float64
- func Vec2Copy(out, a []float64) []float64
- func Vec2Create() []float64
- func Vec2Cross(out, a, b []float64) []float64
- func Vec2Distance(a, b []float64) float64
- func Vec2Divide(out, a, b []float64) []float64
- func Vec2Dot(a, b []float64) float64
- func Vec2Equals(a, b []float64) bool
- func Vec2ExactEquals(a, b []float64) bool
- func Vec2Floor(out, a []float64) []float64
- func Vec2ForEach(a []float64, stride, offset, count int, ...) []float64
- func Vec2FromValues(x, y float64) []float64
- func Vec2Inverse(out, a []float64) []float64
- func Vec2Length(out []float64) float64
- func Vec2Lerp(out, a, b []float64, t float64) []float64
- func Vec2Max(out, a, b []float64) []float64
- func Vec2Min(out, a, b []float64) []float64
- func Vec2Multiply(out, a, b []float64) []float64
- func Vec2Negate(out, a []float64) []float64
- func Vec2Normalize(out, a []float64) []float64
- func Vec2Random(out []float64, scale float64) []float64
- func Vec2Rotate(out, p, c []float64, rad float64) []float64
- func Vec2Round(out, a []float64) []float64
- func Vec2Scale(out, a []float64, scale float64) []float64
- func Vec2ScaleAndAdd(out, a, b []float64, scale float64) []float64
- func Vec2Set(out []float64, x, y float64) []float64
- func Vec2SquaredDistance(a, b []float64) float64
- func Vec2SquaredLength(out []float64) float64
- func Vec2Str(out []float64) string
- func Vec2Subtract(out, a, b []float64) []float64
- func Vec2TransformMat2(out, a, m []float64) []float64
- func Vec2TransformMat2d(out, a, m []float64) []float64
- func Vec2TransformMat3(out, a, m []float64) []float64
- func Vec2TransformMat4(out, a, m []float64) []float64
- func Vec2Zero(out []float64) []float64
- func Vec3Add(out, a, b []float64) []float64
- func Vec3Angle(a, b []float64) float64
- func Vec3Bezier(out, a, b, c, d []float64, t float64) []float64
- func Vec3Ceil(out, a []float64) []float64
- func Vec3Clone(a []float64) []float64
- func Vec3Copy(out, a []float64) []float64
- func Vec3Create() []float64
- func Vec3Cross(out, a, b []float64) []float64
- func Vec3Distance(a, b []float64) float64
- func Vec3Divide(out, a, b []float64) []float64
- func Vec3Dot(a, b []float64) float64
- func Vec3Equals(a, b []float64) bool
- func Vec3ExactEquals(a, b []float64) bool
- func Vec3Floor(out, a []float64) []float64
- func Vec3ForEach(a []float64, stride, offset, count int, ...) []float64
- func Vec3FromValues(x, y, z float64) []float64
- func Vec3Hermite(out, a, b, c, d []float64, t float64) []float64
- func Vec3Inverse(out, a []float64) []float64
- func Vec3Length(out []float64) float64
- func Vec3Lerp(out, a, b []float64, t float64) []float64
- func Vec3Max(out, a, b []float64) []float64
- func Vec3Min(out, a, b []float64) []float64
- func Vec3Multiply(out, a, b []float64) []float64
- func Vec3Negate(out, a []float64) []float64
- func Vec3Normalize(out, a []float64) []float64
- func Vec3Random(out []float64, scale float64) []float64
- func Vec3RotateX(out, a, b []float64, rad float64) []float64
- func Vec3RotateY(out, a, b []float64, rad float64) []float64
- func Vec3RotateZ(out, a, b []float64, rad float64) []float64
- func Vec3Round(out, a []float64) []float64
- func Vec3Scale(out, a []float64, scale float64) []float64
- func Vec3ScaleAndAdd(out, a, b []float64, scale float64) []float64
- func Vec3Set(out []float64, x, y, z float64) []float64
- func Vec3Slerp(out, a, b []float64, t float64) []float64
- func Vec3SquaredDistance(a, b []float64) float64
- func Vec3SquaredLength(out []float64) float64
- func Vec3Str(out []float64) string
- func Vec3Subtract(out, a, b []float64) []float64
- func Vec3TransformMat3(out, a, m []float64) []float64
- func Vec3TransformMat4(out, a, m []float64) []float64
- func Vec3TransformQuat(out, a, q []float64) []float64
- func Vec3Zero(out []float64) []float64
- func Vec4Add(out, a, b []float64) []float64
- func Vec4Ceil(out, a []float64) []float64
- func Vec4Clone(a []float64) []float64
- func Vec4Copy(out, a []float64) []float64
- func Vec4Create() []float64
- func Vec4Cross(out, u, v, w []float64) []float64
- func Vec4Distance(a, b []float64) float64
- func Vec4Divide(out, a, b []float64) []float64
- func Vec4Dot(a, b []float64) float64
- func Vec4Equals(a, b []float64) bool
- func Vec4ExactEquals(a, b []float64) bool
- func Vec4Floor(out, a []float64) []float64
- func Vec4ForEach(a []float64, stride, offset, count int, ...) []float64
- func Vec4FromValues(x, y, z, w float64) []float64
- func Vec4Inverse(out, a []float64) []float64
- func Vec4Length(out []float64) float64
- func Vec4Lerp(out, a, b []float64, t float64) []float64
- func Vec4Max(out, a, b []float64) []float64
- func Vec4Min(out, a, b []float64) []float64
- func Vec4Multiply(out, a, b []float64) []float64
- func Vec4Negate(out, a []float64) []float64
- func Vec4Normalize(out, a []float64) []float64
- func Vec4Random(out []float64, scale float64) []float64
- func Vec4Round(out, a []float64) []float64
- func Vec4Scale(out, a []float64, scale float64) []float64
- func Vec4ScaleAndAdd(out, a, b []float64, scale float64) []float64
- func Vec4Set(out []float64, x, y, z, w float64) []float64
- func Vec4SquaredDistance(a, b []float64) float64
- func Vec4SquaredLength(out []float64) float64
- func Vec4Str(a []float64) string
- func Vec4Subtract(out, a, b []float64) []float64
- func Vec4TransformMat4(out, a, m []float64) []float64
- func Vec4TransformQuat(out, a, q []float64) []float64
- func Vec4Zero(out []float64) []float64
- type Fov
Constants ¶
const Epsilon = 0.000001
Epsilon is a tolerant value
Variables ¶
var Mat2Mul = Mat2Multiply
Mat2Mul alias for Mat2Multiply
var Mat2Sub = Mat2Subtract
Mat2Sub alias for Mat2Subtract
var Mat2dMul = Mat2dMultiply
Mat2dMul alias for Mat2dMultiply
var Mat2dSub = Mat2dSubtract
Mat2dSub alias for Mat2dSubtract
var Mat3Mul = Mat3Multiply
Mat3Mul alias for Mat3Multiply
var Mat3Sub = Mat3Subtract
Mat3Sub alias for Mat3Subtract
var Mat4Mul = Mat4Multiply
Mat4Mul alias for Mat4Multiply
var Mat4Sub = Mat4Subtract
Mat4Sub alias for Mat4Subtract
var Quat2Dot = QuatDot
Quat2Dot calculates the dot product of two dual quat's (The dot product of the real parts)
var Quat2GetReal = QuatCopy
Quat2GetReal gets the real part of a dual quat
var Quat2Len = Quat2Length
Quat2Len alias for Quat2Length
var Quat2Length = QuatLength
Quat2Length calculates the length of a dual quat
var Quat2Mul = Quat2Multiply
Quat2Mul alias for Quat2Multiply
var Quat2SetReal = QuatCopy
Quat2SetReal set the real component of a dual quat to the given quaternion
var Quat2SqrLen = Quat2SquaredLength
Quat2SqrLen alias for Quat2SquaredLength
var Quat2SquaredLength = QuatSquaredLength
Quat2SquaredLength calculates the squared length of a dual quat
var QuatAdd = Vec4Add
QuatAdd adds two quat's
var QuatClone = Vec4Clone
QuatClone creates a new quat initialized with values from an existing quaternion
var QuatCopy = Vec4Copy
QuatCopy copy the values from one quat to another
var QuatDot = Vec4Dot
QuatDot calculates the dot product of two quat's
var QuatEquals = Vec4Equals
QuatEquals returns whether or not the quaternions have approximately the same elements in the same position.
var QuatExactEquals = Vec4ExactEquals
QuatExactEquals returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===)
var QuatFromValues = Vec4FromValues
QuatFromValues creates a new quat initialized with the given values
var QuatLen = QuatLength
QuatLen alias for QuatLength
var QuatLength = Vec4Length
QuatLength calculates the length of a quat
var QuatLerp = Vec4Lerp
QuatLerp performs a linear interpolation between two quat's
var QuatMul = QuatMultiply
QuatMul alias QuatMultiply
var QuatNormalize = Vec4Normalize
QuatNormalize mormalize a quat
var QuatScale = Vec4Scale
QuatScale scales a quat by a scalar number
var QuatSet = Vec4Set
QuatSet set the components of a quat to the given values
var QuatSetAxes = (func() func(out, view, right, up []float64) []float64 { matr := Mat3Create() return func(out, view, right, up []float64) []float64 { matr[0] = right[0] matr[3] = right[1] matr[6] = right[2] matr[1] = up[0] matr[4] = up[1] matr[7] = up[2] matr[2] = -view[0] matr[5] = -view[1] matr[8] = -view[2] return QuatNormalize(out, QuatFromMat3(out, matr)) } })()
QuatSetAxes sets the specified quaternion with values corresponding to the given axes. Each axis is a vec3 and is expected to be unit length and perpendicular to all other specified axes.
var QuatSqlerp = (func() func(out, a, b, c, d []float64, t float64) []float64 { temp1 := QuatCreate() temp2 := QuatCreate() return func(out, a, b, c, d []float64, t float64) []float64 { QuatSlerp(temp1, a, d, t) QuatSlerp(temp2, b, c, t) QuatSlerp(out, temp1, temp2, 2*t*(1-t)) return out } })()
QuatSqlerp performs a spherical linear interpolation with two control points
var QuatSqrLen = QuatSquaredLength
QuatSqrLen alias for QuatSquaredLength
var QuatSquaredLength = Vec4SquaredLength
QuatSquaredLength calculates the squared length of a quat
var Vec2Dist = Vec2Distance
Vec2Dist alias for Vec2Distance
var Vec2Div = Vec2Divide
Vec2Div alias for Vec2Divide
var Vec2Len = Vec2Length
Vec2Len alias for Vec2Length
var Vec2Mul = Vec2Multiply
Vec2Mul alias for Vec2Multiply
var Vec2SqrDist = Vec2SquaredDistance
Vec2SqrDist alias for Vec2SquaredDistance
var Vec2SqrLen = Vec2SquaredLength
Vec2SqrLen alias for Vec2SquaredLength
var Vec2Sub = Vec2Subtract
Vec2Sub alias for Vec2Subtract
var Vec3Dist = Vec3Distance
Vec3Dist alias for Vec3Distance
var Vec3Div = Vec3Divide
Vec3Div alias for Vec3Divide
var Vec3Len = Vec3Length
Vec3Len alias for Vec3Length
var Vec3Mul = Vec3Multiply
Vec3Mul alias for Vec3Multiply
var Vec3SqrDist = Vec3SquaredDistance
Vec3SqrDist alias for Vec3SquaredDistance
var Vec3SqrLen = Vec3SquaredLength
Vec3SqrLen alias for Vec3SquaredLength
var Vec3Sub = Vec3Subtract
Vec3Sub alias for Vec3Subtract
var Vec4Dist = Vec4Distance
Vec4Dist alias for Vec4Distance
var Vec4Div = Vec4Divide
Vec4Div alias for Vec4Divide
var Vec4Len = Vec4Length
Vec4Len alias for Vec4Length
var Vec4Mul = Vec4Multiply
Vec4Mul alias for Vec4Multiply
var Vec4SqrDist = Vec4SquaredDistance
Vec4SqrDist alias for Vec4SquaredDistance
var Vec4SqrLen = Vec4SquaredLength
Vec4SqrLen alias for Vec4SquaredLength
var Vec4Sub = Vec4Subtract
Vec4Sub alias for Vec4Subtract
Functions ¶
func Mat2Adjoint ¶
Mat2Adjoint calculates the adjugate of a mat2
func Mat2Determinant ¶
Mat2Determinant calculates the determinant of a mat2
func Mat2Equals ¶
Mat2Equals returns whether or not the matrices have approximately the same elements in the same position.
func Mat2ExactEquals ¶
Mat2ExactEquals returns whether or not the matrices have exactly the same elements in the same position (when compared with ==)
func Mat2FromRotation ¶
Mat2FromRotation creates a matrix from a given angle This is equivalent to (but much faster than):
- Mat2Identity(dest) - Mat2Rotate(dest, dest, rad)
func Mat2FromScaling ¶
Mat2FromScaling creates a matrix from a vector scaling This is equivalent to (but much faster than):
- Mat2Identity(dest) - Mat2Scale(dest, dest, vec)
func Mat2FromValues ¶
Mat2FromValues create a new mat2 with the given values
func Mat2Identity ¶
Mat2Identity set a mat2 to the identity matrix
func Mat2LDU ¶
Mat2LDU returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix
func Mat2Multiply ¶
Mat2Multiply multiplies two mat2's
func Mat2MultiplyScalar ¶
Mat2MultiplyScalar multiply each element of the matrix by a scalar.
func Mat2MultiplyScalarAndAdd ¶
Mat2MultiplyScalarAndAdd adds two mat2's after multiplying each element of the second operand by a scalar value.
func Mat2Rotate ¶
Mat2Rotate rotates a mat2 by the given angle
func Mat2Subtract ¶
Mat2Subtract subtracts matrix b from matrix a
func Mat2Transpose ¶
Mat2Transpose transpose the values of a mat2
func Mat2dClone ¶
Mat2dClone creates a new mat2d initialized with values from an existing matrix
func Mat2dDeterminant ¶
Mat2dDeterminant calculates the determinant of a mat2d
func Mat2dEquals ¶
Mat2dEquals returns whether or not the matrices have approximately the same elements in the same position.
func Mat2dExactEquals ¶
Mat2dExactEquals returns whether or not the matrices have exactly the same elements in the same position (when compared with ==)
func Mat2dFromRotation ¶
Mat2dFromRotation creates a matrix from a given angle This is equivalent to (but much faster than):
- Mat2dIdentity(dest) - Mat2dRotate(dest, dest, rad)
func Mat2dFromScaling ¶
Mat2dFromScaling creates a matrix from a vector scaling This is equivalent to (but much faster than):
- Mat2dIdentity(dest) - Mat2dScale(dest, dest, vec)
func Mat2dFromTranslation ¶
Mat2dFromTranslation creates a matrix from a vector translation This is equivalent to (but much faster than):
- Mat2dIdentity(dest) - Mat2dTranslate(dest, dest, vec)
func Mat2dFromValues ¶
Mat2dFromValues create a new mat2d with the given values
func Mat2dIdentity ¶
Mat2dIdentity set a mat2d to the identity matrix
func Mat2dMultiply ¶
Mat2dMultiply multiplies two mat2d's
func Mat2dMultiplyScalar ¶
Mat2dMultiplyScalar multiply each element of the matrix by a scalar.
func Mat2dMultiplyScalarAndAdd ¶
Mat2dMultiplyScalarAndAdd adds two mat2d's after multiplying each element of the second operand by a scalar value.
func Mat2dRotate ¶
Mat2dRotate rotates a mat2d by the given angle
func Mat2dScale ¶
Mat2dScale scales the mat2d by the dimensions in the given vec2
func Mat2dSubtract ¶
Mat2dSubtract subtracts matrix b from matrix a
func Mat2dTranslate ¶
Mat2dTranslate translates the mat2d by the dimensions in the given vec2
func Mat3Adjoint ¶
Mat3Adjoint calculates the adjugate of a mat3
func Mat3Determinant ¶
Mat3Determinant calculates the determinant of a mat3
func Mat3Equals ¶
Mat3Equals returns whether or not the matrices have approximately the same elements in the same position.
func Mat3ExactEquals ¶
Mat3ExactEquals returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)
func Mat3FromMat2d ¶
Mat3FromMat2d copies the values from a mat2d into a mat3
func Mat3FromMat4 ¶
Mat3FromMat4 copies the upper-left 3x3 values into the given mat3.
func Mat3FromQuat ¶
Mat3FromQuat calculates a 3x3 matrix from the given quaternion
func Mat3FromRotation ¶
Mat3FromRotation creates a matrix from a given angle This is equivalent to (but much faster than):
- Mat3Identity(dest) - Mat3Rotate(dest, dest, rad)
func Mat3FromScaling ¶
Mat3FromScaling creates a matrix from a vector scaling This is equivalent to (but much faster than):
- Mat3Identity(dest) - Mat3Scale(dest, dest, vec)
func Mat3FromTranslation ¶
Mat3FromTranslation creates a matrix from a vector translation This is equivalent to (but much faster than):
- Mat3Identity(dest) - Mat3Translate(dest, dest, vec)
func Mat3FromValues ¶
Mat3FromValues create a new mat3 with the given values
func Mat3Identity ¶
Mat3Identity set a mat3 to the identity matrix
func Mat3Multiply ¶
Mat3Multiply multiplies two mat3's
func Mat3MultiplyScalar ¶
Mat3MultiplyScalar multiply each element of the matrix by a scalar.
func Mat3MultiplyScalarAndAdd ¶
Mat3MultiplyScalarAndAdd adds two mat3's after multiplying each element of the second operand by a scalar value.
func Mat3NormalFromMat4 ¶
Mat3NormalFromMat4 calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix
func Mat3Projection ¶
Mat3Projection generates a 2D projection matrix with the given bounds
func Mat3Rotate ¶
Mat3Rotate rotates a mat3 by the given angle
func Mat3Subtract ¶
Mat3Subtract subtracts matrix b from matrix a
func Mat3Translate ¶
Mat3Translate translate a mat3 by the given vector
func Mat3Transpose ¶
Mat3Transpose transpose the values of a mat3
func Mat4Adjoint ¶
Mat4Adjoint calculates the adjugate of a mat4
func Mat4Determinant ¶
Mat4Determinant calculates the determinant of a mat4
func Mat4Equals ¶
Mat4Equals returns whether or not the matrices have approximately the same elements in the same position.
func Mat4ExactEquals ¶
Mat4ExactEquals returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)
func Mat4FromQuat ¶
Mat4FromQuat calculates a 4x4 matrix from the given quaternion
func Mat4FromQuat2 ¶
Mat4FromQuat2 creates a new mat4 from a dual quat.
func Mat4FromRotation ¶
Mat4FromRotation creates a matrix from a given angle around a given axis This is equivalent to (but much faster than):
- Mat4Identity(dest) - Mat4Rotate(dest, dest, rad, axis)
func Mat4FromRotationTranslation ¶
Mat4FromRotationTranslation creates a matrix from a quaternion rotation and vector translation This is equivalent to (but much faster than):
- Mat4Identity(dest) - Mat4Translate(dest, vec) - quatMat := Mat4Create() - Quat4ToMat4(quat, quatMat) - Mat4Multiply(dest, quatMat)
func Mat4FromRotationTranslationScale ¶
Mat4FromRotationTranslationScale creates a matrix from a quaternion rotation, vector translation and vector scale This is equivalent to (but much faster than):
- Mat4Identity(dest) - Mat4Translate(dest, vec) - quatMat := Mat4Create() - Quat4ToMat4(quat, quatMat) - Mat4Multiply(dest, quatMat) - Mat4Scale(dest, scale)
func Mat4FromRotationTranslationScaleOrigin ¶
Mat4FromRotationTranslationScaleOrigin creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin This is equivalent to (but much faster than):
- Mat4Identity(dest) - Mat4Translate(dest, vec) - Mat4Translate(dest, origin) - quatMat := Mat4Create() - Quat4ToMat4(quat, quatMat) - Mat4Multiply(dest, quatMat) - Mat4Scale(dest, scale) - Mat4Translate(dest, negativeOrigin)
func Mat4FromScaling ¶
Mat4FromScaling creates a matrix from a vector scaling This is equivalent to (but much faster than):
- Mat4Identity(dest) - Mat4Scale(dest, dest, vec)
func Mat4FromTranslation ¶
Mat4FromTranslation creates a matrix from a vector translation This is equivalent to (but much faster than):
- Mat4Identity(dest) - Mat4Translate(dest, dest, vec)
func Mat4FromValues ¶
func Mat4FromValues(m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33 float64) []float64
Mat4FromValues create a new mat4 with the given values
func Mat4FromXRotation ¶
Mat4FromXRotation creates a matrix from the given angle around the X axis This is equivalent to (but much faster than):
- Mat4Identity(dest) - Mat4RotateX(dest, dest, rad)
func Mat4FromYRotation ¶
Mat4FromYRotation creates a matrix from the given angle around the Y axis This is equivalent to (but much faster than):
- Mat4Identity(dest) - Mat4RotateY(dest, dest, rad)
func Mat4FromZRotation ¶
Mat4FromZRotation creates a matrix from the given angle around the Z axis This is equivalent to (but much faster than):
- Mat4Identity(dest) - Mat4RotateZ(dest, dest, rad)
func Mat4Frustum ¶
Mat4Frustum generates a frustum matrix with the given bounds
func Mat4GetRotation ¶
Mat4GetRotation returns a quaternion representing the rotational component of a transformation matrix. If a matrix is built with fromRotationTranslation, the returned quaternion will be the same as the quaternion originally supplied.
func Mat4GetScaling ¶
Mat4GetScaling returns the scaling factor component of a transformation matrix. If a matrix is built with fromRotationTranslationScale with a normalized Quaternion parameter, the returned vector will be the same as the scaling vector originally supplied.
func Mat4GetTranslation ¶
Mat4GetTranslation returns the translation vector component of a transformation matrix. If a matrix is built with fromRotationTranslation, the returned vector will be the same as the translation vector originally supplied.
func Mat4Identity ¶
Mat4Identity set a mat4 to the identity matrix
func Mat4LookAt ¶
Mat4LookAt generates a look-at matrix with the given eye position, focal point, and up axis. If you want a matrix that actually makes an object look at another object, you should use targetTo instead.
func Mat4Multiply ¶
Mat4Multiply multiplies two mat4s
func Mat4MultiplyScalar ¶
Mat4MultiplyScalar multiply each element of the matrix by a scalar.
func Mat4MultiplyScalarAndAdd ¶
Mat4MultiplyScalarAndAdd adds two mat4's after multiplying each element of the second operand by a scalar value.
func Mat4Perspective ¶
Mat4Perspective generates a perspective projection matrix with the given bounds.
func Mat4PerspectiveFromFieldOfView ¶
Mat4PerspectiveFromFieldOfView generates a perspective projection matrix with the given field of view. This is primarily useful for generating projection matrices to be used with the still experiemental WebVR API.
func Mat4Rotate ¶
Mat4Rotate rotates a mat4 by the given angle around the given axis
func Mat4RotateX ¶
Mat4RotateX rotates a matrix by the given angle around the X axis
func Mat4RotateY ¶
Mat4RotateY rotates a matrix by the given angle around the Y axis
func Mat4RotateZ ¶
Mat4RotateZ rotates a matrix by the given angle around the Z axis
func Mat4Scale ¶
Mat4Scale scales the mat4 by the dimensions in the given vec3 not using vectorization
func Mat4Set ¶
func Mat4Set(out []float64, m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33 float64) []float64
Mat4Set set the components of a mat4 to the given values
func Mat4Subtract ¶
Mat4Subtract subtracts matrix b from matrix a
func Mat4TargetTo ¶
Mat4TargetTo generates a matrix that makes something look at something else.
func Mat4Translate ¶
Mat4Translate translate a mat4 by the given vector
func Mat4Transpose ¶
Mat4Transpose transpose the values of a mat4
func Quat2Clone ¶
Quat2Clone creates a new quat initialized with values from an existing quaternion
func Quat2Conjugate ¶
Quat2Conjugate calculates the conjugate of a dual quat If the dual quaternion is normalized, this function is faster than quat2.inverse and produces the same result.
func Quat2Equals ¶
Quat2Equals returns whether or not the dual quaternions have approximately the same elements in the same position.
func Quat2ExactEquals ¶
Quat2ExactEquals returns whether or not the dual quaternions have exactly the same elements in the same position (when compared with ==)
func Quat2FromMat4 ¶
Quat2FromMat4 creates a new dual quat from a matrix (4x4)
func Quat2FromRotation ¶
Quat2FromRotation creates a dual quat from a quaternion
func Quat2FromRotationTranslation ¶
Quat2FromRotationTranslation creates a dual quat from a quaternion and a translation
func Quat2FromRotationTranslationValues ¶
Quat2FromRotationTranslationValues creates a new dual quat from the given values (quat and translation)
func Quat2FromTranslation ¶
Quat2FromTranslation creates a dual quat from a translation
func Quat2FromValues ¶
Quat2FromValues creates a new dual quat initialized with the given values
func Quat2GetDual ¶
Quat2GetDual gets the dual part of a dual quat
func Quat2GetTranslation ¶
Quat2GetTranslation gets the translation of a normalized dual quat
func Quat2Identity ¶
Quat2Identity set a dual quat to the identity dual quaternion
func Quat2Invert ¶
Quat2Invert calculates the inverse of a dual quat. If they are normalized, conjugate is cheaper
func Quat2Lerp ¶
Quat2Lerp performs a linear interpolation between two dual quats's NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when t = 0.5)
func Quat2Multiply ¶
Quat2Multiply multiplies two dual quat's
func Quat2Normalize ¶
Quat2Normalize normalize a dual quat
func Quat2RotateAroundAxis ¶
Quat2RotateAroundAxis rotates a dual quat around a given axis. Does the normalisation automatically
func Quat2RotateByQuatAppend ¶
Quat2RotateByQuatAppend rotates a dual quat by a given quaternion (a * q)
func Quat2RotateByQuatPrepend ¶
Quat2RotateByQuatPrepend rotates a dual quat by a given quaternion (q * a)
func Quat2RotateX ¶
Quat2RotateX rotates a dual quat around the X axis
func Quat2RotateY ¶
Quat2RotateY rotates a dual quat around the Y axis
func Quat2RotateZ ¶
Quat2RotateZ rotates a dual quat around the Z axis
func Quat2Scale ¶
Quat2Scale scales a dual quat by a scalar number
func Quat2SetDual ¶
Quat2SetDual set the dual component of a dual quat to the given quaternion
func Quat2Translate ¶
Quat2Translate translates a dual quat by the given vector
func QuatCalculateW ¶
QuatCalculateW calculates the W component of a quat from the X, Y, and Z components. Assumes that quaternion is 1 unit in length. Any existing W component will be ignored.
func QuatConjugate ¶
QuatConjugate calculates the conjugate of a quat If the quaternion is normalized, this function is faster than quat.inverse and produces the same result.
func QuatFromEuler ¶
QuatFromEuler creates a quaternion from the given euler angle x, y, z.
func QuatFromMat3 ¶
QuatFromMat3 creates a quaternion from the given 3x3 rotation matrix.
NOTE: The resultant quaternion is not normalized, so you should be sure to renormalize the quaternion yourself where necessary.
func QuatGetAngle ¶
QuatGetAngle gets the angular distance between two unit quaternions
func QuatGetAxisAngle ¶
QuatGetAxisAngle gets the rotation axis and angle for a given quaternion. If a quaternion is created with setAxisAngle, this method will return the same values as providied in the original parameter list OR functionally equivalent values.
Example: The quaternion formed by axis [0, 0, 1] and
angle -90 is the same as the quaternion formed by [0, 0, 1] and 270. This method favors the latter.
func QuatIdentity ¶
QuatIdentity set a quat to the identity quaternion
func QuatInvert ¶
QuatInvert calculates the inverse of a quat
func QuatMultiply ¶
QuatMultiply multiplies two quat's
func QuatRandom ¶
QuatRandom generates a random unit quaternion
func QuatRotateX ¶
QuatRotateX rotates a quaternion by the given angle about the X axis
func QuatRotateY ¶
QuatRotateY rotates a quaternion by the given angle about the Y axis
func QuatRotateZ ¶
QuatRotateZ rotates a quaternion by the given angle about the Z axis
func QuatRotationTo ¶
QuatRotationTo sets a quaternion to represent the shortest rotation from one vector to another.
Both vectors are assumed to be unit length.
func QuatSetAxisAngle ¶
QuatSetAxisAngle sets a quat from the given angle and rotation axis, then returns it.
func Vec2Create ¶
func Vec2Create() []float64
Vec2Create creates a new vec2 initialized with values from an existing vector
func Vec2Cross ¶
Vec2Cross computes the cross product of two vec2's Note that the cross product must by definition produce a 3D vector
func Vec2Distance ¶
Vec2Distance calculates the euclidian distance between two vec2's
func Vec2Equals ¶
Vec2Equals returns whether or not the vectors have approximately the same elements in the same position.
func Vec2ExactEquals ¶
Vec2ExactEquals returns whether or not the vectors exactly have the same elements in the same position (when compared with ===)
func Vec2ForEach ¶
func Vec2ForEach(a []float64, stride, offset, count int, fn func([]float64, []float64, []float64), arg []float64) []float64
Vec2ForEach perform some operation over an array of vec2s.
func Vec2FromValues ¶
Vec2FromValues creates a new vec2 initialized with the given values
func Vec2Inverse ¶
Vec2Inverse returns the inverse of the components of a vec2
func Vec2Multiply ¶
Vec2Multiply multiplies two vec2's
func Vec2Negate ¶
Vec2Negate negates the components of a vec2
func Vec2Random ¶
Vec2Random generates a random vector with the given scale
func Vec2Rotate ¶
Vec2Rotate rotate a 2D vector
func Vec2ScaleAndAdd ¶
Vec2ScaleAndAdd adds two vec2's after scaling the second operand by a scalar value
func Vec2SquaredDistance ¶
Vec2SquaredDistance calculates the squared euclidian distance between two vec2's
func Vec2SquaredLength ¶
Vec2SquaredLength calculates the squared length of a vec2
func Vec2Subtract ¶
Vec2Subtract subtracts vector b from vector a
func Vec2TransformMat2 ¶
Vec2TransformMat2 transforms the vec2 with a mat2
func Vec2TransformMat2d ¶
Vec2TransformMat2d transforms the vec2 with a mat2d
func Vec2TransformMat3 ¶
Vec2TransformMat3 transforms the vec2 with a mat3 3rd vector component is implicitly '1'
func Vec2TransformMat4 ¶
Vec2TransformMat4 transforms the vec2 with a mat4 3rd vector component is implicitly '0' 4th vector component is implicitly '1'
func Vec3Bezier ¶
Vec3Bezier performs a bezier interpolation with two control points
func Vec3Create ¶
func Vec3Create() []float64
Vec3Create creates a new Vec3 initialized with values from an existing vector
func Vec3Distance ¶
Vec3Distance calculates the euclidian distance between two Vec3's
func Vec3Equals ¶
Vec3Equals returns whether or not the vectors have approximately the same elements in the same position.
func Vec3ExactEquals ¶
Vec3ExactEquals returns whether or not the vectors exactly have the same elements in the same position (when compared with ===)
func Vec3ForEach ¶
func Vec3ForEach(a []float64, stride, offset, count int, fn func([]float64, []float64, []float64), arg []float64) []float64
Vec3ForEach perform some operation over an array of Vec3s.
func Vec3FromValues ¶
Vec3FromValues creates a new Vec3 initialized with the given values
func Vec3Hermite ¶
Vec3Hermite performs a hermite interpolation with two control points
func Vec3Inverse ¶
Vec3Inverse returns the inverse of the components of a Vec3
func Vec3Multiply ¶
Vec3Multiply multiplies two Vec3's
func Vec3Negate ¶
Vec3Negate negates the components of a Vec3
func Vec3Random ¶
Vec3Random generates a random vector with the given scale
func Vec3RotateX ¶
Vec3RotateX rotate a 3D vector around the x-axis
func Vec3RotateY ¶
Vec3RotateY rotate a 3D vector around the y-axis
func Vec3RotateZ ¶
Vec3RotateZ rotate a 3D vector around the z-axis
func Vec3ScaleAndAdd ¶
Vec3ScaleAndAdd adds two Vec3's after scaling the second operand by a scalar value
func Vec3SquaredDistance ¶
Vec3SquaredDistance calculates the squared euclidian distance between two Vec3's
func Vec3SquaredLength ¶
Vec3SquaredLength calculates the squared length of a Vec3
func Vec3Subtract ¶
Vec3Subtract subtracts vector b from vector a
func Vec3TransformMat3 ¶
Vec3TransformMat3 transforms the vec3 with a mat3
func Vec3TransformMat4 ¶
Vec3TransformMat4 transforms the vec3 with a mat4
func Vec3TransformQuat ¶
Vec3TransformQuat transforms the vec3 with a quat Can also be used for dual quaternions. (Multiply it with the real part)
func Vec4Create ¶
func Vec4Create() []float64
Vec4Create creates a new Vec4 initialized with values from an existing vector
func Vec4Distance ¶
Vec4Distance calculates the euclidian distance between two Vec4's
func Vec4Equals ¶
Vec4Equals returns whether or not the vectors have approximately the same elements in the same position.
func Vec4ExactEquals ¶
Vec4ExactEquals returns whether or not the vectors exactly have the same elements in the same position (when compared with ===)
func Vec4ForEach ¶
func Vec4ForEach(a []float64, stride, offset, count int, fn func([]float64, []float64, []float64), arg []float64) []float64
Vec4ForEach perform some operation over an array of Vec4s.
func Vec4FromValues ¶
Vec4FromValues creates a new Vec4 initialized with the given values
func Vec4Inverse ¶
Vec4Inverse returns the inverse of the components of a vec4
func Vec4Multiply ¶
Vec4Multiply multiplies two Vec4's
func Vec4Negate ¶
Vec4Negate negates the components of a vec4
func Vec4Random ¶
Vec4Random generates a random vector with the given scale
func Vec4ScaleAndAdd ¶
Vec4ScaleAndAdd adds two Vec4's after scaling the second operand by a scalar value
func Vec4SquaredDistance ¶
Vec4SquaredDistance calculates the squared euclidian distance between two Vec4's
func Vec4SquaredLength ¶
Vec4SquaredLength calculates the squared length of a vec4
func Vec4Subtract ¶
Vec4Subtract subtracts vector b from vector a
func Vec4TransformMat4 ¶
Vec4TransformMat4 transforms the vec4 with a mat4
func Vec4TransformQuat ¶
Vec4TransformQuat transforms the vec4 with a quat