trs

package
v0.37.0 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Positions added in v0.34.0

func Positions(transforms []TRS) []vector3.Float64

func Rotations added in v0.34.0

func Rotations(transforms []TRS) []quaternion.Quaternion

func Scales added in v0.34.0

func Scales(transforms []TRS) []vector3.Float64

Types

type ArrayNode added in v0.22.2

type ArrayNode struct {
	Position nodes.Output[[]vector3.Float64]
	Scale    nodes.Output[[]vector3.Float64]
	Rotation nodes.Output[[]quaternion.Quaternion]
}

func (ArrayNode) Out added in v0.32.0

func (tnd ArrayNode) Out(out *nodes.StructOutput[[]TRS])

type FilterPositionNode added in v0.27.0

type FilterPositionNode struct {
	Input nodes.Output[[]TRS]
	MinX  nodes.Output[float64]
	MinY  nodes.Output[float64]
	MinZ  nodes.Output[float64]
	MaxX  nodes.Output[float64]
	MaxY  nodes.Output[float64]
	MaxZ  nodes.Output[float64]
}

func (FilterPositionNode) Filter added in v0.27.0

func (tnd FilterPositionNode) Filter(out *nodes.StructOutput[[]TRS]) ([]TRS, []TRS)

func (FilterPositionNode) Kept added in v0.27.0

func (tnd FilterPositionNode) Kept(out *nodes.StructOutput[[]TRS])

func (FilterPositionNode) Removed added in v0.27.0

func (tnd FilterPositionNode) Removed(out *nodes.StructOutput[[]TRS])

type FilterScaleNode added in v0.27.0

type FilterScaleNode struct {
	Input nodes.Output[[]TRS]
	MinX  nodes.Output[float64]
	MinY  nodes.Output[float64]
	MinZ  nodes.Output[float64]
	MaxX  nodes.Output[float64]
	MaxY  nodes.Output[float64]
	MaxZ  nodes.Output[float64]
}

func (FilterScaleNode) Filter added in v0.27.0

func (tnd FilterScaleNode) Filter(out *nodes.StructOutput[[]TRS]) ([]TRS, []TRS)

func (FilterScaleNode) Kept added in v0.27.0

func (tnd FilterScaleNode) Kept(out *nodes.StructOutput[[]TRS])

func (FilterScaleNode) Removed added in v0.27.0

func (tnd FilterScaleNode) Removed(out *nodes.StructOutput[[]TRS])

type MultiplyArrayNode added in v0.23.0

type MultiplyArrayNode struct {
	A nodes.Output[[]TRS]
	B nodes.Output[[]TRS]
}

func (MultiplyArrayNode) Out added in v0.32.0

func (tnd MultiplyArrayNode) Out(out *nodes.StructOutput[[]TRS])

type MultiplyNode added in v0.23.0

type MultiplyNode struct {
	A nodes.Output[TRS]
	B nodes.Output[TRS]
}

func (MultiplyNode) Out added in v0.32.0

func (tnd MultiplyNode) Out(out *nodes.StructOutput[TRS])

type MultiplyToArrayNode added in v0.27.0

type MultiplyToArrayNode struct {
	Left  nodes.Output[TRS]
	Array nodes.Output[[]TRS]
	Right nodes.Output[TRS]
}

func (MultiplyToArrayNode) Description added in v0.32.0

func (n MultiplyToArrayNode) Description() string

func (MultiplyToArrayNode) Out added in v0.32.0

func (n MultiplyToArrayNode) Out(out *nodes.StructOutput[[]TRS])

type NewNode added in v0.22.2

type NewNode struct {
	Position nodes.Output[vector3.Float64]
	Rotation nodes.Output[quaternion.Quaternion]
	Scale    nodes.Output[vector3.Float64]
}

func (NewNode) Out added in v0.32.0

func (tnd NewNode) Out(out *nodes.StructOutput[TRS])

type RandomizeArrayNode added in v0.26.0

type RandomizeArrayNode struct {
	TranslationMinimum nodes.Output[vector3.Float64]
	TranslationMaximum nodes.Output[vector3.Float64]
	ScaleMinimum       nodes.Output[vector3.Float64]
	ScaleMaximum       nodes.Output[vector3.Float64]
	RotationMinimum    nodes.Output[vector3.Float64]
	RotationMaximum    nodes.Output[vector3.Float64]
	Array              nodes.Output[[]TRS]
}

func (RandomizeArrayNode) Out added in v0.32.0

func (tnd RandomizeArrayNode) Out(out *nodes.StructOutput[[]TRS])

type RotateDirectionNode added in v0.23.0

type RotateDirectionNode struct {
	TRS       nodes.Output[TRS]
	Direction nodes.Output[vector3.Float64]
}

func (RotateDirectionNode) Out added in v0.32.0

type RotateDirectionsNode added in v0.23.0

type RotateDirectionsNode struct {
	TRS       nodes.Output[[]TRS]
	Direction nodes.Output[[]vector3.Float64]
}

func (RotateDirectionsNode) Out added in v0.32.0

type SelectArrayNode added in v0.23.0

type SelectArrayNode struct {
	TRS nodes.Output[[]TRS]
}

func (SelectArrayNode) Position added in v0.32.0

func (tnd SelectArrayNode) Position(out *nodes.StructOutput[[]vector3.Float64])

func (SelectArrayNode) Rotation added in v0.32.0

func (tnd SelectArrayNode) Rotation(out *nodes.StructOutput[[]quaternion.Quaternion])

func (SelectArrayNode) Scale added in v0.32.0

func (tnd SelectArrayNode) Scale(out *nodes.StructOutput[[]vector3.Float64])

type SelectNode added in v0.23.0

type SelectNode struct {
	TRS nodes.Output[TRS]
}

func (SelectNode) Position added in v0.32.0

func (tnd SelectNode) Position(out *nodes.StructOutput[vector3.Float64])

func (SelectNode) Rotation added in v0.32.0

func (tnd SelectNode) Rotation(out *nodes.StructOutput[quaternion.Quaternion])

func (SelectNode) Scale added in v0.32.0

func (tnd SelectNode) Scale(out *nodes.StructOutput[vector3.Float64])

type TRS

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

func FromMatrix added in v0.22.2

func FromMatrix(m mat.Matrix4x4) TRS

func Identity added in v0.22.2

func Identity() TRS

func New

func New(position vector3.Float64, rotation quaternion.Quaternion, scale vector3.Float64) TRS

Create a new TRS

func Position

func Position(position vector3.Float64) TRS

Create a new TRS with a specified position, with a scale of (1, 1, 1) and a identity rotation

func Rotation

func Rotation(rotation quaternion.Quaternion) TRS

Create a new TRS with a specified rotation, a position of (0, 0, 0) and a scale of (1, 1, 1)

func Scale

func Scale(scale vector3.Float64) TRS

Create a new TRS with a specified scale, with a position of (0, 0, 0) and a identity rotation

func (TRS) Inverse added in v0.35.1

func (trs TRS) Inverse() TRS

func (TRS) LookAt added in v0.27.0

func (trs TRS) LookAt(positionToLookAt vector3.Float64) TRS

Look at returns a new TRS with it's rotation modified to be looking at the position provided

func (TRS) Matrix added in v0.22.2

func (trs TRS) Matrix() mat.Matrix4x4

func (TRS) Multiply added in v0.22.1

func (trs TRS) Multiply(other TRS) TRS

func (TRS) Position

func (trs TRS) Position() vector3.Float64

The position of the TRS

func (TRS) RotateDirection added in v0.23.0

func (trs TRS) RotateDirection(in vector3.Float64) vector3.Float64

func (TRS) Rotation

func (trs TRS) Rotation() quaternion.Quaternion

The rotation of the TRS

func (TRS) Scale

func (trs TRS) Scale() vector3.Float64

The scale of the TRS

func (TRS) SetRotation added in v0.25.0

func (trs TRS) SetRotation(in quaternion.Quaternion) TRS

func (TRS) SetScale added in v0.25.0

func (trs TRS) SetScale(in vector3.Float64) TRS

func (TRS) SetTranslation added in v0.25.0

func (trs TRS) SetTranslation(in vector3.Float64) TRS

func (TRS) Transform

func (trs TRS) Transform(in vector3.Float64) vector3.Float64

Transform a point by the TRS

func (TRS) TransformArray

func (trs TRS) TransformArray(in []vector3.Float64) []vector3.Float64

Transform an array of points by the TRS

func (TRS) TransformInPlace

func (trs TRS) TransformInPlace(in []vector3.Float64)

Transform an array of points by the TRS and store those changes in the array passed in

func (TRS) Translate

func (trs TRS) Translate(in vector3.Float64) TRS

Create a new TRS with the position translated by "in"

func (TRS) WithinDelta added in v0.26.0

func (trs TRS) WithinDelta(in TRS, delta float64) error

Checks if each of the components of this TRS is within delta of TRS passed in. If they aren't, an error is returned describing which component is out of range

type TransformArrayNode added in v0.26.0

type TransformArrayNode struct {
	Transform nodes.Output[TRS]
	Array     nodes.Output[[]TRS]
}

func (TransformArrayNode) Out added in v0.32.0

func (tnd TransformArrayNode) Out(out *nodes.StructOutput[[]TRS])

Jump to

Keyboard shortcuts

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