Documentation ¶
Overview ¶
Package scenemanager implements a basic location manager that satisfies the component.SceneManager interface.
Index ¶
- type TransformManager
- func (tm *TransformManager) CreateComponent(index component.GOiD) error
- func (tm *TransformManager) DeleteComponent(index component.GOiD)
- func (tm *TransformManager) GetMatrixList() []math.Mat4x4
- func (tm *TransformManager) GetObjectLocation(index component.GOiD) (math.Vec3, error)
- func (tm *TransformManager) GetObjectsInLocationRadius(loc math.Vec3, lookRange float32) *common.Queue
- func (tm *TransformManager) GetTransform4m(index component.GOiD) (math.Mat4x4, error)
- func (tm *TransformManager) GetTransformMatrix(index component.GOiD) (math.Mat4x4, error)
- func (tm *TransformManager) SetLocation(index component.GOiD, newLocation math.Vec3)
- func (tm *TransformManager) SetLocationOverTime(id component.GOiD, newLocation math.Vec3, timeToMove float64) error
- func (tm *TransformManager) SetTransform(index component.GOiD, newLocalMat math.Mat4x4)
- func (tm *TransformManager) Tick(delta float64)
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 ¶
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 ¶
GetTransform4m implements the component.SceneManager interface and returns a matrix of the location of an object.
func (*TransformManager) GetTransformMatrix ¶
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.