Documentation ¶
Index ¶
- Variables
- func Dot(a, b T) float32
- type Array
- type T
- func (v T) Abs() T
- func (v T) Add(v2 T) T
- func (v T) Div(v2 T) T
- func (v *T) Invert()
- func (v T) Inverted() T
- func (v T) Length() float32
- func (v T) LengthSqr() float32
- func (v T) Mul(v2 T) T
- func (v *T) Normalize()
- func (v T) Normalized() T
- func (v *T) Scale(f float32)
- func (v T) Scaled(f float32) T
- func (v T) Slice() [4]float32
- func (v T) String() string
- func (v T) Sub(v2 T) T
- func (v T) XY() vec2.T
- func (v T) XYZ() vec3.T
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Zero is the zero vector Zero = T{0, 0, 0, 0} // One is the unit vector One = T{1, 1, 1, 1} // UnitX returns a unit vector in the X direction UnitX = T{1, 0, 0, 0} // UnitY returns a unit vector in the Y direction UnitY = T{0, 1, 0, 0} // UnitZ returns a unit vector in the Z direction UnitZ = T{0, 0, 1, 0} // UnitW returns a unit vector in the W direction UnitW = T{0, 0, 0, 1} InfPos = T{math.InfPos, math.InfPos, math.InfPos, math.InfPos} InfNeg = T{math.InfNeg, math.InfNeg, math.InfNeg, math.InfNeg} )
Functions ¶
Types ¶
type Array ¶
type Array []T
Array holds an array of 4-component vectors
type T ¶
type T struct {
X, Y, Z, W float32
}
T holds a 4-component vector of 32-bit floats
func (T) Div ¶
Div divides each element of the vector with the corresponding element of another vector
func (T) LengthSqr ¶
LengthSqr returns the squared length of the vector. See also Length and Normalize.
func (T) Mul ¶
Mul multiplies each element of the vector with the corresponding element of another vector
func (T) Normalized ¶
Normalized returns a unit length normalized copy of the vector.
Click to show internal directories.
Click to hide internal directories.