glmatrix package - github.com/technohippy/go-glmatrix - Go Packages (original) (raw)
- 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
Epsilon is a tolerant value
Mat2Mul alias for Mat2Multiply
Mat2Sub alias for Mat2Subtract
Mat2dMul alias for Mat2dMultiply
Mat2dSub alias for Mat2dSubtract
Mat3Mul alias for Mat3Multiply
Mat3Sub alias for Mat3Subtract
Mat4Mul alias for Mat4Multiply
Mat4Sub alias for Mat4Subtract
Quat2Dot calculates the dot product of two dual quat's (The dot product of the real parts)
Quat2GetReal gets the real part of a dual quat
Quat2Len alias for Quat2Length
Quat2Length calculates the length of a dual quat
Quat2Mul alias for Quat2Multiply
Quat2SetReal set the real component of a dual quat to the given quaternion
Quat2SqrLen alias for Quat2SquaredLength
Quat2SquaredLength calculates the squared length of a dual quat
QuatAdd adds two quat's
QuatClone creates a new quat initialized with values from an existing quaternion
QuatCopy copy the values from one quat to another
QuatDot calculates the dot product of two quat's
QuatEquals returns whether or not the quaternions have approximately the same elements in the same position.
QuatExactEquals returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===)
QuatFromValues creates a new quat initialized with the given values
QuatLen alias for QuatLength
QuatLength calculates the length of a quat
QuatLerp performs a linear interpolation between two quat's
QuatMul alias QuatMultiply
QuatNormalize mormalize a quat
QuatScale scales a quat by a scalar number
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](#QuatNormalize)(out, [QuatFromMat3](#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](/builtin#float64), t [float64](/builtin#float64)) [][float64](/builtin#float64) {
[QuatSlerp](#QuatSlerp)(temp1, a, d, t)
[QuatSlerp](#QuatSlerp)(temp2, b, c, t)
[QuatSlerp](#QuatSlerp)(out, temp1, temp2, 2*t*(1-t))
return out
}})()
QuatSqlerp performs a spherical linear interpolation with two control points
QuatSqrLen alias for QuatSquaredLength
QuatSquaredLength calculates the squared length of a quat
Vec2Dist alias for Vec2Distance
Vec2Div alias for Vec2Divide
Vec2Len alias for Vec2Length
Vec2Mul alias for Vec2Multiply
Vec2SqrDist alias for Vec2SquaredDistance
Vec2SqrLen alias for Vec2SquaredLength
Vec2Sub alias for Vec2Subtract
Vec3Dist alias for Vec3Distance
Vec3Div alias for Vec3Divide
Vec3Len alias for Vec3Length
Vec3Mul alias for Vec3Multiply
Vec3SqrDist alias for Vec3SquaredDistance
Vec3SqrLen alias for Vec3SquaredLength
Vec3Sub alias for Vec3Subtract
Vec4Dist alias for Vec4Distance
Vec4Div alias for Vec4Divide
Vec4Len alias for Vec4Length
Vec4Mul alias for Vec4Multiply
Vec4SqrDist alias for Vec4SquaredDistance
Vec4SqrLen alias for Vec4SquaredLength
Vec4Sub alias for Vec4Subtract
Mat2Adjoint calculates the adjugate of a mat2
Mat2Clone creates a new mat2 initialized with values from an existing matrix
Mat2Copy copy the values from one mat2 to another
Mat2Create creates a new identity mat2
Mat2Determinant calculates the determinant of a mat2
Mat2Equals returns whether or not the matrices have approximately the same elements in the same position.
Mat2ExactEquals returns whether or not the matrices have exactly the same elements in the same position (when compared with ==)
Mat2Frob returns Frobenius norm of a mat2
Mat2FromRotation creates a matrix from a given angle This is equivalent to (but much faster than):
- Mat2Identity(dest) - Mat2Rotate(dest, dest, rad)
Mat2FromScaling creates a matrix from a vector scaling This is equivalent to (but much faster than):
- Mat2Identity(dest) - Mat2Scale(dest, dest, vec)
Mat2FromValues create a new mat2 with the given values
Mat2Identity set a mat2 to the identity matrix
Mat2Invert inverts a mat2
Mat2LDU returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix
Mat2Multiply multiplies two mat2's
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.
Mat2Rotate rotates a mat2 by the given angle
Mat2Scale scales the mat2 by the dimensions in the given vec2
Mat2Set set the components of a mat2 to the given values
Mat2Str returns a string representation of a mat2
Mat2Subtract subtracts matrix b from matrix a
Mat2Transpose transpose the values of a mat2
Mat2dAdd adds two mat2d's
Mat2dClone creates a new mat2d initialized with values from an existing matrix
Mat2dCopy copy the values from one mat2d to another
Mat2dCreate creates a new identity mat2d
Mat2dDeterminant calculates the determinant of a mat2d
Mat2dEquals returns whether or not the matrices have approximately the same elements in the same position.
Mat2dExactEquals returns whether or not the matrices have exactly the same elements in the same position (when compared with ==)
Mat2dFrob returns Frobenius norm of a mat2d
Mat2dFromRotation creates a matrix from a given angle This is equivalent to (but much faster than):
- Mat2dIdentity(dest) - Mat2dRotate(dest, dest, rad)
Mat2dFromScaling creates a matrix from a vector scaling This is equivalent to (but much faster than):
- Mat2dIdentity(dest) - Mat2dScale(dest, dest, vec)
Mat2dFromTranslation creates a matrix from a vector translation This is equivalent to (but much faster than):
- Mat2dIdentity(dest) - Mat2dTranslate(dest, dest, vec)
Mat2dFromValues create a new mat2d with the given values
Mat2dIdentity set a mat2d to the identity matrix
Mat2dInvert inverts a mat2d
Mat2dMultiply multiplies two mat2d's
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.
Mat2dRotate rotates a mat2d by the given angle
Mat2dScale scales the mat2d by the dimensions in the given vec2
Mat2dSet set the components of a mat2d to the given values
Mat2dStr returns a string representation of a mat2d
Mat2dSubtract subtracts matrix b from matrix a
Mat2dTranslate translates the mat2d by the dimensions in the given vec2
Mat3Adjoint calculates the adjugate of a mat3
Mat3Clone creates a new mat3 initialized with values from an existing matrix
Mat3Copy copy the values from one mat3 to another
Mat3Create creates a new identity mat3
Mat3Determinant calculates the determinant of a mat3
Mat3Equals returns whether or not the matrices have approximately the same elements in the same position.
Mat3ExactEquals returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)
Mat3Frob returns Frobenius norm of a mat3
Mat3FromMat2d copies the values from a mat2d into a mat3
Mat3FromMat4 copies the upper-left 3x3 values into the given mat3.
Mat3FromQuat calculates a 3x3 matrix from the given quaternion
Mat3FromRotation creates a matrix from a given angle This is equivalent to (but much faster than):
- Mat3Identity(dest) - Mat3Rotate(dest, dest, rad)
Mat3FromScaling creates a matrix from a vector scaling This is equivalent to (but much faster than):
- Mat3Identity(dest) - Mat3Scale(dest, dest, vec)
Mat3FromTranslation creates a matrix from a vector translation This is equivalent to (but much faster than):
- Mat3Identity(dest) - Mat3Translate(dest, dest, vec)
func Mat3FromValues(m00, m01, m02, m10, m11, m12, m20, m21, m22 float64) []float64
Mat3FromValues create a new mat3 with the given values
Mat3Identity set a mat3 to the identity matrix
Mat3Invert inverts a mat3
Mat3Multiply multiplies two mat3's
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.
Mat3NormalFromMat4 calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix
Mat3Projection generates a 2D projection matrix with the given bounds
Mat3Rotate rotates a mat3 by the given angle
Mat3Scale scales the mat3 by the dimensions in the given vec2
Mat3Set set the components of a mat3 to the given values
Mat3Str returns a string representation of a mat3
Mat3Subtract subtracts matrix b from matrix a
Mat3Translate translate a mat3 by the given vector
Mat3Transpose transpose the values of a mat3
Mat4Adjoint calculates the adjugate of a mat4
Mat4Clone creates a new mat4 initialized with values from an existing matrix
Mat4Copy copy the values from one mat4 to another
Mat4Create creates a new identity mat4
Mat4Determinant calculates the determinant of a mat4
Mat4Equals returns whether or not the matrices have approximately the same elements in the same position.
Mat4ExactEquals returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)
Mat4Frob returns Frobenius norm of a mat4
Mat4FromQuat calculates a 4x4 matrix from the given quaternion
Mat4FromQuat2 creates a new mat4 from a dual quat.
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)
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(out, q, v, s []float64) []float64
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(out, q, v, s, o []float64) []float64
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)
Mat4FromScaling creates a matrix from a vector scaling This is equivalent to (but much faster than):
- Mat4Identity(dest) - Mat4Scale(dest, dest, vec)
Mat4FromTranslation creates a matrix from a vector translation This is equivalent to (but much faster than):
- Mat4Identity(dest) - Mat4Translate(dest, dest, vec)
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
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)
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)
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)
Mat4Frustum generates a frustum matrix with the given bounds
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.
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.
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.
Mat4Identity set a mat4 to the identity matrix
Mat4Invert inverts a mat4
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.
Mat4Multiply multiplies two mat4s
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.
Mat4Ortho generates a orthogonal projection matrix with the given bounds
Mat4Perspective generates a perspective projection matrix with the given bounds.
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.
Mat4Rotate rotates a mat4 by the given angle around the given axis
Mat4RotateX rotates a matrix by the given angle around the X axis
Mat4RotateY rotates a matrix by the given angle around the Y axis
Mat4RotateZ rotates a matrix by the given angle around the Z axis
Mat4Scale scales the mat4 by the dimensions in the given vec3 not using vectorization
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
Mat4Str returns a string representation of a mat4
Mat4Subtract subtracts matrix b from matrix a
Mat4TargetTo generates a matrix that makes something look at something else.
Mat4Translate translate a mat4 by the given vector
Mat4Transpose transpose the values of a mat4
NewMat3 creates a new identity mat3
NewMat4 creates a new identity mat4
NewQuat creates a new identity quat
NewVec2 creates a new, empty vec2
NewVec3 creates a new, empty Vec3
NewVec4 creates a new, empty Vec4
Quat2Add adds two dual quat's
Quat2Clone creates a new quat initialized with values from an existing quaternion
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.
Quat2Copy copy the values from one dual quat to another
Quat2Create creates a new identity dual quat
Quat2Equals returns whether or not the dual quaternions have approximately the same elements in the same position.
Quat2ExactEquals returns whether or not the dual quaternions have exactly the same elements in the same position (when compared with ==)
Quat2FromMat4 creates a new dual quat from a matrix (4x4)
Quat2FromRotation creates a dual quat from a quaternion
Quat2FromRotationTranslation creates a dual quat from a quaternion and a translation
func Quat2FromRotationTranslationValues(x1, y1, z1, w1, x2, y2, z2 float64) []float64
Quat2FromRotationTranslationValues creates a new dual quat from the given values (quat and translation)
Quat2FromTranslation creates a dual quat from a translation
func Quat2FromValues(x1, y1, z1, w1, x2, y2, z2, w2 float64) []float64
Quat2FromValues creates a new dual quat initialized with the given values
Quat2GetDual gets the dual part of a dual quat
Quat2GetTranslation gets the translation of a normalized dual quat
Quat2Identity set a dual quat to the identity dual quaternion
Quat2Invert calculates the inverse of a dual quat. If they are normalized, conjugate is cheaper
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)
Quat2Multiply multiplies two dual quat's
Quat2Normalize normalize a dual quat
Quat2RotateAroundAxis rotates a dual quat around a given axis. Does the normalisation automatically
Quat2RotateByQuatAppend rotates a dual quat by a given quaternion (a * q)
Quat2RotateByQuatPrepend rotates a dual quat by a given quaternion (q * a)
Quat2RotateX rotates a dual quat around the X axis
Quat2RotateY rotates a dual quat around the Y axis
Quat2RotateZ rotates a dual quat around the Z axis
Quat2Scale scales a dual quat by a scalar number
Quat2Set set the components of a dual quat to the given values
Quat2SetDual set the dual component of a dual quat to the given quaternion
Quat2Str returns a string representation of a dual quatenion
Quat2Translate translates a dual quat by the given vector
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.
QuatConjugate calculates the conjugate of a quat If the quaternion is normalized, this function is faster than quat.inverse and produces the same result.
QuatCreate creates a new identity quat
QuatExp calculate the exponential of a unit quaternion.
QuatFromEuler creates a quaternion from the given euler angle x, y, z.
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.
QuatGetAngle gets the angular distance between two unit quaternions
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.
QuatIdentity set a quat to the identity quaternion
QuatInvert calculates the inverse of a quat
QuatLn calculate the natural logarithm of a unit quaternion.
QuatMultiply multiplies two quat's
QuatPow calculate the scalar power of a unit quaternion.
func QuatRandom ¶
QuatRandom generates a random unit quaternion
QuatRotateX rotates a quaternion by the given angle about the X axis
QuatRotateY rotates a quaternion by the given angle about the Y axis
QuatRotateZ rotates a quaternion by the given angle about the Z axis
QuatRotationTo sets a quaternion to represent the shortest rotation from one vector to another.
Both vectors are assumed to be unit length.
QuatSetAxisAngle sets a quat from the given angle and rotation axis, then returns it.
QuatSlerp performs a spherical linear interpolation between two quat
QuatStr returns a string representation of a quatenion
ToRadian convert Degree To Radian
Vec2Angle get the angle between two 2D vectors
Vec2Ceil math.ceil the components of a vec2
Vec2Clone creates a new vec2 initialized with the given values
Vec2Copy copy the values from one vec2 to another
Vec2Create creates a new vec2 initialized with values from an existing vector
Vec2Cross computes the cross product of two vec2's Note that the cross product must by definition produce a 3D vector
Vec2Distance calculates the euclidian distance between two vec2's
Vec2Divide divides two vec2's
Vec2Dot calculates the dot product of two vec2's
Vec2Equals returns whether or not the vectors have approximately the same elements in the same position.
Vec2ExactEquals returns whether or not the vectors exactly have the same elements in the same position (when compared with ===)
Vec2Floor math.floor the components of a vec2
Vec2ForEach perform some operation over an array of vec2s.
Vec2FromValues creates a new vec2 initialized with the given values
Vec2Inverse returns the inverse of the components of a vec2
Vec2Length calculates the length of a vec2
Vec2Lerp performs a linear interpolation between two vec2's
Vec2Max returns the maximum of two vec2's
Vec2Min returns the minimum of two vec2's
Vec2Multiply multiplies two vec2's
Vec2Negate negates the components of a vec2
Vec2Normalize normalize a vec2
func Vec2Random ¶
Vec2Random generates a random vector with the given scale
Vec2Rotate rotate a 2D vector
Vec2Round math.round the components of a vec2
Vec2Scale scales a vec2 by a scalar number
func Vec2ScaleAndAdd ¶
Vec2ScaleAndAdd adds two vec2's after scaling the second operand by a scalar value
Vec2Set set the components of a vec2 to the given values
Vec2SquaredDistance calculates the squared euclidian distance between two vec2's
Vec2SquaredLength calculates the squared length of a vec2
Vec2Str returns a string representation of a vector
Vec2Subtract subtracts vector b from vector a
Vec2TransformMat2 transforms the vec2 with a mat2
Vec2TransformMat2d transforms the vec2 with a mat2d
Vec2TransformMat3 transforms the vec2 with a mat3 3rd vector component is implicitly '1'
Vec2TransformMat4 transforms the vec2 with a mat4 3rd vector component is implicitly '0' 4th vector component is implicitly '1'
Vec2Zero set the components of a vec2 to zero
Vec3Angle get the angle between two 2D vectors
Vec3Bezier performs a bezier interpolation with two control points
Vec3Ceil math.ceil the components of a Vec3
Vec3Clone creates a new Vec3 initialized with the given values
Vec3Copy copy the values from one Vec3 to another
Vec3Create creates a new Vec3 initialized with values from an existing vector
Vec3Cross computes the cross product of two Vec3's
Vec3Distance calculates the euclidian distance between two Vec3's
Vec3Divide divides two Vec3's
Vec3Dot calculates the dot product of two Vec3's
Vec3Equals returns whether or not the vectors have approximately the same elements in the same position.
Vec3ExactEquals returns whether or not the vectors exactly have the same elements in the same position (when compared with ===)
Vec3Floor math.floor the components of a Vec3
Vec3ForEach perform some operation over an array of Vec3s.
Vec3FromValues creates a new Vec3 initialized with the given values
Vec3Hermite performs a hermite interpolation with two control points
Vec3Inverse returns the inverse of the components of a Vec3
Vec3Length calculates the length of a Vec3
Vec3Lerp performs a linear interpolation between two Vec3's
Vec3Max returns the maximum of two Vec3's
Vec3Min returns the minimum of two Vec3's
Vec3Multiply multiplies two Vec3's
Vec3Negate negates the components of a Vec3
Vec3Normalize normalize a Vec3
func Vec3Random ¶
Vec3Random generates a random vector with the given scale
Vec3RotateX rotate a 3D vector around the x-axis
Vec3RotateY rotate a 3D vector around the y-axis
Vec3RotateZ rotate a 3D vector around the z-axis
Vec3Round math.round the components of a Vec3
Vec3Scale scales a Vec3 by a scalar number
func Vec3ScaleAndAdd ¶
Vec3ScaleAndAdd adds two Vec3's after scaling the second operand by a scalar value
Vec3Set set the components of a Vec3 to the given values
Vec3Slerp performs a spherical linear interpolation between two vec3's
Vec3SquaredDistance calculates the squared euclidian distance between two Vec3's
Vec3SquaredLength calculates the squared length of a Vec3
Vec3Str returns a string representation of a vector
Vec3Subtract subtracts vector b from vector a
Vec3TransformMat3 transforms the vec3 with a mat3
Vec3TransformMat4 transforms the vec3 with a mat4
Vec3TransformQuat transforms the vec3 with a quat Can also be used for dual quaternions. (Multiply it with the real part)
Vec3Zero set the components of a Vec3 to zero
Vec4Ceil math.ceil the components of a vec4
Vec4Clone creates a new Vec4 initialized with the given values
Vec4Copy copy the values from one Vec4 to another
Vec4Create creates a new Vec4 initialized with values from an existing vector
Vec4Cross computes the cross product of two Vec4's
Vec4Distance calculates the euclidian distance between two Vec4's
Vec4Divide divides two Vec4's
Vec4Dot calculates the dot product of two Vec4's
Vec4Equals returns whether or not the vectors have approximately the same elements in the same position.
Vec4ExactEquals returns whether or not the vectors exactly have the same elements in the same position (when compared with ===)
Vec4Floor math.floor the components of a vec4
Vec4ForEach perform some operation over an array of Vec4s.
Vec4FromValues creates a new Vec4 initialized with the given values
Vec4Inverse returns the inverse of the components of a vec4
Vec4Length calculates the length of a vec4
Vec4Lerp performs a linear interpolation between two Vec4's
Vec4Max returns the maximum of two Vec4's
Vec4Min returns the minimum of two Vec4's
Vec4Multiply multiplies two Vec4's
Vec4Negate negates the components of a vec4
Vec4Normalize normalize a vec4
func Vec4Random ¶
Vec4Random generates a random vector with the given scale
Vec4Round math.round the components of a vec4
Vec4Scale scales a vec4 by a scalar number
func Vec4ScaleAndAdd ¶
Vec4ScaleAndAdd adds two Vec4's after scaling the second operand by a scalar value
Vec4Set set the components of a vec4 to the given values
Vec4SquaredDistance calculates the squared euclidian distance between two Vec4's
Vec4SquaredLength calculates the squared length of a vec4
Vec4Str returns a string representation of a vector
Vec4Subtract subtracts vector b from vector a
Vec4TransformMat4 transforms the vec4 with a mat4
Vec4TransformQuat transforms the vec4 with a quat
Vec4Zero set the components of a vec4 to zero
Fov represent Field of View