gm

package
v0.0.0-...-6aa7f09 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package gm math and gl math for floats32 Contains code from github.com/go-gl/mathgl/mgl32 BSD-3 Copyright ©2013 The go-gl Authors. All rights reserved.

Index

Constants

View Source
const (
	Epsilon   = 0.000001
	MinNormal = 1.1754943508222875e-38 // 1 / 2**(127 - 1)
	MinValue  = math.SmallestNonzeroFloat32
	MaxValue  = math.MaxFloat32
	Pi        = math.Pi
)

Epsilon float error stuff.

Variables

View Source
var (
	InfPos = Float(math.Inf(1))
	InfNeg = Float(math.Inf(-1))
	NaN    = Float(math.NaN())
)

values from math

Functions

func FloatEqual

func FloatEqual(a, b Float) bool

FloatEqual is a safe utility function to compare floats. It's Taken from http://floating-point-gui.de/errors/comparison/

It is slightly altered to not call Abs when not needed.

func FloatEqualThreshold

func FloatEqualThreshold(a, b, epsilon Float) bool

FloatEqualThreshold is a utility function to compare floats. It's Taken from http://floating-point-gui.de/errors/comparison/

It is slightly altered to not call Abs when not needed.

This differs from FloatEqual in that it lets you pass in your comparison threshold, so that you can adjust the comparison value to your specific needs

func Sincos

func Sincos(x Float) (Float, Float)

Sincos returns Sin(x), Cos(x).

Types

type Float

type Float = float32

func Abs

func Abs(x Float) Float

Abs returns the absolute value of x.

func Acos

func Acos(x Float) Float

Acos returns the arccosine, in radians, of x.

Special case is:

Acos(x) = NaN if x < -1 or x > 1

func Asin

func Asin(x Float) Float

Asin returns the arcsine, in radians, of x.

Special cases are:

Asin(±0) = ±0
Asin(x) = NaN if x < -1 or x > 1

func Atan2

func Atan2(y, x Float) Float

Atan2 returns the arc tangent of y/x, using the signs of the two to determine the quadrant of the return value.

func Cbrt

func Cbrt(x Float) Float

Cbrt returns the cube root of x.

func Ceil

func Ceil(x Float) Float

Ceil returns the .. ceil

func Clamp

func Clamp(v, min, max Float) Float

Clamp v

func Copysign

func Copysign(x, y Float) Float

Copysign returns a value with the magnitude of x and the sign of y.

func Cos

func Cos(x Float) Float

Cos casts values to float64 and uses native math.Cos to return the cosine of the radian argument x.

func Hypot

func Hypot(x, y Float) Float

Hypot returns Sqrt(p*p + q*q), taking care to avoid unnecessary overflow and underflow.

func Lerp

func Lerp(v0, v1, t Float) Float

Lerp Linear interpolation between 2 scalar

func Max

func Max(a, b Float) Float

Max returns the greatest value between a or b

func Min

func Min(a, b Float) Float

Min returns the lowest value between a or b

func Mod

func Mod(x, y Float) Float

Mod returns the floating-point remainder of x/y. The magnitude of the result is less than y and its sign agrees with that of x.

func Sin

func Sin(x Float) Float

Sin to return the sine of the radian argument x.

func Sqrt

func Sqrt(x Float) Float

Sqrt returns the square root of x.

func Tan

func Tan(x Float) Float

Tan returns the tangent of the radian argument x.

type Mat3

type Mat3 [9]Float

Mat3 is a 3x3 matrix in row major order.

m[3*r + c] is the element in the r'th row and c'th column.

func M3Ident

func M3Ident() Mat3

M3Ident returns the 3x3 identity matrix. The identity matrix is a square matrix with the value 1 on its diagonals. The characteristic property of the identity matrix is that any matrix multiplied by it is itself. (MI = M; IN = N)

func M3Rotate

func M3Rotate(angle Float) Mat3

M3Rotate returns a 2D rotation matrix based on radians 'angle'.

func M3Scale

func M3Scale(sx, sy Float) Mat3

M3Scale returns a Scale matrix.

func (Mat3) Abs

func (m Mat3) Abs() Mat3

Abs returns the element-wise absolute value of this matrix

func (Mat3) Add

func (m Mat3) Add(m2 Mat3) Mat3

Add performs an element-wise addition of two matrices, this is equivalent to iterating over every element of m and adding the corresponding value of m2.

func (Mat3) ApproxEqual

func (m Mat3) ApproxEqual(m2 Mat3) bool

ApproxEqual performs an element-wise approximate equality test between two matrices, as if FloatEqual had been used.

func (Mat3) ApproxEqualThreshold

func (m Mat3) ApproxEqualThreshold(m2 Mat3, threshold Float) bool

ApproxEqualThreshold performs an element-wise approximate equality test between two matrices with a given epsilon threshold, as if FloatEqualThreshold had been used.

func (Mat3) ApproxFuncEqual

func (m Mat3) ApproxFuncEqual(m2 Mat3, eq func(Float, Float) bool) bool

ApproxFuncEqual performs an element-wise approximate equality test between two matrices with a given equality functions, intended to be used with FloatEqualFunc; although and comparison function may be used in practice.

func (Mat3) At

func (m Mat3) At(row, col int) Float

At returns the matrix element at the given row and column. This is equivalent to mat[col * numRow + row] where numRow is constant (E.G. for a Mat3x2 it's equal to 3)

This method is garbage-in garbage-out. For instance, on a Mat4 asking for At(5,0) will work just like At(1,1). Or it may panic if it's out of bounds.

func (Mat3) Col

func (m Mat3) Col(col int) Vec3

Col returns a vector representing the corresponding column (starting at col 0). This package makes no distinction between row and column vectors, so it will be a normal VecN for a MxN matrix.

func (Mat3) Cols

func (m Mat3) Cols() (col0, col1, col2 Vec3)

Cols decomposes a matrix into its corresponding column vectors. This is equivalent to calling mat.Col for each column.

func (Mat3) Det

func (m Mat3) Det() Float

Det returns the determinant of a matrix. It is a measure of a square matrix's singularity and invertability, among other things. In this library, the determinant is hard coded based on pre-computed cofactor expansion, and uses no loops. Of course, the addition and multiplication must still be done.

func (Mat3) Diag

func (m Mat3) Diag() Vec3

Diag is a basic operation on a square matrix that simply returns main diagonal (meaning all elements such that row==col).

func (Mat3) Index

func (m Mat3) Index(row, col int) int

Index returns the index of the given row and column, to be used with direct access. E.G. Index(0,0) = 0.

This is a garbage-in garbage-out method. For instance, on a Mat4 asking for the index of (5,0) will work the same as asking for (1,1). Or it may give you a value that will cause a panic if you try to access the array with it if it's truly out of bounds.

func (Mat3) Inv

func (m Mat3) Inv() Mat3

Inv computes the inverse of a square matrix. An inverse is a square matrix such that when multiplied by the original, yields the identity.

M_inv * M = M * M_inv = I

In this library, the math is precomputed, and uses no loops, though the multiplications, additions, determinant calculation, and scaling are still done. This can still be (relatively) expensive for a 4x4.

This function checks the determinant to see if the matrix is invertible. If the determinant is 0.0, this function returns the zero matrix. However, due to floating point errors, it is entirely plausible to get a false positive or negative. In the future, an alternate function may be written which takes in a pre-computed determinant.

func (Mat3) Mat4

func (m Mat3) Mat4() Mat4

Mat4 returns a Mat4 from Mat3 by Adding a row and a column with last element being 1.

func (Mat3) Mul

func (m Mat3) Mul(m2 Mat3) Mat3

Mul performs a "matrix product" between this matrix and another of the given dimension. For any two matrices of dimensionality MxN and NxO, the result will be MxO. For instance, Mat4 multiplied using Mul4x2 will result in a Mat4x2.

func (Mat3) MulS

func (m Mat3) MulS(c Float) Mat3

MulS performs a scalar multiplcation of the matrix. This is equivalent to iterating over every element of the matrix and multiply it by c.

func (Mat3) MulV3

func (m Mat3) MulV3(v Vec3) Vec3

MulV3 return a the Vec3 multiplied by matrix.

func (Mat3) Row

func (m Mat3) Row(row int) Vec3

Row returns a vector representing the corresponding row (starting at row 0). This package makes no distinction between row and column vectors, so it will be a normal VecM for a MxN matrix.

func (Mat3) Rows

func (m Mat3) Rows() (row0, row1, row2 Vec3)

Rows decomposes a matrix into its corresponding row vectors. This is equivalent to calling mat.Row for each row.

func (*Mat3) Set

func (m *Mat3) Set(row, col int, value Float)

Set sets the corresponding matrix element at the given row and column. This has a pointer receiver because it mutates the matrix.

This method is garbage-in garbage-out. For instance, on a Mat4 asking for Set(5,0,val) will work just like Set(1,1,val). Or it may panic if it's out of bounds.

func (Mat3) String

func (m Mat3) String() string

String pretty prints matrix

func (Mat3) Sub

func (m Mat3) Sub(m2 Mat3) Mat3

Sub performs an element-wise subtraction of two matrices, this is equivalent to iterating over every element of m and subtracting the corresponding value of m2.

func (Mat3) Trace

func (m Mat3) Trace() Float

Trace is a basic operation on a square matrix that simply sums up all elements on the main diagonal (meaning all elements such that row==col).

func (Mat3) Transpose

func (m Mat3) Transpose() Mat3

Transpose produces the transpose of this matrix. For any MxN matrix the transpose is an NxM matrix with the rows swapped with the columns. For instance the transpose of the Mat3x2 is a Mat2x3 like so:

[[a b]]    [[a c e]]
[[c d]] =  [[b d f]]
[[e f]]

type Mat4

type Mat4 [16]Float

Mat4 is a 4x4 matrix in row major order.

m[4*r + c] is the element in the r'th row and c'th column.

func LookAt

func LookAt(eye, center, up Vec3) Mat4

LookAt based on f32

func M4Ident

func M4Ident() Mat4

M4Ident returns a mat4 identity.

func M4Mul

func M4Mul(ms ...Mat4) Mat4

M4Mul multiply sequence of matrices

func Ortho

func Ortho(left, right, bottom, top, near, far Float) Mat4

Ortho creates an orthographic matrix https://stackoverflow.com/questions/31839119/projection-and-orthographic-matrices-for-opengl

func Perspective

func Perspective(fovy, aspect, near, far Float) Mat4

Perspective generates a Perspective Matrix.

func Scale3D

func Scale3D(sx, sy, sz Float) Mat4

Scale3D returns a scale matrix

func Translate3D

func Translate3D(x, y, z Float) Mat4

Translate3D returns a translation matrix

func (Mat4) Abs

func (m Mat4) Abs() Mat4

Abs returns the element-wise absolute value of this matrix

func (Mat4) Add

func (m Mat4) Add(m2 Mat4) Mat4

Add performs an element-wise addition of two matrices, this is equivalent to iterating over every element of m1 and adding the corresponding value of m2.

func (Mat4) ApproxEqual

func (m Mat4) ApproxEqual(m2 Mat4) bool

ApproxEqual performs an element-wise approximate equality test between two matrices, as if FloatEqual had been used.

func (Mat4) ApproxEqualThreshold

func (m Mat4) ApproxEqualThreshold(m2 Mat4, threshold Float) bool

ApproxEqualThreshold performs an element-wise approximate equality test between two matrices with a given epsilon threshold, as if FloatEqualThreshold had been used.

func (Mat4) ApproxFuncEqual

func (m Mat4) ApproxFuncEqual(m2 Mat4, eq func(Float, Float) bool) bool

ApproxFuncEqual performs an element-wise approximate equality test between two matrices with a given equality functions, intended to be used with FloatEqualFunc; although and comparison function may be used in practice.

func (Mat4) Col

func (m Mat4) Col(n int) Vec4

Col returns a vector representing the corresponding column (starting at col 0). This package makes no distinction between row and column vectors, so it will be a normal VecN for a MxN matrix.

func (Mat4) Det

func (m Mat4) Det() Float

Det returns the determinant of a matrix. It is a measure of a square matrix's singularity and invertability, among other things. In this library, the determinant is hard coded based on pre-computed cofactor expansion, and uses no loops. Of course, the addition and multiplication must still be done.

func (Mat4) Diag

func (m Mat4) Diag() Vec4

Diag is a basic operation on a square matrix that simply returns main diagonal (meaning all elements such that row==col).

func (Mat4) Inv

func (m Mat4) Inv() Mat4

Inv computes the inverse of a square matrix. An inverse is a square matrix such that when multiplied by the original, yields the identity.

M_inv * M = M * M_inv = I

In this library, the math is precomputed, and uses no loops, though the multiplications, additions, determinant calculation, and scaling are still done. This can still be (relatively) expensive for a 4x4.

This function checks the determinant to see if the matrix is invertible. If the determinant is 0.0, this function returns the zero matrix. However, due to floating point errors, it is entirely plausible to get a false positive or negative. In the future, an alternate function may be written which takes in a pre-computed determinant.

func (Mat4) Mat3

func (m Mat4) Mat3() Mat3

Mat3 returns a truncated mat3 removing last col and row.

func (Mat4) Mul

func (m Mat4) Mul(m2 Mat4) Mat4

Mul performs a "matrix product" between this matrix and another of the given dimension. For any two matrices of dimensionality MxN and NxO, the result will be MxO. For instance, Mat4 multiplied using Mul4x2 will result in a Mat4x2.

func (Mat4) MulS

func (m Mat4) MulS(v Float) Mat4

MulS performs a scalar multiplcation of the matrix. This is equivalent to iterating over every element of the matrix and multiply it by c.

func (Mat4) MulV4

func (m Mat4) MulV4(m2 Vec4) Vec4

MulV4 returns a Vec4 based on the multiplication of m and m2.

func (Mat4) Quat

func (m Mat4) Quat() Quat

Quat returns the quaternion representation of this matrix.

func (Mat4) Row

func (m Mat4) Row(row int) Vec4

Row returns a vector representing the corresponding row (starting at row 0). This package makes no distinction between row and column vectors, so it will be a normal VecM for a MxN matrix.

func (Mat4) String

func (m Mat4) String() string

func (Mat4) Sub

func (m Mat4) Sub(m2 Mat4) Mat4

Sub performs an element-wise subtraction of two matrices, this is equivalent to iterating over every element of m1 and subtracting the corresponding value of m2.

func (Mat4) Trace

func (m Mat4) Trace() Float

Trace is a basic operation on a square matrix that simply sums up all elements on the main diagonal (meaning all elements such that row==col).

func (Mat4) Transpose

func (m Mat4) Transpose() Mat4

Transpose produces the transpose of this matrix. For any MxN matrix the transpose is an NxM matrix with the rows swapped with the columns. For instance the transpose of the Mat3x2 is a Mat2x3 like so:

[[a b]]    [[a c e]]
[[c d]] =  [[b d f]]
[[e f]]

type Quat

type Quat [4]Float

Quat short for quaternion:

https://answers.unity.com/questions/467614/what-is-the-source-code-of-quaternionlookrotation.html

W is [3]

func QAxisAngle

func QAxisAngle(v3 Vec3, rad Float) Quat

QAxisAngle returns a axis angle quaternion.

func QBetweenV3

func QBetweenV3(v1, v2 Vec3) Quat

QBetweenV3 returns a quaternion between two vectors.

func QEuler

func QEuler(x, y, z Float) Quat

QEuler returns a quaternion based on those euler angles https://en.wikipedia.org/wiki/Conversion_between_quaternions_and_Euler_angles

func QFromAngles

func QFromAngles(a1, a2, a3 Float, order RotationOrder) Quat

QFromAngles returns a rotation quaternion based on the angles.

func QIdent

func QIdent() Quat

QIdent returns a quaternion identity.

func QLookAt

func QLookAt(dir, up Vec3) Quat

QLookAt creates a LookAt Matrix and extract the quaternion

func (Quat) Add

func (q Quat) Add(q2 Quat) Quat

Add returns a new quaternion based on the sum of q and q2.

func (Quat) Len

func (q Quat) Len() Float

Len computes quaternion length.

func (Quat) Mat4

func (q Quat) Mat4() Mat4

Mat4 returns a 4x4 matrix from the quaternion.

func (Quat) Mul

func (q Quat) Mul(q2 Quat) Quat

Mul returns a new quaternion based on the multiplication with q2.

func (Quat) Normalize

func (q Quat) Normalize() Quat

Normalize returns a normalized copy of the quaternion.

func (Quat) Slerp

func (q Quat) Slerp(b Quat, t Float) Quat

Slerp spherical linear interpolation between two quat https://github.com/toji/gl-matrix/blob/6c0268c89f30090b17bcadade9e7feb7205b85c5/src/quat.js#L296

func (Quat) ToEuler

func (q Quat) ToEuler() Vec3

ToEuler quaternion to euler angles.

func (Quat) V

func (q Quat) V() Vec3

V returns the Vector (0,1,2) part of the quaternion.

func (Quat) W

func (q Quat) W() Float

W returns the W part of the quaternion.

type Rand

type Rand struct {
	*rand.Rand
}

Rand helper function that handlers vec3, vec4 etc..

func NewRand

func NewRand(seed int64) *Rand

func (Rand) Cone

func (r Rand) Cone(dir Vec3, spread Float) Vec3

Cone returns a random direction on a cone

func (Rand) Float32

func (r Rand) Float32() Float

Float32 returns a Float with random values [0, 1] using inner rand generator. if the inner source is nil it will use the global one.

func (Rand) NFloat32

func (r Rand) NFloat32() Float

NFloat32 returns a Float with random values between [-1,1]

func (Rand) SphereSurface

func (r Rand) SphereSurface() Vec3

SphereSurface returns a random surface points on a sphere.

func (Rand) UnitSphere

func (r Rand) UnitSphere() Vec3

UnitSphere generate random points in a sphere From: https://karthikkaranth.me/blog/generating-random-points-in-a-sphere/ Still needs improvements as it doesn't seem right yet

func (Rand) Vec3

func (r Rand) Vec3() Vec3

Vec3 returns a vec3 with random values [0, 1]

func (Rand) Vec4

func (r Rand) Vec4() Vec4

Vec4 returns a vec4 with random values [0, 1]

type RotationOrder

type RotationOrder int

RotationOrder is the order in which rotations will be transformed for the purposes of QFromAngles.

const (
	XYX RotationOrder = iota
	XYZ
	XZX
	XZY
	YXY
	YXZ
	YZY
	YZX
	ZYZ
	ZYX
	ZXZ
	ZXY
)

The RotationOrder constants represent a series of rotations along the given axes for the use of QFromAngles.

type Vec2

type Vec2 [2]Float

Vec2 vector2

func V2

func V2(v ...Float) Vec2

func (Vec2) Abs

func (v Vec2) Abs() Vec2

Abs returns the vec2 with abs values for each element.

func (Vec2) Add

func (v Vec2) Add(v2 Vec2) Vec2

Add sums the elements with v2 and returns a new vec2.

func (Vec2) Clamp

func (v Vec2) Clamp(min, max Vec2) Vec2

Clamp clamps the vec2 elements to specific min and max floats.

func (Vec2) Len

func (v Vec2) Len() Float

Len returns the len of v.

func (Vec2) Lerp

func (v Vec2) Lerp(b Vec2, t Float) Vec2

Lerp Linear interpolation between 2 vecs2.

func (Vec2) Mul

func (v Vec2) Mul(c Float) Vec2

Mul returns a new vec2 with the multiplication of each element with c.

func (Vec2) MulVec2

func (v Vec2) MulVec2(v2 Vec2) Vec2

MulVec2 returns a new Vec2 with the multiplication by the corresponding elements of v2.

func (Vec2) Sub

func (v Vec2) Sub(v2 Vec2) Vec2

Sub returns a new vec2 the subtraction with v2.

func (Vec2) Vec3

func (v Vec2) Vec3(z Float) Vec3

Vec3 returns a vec3 with the extra value z.

func (Vec2) Vec4

func (v Vec2) Vec4(z, w Float) Vec4

Vec4 returns a vec4 with the extra values z and w.

func (Vec2) X

func (v Vec2) X() Float

func (Vec2) Y

func (v Vec2) Y() Float

type Vec3

type Vec3 [3]Float

Vec3 an Float array of size 3 with methods for vector operations.

func Backward

func Backward() Vec3

Backward returns a vector facing backward

func Down

func Down() Vec3

Down returns a down vector

func Forward

func Forward() Vec3

Forward returns a vector facing forward

func HSV2RGB

func HSV2RGB(h, s, v Float) Vec3

HSV2RGB Hue Saturation Value to RGB values are in the range 0-1 and will be clamped to that range.

func Left

func Left() Vec3

Left returns a vector pointing left

func Right() Vec3

Right returns a vector pointing left

func Up

func Up() Vec3

Up returns a up vector

func V3

func V3(v ...Float) Vec3

func (Vec3) Add

func (v Vec3) Add(v2 Vec3) Vec3

Add returns a new Vec3 based on the sum of the param.

func (Vec3) Clamp

func (v Vec3) Clamp(min, max Vec3) Vec3

Clamp returns a vec3 with the v elements clamped to min and max.

func (Vec3) Cross

func (v Vec3) Cross(v2 Vec3) Vec3

Cross returns a new vec3 with the cross product of v with v2.

func (Vec3) Dot

func (v Vec3) Dot(v2 Vec3) Float

Dot returns the dot product of v with v2

func (Vec3) Len

func (v Vec3) Len() Float

Len returns the vec3 len.

func (Vec3) Lerp

func (v Vec3) Lerp(b Vec3, t Float) Vec3

Lerp Linear interpolation between 2 vecs

func (Vec3) Mul

func (v Vec3) Mul(c Float) Vec3

Mul returns a new vec3 based on the multiplication of vec3*scalar.

func (Vec3) MulVec3

func (v Vec3) MulVec3(v2 Vec3) Vec3

MulVec3 multiplies each element by the corresponding element of v2.

func (Vec3) Normalize

func (v Vec3) Normalize() Vec3

Normalize returns a new normalized vec3.

func (Vec3) Reflect

func (v Vec3) Reflect(n Vec3) Vec3

Reflect returns a reflected vec3 with n

func (Vec3) Sub

func (v Vec3) Sub(v2 Vec3) Vec3

Sub returns a new Vec3 with subtracting each element of v2.

func (Vec3) Vec2

func (v Vec3) Vec2() Vec2

Vec2 returns a Vec2 with the first 2 elements of v.

func (Vec3) Vec4

func (v Vec3) Vec4(w Float) Vec4

Vec4 returns a vec4 with the new element w.

func (Vec3) X

func (v Vec3) X() Float

func (Vec3) XY

func (v Vec3) XY() Vec2

func (Vec3) Y

func (v Vec3) Y() Float

func (Vec3) YZ

func (v Vec3) YZ() Vec2

func (Vec3) Z

func (v Vec3) Z() Float

type Vec4

type Vec4 [4]Float

Vec4 Float array of size 4 with vector operation methods.

func Color

func Color(v ...Float) Vec4

Color returns a vec4 with the colors value if the number of params is: 0 - returns a zero Vec4 1 - returns a Vec4 with all 3 elements set to param 0 and alpha 1 2 - returns a Vec4 with all 3 elements set to param 0 and alpha to param 1 3 - returns a Vec4 with all 3 elements set to params and alpha 1 4 - returns a Vec4 with all 4 elements set to params.

func V4

func V4(v ...Float) Vec4

func (Vec4) Add

func (v Vec4) Add(v2 Vec4) Vec4

Add returns the addition of each element with v2 in a new vec4.

func (Vec4) Dot

func (v Vec4) Dot(v2 Vec4) Float

Dot returns the dot product of v and v2.

func (Vec4) Equal

func (v Vec4) Equal(v2 Vec4) bool

Equal returns true if v and v2 are approximately equal.

func (Vec4) Len

func (v Vec4) Len() Float

Len returns the length of the vec4.

func (Vec4) Lerp

func (v Vec4) Lerp(b Vec4, t Float) Vec4

Lerp Linear interpolation between 2 vecs

func (Vec4) Mul

func (v Vec4) Mul(c Float) Vec4

Mul returns a new vec4 with the elements multiplied by c.

func (Vec4) MulVec4

func (v Vec4) MulVec4(v2 Vec4) Vec4

MulVec4 multiplies each element of v with each element of v2.

func (Vec4) Normalize

func (v Vec4) Normalize() Vec4

Normalize returns the normalized vec4.

func (Vec4) Sub

func (v Vec4) Sub(v2 Vec4) Vec4

Sub returns the subtraction of each element with v2 in a new vec4.

func (Vec4) Vec2

func (v Vec4) Vec2() Vec2

Vec2 returns a vec2 based on first and second element.

func (Vec4) Vec3

func (v Vec4) Vec3() Vec3

Vec3 returns a vec3 based on the first elements of vec4.

func (Vec4) W

func (v Vec4) W() Float

func (Vec4) X

func (v Vec4) X() Float

func (Vec4) XY

func (v Vec4) XY() Vec2

func (Vec4) XYZ

func (v Vec4) XYZ() Vec3

func (Vec4) XZ

func (v Vec4) XZ() Vec2

func (Vec4) Y

func (v Vec4) Y() Float

func (Vec4) YW

func (v Vec4) YW() Vec2

func (Vec4) YZ

func (v Vec4) YZ() Vec2

func (Vec4) Z

func (v Vec4) Z() Float

func (Vec4) ZW

func (v Vec4) ZW() Vec2

Jump to

Keyboard shortcuts

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