transform

package
v0.0.0-...-ed1452e Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2016 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RotateVect

func RotateVect(v vect.Vect, r Rotation) vect.Vect

func RotateVectInv

func RotateVectInv(v vect.Vect, r Rotation) vect.Vect

func RotateVectPtr

func RotateVectPtr(v *vect.Vect, r *Rotation) vect.Vect

Types

type Rotation

type Rotation struct {
	//sine and cosine.
	C, S vect.Float
}

func NewRotation

func NewRotation(angle vect.Float) Rotation

func (*Rotation) Angle

func (rot *Rotation) Angle() vect.Float

func (*Rotation) RotateVect

func (rot *Rotation) RotateVect(v vect.Vect) vect.Vect

rotates the input vector.

func (*Rotation) RotateVectInv

func (rot *Rotation) RotateVectInv(v vect.Vect) vect.Vect

func (*Rotation) RotateVectPtr

func (rot *Rotation) RotateVectPtr(v *vect.Vect) vect.Vect

rotates the input vector.

func (*Rotation) SetAngle

func (rot *Rotation) SetAngle(angle vect.Float)

func (*Rotation) SetIdentity

func (rot *Rotation) SetIdentity()

type Transform

type Transform struct {
	Position vect.Vect
	Rotation
}

func NewTransform

func NewTransform(pos vect.Vect, angle vect.Float) Transform

func NewTransform2

func NewTransform2(pos vect.Vect, rot vect.Vect) Transform

func (Transform) MarshalJSON

func (xf Transform) MarshalJSON() ([]byte, error)

func (*Transform) Set

func (xf *Transform) Set(pos vect.Vect, rot vect.Float)

func (*Transform) SetIdentity

func (xf *Transform) SetIdentity()

func (*Transform) TransformVect

func (xf *Transform) TransformVect(v vect.Vect) vect.Vect

moves and roates the input vector.

func (*Transform) TransformVectInv

func (xf *Transform) TransformVectInv(v vect.Vect) vect.Vect

func (*Transform) UnmarshalJSON

func (xf *Transform) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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