Skip to content

package matrix

import "kaiju/matrix"

Constants

Mat4Row0

iota

Mat4Row1

Mat4Row2

Mat4Row3

Mat4Col0

iota

Mat4Col1

Mat4Col2

Mat4Col3

Mat4x0y0

x0y0

Mat4x1y0

x1y0

Mat4x2y0

x2y0

Mat4x3y0

x3y0

Mat4x0y1

x0y1

Mat4x1y1

x1y1

Mat4x2y1

x2y1

Mat4x3y1

x3y1

Mat4x0y2

x0y2

Mat4x1y2

x1y2

Mat4x2y2

x2y2

Mat4x3y2

x3y2

Mat4x0y3

x0y3

Mat4x1y3

x1y3

Mat4x2y3

x2y3

Mat4x3y3

x3y3

Functions

AbsInt

func AbsInt(a int) int

Approx

func Approx(a, b Float) bool

ApproxTo

func ApproxTo(a, b, tolerance Float) bool

IsInf

func IsInf(x Float, sign int) bool

IsNaN

func IsNaN(x Float) bool

QuaternionApprox

func QuaternionApprox(a, b Quaternion) bool

Vec2Approx

func Vec2Approx(a, b Vec2) bool

Vec2ApproxTo

func Vec2ApproxTo(a, b Vec2, delta Float) bool

Vec3Approx

func Vec3Approx(a, b Vec3) bool

Vec3ApproxTo

func Vec3ApproxTo(a, b Vec3, delta Float) bool

Vec4Approx

func Vec4Approx(a, b Vec4) bool

Vec4ApproxTo

func Vec4ApproxTo(a, b Vec4, delta Float) bool

Types

Color

Vec4

type Color Vec4

ColorAqua

func ColorAqua() Color

ColorAquamarine

func ColorAquamarine() Color

ColorAzure

func ColorAzure() Color

ColorBeige

func ColorBeige() Color

ColorBisque

func ColorBisque() Color

ColorBlack

func ColorBlack() Color

ColorBlanchedAlmond

func ColorBlanchedAlmond() Color

ColorBlue

func ColorBlue() Color

ColorBlueViolet

func ColorBlueViolet() Color

ColorBrown

func ColorBrown() Color

ColorBurlyWood

func ColorBurlyWood() Color

ColorCadetBlue

func ColorCadetBlue() Color

ColorChartreuse

func ColorChartreuse() Color

ColorChocolate

func ColorChocolate() Color

ColorClear

func ColorClear() Color

ColorCoral

func ColorCoral() Color

ColorCornSilk

func ColorCornSilk() Color

ColorCornflowerBlue

func ColorCornflowerBlue() Color

ColorCrimson

func ColorCrimson() Color

ColorCyan

func ColorCyan() Color

ColorDarkBG

func ColorDarkBG() Color

ColorDarkBlue

func ColorDarkBlue() Color

ColorDarkCyan

func ColorDarkCyan() Color

ColorDarkGoldenrod

func ColorDarkGoldenrod() Color

ColorDarkGray

func ColorDarkGray() Color

ColorDarkGreen

func ColorDarkGreen() Color

ColorDarkKhaki

func ColorDarkKhaki() Color

ColorDarkMagenta

func ColorDarkMagenta() Color

ColorDarkModeGrayBG

func ColorDarkModeGrayBG() Color

ColorDarkModeGrayFG

func ColorDarkModeGrayFG() Color

ColorDarkOliveGreen

func ColorDarkOliveGreen() Color

ColorDarkOrange

func ColorDarkOrange() Color

ColorDarkOrchid

func ColorDarkOrchid() Color

ColorDarkRed

func ColorDarkRed() Color

ColorDarkSalmon

func ColorDarkSalmon() Color

ColorDarkSeaGreen

func ColorDarkSeaGreen() Color

ColorDarkSlateBlue

func ColorDarkSlateBlue() Color

ColorDarkSlateGray

func ColorDarkSlateGray() Color

ColorDarkTurquoise

func ColorDarkTurquoise() Color

ColorDarkViolet

func ColorDarkViolet() Color

ColorDeepPink

func ColorDeepPink() Color

ColorDeepSkyBlue

func ColorDeepSkyBlue() Color

ColorDimGray

func ColorDimGray() Color

ColorDodgerBlue

func ColorDodgerBlue() Color

ColorFirebrick

func ColorFirebrick() Color

ColorFloralWhite

func ColorFloralWhite() Color

ColorForestGreen

func ColorForestGreen() Color

ColorFromColor8

func ColorFromColor8(c Color8) Color

ColorFromHexString

func ColorFromHexString(str string) (Color, error)

ColorFromVec3

func ColorFromVec3(v Vec3) Color

ColorFromVec4

func ColorFromVec4(v Vec4) Color

ColorFuchsia

func ColorFuchsia() Color

ColorGainsboro

func ColorGainsboro() Color

ColorGhostWhite

func ColorGhostWhite() Color

ColorGold

func ColorGold() Color

ColorGoldenrod

func ColorGoldenrod() Color

ColorGray

func ColorGray() Color

ColorGreen

func ColorGreen() Color

ColorGreenYellow

func ColorGreenYellow() Color

ColorHoneydew

func ColorHoneydew() Color

ColorHotPink

func ColorHotPink() Color

ColorIndianRed

func ColorIndianRed() Color

ColorIndigo

func ColorIndigo() Color

ColorIvory

func ColorIvory() Color

ColorKhaki

func ColorKhaki() Color

ColorLavender

func ColorLavender() Color

ColorLavenderBlush

func ColorLavenderBlush() Color

ColorLawnGreen

func ColorLawnGreen() Color

ColorLemonChiffon

func ColorLemonChiffon() Color

ColorLightBlue

func ColorLightBlue() Color

ColorLightCoral

func ColorLightCoral() Color

ColorLightCyan

func ColorLightCyan() Color

ColorLightGoldenrodYellow

func ColorLightGoldenrodYellow() Color

ColorLightGreen

func ColorLightGreen() Color

ColorLightGrey

func ColorLightGrey() Color

ColorLightPink

func ColorLightPink() Color

ColorLightSalmon

func ColorLightSalmon() Color

ColorLightSeaGreen

func ColorLightSeaGreen() Color

ColorLightSkyBlue

func ColorLightSkyBlue() Color

ColorLightSlateGray

func ColorLightSlateGray() Color

ColorLightSteelBlue

func ColorLightSteelBlue() Color

ColorLightYellow

func ColorLightYellow() Color

ColorLime

func ColorLime() Color

ColorLimeGreen

func ColorLimeGreen() Color

ColorLinen

func ColorLinen() Color

ColorMagenta

func ColorMagenta() Color

ColorMaroon

func ColorMaroon() Color

ColorMediumAquamarine

func ColorMediumAquamarine() Color

ColorMediumBlue

func ColorMediumBlue() Color

ColorMediumOrchid

func ColorMediumOrchid() Color

ColorMediumPurple

func ColorMediumPurple() Color

ColorMediumSeaGreen

func ColorMediumSeaGreen() Color

ColorMediumSlateBlue

func ColorMediumSlateBlue() Color

ColorMediumSpringGreen

func ColorMediumSpringGreen() Color

ColorMediumTurquoise

func ColorMediumTurquoise() Color

ColorMediumVioletRed

func ColorMediumVioletRed() Color

ColorMidnightBlue

func ColorMidnightBlue() Color

ColorMintCream

func ColorMintCream() Color

ColorMistyRose

func ColorMistyRose() Color

ColorMix

func ColorMix(lhs, rhs Color, amount Float) Color

ColorMoccasin

func ColorMoccasin() Color

ColorNavajoWhite

func ColorNavajoWhite() Color

ColorNavy

func ColorNavy() Color

ColorOldLace

func ColorOldLace() Color

ColorOlive

func ColorOlive() Color

ColorOliveDrab

func ColorOliveDrab() Color

ColorOrange

func ColorOrange() Color

ColorOrangeRed

func ColorOrangeRed() Color

ColorOrchid

func ColorOrchid() Color

ColorPaleGoldenrod

func ColorPaleGoldenrod() Color

ColorPaleGreen

func ColorPaleGreen() Color

ColorPaleTurquoise

func ColorPaleTurquoise() Color

ColorPaleVioletred

func ColorPaleVioletred() Color

ColorPapayaWhip

func ColorPapayaWhip() Color

ColorPeachPuff

func ColorPeachPuff() Color

ColorPeru

func ColorPeru() Color

ColorPink

func ColorPink() Color

ColorPlum

func ColorPlum() Color

ColorPowderBlue

func ColorPowderBlue() Color

ColorPurple

func ColorPurple() Color

ColorRGBAInt

func ColorRGBAInt(r, g, b, a int) Color

ColorRGBInt

func ColorRGBInt(r, g, b int) Color

ColorRed

func ColorRed() Color

ColorRosyBrown

func ColorRosyBrown() Color

ColorRoyalBlue

func ColorRoyalBlue() Color

ColorSaddleBrown

func ColorSaddleBrown() Color

ColorSalmon

func ColorSalmon() Color

ColorSandyBrown

func ColorSandyBrown() Color

ColorSeaGreen

func ColorSeaGreen() Color

ColorSeashell

func ColorSeashell() Color

ColorSienna

func ColorSienna() Color

ColorSilver

func ColorSilver() Color

ColorSky

func ColorSky() Color

ColorSkyBlue

func ColorSkyBlue() Color

ColorSlateBlue

func ColorSlateBlue() Color

ColorSlateGray

func ColorSlateGray() Color

ColorSlateGrey

func ColorSlateGrey() Color

ColorSnow

func ColorSnow() Color

ColorSpringGreen

func ColorSpringGreen() Color

ColorSteelBlue

func ColorSteelBlue() Color

ColorTan

func ColorTan() Color

ColorTeal

func ColorTeal() Color

ColorThistle

func ColorThistle() Color

ColorTomato

func ColorTomato() Color

ColorTransparent

func ColorTransparent() Color

ColorTurquoise

func ColorTurquoise() Color

ColorViolet

func ColorViolet() Color

ColorWheat

func ColorWheat() Color

ColorWhite

func ColorWhite() Color

ColorWhiteSmoke

func ColorWhiteSmoke() Color

ColorYellow

func ColorYellow() Color

ColorYellowGreen

func ColorYellowGreen() Color

ColorZero

func ColorZero() Color

NewColor

func NewColor(r, g, b, a Float) Color

Color.A

func (c Color) A() Float

Color.AsColor8

func (c Color) AsColor8() Color8

Color.B

func (c Color) B() Float

Color.Equals

func (lhs Color) Equals(rhs Color) bool

Color.G

func (c Color) G() Float

Color.Hex

func (c Color) Hex() string

Color.IsZero

func (c Color) IsZero() bool

Color.MultiplyAssign

func (c *Color) MultiplyAssign(other Color)

Color.PA

func (c *Color) PA() *Float

Color.PB

func (c *Color) PB() *Float

Color.PG

func (c *Color) PG() *Float

Color.PR

func (c *Color) PR() *Float

Color.R

func (c Color) R() Float

Color.RGBA

func (c Color) RGBA() (Float, Float, Float, Float)

Color.ScaleWithoutAlpha

func (c Color) ScaleWithoutAlpha(scale Float) Color

Color.SetA

func (c *Color) SetA(a Float)

Color.SetB

func (c *Color) SetB(b Float)

Color.SetG

func (c *Color) SetG(g Float)

Color.SetR

func (c *Color) SetR(r Float)

Color8

struct

type Color8 struct {
    R uint8
    G uint8
    B uint8
    A uint8
}

Color8FromColor

func Color8FromColor(c Color) Color8

Color8FromHexString

func Color8FromHexString(str string) (Color8, error)

NewColor8

func NewColor8(r, g, b, a uint8) Color8

Color8.AsColor

func (c Color8) AsColor() Color

Color8.Equal

func (c Color8) Equal(rhs Color8) bool

Color8.Hex

func (c Color8) Hex() string

Color8.Similar

func (lhs Color8) Similar(rhs Color8, tolerance uint8) bool

ColorComponent

int

type ColorComponent = int

const ( R ColorComponent = iota G B A )

Float

float32

type Float = float32

Abs

func Abs(x Float) Float

Acos

func Acos(x Float) Float

Asin

func Asin(x Float) Float

Atan

func Atan(x Float) Float

Atan2

func Atan2(y Float, x Float) Float

Ceil

func Ceil(x Float) Float

Clamp

func Clamp(current, minimum, maximum Float) Float

Cos

func Cos(x Float) Float

Deg2Rad

func Deg2Rad(degree Float) Float

Floor

func Floor(x Float) Float

Inf

func Inf(sign int) Float

Log2

func Log2(x Float) Float

Max

func Max(a Float, b Float) Float

Min

func Min(a Float, b Float) Float

Mod

func Mod(x Float, y Float) Float

Pow

func Pow(x Float, y Float) Float

Rad2Deg

func Rad2Deg(radian Float) Float

Round

func Round(x Float) Float

Sin

func Sin(x Float) Float

Sqrt

func Sqrt(x Float) Float

Tan

func Tan(x Float) Float

Vec2Dot

func Vec2Dot(v, other Vec2) Float

Vec3Dot

func Vec3Dot(v, other Vec3) Float

Vec4Dot

func Vec4Dot(a, b Vec4) Float

Mat3

[9]Float

type Mat3 [9]Float

Mat3FromMat4

func Mat3FromMat4(m Mat4) Mat3

Mat3Identity

func Mat3Identity() Mat3

Mat3Zero

func Mat3Zero() Mat3

NewMat3

func NewMat3() Mat3

Mat3.ColumnVector

func (m Mat3) ColumnVector(col int) Vec3

Mat3.Multiply

func (m Mat3) Multiply(rhs Mat3) Mat3

Mat3.MultiplyAssign

func (m *Mat3) MultiplyAssign(rhs Mat3)

Mat3.MultiplyVec3

func (m Mat3) MultiplyVec3(v Vec3) Vec3

Mat3.Reset

func (m *Mat3) Reset()

Mat3.RowVector

func (m Mat3) RowVector(row int) Vec3

Mat3.ToMat4

func (m Mat3) ToMat4() Mat4

Mat3.Transpose

func (m Mat3) Transpose() Mat3

Mat4

[16]Float

type Mat4 [16]Float

Mat4FromSlice

func Mat4FromSlice(a []Float) Mat4

Mat4Identity

func Mat4Identity() Mat4

Mat4LookAt

func Mat4LookAt(eye, center, up Vec3) Mat4

Mat4Multiply

func Mat4Multiply(a, b Mat4) Mat4

Mat4Zero

func Mat4Zero() Mat4

NewMat4

func NewMat4() Mat4

Mat4.AddAssign

func (m *Mat4) AddAssign(rhs Mat4)

Mat4.At

func (m Mat4) At(rowIndex, colIndex int) Float

Mat4.ColumnVector

func (m Mat4) ColumnVector(col int) Vec4

Mat4.Forward

func (m Mat4) Forward() Vec3

Mat4.Inverse

func (m *Mat4) Inverse()

Mat4.Invert

func (m Mat4) Invert() Mat4

Mat4.Mat4ProjToVulkan

func (m Mat4) Mat4ProjToVulkan() Mat4

Mat4.Mat4Project

func (m Mat4) Mat4Project(pos Vec3, viewport Vec4) Vec3

Mat4.Mat4UnProject

func (m Mat4) Mat4UnProject(pos Vec3, viewport Vec4) Vec3

Mat4.MultiplyAssign

func (a *Mat4) MultiplyAssign(b Mat4)

Mat4.NegateAssign

func (m *Mat4) NegateAssign()

Mat4.Orthographic

func (m *Mat4) Orthographic(left, right, bottom, top, near, far Float)

Mat4.Perspective

func (m *Mat4) Perspective(fovy, aspect, nearVal, farVal Float)

Mat4.Position

func (m Mat4) Position() Vec3

Mat4.Reset

func (m *Mat4) Reset()

Mat4.Right

func (m Mat4) Right() Vec3

Mat4.Rotate

func (m *Mat4) Rotate(rotate Vec3)

Mat4.RotateAngles

func (m *Mat4) RotateAngles(axis Vec3, angle Float)

Mat4.RotateX

func (m *Mat4) RotateX(angles Float)

Mat4.RotateY

func (m *Mat4) RotateY(angles Float)

Mat4.RotateZ

func (m *Mat4) RotateZ(angles Float)

Mat4.RowVector

func (m Mat4) RowVector(row int) Vec4

Mat4.Scale

func (m *Mat4) Scale(scale Vec3)

Mat4.SetTranslation

func (m *Mat4) SetTranslation(translation Vec3)

Mat4.SubtractAssign

func (m *Mat4) SubtractAssign(rhs Mat4)

Mat4.ToQuaternion

func (m Mat4) ToQuaternion() Quaternion

Mat4.TransformPoint

func (m Mat4) TransformPoint(point Vec3) Vec3

Mat4.Translate

func (m *Mat4) Translate(translation Vec3)

Mat4.Transpose

func (m Mat4) Transpose() Mat4

Mat4.TransposeAssign

func (m *Mat4) TransposeAssign()

Mat4.Up

func (m Mat4) Up() Vec3

Mat4.Zero

func (m *Mat4) Zero()

Quaternion

[4]Float

type Quaternion [4]Float

NewQuaternion

func NewQuaternion(w, x, y, z Float) Quaternion

QuatAngleBetween

func QuatAngleBetween(lhs, rhs Vec3) Quaternion

QuaternionAxisAngle

func QuaternionAxisAngle(axis Vec3, angle Float) Quaternion

QuaternionFromArray

func QuaternionFromArray(xyzw [4]Float) Quaternion

QuaternionFromEuler

func QuaternionFromEuler(v Vec3) Quaternion

QuaternionFromMat4

func QuaternionFromMat4(m Mat4) Quaternion

QuaternionFromSlice

func QuaternionFromSlice(xyzw []Float) Quaternion

QuaternionFromVec4

func QuaternionFromVec4(v Vec4) Quaternion

QuaternionFromXYZW

func QuaternionFromXYZW(xyzw [4]Float) Quaternion

QuaternionFromXYZWSlice

func QuaternionFromXYZWSlice(xyzw []Float) Quaternion

QuaternionIdentity

func QuaternionIdentity() Quaternion

QuaternionLerp

func QuaternionLerp(from, to Quaternion, factor Float) Quaternion

QuaternionLookAt

func QuaternionLookAt(from, to Vec3) Quaternion

QuaternionSlerp

func QuaternionSlerp(from, to Quaternion, factor Float) Quaternion

Quaternion.AddAssign

func (q *Quaternion) AddAssign(rhs Quaternion)

Quaternion.Conjugate

func (q *Quaternion) Conjugate()

Quaternion.Inverse

func (q *Quaternion) Inverse()

Quaternion.MultiplyAssign

func (q *Quaternion) MultiplyAssign(rhs Quaternion)

Quaternion.MultiplyVec3

func (q Quaternion) MultiplyVec3(rhs Vec3) Vec3

Quaternion.Normal

func (q Quaternion) Normal() Quaternion

Quaternion.Normalize

func (q *Quaternion) Normalize()

Quaternion.ToEuler

func (q Quaternion) ToEuler() Vec3

Quaternion.ToMat4

func (q Quaternion) ToMat4() Mat4

Quaternion.W

func (q Quaternion) W() Float

Quaternion.X

func (q Quaternion) X() Float

Quaternion.Y

func (q Quaternion) Y() Float

Quaternion.Z

func (q Quaternion) Z() Float

QuaternionComponent

int

type QuaternionComponent = int

const ( Qw QuaternionComponent = iota Qx Qy Qz )

Transform

struct

type Transform struct {
    Identifier uint8 // Typically just used for bone index right now
    // Has unexported fields.
}

NewTransform

func NewTransform() Transform

Transform.CalcWorldMatrix

func (t *Transform) CalcWorldMatrix() Mat4

Transform.ContainsPoint

func (t *Transform) ContainsPoint(point Vec3) bool

Transform.ContainsPoint2D

func (t *Transform) ContainsPoint2D(point Vec2) bool

Transform.Copy

func (t *Transform) Copy(other Transform)

Transform.Forward

func (t *Transform) Forward() Vec3

Transform.IsDirty

func (t *Transform) IsDirty() bool

Transform.LookAt

func (t *Transform) LookAt(point Vec3)

Transform.Matrix

func (t *Transform) Matrix() Mat4

Transform.Parent

func (t *Transform) Parent() *Transform

Transform.Position

func (t *Transform) Position() Vec3

Transform.ResetDirty

func (t *Transform) ResetDirty()

Transform.Right

func (t *Transform) Right() Vec3

Transform.Rotation

func (t *Transform) Rotation() Vec3

Transform.Scale

func (t *Transform) Scale() Vec3

Transform.SetChildrenOrdered

func (t *Transform) SetChildrenOrdered()

Transform.SetChildrenUnordered

func (t *Transform) SetChildrenUnordered()

Transform.SetDirty

func (t *Transform) SetDirty()

Transform.SetParent

func (t *Transform) SetParent(parent *Transform)

Transform.SetPosition

func (t *Transform) SetPosition(position Vec3)

Transform.SetRotation

func (t *Transform) SetRotation(rotation Vec3)

Transform.SetScale

func (t *Transform) SetScale(scale Vec3)

Transform.SetWorldPosition

func (t *Transform) SetWorldPosition(position Vec3)

Transform.SetWorldRotation

func (t *Transform) SetWorldRotation(rotation Vec3)

Transform.SetWorldScale

func (t *Transform) SetWorldScale(scale Vec3)

Transform.StartLive

func (t *Transform) StartLive()

Transform.StopLive

func (t *Transform) StopLive()

Transform.Up

func (t *Transform) Up() Vec3

Transform.UpdateMatrix

func (t *Transform) UpdateMatrix()

Transform.UpdateWorldMatrix

func (t *Transform) UpdateWorldMatrix()

Transform.WorldMatrix

func (t *Transform) WorldMatrix() Mat4

Transform.WorldPosition

func (t *Transform) WorldPosition() Vec3

Transform.WorldRotation

func (t *Transform) WorldRotation() Vec3

Transform.WorldScale

func (t *Transform) WorldScale() Vec3

Transform.WorldTransform

func (t *Transform) WorldTransform() (Vec3, Vec3, Vec3)

Vec2

[2]Float

type Vec2 [2]Float

NewVec2

func NewVec2(x, y Float) Vec2

Vec2Down

func Vec2Down() Vec2

Vec2FromArray

func Vec2FromArray(a [2]Float) Vec2

Vec2FromSlice

func Vec2FromSlice(a []Float) Vec2

Vec2FromString

func Vec2FromString(str string) Vec2

Vec2Half

func Vec2Half() Vec2

Vec2Largest

func Vec2Largest() Vec2

Vec2Left

func Vec2Left() Vec2

Vec2Lerp

func Vec2Lerp(from, to Vec2, t Float) Vec2

Vec2Max

func Vec2Max(a, b Vec2) Vec2

Vec2MaxAbs

func Vec2MaxAbs(a, b Vec2) Vec2

Vec2Min

func Vec2Min(a, b Vec2) Vec2

Vec2MinAbs

func Vec2MinAbs(a, b Vec2) Vec2

Vec2One

func Vec2One() Vec2

Vec2Right

func Vec2Right() Vec2

Vec2Up

func Vec2Up() Vec2

Vec2Zero

func Vec2Zero() Vec2

Vec2.Abs

func (v Vec2) Abs() Vec2

Vec2.Add

func (v Vec2) Add(other Vec2) Vec2

Vec2.AddAssign

func (v *Vec2) AddAssign(other Vec2)

Vec2.Angle

func (v Vec2) Angle(other Vec2) Float

Vec2.AsVec2i

func (v Vec2) AsVec2i() Vec2i

Vec2.Distance

func (v Vec2) Distance(other Vec2) Float

Vec2.Divide

func (v Vec2) Divide(other Vec2) Vec2

Vec2.DivideAssign

func (v *Vec2) DivideAssign(other Vec2)

Vec2.Equals

func (v Vec2) Equals(other Vec2) bool

Vec2.Height

func (v Vec2) Height() Float

Vec2.Inverse

func (v *Vec2) Inverse()

Vec2.LargestAxis

func (v Vec2) LargestAxis() Float

Vec2.Length

func (v Vec2) Length() Float

Vec2.Multiply

func (v Vec2) Multiply(other Vec2) Vec2

Vec2.MultiplyAssign

func (v *Vec2) MultiplyAssign(other Vec2)

Vec2.Negative

func (v Vec2) Negative() Vec2

Vec2.Normal

func (v Vec2) Normal() Vec2

Vec2.Normalize

func (v *Vec2) Normalize()

Vec2.PX

func (v *Vec2) PX() *Float

Vec2.PY

func (v *Vec2) PY() *Float

Vec2.Scale

func (v Vec2) Scale(scalar Float) Vec2

Vec2.ScaleAssign

func (v *Vec2) ScaleAssign(scalar Float)

Vec2.SetHeight

func (v *Vec2) SetHeight(y Float)

Vec2.SetWidth

func (v *Vec2) SetWidth(x Float)

Vec2.SetX

func (v *Vec2) SetX(x Float)

Vec2.SetY

func (v *Vec2) SetY(y Float)

Vec2.Shrink

func (v Vec2) Shrink(scalar Float) Vec2

Vec2.ShrinkAssign

func (v *Vec2) ShrinkAssign(scalar Float)

Vec2.String

func (v Vec2) String() string

Vec2.Subtract

func (v Vec2) Subtract(other Vec2) Vec2

Vec2.SubtractAssign

func (v *Vec2) SubtractAssign(other Vec2)

Vec2.Width

func (v Vec2) Width() Float

Vec2.X

func (v Vec2) X() Float

Vec2.XY

func (v Vec2) XY() (Float, Float)

Vec2.Y

func (v Vec2) Y() Float

Vec2i

[2]int32

type Vec2i [2]int32

Vec2i.X

func (v Vec2i) X() int32

Vec2i.Y

func (v Vec2i) Y() int32

Vec3

[3]Float

type Vec3 [3]Float

Mat4ToScreenSpace

func Mat4ToScreenSpace(pos Vec3, view, projection Mat4, viewport Vec4) Vec3

NewVec3

func NewVec3(x, y, z Float) Vec3

Vec3Backward

func Vec3Backward() Vec3

Vec3Cross

func Vec3Cross(v, other Vec3) Vec3

Vec3Down

func Vec3Down() Vec3

Vec3Forward

func Vec3Forward() Vec3

Vec3FromArray

func Vec3FromArray(a [3]Float) Vec3

Vec3FromSlice

func Vec3FromSlice(a []Float) Vec3

Vec3FromString

func Vec3FromString(str string) Vec3

Vec3Half

func Vec3Half() Vec3

Vec3Inf

func Vec3Inf(sign int) Vec3

Vec3Largest

func Vec3Largest() Vec3

Vec3Left

func Vec3Left() Vec3

Vec3Lerp

func Vec3Lerp(from, to Vec3, t Float) Vec3

Vec3Max

func Vec3Max(v ...Vec3) Vec3

Vec3MaxAbs

func Vec3MaxAbs(v ...Vec3) Vec3

Vec3Min

func Vec3Min(v ...Vec3) Vec3

Vec3MinAbs

func Vec3MinAbs(v ...Vec3) Vec3

Vec3One

func Vec3One() Vec3

Vec3Right

func Vec3Right() Vec3

Vec3Up

func Vec3Up() Vec3

Vec3Zero

func Vec3Zero() Vec3

Vec3.Abs

func (v Vec3) Abs() Vec3

Vec3.Add

func (v Vec3) Add(other Vec3) Vec3

Vec3.AddAssign

func (v *Vec3) AddAssign(other Vec3)

Vec3.Angle

func (v Vec3) Angle(other Vec3) Float

Vec3.AsAligned16

func (v Vec3) AsAligned16() [4]Float

Vec3.AsVec2

func (v Vec3) AsVec2() Vec2

Vec3.AsVec3i

func (v Vec3) AsVec3i() Vec3i

Vec3.AsVec4

func (v Vec3) AsVec4() Vec4

Vec3.Distance

func (v Vec3) Distance(other Vec3) Float

Vec3.Divide

func (v Vec3) Divide(other Vec3) Vec3

Vec3.DivideAssign

func (v *Vec3) DivideAssign(other Vec3)

Vec3.Equals

func (v Vec3) Equals(other Vec3) bool

Vec3.Inverse

func (v *Vec3) Inverse()

Vec3.Length

func (v Vec3) Length() Float

Vec3.LongestAxis

func (v Vec3) LongestAxis() int

Vec3.LongestAxisValue

func (v Vec3) LongestAxisValue() Float

Vec3.Multiply

func (v Vec3) Multiply(other Vec3) Vec3

Vec3.MultiplyAssign

func (v *Vec3) MultiplyAssign(other Vec3)

Vec3.MultiplyMat3

func (v Vec3) MultiplyMat3(rhs Mat3) Vec3

Vec3.Negative

func (v Vec3) Negative() Vec3

Vec3.Normal

func (v Vec3) Normal() Vec3

Vec3.Normalize

func (v *Vec3) Normalize()

Vec3.Orthogonal

func (v Vec3) Orthogonal() Vec3

Vec3.PX

func (v *Vec3) PX() *Float

Vec3.PY

func (v *Vec3) PY() *Float

Vec3.PZ

func (v *Vec3) PZ() *Float

Vec3.Scale

func (v Vec3) Scale(scalar Float) Vec3

Vec3.ScaleAssign

func (v *Vec3) ScaleAssign(scalar Float)

Vec3.SetX

func (v *Vec3) SetX(x Float)

Vec3.SetY

func (v *Vec3) SetY(y Float)

Vec3.SetZ

func (v *Vec3) SetZ(z Float)

Vec3.Shrink

func (v Vec3) Shrink(scalar Float) Vec3

Vec3.ShrinkAssign

func (v *Vec3) ShrinkAssign(scalar Float)

Vec3.SquareDistance

func (v Vec3) SquareDistance(b Vec3) Float

Vec3.String

func (v Vec3) String() string

Vec3.Subtract

func (v Vec3) Subtract(other Vec3) Vec3

Vec3.SubtractAssign

func (v *Vec3) SubtractAssign(other Vec3)

Vec3.X

func (v Vec3) X() Float

Vec3.XYZ

func (v Vec3) XYZ() (Float, Float, Float)

Vec3.Y

func (v Vec3) Y() Float

Vec3.Z

func (v Vec3) Z() Float

Vec3i

[3]int32

type Vec3i [3]int32

Vec3i.X

func (v Vec3i) X() int32

Vec3i.Y

func (v Vec3i) Y() int32

Vec3i.Z

func (v Vec3i) Z() int32

Vec4

[4]Float

type Vec4 [4]Float

Mat4MultiplyVec4

func Mat4MultiplyVec4(a Mat4, b Vec4) Vec4

NewVec4

func NewVec4(x, y, z, w Float) Vec4

Vec4Area

func Vec4Area(xa, ya, xb, yb Float) Vec4

Vec4FromArray

func Vec4FromArray(a [4]Float) Vec4

Vec4FromSlice

func Vec4FromSlice(a []Float) Vec4

Vec4FromString

func Vec4FromString(str string) Vec4

Vec4Half

func Vec4Half() Vec4

Vec4Largest

func Vec4Largest() Vec4

Vec4Lerp

func Vec4Lerp(from, to Vec4, t Float) Vec4

Vec4Max

func Vec4Max(a, b Vec4) Vec4

Vec4MaxAbs

func Vec4MaxAbs(a, b Vec4) Vec4

Vec4Min

func Vec4Min(a, b Vec4) Vec4

Vec4MinAbs

func Vec4MinAbs(a, b Vec4) Vec4

Vec4MultiplyMat4

func Vec4MultiplyMat4(v Vec4, m Mat4) Vec4

Vec4One

func Vec4One() Vec4

Vec4Zero

func Vec4Zero() Vec4

Vec4.Abs

func (v Vec4) Abs() Vec4

Vec4.Add

func (v Vec4) Add(other Vec4) Vec4

Vec4.AddAssign

func (v *Vec4) AddAssign(other Vec4)

Vec4.Angle

func (v Vec4) Angle(other Vec4) Float

Vec4.AreaContains

func (v Vec4) AreaContains(x, y Float) bool

Vec4.AsVec3

func (v Vec4) AsVec3() Vec3

Vec4.AsVec4i

func (v Vec4) AsVec4i() Vec4i

Vec4.Bottom

func (v Vec4) Bottom() Float

Vec4.BoxContains

func (v Vec4) BoxContains(x, y Float) bool

Vec4.Distance

func (v Vec4) Distance(other Vec4) Float

Vec4.Divide

func (v Vec4) Divide(other Vec4) Vec4

Vec4.DivideAssign

func (v *Vec4) DivideAssign(other Vec4)

Vec4.Equals

func (v Vec4) Equals(other Vec4) bool

Vec4.Height

func (v Vec4) Height() Float

Vec4.Inverse

func (v *Vec4) Inverse()

Vec4.LargestAxis

func (v Vec4) LargestAxis() Float

Vec4.Left

func (v Vec4) Left() Float

Vec4.Length

func (v Vec4) Length() Float

Vec4.Multiply

func (v Vec4) Multiply(other Vec4) Vec4

Vec4.MultiplyAssign

func (v *Vec4) MultiplyAssign(other Vec4)

Vec4.Negative

func (v Vec4) Negative() Vec4

Vec4.Normal

func (v Vec4) Normal() Vec4

Vec4.Normalize

func (v *Vec4) Normalize()

Vec4.PW

func (v *Vec4) PW() *Float

Vec4.PX

func (v *Vec4) PX() *Float

Vec4.PY

func (v *Vec4) PY() *Float

Vec4.PZ

func (v *Vec4) PZ() *Float

Vec4.Right

func (v Vec4) Right() Float

Vec4.Scale

func (v Vec4) Scale(scalar Float) Vec4

Vec4.ScaleAssign

func (v *Vec4) ScaleAssign(scalar Float)

Vec4.ScreenAreaContains

func (v Vec4) ScreenAreaContains(x, y Float) bool

Vec4.SetBottom

func (v *Vec4) SetBottom(w Float)

Vec4.SetHeight

func (v *Vec4) SetHeight(w Float)

Vec4.SetLeft

func (v *Vec4) SetLeft(x Float)

Vec4.SetRight

func (v *Vec4) SetRight(z Float)

Vec4.SetTop

func (v *Vec4) SetTop(y Float)

Vec4.SetW

func (v *Vec4) SetW(w Float)

Vec4.SetWidth

func (v *Vec4) SetWidth(z Float)

Vec4.SetX

func (v *Vec4) SetX(x Float)

Vec4.SetY

func (v *Vec4) SetY(y Float)

Vec4.SetZ

func (v *Vec4) SetZ(z Float)

Vec4.Shrink

func (v Vec4) Shrink(scalar Float) Vec4

Vec4.ShrinkAssign

func (v *Vec4) ShrinkAssign(scalar Float)

Vec4.String

func (v Vec4) String() string

Vec4.Subtract

func (v Vec4) Subtract(other Vec4) Vec4

Vec4.SubtractAssign

func (v *Vec4) SubtractAssign(other Vec4)

Vec4.Top

func (v Vec4) Top() Float

Vec4.W

func (v Vec4) W() Float

Vec4.Width

func (v Vec4) Width() Float

Vec4.X

func (v Vec4) X() Float

Vec4.XYZW

func (v Vec4) XYZW() (Float, Float, Float, Float)

Vec4.Y

func (v Vec4) Y() Float

Vec4.Z

func (v Vec4) Z() Float

Vec4i

[4]int32

type Vec4i [4]int32

Vec4i.W

func (v Vec4i) W() int32

Vec4i.X

func (v Vec4i) X() int32

Vec4i.Y

func (v Vec4i) Y() int32

Vec4i.Z

func (v Vec4i) Z() int32

VectorComponent

int

type VectorComponent = int

const ( Vx VectorComponent = iota Vy Vz Vw )