MCPcopy
hub / github.com/g3n/engine / Init

Method Init

core/node.go:79–101  ·  view source on GitHub ↗

Init initializes the node. Normally called by other types which embed a Node.

(inode INode)

Source from the content-addressed store, hash-verified

77// Init initializes the node.
78// Normally called by other types which embed a Node.
79func (n *Node) Init(inode INode) {
80
81 n.Dispatcher.Initialize()
82 n.inode = inode
83 n.children = make([]INode, 0)
84 n.visible = true
85
86 // Initialize spatial properties
87 n.position.Set(0, 0, 0)
88 n.scale.Set(1, 1, 1)
89 n.direction.Set(0, 0, 1)
90 n.rotation.Set(0, 0, 0)
91 n.quaternion.Set(0, 0, 0, 1)
92 n.matrix.Identity()
93 n.matrixWorld.Identity()
94
95 // Subscribe to events
96 n.Subscribe(OnDescendant, func(evname string, ev interface{}) {
97 if n.parent != nil {
98 n.parent.Dispatch(evname, ev)
99 }
100 })
101}
102
103// GetINode returns the INode associated with this Node.
104func (n *Node) GetINode() INode {

Callers 12

NewPerspectiveFunction · 0.45
NewOrthographicFunction · 0.45
InitFunction · 0.45
NewNodeFunction · 0.45
newTexture2DFunction · 0.45
SetUniformNamesMethod · 0.45
NewPlayerFunction · 0.45
NewListenerFunction · 0.45
NewListenerFunction · 0.45
NewGridFunction · 0.45
NewNormalsFunction · 0.45
NewAxesFunction · 0.45

Calls 5

SubscribeMethod · 0.65
DispatchMethod · 0.65
InitializeMethod · 0.45
SetMethod · 0.45
IdentityMethod · 0.45

Tested by

no test coverage detected