transform

package
v0.0.0-...-c5d59ff Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Component

type Component = Transform // Component is an alias to Transform

type ComponentFactory

type ComponentFactory struct {
	*akara.ComponentFactory
}

ComponentFactory is a wrapper for the generic component factory.

func (*ComponentFactory) Add

func (concrete *ComponentFactory) Add(id akara.EID) *Transform

Add adds a Transform component to the given entity and returns it

func (*ComponentFactory) ExportToLua

func (concrete *ComponentFactory) ExportToLua(state *lua.LState, table *lua.LTable) *lua.LTable

ExportToLua exports the factory to a lua table using the given lua state machine and lua table

func (*ComponentFactory) Get

func (concrete *ComponentFactory) Get(id akara.EID) (*Transform, bool)

Get returns the Transform component for the given entity, and a bool for whether or not it exists

type Transform

type Transform struct {
	Translation, Rotation, Scale *mathlib.Vector3
}

Transform is a component that contains a matrix4 that expresses translation, rotation, and scale.

func (*Transform) ExportToLua

func (component *Transform) ExportToLua(state *lua.LState, table *lua.LTable) *lua.LTable

ExportToLua exports the component into the given table, using the given lua state machine.

func (*Transform) GetMatrix

func (component *Transform) GetMatrix() *mathlib.Matrix4

GetMatrix returns a matrix4, composed from the translation, rotation, and scale of this transform

func (*Transform) New

func (*Transform) New() akara.Component

New creates a new alpha component instance. The default alpha is opaque with value 1.0

Jump to

Keyboard shortcuts

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