quaternion

package
v0.35.1 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FromEulerAngleNode added in v0.23.0

type FromEulerAngleNode struct {
	Angle nodes.Output[vector3.Float64]
}

From Euler Angles ==========================================================

func (FromEulerAngleNode) Out added in v0.32.0

type FromEulerAnglesNode added in v0.22.2

type FromEulerAnglesNode struct {
	Angles nodes.Output[[]vector3.Float64]
}

func (FromEulerAnglesNode) Out added in v0.32.0

type FromThetaArrayNode added in v0.22.2

type FromThetaArrayNode struct {
	Direction nodes.Output[[]vector3.Float64]
	Theta     nodes.Output[[]float64]
}

func (FromThetaArrayNode) Out added in v0.32.0

type FromThetaNode added in v0.22.2

type FromThetaNode struct {
	Theta     nodes.Output[float64]
	Direction nodes.Output[vector3.Float64]
}

func (FromThetaNode) Out added in v0.32.0

type NewNode added in v0.22.2

type NewNode struct {
	X nodes.Output[float64]
	Y nodes.Output[float64]
	Z nodes.Output[float64]
	W nodes.Output[float64]
}

func (NewNode) Out added in v0.32.0

func (cn NewNode) Out(out *nodes.StructOutput[Quaternion])

type Quaternion

type Quaternion struct {
	// contains filtered or unexported fields
}

Quaternion is a 4 component imaginary number thingy for rotating 3D meshes.

func FromMatrix added in v0.22.2

func FromMatrix(k mat.Matrix4x4) Quaternion

func FromTheta

func FromTheta(theta float64, v vector3.Float64) Quaternion

UnitQuaternionFromTheta takes a vector and angle and builds a unit quaternion in the form (cos(theta/2.0), sin(theta/2.0))

Resources Used:

https://www.youtube.com/watch?v=mHVwd8gYLnI
https://en.wikipedia.org/wiki/Quaternions_and_spatial_rotation

func Identity added in v0.17.0

func Identity() Quaternion

func New

NewQuaternion creates a quaternion

func RotationTo

func RotationTo(from, to vector3.Float64) Quaternion

func Zero

func Zero() Quaternion

Zero returns a quaternion with 0 for all it's components

func (Quaternion) Dir

func (q Quaternion) Dir() vector3.Float64

func (Quaternion) Dot added in v0.27.0

func (q Quaternion) Dot(o Quaternion) float64

func (Quaternion) Normalize

func (q Quaternion) Normalize() Quaternion

func (Quaternion) Rotate

Rotate takes a given vector and rotates it with by this quaternion.

Resources Used:

https://gamedev.stackexchange.com/questions/28395

func (Quaternion) RotateArray

func (q Quaternion) RotateArray(arr []vector3.Float64) []vector3.Float64

func (Quaternion) ToArr added in v0.18.0

func (q Quaternion) ToArr() [4]float64

func (Quaternion) Vector4 added in v0.18.0

func (q Quaternion) Vector4() vector4.Float64

func (Quaternion) W

func (q Quaternion) W() float64

Jump to

Keyboard shortcuts

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