Documentation ¶
Index ¶
- Constants
- func IsInTriangle(p, a, b, c *Vector3) bool
- func Triangulate(poly []*Vector3) [][3]int
- type Element
- type EulerAngles
- type Matrix4
- func NewMatrix4() *Matrix4
- func NewMatrix4FromSlice(a []Element) *Matrix4
- func NewRotationMatrix4FromQuaternion(q *Quaternion) *Matrix4
- func NewScaleMatrix4(x, y, z Element) *Matrix4
- func NewTRSMatrix4(t *Vector3, r *Quaternion, s *Vector3) *Matrix4
- func NewTranslateMatrix4(x, y, z Element) *Matrix4
- func (mat *Matrix4) ApplyTo(v *Vector3) *Vector3
- func (m *Matrix4) Clone() *Matrix4
- func (mat *Matrix4) Decompose() (translate *Vector3, rotation *Quaternion, scale *Vector3)
- func (m *Matrix4) Det() Element
- func (m *Matrix4) Inverse() *Matrix4
- func (b *Matrix4) Mul(a *Matrix4) *Matrix4
- func (mat *Matrix4) ToArray(a []Element)
- func (m *Matrix4) Transposed() *Matrix4
- type Quaternion
- type RotationOrder
- type Vector2
- type Vector3
- func (v *Vector3) Add(v2 *Vector3) *Vector3
- func (v *Vector3) Cross(v2 *Vector3) *Vector3
- func (v *Vector3) Dot(v2 *Vector3) Element
- func (v *Vector3) Len() Element
- func (v *Vector3) LenSqr() Element
- func (v *Vector3) Normalize() *Vector3
- func (v *Vector3) Scale(s Element) *Vector3
- func (v *Vector3) Sub(v2 *Vector3) *Vector3
- func (v *Vector3) ToArray(array []Element)
- type Vector4
- func (v *Vector4) Add(v2 *Vector4) *Vector4
- func (v *Vector4) Dot(v2 *Vector4) Element
- func (v *Vector4) Inverse() *Vector4
- func (v *Vector4) Len() Element
- func (v *Vector4) LenSqr() Element
- func (a *Vector4) Mul(b *Vector4) *Vector4
- func (v *Vector4) Normalize() *Vector4
- func (v *Vector4) Sub(v2 *Vector4) *Vector4
Constants ¶
View Source
const ( RotationOrderXYZ = iota RotationOrderYXZ RotationOrderZXY RotationOrderZYX )
Variables ¶
This section is empty.
Functions ¶
func IsInTriangle ¶ added in v0.3.5
func Triangulate ¶ added in v0.3.5
Types ¶
type EulerAngles ¶ added in v0.3.5
type EulerAngles struct { Vector3 Order RotationOrder }
func NewEuler ¶ added in v0.3.5
func NewEuler(x, y, z float32, order RotationOrder) *EulerAngles
func NewEulerFromMatrix4 ¶ added in v0.3.5
func NewEulerFromMatrix4(mat *Matrix4, order RotationOrder) *EulerAngles
func NewEulerFromQuaternion ¶ added in v0.3.5
func NewEulerFromQuaternion(q *Quaternion, order RotationOrder) *EulerAngles
func (*EulerAngles) ToQuaternion ¶ added in v0.3.5
func (v *EulerAngles) ToQuaternion() *Quaternion
type Matrix4 ¶
type Matrix4 [16]Element
column-major matrix
func NewMatrix4 ¶
func NewMatrix4() *Matrix4
func NewMatrix4FromSlice ¶
func NewRotationMatrix4FromQuaternion ¶ added in v0.3.2
func NewRotationMatrix4FromQuaternion(q *Quaternion) *Matrix4
func NewScaleMatrix4 ¶
func NewTRSMatrix4 ¶ added in v0.3.5
func NewTRSMatrix4(t *Vector3, r *Quaternion, s *Vector3) *Matrix4
func NewTranslateMatrix4 ¶
func (*Matrix4) Decompose ¶ added in v0.3.5
func (mat *Matrix4) Decompose() (translate *Vector3, rotation *Quaternion, scale *Vector3)
func (*Matrix4) Transposed ¶ added in v0.3.2
type Quaternion ¶ added in v0.3.5
type Quaternion = Vector4
type RotationOrder ¶ added in v0.3.5
type RotationOrder int
type Vector2 ¶
func NewVector2 ¶ added in v0.3.5
type Vector3 ¶
func NewVector3 ¶ added in v0.3.5
func NewVector3FromArray ¶
func NewVector3FromSlice ¶
Click to show internal directories.
Click to hide internal directories.