Init initializes the node. Normally called by other types which embed a Node.
(inode INode)
| 77 | // Init initializes the node. |
| 78 | // Normally called by other types which embed a Node. |
| 79 | func (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. |
| 104 | func (n *Node) GetINode() INode { |
no test coverage detected