Versions in this module Expand all Collapse all v0 v0.0.1 Jun 24, 2021 Changes in this version + const DefaultEpsilon + var Abs = math.Abs + var Atan = math.Atan + var Atan2 = math.Atan2 + var Cos = math.Cos + var Floor = math.Floor + var IsNaN = math.IsNaN + var Log2 = math.Log2 + var MatI = Matrix + var MatZero = Matrix + var MaxFloat64 = math.MaxFloat64 + var MaxInt64 = math.MaxInt64 + var Modf = math.Modf + var Pi = math.Pi + var Pow = math.Pow + var Round = math.Round + var Sin = math.Sin + var Sqrt = math.Sqrt + var Tan = math.Tan + func ApproxEq(v1, v2, epsilon float64) bool + func Clamp(n, min, max float64) float64 + func Lerp(from float64, to float64, t float64) float64 + func LerpC(from color.RGBA, to color.RGBA, t float64) color.RGBA + func Max(xs ...float64) float64 + func Min(xs ...float64) float64 + type Matrix struct + X00 float64 + X01 float64 + X02 float64 + X03 float64 + X10 float64 + X11 float64 + X12 float64 + X13 float64 + X20 float64 + X21 float64 + X22 float64 + X23 float64 + X30 float64 + X31 float64 + X32 float64 + X33 float64 + func NewMatrix(...) Matrix + func ViewportMatrix(w, h float64) Matrix + func (m Matrix) Add(n Matrix) Matrix + func (m Matrix) Det() float64 + func (m Matrix) Eq(n Matrix) bool + func (m Matrix) Get(i, j int) float64 + func (m Matrix) Inv() Matrix + func (m Matrix) MulM(n Matrix) Matrix + func (m Matrix) MulV(v Vector) Vector + func (m Matrix) Set(i, j int, v float64) + func (m Matrix) Sub(n Matrix) Matrix + func (m Matrix) T() Matrix + type Quaternion struct + A float64 + V Vector + func NewQuaternion(a, b, c, d float64) Quaternion + func (q Quaternion) Mul(p Quaternion) Quaternion + func (q Quaternion) ToRoMat() Matrix + type TransformContext struct + func (ctx *TransformContext) ModelMatrix() Matrix + func (ctx *TransformContext) ResetContext() + func (ctx *TransformContext) Rotate(dir Vector, angle float64) + func (ctx *TransformContext) RotateX(angle float64) + func (ctx *TransformContext) RotateY(angle float64) + func (ctx *TransformContext) RotateZ(angle float64) + func (ctx *TransformContext) Scale(sx, sy, sz float64) + func (ctx *TransformContext) Translate(tx, ty, tz float64) + type Vector struct + W float64 + X float64 + Y float64 + Z float64 + func ClampV(v Vector, min, max float64) Vector + func LerpV(from Vector, to Vector, t float64) Vector + func NewVector(x, y, z, w float64) Vector + func (v Vector) Add(u Vector) Vector + func (v Vector) Apply(m Matrix) Vector + func (v Vector) Cross(u Vector) Vector + func (v Vector) Dot(u Vector) float64 + func (v Vector) Eq(u Vector) bool + func (v Vector) IsZero() bool + func (v Vector) Len() float64 + func (v Vector) Pos() Vector + func (v Vector) Scale(x, y, z, w float64) Vector + func (v Vector) Sub(u Vector) Vector + func (v Vector) Translate(x, y, z float64) Vector + func (v Vector) Unit() Vector + func (v Vector) Vec() Vector