glmatrix

package module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 6, 2020 License: MIT Imports: 3 Imported by: 0

README

Build Status Coverage Status Go Report Card GoDoc license

go-glmatrix

go-glmatrix is a golang version of glMatrix, which is ``designed to perform vector and matrix operations stupidly fast''.

Usage

package main

import (
	"fmt"
	glm "github.com/technohippy/go-glmatrix"
)

func main() {
	pers := glm.Mat4Create() // pers is just a float64 slice
	glm.Mat4Perspective(pers, glm.ToRadian(45), 640./480, 0.1, 200.)
	fmt.Println(glm.Mat4Str(pers))
}

Document

License

MIT

Documentation

Index

Constants

View Source
const Epsilon = 0.000001

Epsilon is a tolerant value

Variables

View Source
var Mat2Mul = Mat2Multiply

Mat2Mul alias for Mat2Multiply

View Source
var Mat2Sub = Mat2Subtract

Mat2Sub alias for Mat2Subtract

View Source
var Mat2dMul = Mat2dMultiply

Mat2dMul alias for Mat2dMultiply

View Source
var Mat2dSub = Mat2dSubtract

Mat2dSub alias for Mat2dSubtract

View Source
var Mat3Mul = Mat3Multiply

Mat3Mul alias for Mat3Multiply

View Source
var Mat3Sub = Mat3Subtract

Mat3Sub alias for Mat3Subtract

View Source
var Mat4Mul = Mat4Multiply

Mat4Mul alias for Mat4Multiply

View Source
var Mat4Sub = Mat4Subtract

Mat4Sub alias for Mat4Subtract

View Source
var Quat2Dot = QuatDot

Quat2Dot calculates the dot product of two dual quat's (The dot product of the real parts)

View Source
var Quat2GetReal = QuatCopy

Quat2GetReal gets the real part of a dual quat

View Source
var Quat2Len = Quat2Length

Quat2Len alias for Quat2Length

View Source
var Quat2Length = QuatLength

Quat2Length calculates the length of a dual quat

View Source
var Quat2Mul = Quat2Multiply

Quat2Mul alias for Quat2Multiply

View Source
var Quat2SetReal = QuatCopy

Quat2SetReal set the real component of a dual quat to the given quaternion

View Source
var Quat2SqrLen = Quat2SquaredLength

Quat2SqrLen alias for Quat2SquaredLength

View Source
var Quat2SquaredLength = QuatSquaredLength

Quat2SquaredLength calculates the squared length of a dual quat

View Source
var QuatAdd = Vec4Add

QuatAdd adds two quat's

View Source
var QuatClone = Vec4Clone

QuatClone creates a new quat initialized with values from an existing quaternion

View Source
var QuatCopy = Vec4Copy

QuatCopy copy the values from one quat to another

View Source
var QuatDot = Vec4Dot

QuatDot calculates the dot product of two quat's

View Source
var QuatEquals = Vec4Equals

QuatEquals returns whether or not the quaternions have approximately the same elements in the same position.

View Source
var QuatExactEquals = Vec4ExactEquals

QuatExactEquals returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===)

View Source
var QuatFromValues = Vec4FromValues

QuatFromValues creates a new quat initialized with the given values

View Source
var QuatLen = QuatLength

QuatLen alias for QuatLength

View Source
var QuatLength = Vec4Length

QuatLength calculates the length of a quat

View Source
var QuatLerp = Vec4Lerp

QuatLerp performs a linear interpolation between two quat's

View Source
var QuatMul = QuatMultiply

QuatMul alias QuatMultiply

View Source
var QuatNormalize = Vec4Normalize

QuatNormalize mormalize a quat

View Source
var QuatScale = Vec4Scale

QuatScale scales a quat by a scalar number

View Source
var QuatSet = Vec4Set

QuatSet set the components of a quat to the given values

View Source
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.

View Source
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

View Source
var QuatSqrLen = QuatSquaredLength

QuatSqrLen alias for QuatSquaredLength

View Source
var QuatSquaredLength = Vec4SquaredLength

QuatSquaredLength calculates the squared length of a quat

View Source
var Vec2Dist = Vec2Distance

Vec2Dist alias for Vec2Distance

View Source
var Vec2Div = Vec2Divide

Vec2Div alias for Vec2Divide

View Source
var Vec2Len = Vec2Length

Vec2Len alias for Vec2Length

View Source
var Vec2Mul = Vec2Multiply

Vec2Mul alias for Vec2Multiply

View Source
var Vec2SqrDist = Vec2SquaredDistance

Vec2SqrDist alias for Vec2SquaredDistance

View Source
var Vec2SqrLen = Vec2SquaredLength

Vec2SqrLen alias for Vec2SquaredLength

View Source
var Vec2Sub = Vec2Subtract

Vec2Sub alias for Vec2Subtract

View Source
var Vec3Dist = Vec3Distance

Vec3Dist alias for Vec3Distance

View Source
var Vec3Div = Vec3Divide

Vec3Div alias for Vec3Divide

View Source
var Vec3Len = Vec3Length

Vec3Len alias for Vec3Length

View Source
var Vec3Mul = Vec3Multiply

Vec3Mul alias for Vec3Multiply

View Source
var Vec3SqrDist = Vec3SquaredDistance

Vec3SqrDist alias for Vec3SquaredDistance

View Source
var Vec3SqrLen = Vec3SquaredLength

Vec3SqrLen alias for Vec3SquaredLength

View Source
var Vec3Sub = Vec3Subtract

Vec3Sub alias for Vec3Subtract

View Source
var Vec4Dist = Vec4Distance

Vec4Dist alias for Vec4Distance

View Source
var Vec4Div = Vec4Divide

Vec4Div alias for Vec4Divide

View Source
var Vec4Len = Vec4Length

Vec4Len alias for Vec4Length

View Source
var Vec4Mul = Vec4Multiply

Vec4Mul alias for Vec4Multiply

View Source
var Vec4SqrDist = Vec4SquaredDistance

Vec4SqrDist alias for Vec4SquaredDistance

View Source
var Vec4SqrLen = Vec4SquaredLength

Vec4SqrLen alias for Vec4SquaredLength

View Source
var Vec4Sub = Vec4Subtract

Vec4Sub alias for Vec4Subtract

Functions

func Mat2Add

func Mat2Add(out, a, b []float64) []float64

Mat2Add adds two mat2's

func Mat2Adjoint

func Mat2Adjoint(out, a []float64) []float64

Mat2Adjoint calculates the adjugate of a mat2

func Mat2Clone

func Mat2Clone(a []float64) []float64

Mat2Clone creates a new mat2 initialized with values from an existing matrix

func Mat2Copy

func Mat2Copy(out, a []float64) []float64

Mat2Copy copy the values from one mat2 to another

func Mat2Create

func Mat2Create() []float64

Mat2Create creates a new identity mat2

func Mat2Determinant

func Mat2Determinant(a []float64) float64

Mat2Determinant calculates the determinant of a mat2

func Mat2Equals

func Mat2Equals(a, b []float64) bool

Mat2Equals returns whether or not the matrices have approximately the same elements in the same position.

func Mat2ExactEquals

func Mat2ExactEquals(a, b []float64) bool

Mat2ExactEquals returns whether or not the matrices have exactly the same elements in the same position (when compared with ==)

func Mat2Frob

func Mat2Frob(a []float64) float64

Mat2Frob returns Frobenius norm of a mat2

func Mat2FromRotation

func Mat2FromRotation(out []float64, rad float64) []float64

Mat2FromRotation creates a matrix from a given angle This is equivalent to (but much faster than):

- Mat2Identity(dest) - Mat2Rotate(dest, dest, rad)

func Mat2FromScaling

func Mat2FromScaling(out, v []float64) []float64

Mat2FromScaling creates a matrix from a vector scaling This is equivalent to (but much faster than):

- Mat2Identity(dest) - Mat2Scale(dest, dest, vec)

func Mat2FromValues

func Mat2FromValues(m00, m01, m10, m11 float64) []float64

Mat2FromValues create a new mat2 with the given values

func Mat2Identity

func Mat2Identity(out []float64) []float64

Mat2Identity set a mat2 to the identity matrix

func Mat2Invert

func Mat2Invert(out, a []float64) []float64

Mat2Invert inverts a mat2

func Mat2LDU

func Mat2LDU(L, D, U, a []float64) [][]float64

Mat2LDU returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix

func Mat2Multiply

func Mat2Multiply(out, a, b []float64) []float64

Mat2Multiply multiplies two mat2's

func Mat2MultiplyScalar

func Mat2MultiplyScalar(out, a []float64, b float64) []float64

Mat2MultiplyScalar multiply each element of the matrix by a scalar.

func Mat2MultiplyScalarAndAdd

func Mat2MultiplyScalarAndAdd(out, a, b []float64, scale float64) []float64

Mat2MultiplyScalarAndAdd adds two mat2's after multiplying each element of the second operand by a scalar value.

func Mat2Rotate

func Mat2Rotate(out, a []float64, rad float64) []float64

Mat2Rotate rotates a mat2 by the given angle

func Mat2Scale

func Mat2Scale(out, a, v []float64) []float64

Mat2Scale scales the mat2 by the dimensions in the given vec2

func Mat2Set

func Mat2Set(out []float64, m00, m01, m10, m11 float64) []float64

Mat2Set set the components of a mat2 to the given values

func Mat2Str

func Mat2Str(a []float64) string

Mat2Str returns a string representation of a mat2

func Mat2Subtract

func Mat2Subtract(out, a, b []float64) []float64

Mat2Subtract subtracts matrix b from matrix a

func Mat2Transpose

func Mat2Transpose(out, a []float64) []float64

Mat2Transpose transpose the values of a mat2

func Mat2dAdd

func Mat2dAdd(out, a, b []float64) []float64

Mat2dAdd adds two mat2d's

func Mat2dClone

func Mat2dClone(a []float64) []float64

Mat2dClone creates a new mat2d initialized with values from an existing matrix

func Mat2dCopy

func Mat2dCopy(out, a []float64) []float64

Mat2dCopy copy the values from one mat2d to another

func Mat2dCreate

func Mat2dCreate() []float64

Mat2dCreate creates a new identity mat2d

func Mat2dDeterminant

func Mat2dDeterminant(a []float64) float64

Mat2dDeterminant calculates the determinant of a mat2d

func Mat2dEquals

func Mat2dEquals(a, b []float64) bool

Mat2dEquals returns whether or not the matrices have approximately the same elements in the same position.

func Mat2dExactEquals

func Mat2dExactEquals(a, b []float64) bool

Mat2dExactEquals returns whether or not the matrices have exactly the same elements in the same position (when compared with ==)

func Mat2dFrob

func Mat2dFrob(a []float64) float64

Mat2dFrob returns Frobenius norm of a mat2d

func Mat2dFromRotation

func Mat2dFromRotation(out []float64, rad float64) []float64

Mat2dFromRotation creates a matrix from a given angle This is equivalent to (but much faster than):

- Mat2dIdentity(dest) - Mat2dRotate(dest, dest, rad)

func Mat2dFromScaling

func Mat2dFromScaling(out, v []float64) []float64

Mat2dFromScaling creates a matrix from a vector scaling This is equivalent to (but much faster than):

- Mat2dIdentity(dest) - Mat2dScale(dest, dest, vec)

func Mat2dFromTranslation

func Mat2dFromTranslation(out, v []float64) []float64

Mat2dFromTranslation creates a matrix from a vector translation This is equivalent to (but much faster than):

- Mat2dIdentity(dest) - Mat2dTranslate(dest, dest, vec)

func Mat2dFromValues

func Mat2dFromValues(a, b, c, d, tx, ty float64) []float64

Mat2dFromValues create a new mat2d with the given values

func Mat2dIdentity

func Mat2dIdentity(out []float64) []float64

Mat2dIdentity set a mat2d to the identity matrix

func Mat2dInvert

func Mat2dInvert(out, a []float64) []float64

Mat2dInvert inverts a mat2d

func Mat2dMultiply

func Mat2dMultiply(out, a, b []float64) []float64

Mat2dMultiply multiplies two mat2d's

func Mat2dMultiplyScalar

func Mat2dMultiplyScalar(out, a []float64, b float64) []float64

Mat2dMultiplyScalar multiply each element of the matrix by a scalar.

func Mat2dMultiplyScalarAndAdd

func Mat2dMultiplyScalarAndAdd(out, a, b []float64, scale float64) []float64

Mat2dMultiplyScalarAndAdd adds two mat2d's after multiplying each element of the second operand by a scalar value.

func Mat2dRotate

func Mat2dRotate(out, a []float64, rad float64) []float64

Mat2dRotate rotates a mat2d by the given angle

func Mat2dScale

func Mat2dScale(out, a, v []float64) []float64

Mat2dScale scales the mat2d by the dimensions in the given vec2

func Mat2dSet

func Mat2dSet(out []float64, a, b, c, d, tx, ty float64) []float64

Mat2dSet set the components of a mat2d to the given values

func Mat2dStr

func Mat2dStr(a []float64) string

Mat2dStr returns a string representation of a mat2d

func Mat2dSubtract

func Mat2dSubtract(out, a, b []float64) []float64

Mat2dSubtract subtracts matrix b from matrix a

func Mat2dTranslate

func Mat2dTranslate(out, a, v []float64) []float64

Mat2dTranslate translates the mat2d by the dimensions in the given vec2

func Mat3Add

func Mat3Add(out, a, b []float64) []float64

Mat3Add adds two mat3's

func Mat3Adjoint

func Mat3Adjoint(out, a []float64) []float64

Mat3Adjoint calculates the adjugate of a mat3

func Mat3Clone

func Mat3Clone(a []float64) []float64

Mat3Clone creates a new mat3 initialized with values from an existing matrix

func Mat3Copy

func Mat3Copy(out, a []float64) []float64

Mat3Copy copy the values from one mat3 to another

func Mat3Create

func Mat3Create() []float64

Mat3Create creates a new identity mat3

func Mat3Determinant

func Mat3Determinant(a []float64) float64

Mat3Determinant calculates the determinant of a mat3

func Mat3Equals

func Mat3Equals(a, b []float64) bool

Mat3Equals returns whether or not the matrices have approximately the same elements in the same position.

func Mat3ExactEquals

func Mat3ExactEquals(a, b []float64) bool

Mat3ExactEquals returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)

func Mat3Frob

func Mat3Frob(a []float64) float64

Mat3Frob returns Frobenius norm of a mat3

func Mat3FromMat2d

func Mat3FromMat2d(out, a []float64) []float64

Mat3FromMat2d copies the values from a mat2d into a mat3

func Mat3FromMat4

func Mat3FromMat4(out, a []float64) []float64

Mat3FromMat4 copies the upper-left 3x3 values into the given mat3.

func Mat3FromQuat

func Mat3FromQuat(out, q []float64) []float64

Mat3FromQuat calculates a 3x3 matrix from the given quaternion

func Mat3FromRotation

func Mat3FromRotation(out []float64, rad float64) []float64

Mat3FromRotation creates a matrix from a given angle This is equivalent to (but much faster than):

- Mat3Identity(dest) - Mat3Rotate(dest, dest, rad)

func Mat3FromScaling

func Mat3FromScaling(out, v []float64) []float64

Mat3FromScaling creates a matrix from a vector scaling This is equivalent to (but much faster than):

- Mat3Identity(dest) - Mat3Scale(dest, dest, vec)

func Mat3FromTranslation

func Mat3FromTranslation(out, v []float64) []float64

Mat3FromTranslation creates a matrix from a vector translation This is equivalent to (but much faster than):

- Mat3Identity(dest) - Mat3Translate(dest, dest, vec)

func Mat3FromValues

func Mat3FromValues(m00, m01, m02, m10, m11, m12, m20, m21, m22 float64) []float64

Mat3FromValues create a new mat3 with the given values

func Mat3Identity

func Mat3Identity(out []float64) []float64

Mat3Identity set a mat3 to the identity matrix

func Mat3Invert

func Mat3Invert(out, a []float64) []float64

Mat3Invert inverts a mat3

func Mat3Multiply

func Mat3Multiply(out, a, b []float64) []float64

Mat3Multiply multiplies two mat3's

func Mat3MultiplyScalar

func Mat3MultiplyScalar(out, a []float64, b float64) []float64

Mat3MultiplyScalar multiply each element of the matrix by a scalar.

func Mat3MultiplyScalarAndAdd

func Mat3MultiplyScalarAndAdd(out, a, b []float64, scale float64) []float64

Mat3MultiplyScalarAndAdd adds two mat3's after multiplying each element of the second operand by a scalar value.

func Mat3NormalFromMat4

func Mat3NormalFromMat4(out, a []float64) []float64

Mat3NormalFromMat4 calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix

func Mat3Projection

func Mat3Projection(out []float64, width, height float64) []float64

Mat3Projection generates a 2D projection matrix with the given bounds

func Mat3Rotate

func Mat3Rotate(out, a []float64, rad float64) []float64

Mat3Rotate rotates a mat3 by the given angle

func Mat3Scale

func Mat3Scale(out, a, v []float64) []float64

Mat3Scale scales the mat3 by the dimensions in the given vec2

func Mat3Set

func Mat3Set(out []float64, m00, m01, m02, m10, m11, m12, m20, m21, m22 float64) []float64

Mat3Set set the components of a mat3 to the given values

func Mat3Str

func Mat3Str(a []float64) string

Mat3Str returns a string representation of a mat3

func Mat3Subtract

func Mat3Subtract(out, a, b []float64) []float64

Mat3Subtract subtracts matrix b from matrix a

func Mat3Translate

func Mat3Translate(out, a, v []float64) []float64

Mat3Translate translate a mat3 by the given vector

func Mat3Transpose

func Mat3Transpose(out, a []float64) []float64

Mat3Transpose transpose the values of a mat3

func Mat4Add

func Mat4Add(out, a, b []float64) []float64

Mat4Add adds two mat4's

func Mat4Adjoint

func Mat4Adjoint(out, a []float64) []float64

Mat4Adjoint calculates the adjugate of a mat4

func Mat4Clone

func Mat4Clone(a []float64) []float64

Mat4Clone creates a new mat4 initialized with values from an existing matrix

func Mat4Copy

func Mat4Copy(out, a []float64) []float64

Mat4Copy copy the values from one mat4 to another

func Mat4Create

func Mat4Create() []float64

Mat4Create creates a new identity mat4

func Mat4Determinant

func Mat4Determinant(a []float64) float64

Mat4Determinant calculates the determinant of a mat4

func Mat4Equals

func Mat4Equals(a, b []float64) bool

Mat4Equals returns whether or not the matrices have approximately the same elements in the same position.

func Mat4ExactEquals

func Mat4ExactEquals(a, b []float64) bool

Mat4ExactEquals returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)

func Mat4Frob

func Mat4Frob(a []float64) float64

Mat4Frob returns Frobenius norm of a mat4

func Mat4FromQuat

func Mat4FromQuat(out, q []float64) []float64

Mat4FromQuat calculates a 4x4 matrix from the given quaternion

func Mat4FromQuat2

func Mat4FromQuat2(out, a []float64) []float64

Mat4FromQuat2 creates a new mat4 from a dual quat.

func Mat4FromRotation

func Mat4FromRotation(out []float64, rad float64, axis []float64) []float64

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

func Mat4FromRotationTranslation(out, q, v []float64) []float64

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

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

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)

func Mat4FromScaling

func Mat4FromScaling(out, v []float64) []float64

Mat4FromScaling creates a matrix from a vector scaling This is equivalent to (but much faster than):

- Mat4Identity(dest) - Mat4Scale(dest, dest, vec)

func Mat4FromTranslation

func Mat4FromTranslation(out, v []float64) []float64

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

func Mat4FromXRotation(out []float64, rad float64) []float64

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

func Mat4FromYRotation(out []float64, rad float64) []float64

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

func Mat4FromZRotation(out []float64, rad float64) []float64

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

func Mat4Frustum(out []float64, left, right, bottom, top, near, far float64) []float64

Mat4Frustum generates a frustum matrix with the given bounds

func Mat4GetRotation

func Mat4GetRotation(out, mat []float64) []float64

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

func Mat4GetScaling(out, mat []float64) []float64

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

func Mat4GetTranslation(out, mat []float64) []float64

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

func Mat4Identity(out []float64) []float64

Mat4Identity set a mat4 to the identity matrix

func Mat4Invert

func Mat4Invert(out, a []float64) []float64

Mat4Invert inverts a mat4

func Mat4LookAt

func Mat4LookAt(out, eye, center, up []float64) []float64

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

func Mat4Multiply(out, a, b []float64) []float64

Mat4Multiply multiplies two mat4s

func Mat4MultiplyScalar

func Mat4MultiplyScalar(out, a []float64, b float64) []float64

Mat4MultiplyScalar multiply each element of the matrix by a scalar.

func Mat4MultiplyScalarAndAdd

func Mat4MultiplyScalarAndAdd(out, a, b []float64, scale float64) []float64

Mat4MultiplyScalarAndAdd adds two mat4's after multiplying each element of the second operand by a scalar value.

func Mat4Ortho

func Mat4Ortho(out []float64, left, right, bottom, top, near, far float64) []float64

Mat4Ortho generates a orthogonal projection matrix with the given bounds

func Mat4Perspective

func Mat4Perspective(out []float64, fovy, aspect, near, far float64) []float64

Mat4Perspective generates a perspective projection matrix with the given bounds.

func Mat4PerspectiveFromFieldOfView

func Mat4PerspectiveFromFieldOfView(out []float64, fov *Fov, near, far float64) []float64

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

func Mat4Rotate(out, a []float64, rad float64, axis []float64) []float64

Mat4Rotate rotates a mat4 by the given angle around the given axis

func Mat4RotateX

func Mat4RotateX(out, a []float64, rad float64) []float64

Mat4RotateX rotates a matrix by the given angle around the X axis

func Mat4RotateY

func Mat4RotateY(out, a []float64, rad float64) []float64

Mat4RotateY rotates a matrix by the given angle around the Y axis

func Mat4RotateZ

func Mat4RotateZ(out, a []float64, rad float64) []float64

Mat4RotateZ rotates a matrix by the given angle around the Z axis

func Mat4Scale

func Mat4Scale(out, a, v []float64) []float64

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 Mat4Str

func Mat4Str(a []float64) string

Mat4Str returns a string representation of a mat4

func Mat4Subtract

func Mat4Subtract(out, a, b []float64) []float64

Mat4Subtract subtracts matrix b from matrix a

func Mat4TargetTo

func Mat4TargetTo(out, eye, target, up []float64) []float64

Mat4TargetTo generates a matrix that makes something look at something else.

func Mat4Translate

func Mat4Translate(out, a, v []float64) []float64

Mat4Translate translate a mat4 by the given vector

func Mat4Transpose

func Mat4Transpose(out, a []float64) []float64

Mat4Transpose transpose the values of a mat4

func NewMat3

func NewMat3() []float64

NewMat3 creates a new identity mat3

func NewMat4

func NewMat4() []float64

NewMat4 creates a new identity mat4

func NewQuat

func NewQuat() []float64

NewQuat creates a new identity quat

func NewVec2

func NewVec2() []float64

NewVec2 creates a new, empty vec2

func NewVec3

func NewVec3() []float64

NewVec3 creates a new, empty Vec3

func NewVec4

func NewVec4() []float64

NewVec4 creates a new, empty Vec4

func Quat2Add

func Quat2Add(out, a, b []float64) []float64

Quat2Add adds two dual quat's

func Quat2Clone

func Quat2Clone(a []float64) []float64

Quat2Clone creates a new quat initialized with values from an existing quaternion

func Quat2Conjugate

func Quat2Conjugate(out, a []float64) []float64

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 Quat2Copy

func Quat2Copy(out, a []float64) []float64

Quat2Copy copy the values from one dual quat to another

func Quat2Create

func Quat2Create() []float64

Quat2Create creates a new identity dual quat

func Quat2Equals

func Quat2Equals(a, b []float64) bool

Quat2Equals returns whether or not the dual quaternions have approximately the same elements in the same position.

func Quat2ExactEquals

func Quat2ExactEquals(a, b []float64) bool

Quat2ExactEquals returns whether or not the dual quaternions have exactly the same elements in the same position (when compared with ==)

func Quat2FromMat4

func Quat2FromMat4(out, a []float64) []float64

Quat2FromMat4 creates a new dual quat from a matrix (4x4)

func Quat2FromRotation

func Quat2FromRotation(out, q []float64) []float64

Quat2FromRotation creates a dual quat from a quaternion

func Quat2FromRotationTranslation

func Quat2FromRotationTranslation(out, q, t []float64) []float64

Quat2FromRotationTranslation creates a dual quat from a quaternion and a translation

func Quat2FromRotationTranslationValues

func Quat2FromRotationTranslationValues(x1, y1, z1, w1, x2, y2, z2 float64) []float64

Quat2FromRotationTranslationValues creates a new dual quat from the given values (quat and translation)

func Quat2FromTranslation

func Quat2FromTranslation(out, t []float64) []float64

Quat2FromTranslation creates a dual quat from a translation

func Quat2FromValues

func Quat2FromValues(x1, y1, z1, w1, x2, y2, z2, w2 float64) []float64

Quat2FromValues creates a new dual quat initialized with the given values

func Quat2GetDual

func Quat2GetDual(out, a []float64) []float64

Quat2GetDual gets the dual part of a dual quat

func Quat2GetTranslation

func Quat2GetTranslation(out, a []float64) []float64

Quat2GetTranslation gets the translation of a normalized dual quat

func Quat2Identity

func Quat2Identity(out []float64) []float64

Quat2Identity set a dual quat to the identity dual quaternion

func Quat2Invert

func Quat2Invert(out, a []float64) []float64

Quat2Invert calculates the inverse of a dual quat. If they are normalized, conjugate is cheaper

func Quat2Lerp

func Quat2Lerp(out, a, b []float64, t float64) []float64

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

func Quat2Multiply(out, a, b []float64) []float64

Quat2Multiply multiplies two dual quat's

func Quat2Normalize

func Quat2Normalize(out, a []float64) []float64

Quat2Normalize normalize a dual quat

func Quat2RotateAroundAxis

func Quat2RotateAroundAxis(out, a, axis []float64, rad float64) []float64

Quat2RotateAroundAxis rotates a dual quat around a given axis. Does the normalisation automatically

func Quat2RotateByQuatAppend

func Quat2RotateByQuatAppend(out, a, q []float64) []float64

Quat2RotateByQuatAppend rotates a dual quat by a given quaternion (a * q)

func Quat2RotateByQuatPrepend

func Quat2RotateByQuatPrepend(out, q, a []float64) []float64

Quat2RotateByQuatPrepend rotates a dual quat by a given quaternion (q * a)

func Quat2RotateX

func Quat2RotateX(out, a []float64, rad float64) []float64

Quat2RotateX rotates a dual quat around the X axis

func Quat2RotateY

func Quat2RotateY(out, a []float64, rad float64) []float64

Quat2RotateY rotates a dual quat around the Y axis

func Quat2RotateZ

func Quat2RotateZ(out, a []float64, rad float64) []float64

Quat2RotateZ rotates a dual quat around the Z axis

func Quat2Scale

func Quat2Scale(out, a []float64, b float64) []float64

Quat2Scale scales a dual quat by a scalar number

func Quat2Set

func Quat2Set(out []float64, x1, y1, z1, w1, x2, y2, z2, w2 float64) []float64

Quat2Set set the components of a dual quat to the given values

func Quat2SetDual

func Quat2SetDual(out, q []float64) []float64

Quat2SetDual set the dual component of a dual quat to the given quaternion

func Quat2Str

func Quat2Str(a []float64) string

Quat2Str returns a string representation of a dual quatenion

func Quat2Translate

func Quat2Translate(out, a, v []float64) []float64

Quat2Translate translates a dual quat by the given vector

func QuatCalculateW

func QuatCalculateW(out, a []float64) []float64

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

func QuatConjugate(out, a []float64) []float64

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 QuatCreate

func QuatCreate() []float64

QuatCreate creates a new identity quat

func QuatExp

func QuatExp(out, a []float64) []float64

QuatExp calculate the exponential of a unit quaternion.

func QuatFromEuler

func QuatFromEuler(out []float64, x, y, z float64) []float64

QuatFromEuler creates a quaternion from the given euler angle x, y, z.

func QuatFromMat3

func QuatFromMat3(out, m []float64) []float64

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

func QuatGetAngle(a, b []float64) float64

QuatGetAngle gets the angular distance between two unit quaternions

func QuatGetAxisAngle

func QuatGetAxisAngle(out, q []float64) float64

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

func QuatIdentity(out []float64) []float64

QuatIdentity set a quat to the identity quaternion

func QuatInvert

func QuatInvert(out, a []float64) []float64

QuatInvert calculates the inverse of a quat

func QuatLn

func QuatLn(out, a []float64) []float64

QuatLn calculate the natural logarithm of a unit quaternion.

func QuatMultiply

func QuatMultiply(out, a, b []float64) []float64

QuatMultiply multiplies two quat's

func QuatPow

func QuatPow(out, a []float64, b float64) []float64

QuatPow calculate the scalar power of a unit quaternion.

func QuatRandom

func QuatRandom(out []float64) []float64

QuatRandom generates a random unit quaternion

func QuatRotateX

func QuatRotateX(out, a []float64, rad float64) []float64

QuatRotateX rotates a quaternion by the given angle about the X axis

func QuatRotateY

func QuatRotateY(out, a []float64, rad float64) []float64

QuatRotateY rotates a quaternion by the given angle about the Y axis

func QuatRotateZ

func QuatRotateZ(out, a []float64, rad float64) []float64

QuatRotateZ rotates a quaternion by the given angle about the Z axis

func QuatRotationTo

func QuatRotationTo(out, a, b []float64) []float64

QuatRotationTo sets a quaternion to represent the shortest rotation from one vector to another.

Both vectors are assumed to be unit length.

func QuatSetAxisAngle

func QuatSetAxisAngle(out, axis []float64, rad float64) []float64

QuatSetAxisAngle sets a quat from the given angle and rotation axis, then returns it.

func QuatSlerp

func QuatSlerp(out, a, b []float64, t float64) []float64

QuatSlerp performs a spherical linear interpolation between two quat

func QuatStr

func QuatStr(a []float64) string

QuatStr returns a string representation of a quatenion

func ToRadian

func ToRadian(a float64) float64

ToRadian convert Degree To Radian

func Vec2Add

func Vec2Add(out, a, b []float64) []float64

Vec2Add adds two vec2's

func Vec2Angle

func Vec2Angle(a, b []float64) float64

Vec2Angle get the angle between two 2D vectors

func Vec2Ceil

func Vec2Ceil(out, a []float64) []float64

Vec2Ceil math.ceil the components of a vec2

func Vec2Clone

func Vec2Clone(a []float64) []float64

Vec2Clone creates a new vec2 initialized with the given values

func Vec2Copy

func Vec2Copy(out, a []float64) []float64

Vec2Copy copy the values from one vec2 to another

func Vec2Create

func Vec2Create() []float64

Vec2Create creates a new vec2 initialized with values from an existing vector

func Vec2Cross

func Vec2Cross(out, a, b []float64) []float64

Vec2Cross computes the cross product of two vec2's Note that the cross product must by definition produce a 3D vector

func Vec2Distance

func Vec2Distance(a, b []float64) float64

Vec2Distance calculates the euclidian distance between two vec2's

func Vec2Divide

func Vec2Divide(out, a, b []float64) []float64

Vec2Divide divides two vec2's

func Vec2Dot

func Vec2Dot(a, b []float64) float64

Vec2Dot calculates the dot product of two vec2's

func Vec2Equals

func Vec2Equals(a, b []float64) bool

Vec2Equals returns whether or not the vectors have approximately the same elements in the same position.

func Vec2ExactEquals

func Vec2ExactEquals(a, b []float64) bool

Vec2ExactEquals returns whether or not the vectors exactly have the same elements in the same position (when compared with ===)

func Vec2Floor

func Vec2Floor(out, a []float64) []float64

Vec2Floor math.floor the components of a vec2

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

func Vec2FromValues(x, y float64) []float64

Vec2FromValues creates a new vec2 initialized with the given values

func Vec2Inverse

func Vec2Inverse(out, a []float64) []float64

Vec2Inverse returns the inverse of the components of a vec2

func Vec2Length

func Vec2Length(out []float64) float64

Vec2Length calculates the length of a vec2

func Vec2Lerp

func Vec2Lerp(out, a, b []float64, t float64) []float64

Vec2Lerp performs a linear interpolation between two vec2's

func Vec2Max

func Vec2Max(out, a, b []float64) []float64

Vec2Max returns the maximum of two vec2's

func Vec2Min

func Vec2Min(out, a, b []float64) []float64

Vec2Min returns the minimum of two vec2's

func Vec2Multiply

func Vec2Multiply(out, a, b []float64) []float64

Vec2Multiply multiplies two vec2's

func Vec2Negate

func Vec2Negate(out, a []float64) []float64

Vec2Negate negates the components of a vec2

func Vec2Normalize

func Vec2Normalize(out, a []float64) []float64

Vec2Normalize normalize a vec2

func Vec2Random

func Vec2Random(out []float64, scale float64) []float64

Vec2Random generates a random vector with the given scale

func Vec2Rotate

func Vec2Rotate(out, p, c []float64, rad float64) []float64

Vec2Rotate rotate a 2D vector

func Vec2Round

func Vec2Round(out, a []float64) []float64

Vec2Round math.round the components of a vec2

func Vec2Scale

func Vec2Scale(out, a []float64, scale float64) []float64

Vec2Scale scales a vec2 by a scalar number

func Vec2ScaleAndAdd

func Vec2ScaleAndAdd(out, a, b []float64, scale float64) []float64

Vec2ScaleAndAdd adds two vec2's after scaling the second operand by a scalar value

func Vec2Set

func Vec2Set(out []float64, x, y float64) []float64

Vec2Set set the components of a vec2 to the given values

func Vec2SquaredDistance

func Vec2SquaredDistance(a, b []float64) float64

Vec2SquaredDistance calculates the squared euclidian distance between two vec2's

func Vec2SquaredLength

func Vec2SquaredLength(out []float64) float64

Vec2SquaredLength calculates the squared length of a vec2

func Vec2Str

func Vec2Str(out []float64) string

Vec2Str returns a string representation of a vector

func Vec2Subtract

func Vec2Subtract(out, a, b []float64) []float64

Vec2Subtract subtracts vector b from vector a

func Vec2TransformMat2

func Vec2TransformMat2(out, a, m []float64) []float64

Vec2TransformMat2 transforms the vec2 with a mat2

func Vec2TransformMat2d

func Vec2TransformMat2d(out, a, m []float64) []float64

Vec2TransformMat2d transforms the vec2 with a mat2d

func Vec2TransformMat3

func Vec2TransformMat3(out, a, m []float64) []float64

Vec2TransformMat3 transforms the vec2 with a mat3 3rd vector component is implicitly '1'

func Vec2TransformMat4

func Vec2TransformMat4(out, a, m []float64) []float64

Vec2TransformMat4 transforms the vec2 with a mat4 3rd vector component is implicitly '0' 4th vector component is implicitly '1'

func Vec2Zero

func Vec2Zero(out []float64) []float64

Vec2Zero set the components of a vec2 to zero

func Vec3Add

func Vec3Add(out, a, b []float64) []float64

Vec3Add adds two Vec3's

func Vec3Angle

func Vec3Angle(a, b []float64) float64

Vec3Angle get the angle between two 2D vectors

func Vec3Bezier

func Vec3Bezier(out, a, b, c, d []float64, t float64) []float64

Vec3Bezier performs a bezier interpolation with two control points

func Vec3Ceil

func Vec3Ceil(out, a []float64) []float64

Vec3Ceil math.ceil the components of a Vec3

func Vec3Clone

func Vec3Clone(a []float64) []float64

Vec3Clone creates a new Vec3 initialized with the given values

func Vec3Copy

func Vec3Copy(out, a []float64) []float64

Vec3Copy copy the values from one Vec3 to another

func Vec3Create

func Vec3Create() []float64

Vec3Create creates a new Vec3 initialized with values from an existing vector

func Vec3Cross

func Vec3Cross(out, a, b []float64) []float64

Vec3Cross computes the cross product of two Vec3's

func Vec3Distance

func Vec3Distance(a, b []float64) float64

Vec3Distance calculates the euclidian distance between two Vec3's

func Vec3Divide

func Vec3Divide(out, a, b []float64) []float64

Vec3Divide divides two Vec3's

func Vec3Dot

func Vec3Dot(a, b []float64) float64

Vec3Dot calculates the dot product of two Vec3's

func Vec3Equals

func Vec3Equals(a, b []float64) bool

Vec3Equals returns whether or not the vectors have approximately the same elements in the same position.

func Vec3ExactEquals

func Vec3ExactEquals(a, b []float64) bool

Vec3ExactEquals returns whether or not the vectors exactly have the same elements in the same position (when compared with ===)

func Vec3Floor

func Vec3Floor(out, a []float64) []float64

Vec3Floor math.floor the components of a Vec3

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

func Vec3FromValues(x, y, z float64) []float64

Vec3FromValues creates a new Vec3 initialized with the given values

func Vec3Hermite

func Vec3Hermite(out, a, b, c, d []float64, t float64) []float64

Vec3Hermite performs a hermite interpolation with two control points

func Vec3Inverse

func Vec3Inverse(out, a []float64) []float64

Vec3Inverse returns the inverse of the components of a Vec3

func Vec3Length

func Vec3Length(out []float64) float64

Vec3Length calculates the length of a Vec3

func Vec3Lerp

func Vec3Lerp(out, a, b []float64, t float64) []float64

Vec3Lerp performs a linear interpolation between two Vec3's

func Vec3Max

func Vec3Max(out, a, b []float64) []float64

Vec3Max returns the maximum of two Vec3's

func Vec3Min

func Vec3Min(out, a, b []float64) []float64

Vec3Min returns the minimum of two Vec3's

func Vec3Multiply

func Vec3Multiply(out, a, b []float64) []float64

Vec3Multiply multiplies two Vec3's

func Vec3Negate

func Vec3Negate(out, a []float64) []float64

Vec3Negate negates the components of a Vec3

func Vec3Normalize

func Vec3Normalize(out, a []float64) []float64

Vec3Normalize normalize a Vec3

func Vec3Random

func Vec3Random(out []float64, scale float64) []float64

Vec3Random generates a random vector with the given scale

func Vec3RotateX

func Vec3RotateX(out, a, b []float64, rad float64) []float64

Vec3RotateX rotate a 3D vector around the x-axis

func Vec3RotateY

func Vec3RotateY(out, a, b []float64, rad float64) []float64

Vec3RotateY rotate a 3D vector around the y-axis

func Vec3RotateZ

func Vec3RotateZ(out, a, b []float64, rad float64) []float64

Vec3RotateZ rotate a 3D vector around the z-axis

func Vec3Round

func Vec3Round(out, a []float64) []float64

Vec3Round math.round the components of a Vec3

func Vec3Scale

func Vec3Scale(out, a []float64, scale float64) []float64

Vec3Scale scales a Vec3 by a scalar number

func Vec3ScaleAndAdd

func Vec3ScaleAndAdd(out, a, b []float64, scale float64) []float64

Vec3ScaleAndAdd adds two Vec3's after scaling the second operand by a scalar value

func Vec3Set

func Vec3Set(out []float64, x, y, z float64) []float64

Vec3Set set the components of a Vec3 to the given values

func Vec3Slerp

func Vec3Slerp(out, a, b []float64, t float64) []float64

Vec3Slerp performs a spherical linear interpolation between two vec3's

func Vec3SquaredDistance

func Vec3SquaredDistance(a, b []float64) float64

Vec3SquaredDistance calculates the squared euclidian distance between two Vec3's

func Vec3SquaredLength

func Vec3SquaredLength(out []float64) float64

Vec3SquaredLength calculates the squared length of a Vec3

func Vec3Str

func Vec3Str(out []float64) string

Vec3Str returns a string representation of a vector

func Vec3Subtract

func Vec3Subtract(out, a, b []float64) []float64

Vec3Subtract subtracts vector b from vector a

func Vec3TransformMat3

func Vec3TransformMat3(out, a, m []float64) []float64

Vec3TransformMat3 transforms the vec3 with a mat3

func Vec3TransformMat4

func Vec3TransformMat4(out, a, m []float64) []float64

Vec3TransformMat4 transforms the vec3 with a mat4

func Vec3TransformQuat

func Vec3TransformQuat(out, a, q []float64) []float64

Vec3TransformQuat transforms the vec3 with a quat Can also be used for dual quaternions. (Multiply it with the real part)

func Vec3Zero

func Vec3Zero(out []float64) []float64

Vec3Zero set the components of a Vec3 to zero

func Vec4Add

func Vec4Add(out, a, b []float64) []float64

Vec4Add adds two Vec4's

func Vec4Ceil

func Vec4Ceil(out, a []float64) []float64

Vec4Ceil math.ceil the components of a vec4

func Vec4Clone

func Vec4Clone(a []float64) []float64

Vec4Clone creates a new Vec4 initialized with the given values

func Vec4Copy

func Vec4Copy(out, a []float64) []float64

Vec4Copy copy the values from one Vec4 to another

func Vec4Create

func Vec4Create() []float64

Vec4Create creates a new Vec4 initialized with values from an existing vector

func Vec4Cross

func Vec4Cross(out, u, v, w []float64) []float64

Vec4Cross computes the cross product of two Vec4's

func Vec4Distance

func Vec4Distance(a, b []float64) float64

Vec4Distance calculates the euclidian distance between two Vec4's

func Vec4Divide

func Vec4Divide(out, a, b []float64) []float64

Vec4Divide divides two Vec4's

func Vec4Dot

func Vec4Dot(a, b []float64) float64

Vec4Dot calculates the dot product of two Vec4's

func Vec4Equals

func Vec4Equals(a, b []float64) bool

Vec4Equals returns whether or not the vectors have approximately the same elements in the same position.

func Vec4ExactEquals

func Vec4ExactEquals(a, b []float64) bool

Vec4ExactEquals returns whether or not the vectors exactly have the same elements in the same position (when compared with ===)

func Vec4Floor

func Vec4Floor(out, a []float64) []float64

Vec4Floor math.floor the components of a vec4

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

func Vec4FromValues(x, y, z, w float64) []float64

Vec4FromValues creates a new Vec4 initialized with the given values

func Vec4Inverse

func Vec4Inverse(out, a []float64) []float64

Vec4Inverse returns the inverse of the components of a vec4

func Vec4Length

func Vec4Length(out []float64) float64

Vec4Length calculates the length of a vec4

func Vec4Lerp

func Vec4Lerp(out, a, b []float64, t float64) []float64

Vec4Lerp performs a linear interpolation between two Vec4's

func Vec4Max

func Vec4Max(out, a, b []float64) []float64

Vec4Max returns the maximum of two Vec4's

func Vec4Min

func Vec4Min(out, a, b []float64) []float64

Vec4Min returns the minimum of two Vec4's

func Vec4Multiply

func Vec4Multiply(out, a, b []float64) []float64

Vec4Multiply multiplies two Vec4's

func Vec4Negate

func Vec4Negate(out, a []float64) []float64

Vec4Negate negates the components of a vec4

func Vec4Normalize

func Vec4Normalize(out, a []float64) []float64

Vec4Normalize normalize a vec4

func Vec4Random

func Vec4Random(out []float64, scale float64) []float64

Vec4Random generates a random vector with the given scale

func Vec4Round

func Vec4Round(out, a []float64) []float64

Vec4Round math.round the components of a vec4

func Vec4Scale

func Vec4Scale(out, a []float64, scale float64) []float64

Vec4Scale scales a vec4 by a scalar number

func Vec4ScaleAndAdd

func Vec4ScaleAndAdd(out, a, b []float64, scale float64) []float64

Vec4ScaleAndAdd adds two Vec4's after scaling the second operand by a scalar value

func Vec4Set

func Vec4Set(out []float64, x, y, z, w float64) []float64

Vec4Set set the components of a vec4 to the given values

func Vec4SquaredDistance

func Vec4SquaredDistance(a, b []float64) float64

Vec4SquaredDistance calculates the squared euclidian distance between two Vec4's

func Vec4SquaredLength

func Vec4SquaredLength(out []float64) float64

Vec4SquaredLength calculates the squared length of a vec4

func Vec4Str

func Vec4Str(a []float64) string

Vec4Str returns a string representation of a vector

func Vec4Subtract

func Vec4Subtract(out, a, b []float64) []float64

Vec4Subtract subtracts vector b from vector a

func Vec4TransformMat4

func Vec4TransformMat4(out, a, m []float64) []float64

Vec4TransformMat4 transforms the vec4 with a mat4

func Vec4TransformQuat

func Vec4TransformQuat(out, a, q []float64) []float64

Vec4TransformQuat transforms the vec4 with a quat

func Vec4Zero

func Vec4Zero(out []float64) []float64

Vec4Zero set the components of a vec4 to zero

Types

type Fov

type Fov struct {
	UpDegrees    float64
	DownDegrees  float64
	LeftDegrees  float64
	RightDegrees float64
}

Fov represent Field of View

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL