scenemanager

package
v0.0.0-...-eb9c356 Latest Latest
Warning

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

Go to latest
Published: May 21, 2018 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package scenemanager implements a basic location manager that satisfies the component.SceneManager interface.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TransformManager

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

TransformManager implements a basic location manager that satisfies the component.SceneManager interface

func MakeTransformManager

func MakeTransformManager(em *event.EventManager) *TransformManager

MakeTransformManager returns a pointer to a TransformManager

func (*TransformManager) CreateComponent

func (tm *TransformManager) CreateComponent(index component.GOiD) error

CreateComponent is used to initialize a matrix to store the location of a transform component.

func (*TransformManager) DeleteComponent

func (tm *TransformManager) DeleteComponent(index component.GOiD)

DeleteComponent implements the component.ComponentManager interface and deletes character component data from the manager.

func (*TransformManager) GetMatrixList

func (tm *TransformManager) GetMatrixList() []math.Mat4x4

GetMatrixList returns the internal list of location matrices used by the TransformManager.

func (*TransformManager) GetObjectLocation

func (tm *TransformManager) GetObjectLocation(index component.GOiD) (math.Vec3, error)

GetObjectLocation returns the location of an object in a 3 dimensional vector.

func (*TransformManager) GetObjectsInLocationRadius

func (tm *TransformManager) GetObjectsInLocationRadius(loc math.Vec3, lookRange float32) *common.Queue

GetObjectsInLocationRadius returns a list of GOiD's within a radius around a location.

func (*TransformManager) GetTransform4m

func (tm *TransformManager) GetTransform4m(index component.GOiD) (math.Mat4x4, error)

GetTransform4m implements the component.SceneManager interface and returns a matrix of the location of an object.

func (*TransformManager) GetTransformMatrix

func (tm *TransformManager) GetTransformMatrix(index component.GOiD) (math.Mat4x4, error)

GetTransformMatrix returns a matrix of the location of an object.

func (*TransformManager) SetLocation

func (tm *TransformManager) SetLocation(index component.GOiD, newLocation math.Vec3)

SetLocation is used to set the location of a transform component using a 3 dimensional vector.

func (*TransformManager) SetLocationOverTime

func (tm *TransformManager) SetLocationOverTime(id component.GOiD, newLocation math.Vec3, timeToMove float64) error

SetLocationOverTime is used to set the location of a transform component using a 3 dimensional vector. This function will update the location interpolated across the timespan specified.

func (*TransformManager) SetTransform

func (tm *TransformManager) SetTransform(index component.GOiD, newLocalMat math.Mat4x4)

SetTransform is used to set the location of a transform component using a new matrix.

func (*TransformManager) Tick

func (tm *TransformManager) Tick(delta float64)

Tick is used to update the locations of components moving using the SetLocationOverTime function and execute a basic collision detection and resolution algorithm.

Jump to

Keyboard shortcuts

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