transform

package
v0.0.0-...-8e5a076 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2024 License: GPL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Matrix

func Matrix(position vec3.T, rotation quat.T, scale vec3.T) mat4.T

Types

type T

type T interface {
	Forward() vec3.T
	Right() vec3.T
	Up() vec3.T

	Position() vec3.T
	SetPosition(vec3.T)

	Rotation() quat.T
	SetRotation(quat.T)

	Scale() vec3.T
	SetScale(vec3.T)

	Matrix() mat4.T

	ProjectDir(dir vec3.T) vec3.T

	// Project local coordinates to world coordinates
	Project(point vec3.T) vec3.T

	// Unproject world coordinates to local coordinates
	Unproject(point vec3.T) vec3.T

	UnprojectDir(dir vec3.T) vec3.T

	WorldPosition() vec3.T
	SetWorldPosition(vec3.T)

	WorldScale() vec3.T
	SetWorldScale(vec3.T)

	WorldRotation() quat.T
	SetWorldRotation(quat.T)

	Parent() T
	SetParent(T)
	OnChange() *events.Event[T]
}

func Identity

func Identity() T

Identity returns a new transform that does nothing.

func New

func New(position vec3.T, rotation quat.T, scale vec3.T) T

NewTransform creates a new 3D transform

Jump to

Keyboard shortcuts

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