Example #1
0
func NewInput(queue input.InputQueue, entityDB *core.EntityDB) *Input {
	input := new(Input)
	input.inputQueue = queue
	input.entitySet = entityDB.RegisterListener(input, components.INPUT)

	return input
}
Example #2
0
func NewGraphical(renderer render.Renderer, entityDB *core.EntityDB) *Graphical {
	obj := Graphical{}
	obj.renderer = renderer
	obj.entitySet = entityDB.RegisterListener(&obj, components.TRANSFORM, components.VISUAL)

	obj.materialLoader = render.NewMaterialLoader()

	obj.meshes = make(MeshMap)

	obj.LoadMesh(render.DefaultMesh)
	obj.LoadMaterial(render.DefaultMaterial)

	return &obj
}
Example #3
0
func NewAnimation(entityDB *core.EntityDB) *Animation {
	animation := new(Animation)
	animation.entitySet = entityDB.RegisterListener(animation, components.ANIMATION)
	return animation
}
Example #4
0
func NewTransform(entityDB *core.EntityDB) *Transform {
	transform := new(Transform)
	transform.entitySet = entityDB.RegisterListener(transform, components.TRANSFORM)
	return transform
}