Documentation ¶
Index ¶
- func ApproxEqual(v1, v2 Vec3, epsilon float32) bool
- type Mat3
- type Mat4
- type Quat
- type Vec2
- type Vec3
- func (v Vec3) Add(v2 Vec3) Vec3
- func (v Vec3) Cross(v2 Vec3) Vec3
- func (v Vec3) Dot(v2 Vec3) float32
- func (v Vec3) Len() float32
- func (v Vec3) MaxComponent() float32
- func (v Vec3) Mul(s float32) Vec3
- func (v Vec3) Normalize() Vec3
- func (v Vec3) String() string
- func (v Vec3) Sub(v2 Vec3) Vec3
- func (v Vec3) Vec4(w float32) Vec4
- type Vec4
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApproxEqual ¶
Check if two vectors are equal based on a comparison epsilon.
Types ¶
type Mat4 ¶
func Perspective4 ¶
Create a perspective projection 4x4 matrix
type Quat ¶
Quaternion implementation taken from https://github.com/go-gl/mathgl/blob/master/mgl32/quat.go
func QuatFromAxisAngle ¶
Create a quaternion from an axis vector and an angle.
func (Quat) Inverse ¶
The inverse of a quaternion. The inverse is equivalent to the conjugate divided by the square of the length.
func (Quat) Len ¶
Returns the Length of the quaternion, also known as its Norm. This is the same thing as the Len of a Vec4
func (Quat) Mul ¶
Multiplies two quaternions. This can be seen as a rotation. Note that Multiplication is NOT commutative, meaning q1.Mul(q2) does not necessarily equal q2.Mul(q1).
Click to show internal directories.
Click to hide internal directories.