Scene

package
v0.0.0-...-9749107 Latest Latest
Warning

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

Go to latest
Published: May 4, 2020 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NodeFactoryName = "Scene.Node"
)

Variables

View Source
var (
	NodeFactory = nodeFactory{}
)

Functions

func AddChild

func AddChild(parent INode, child INode, childID string)

func UnmarshalChildren

func UnmarshalChildren(value *yaml.Node, node INode) error

Types

type Event

type Event struct {
	Listeners []chan IEventArgs
}

func (*Event) DeregisterListener

func (event *Event) DeregisterListener(listener chan IEventArgs)

func (*Event) NotifyListeners

func (event *Event) NotifyListeners(eventArgs IEventArgs)

func (*Event) RegisterListener

func (event *Event) RegisterListener(listener chan IEventArgs)

type IEvent

type IEvent interface {
	RegisterListener(listener chan IEventArgs)
	DeregisterListener(listener chan IEventArgs)
	NotifyListeners(eventArgs IEventArgs)
}

type IEventArgs

type IEventArgs interface {
}

type INode

type INode interface {
	AddChild(child INode, id string)
	GetChildren() map[string]INode
	GetGrandChildById(id string) INode

	SetID(id string)
	GetID() string

	GetParent() INode
	SetParent(parent INode, childID string)

	GetScene() *Scene
	SetScene(*Scene)

	GetLocalTransformation() GeometryMath.Matrix4x4
	SetLocalTransformation(GeometryMath.Matrix4x4)

	GetLocalRotation() []GeometryMath.EulerAngles
	GetLocalPosition() GeometryMath.Vector3

	GetGlobalTransformation() GeometryMath.Matrix4x4

	GetGlobalRotation() []GeometryMath.EulerAngles
	GetGlobalPosition() GeometryMath.Vector3

	Tick(timeDelta float32) error
	GetBase() INode
	Start() error

	AddEvent(event IEvent, id string)
	GetEventByID(id string) IEvent
}

type ISubNode

type ISubNode interface {
	INode
	SetBase(node INode)
}

type Node

type Node struct {
	Transformation GeometryMath.Matrix4x4
	// contains filtered or unexported fields
}

func (*Node) AddChild

func (node *Node) AddChild(child INode, id string)

func (*Node) AddEvent

func (node *Node) AddEvent(event IEvent, id string)

func (*Node) GetBase

func (node *Node) GetBase() INode

func (*Node) GetChildren

func (node *Node) GetChildren() map[string]INode

func (*Node) GetEventByID

func (node *Node) GetEventByID(id string) IEvent

func (*Node) GetGlobalPosition

func (node *Node) GetGlobalPosition() GeometryMath.Vector3

func (*Node) GetGlobalRotation

func (node *Node) GetGlobalRotation() []GeometryMath.EulerAngles

func (*Node) GetGlobalTransformation

func (node *Node) GetGlobalTransformation() GeometryMath.Matrix4x4

func (*Node) GetGrandChildById

func (node *Node) GetGrandChildById(id string) INode

func (*Node) GetID

func (node *Node) GetID() string

func (*Node) GetLocalPosition

func (node *Node) GetLocalPosition() GeometryMath.Vector3

func (*Node) GetLocalRotation

func (node *Node) GetLocalRotation() []GeometryMath.EulerAngles

func (*Node) GetLocalTransformation

func (node *Node) GetLocalTransformation() GeometryMath.Matrix4x4

func (*Node) GetParent

func (node *Node) GetParent() INode

func (*Node) GetScene

func (node *Node) GetScene() *Scene

func (*Node) SetID

func (node *Node) SetID(id string)

func (*Node) SetLocalTransformation

func (node *Node) SetLocalTransformation(matrix GeometryMath.Matrix4x4)

func (*Node) SetParent

func (node *Node) SetParent(parent INode, childID string)

func (*Node) SetScene

func (node *Node) SetScene(scene *Scene)

func (*Node) Start

func (node *Node) Start() error

func (*Node) Tick

func (node *Node) Tick(timeDelta float32) error

func (*Node) UnmarshalYAML

func (node *Node) UnmarshalYAML(value *yaml.Node) error

type Scene

type Scene struct {
	coreScene.SceneBase
	Root INode
}

func (*Scene) SetRoot

func (scene *Scene) SetRoot(node INode)

func (*Scene) Start

func (scene *Scene) Start() error

func (*Scene) Tick

func (scene *Scene) Tick(timeDelta float32)

func (*Scene) UnmarshalYAML

func (scene *Scene) UnmarshalYAML(value *yaml.Node) error

Jump to

Keyboard shortcuts

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