Example #1
0
func (me *Camera) initNodeCamData(all SceneNodeLib, nodeID int) {
	me.ensureProjMats(len(all))
	me.thrPrep.nodeProjMats[nodeID].Identity()
	uslice.BoolEnsureLen(&me.thrPrep.nodeRender, len(all))
	uslice.BoolEnsureLen(&me.thrRend.nodeRender, len(all))
	me.thrPrep.nodeRender[nodeID] = false
	me.thrRend.nodeRender[nodeID] = false
}
Example #2
0
func (me *Camera) SetScene(sceneID int) {
	if sceneID != me.sceneID {
		me.sceneID = sceneID
		if scene := me.Scene(); scene != nil {
			cap := len(scene.allNodes)
			me.ensureProjMats(cap)
			uslice.BoolEnsureLen(&me.thrPrep.nodeRender, cap)
			uslice.BoolEnsureLen(&me.thrRend.nodeRender, cap)
			for i := 0; i < len(scene.allNodes); i++ {
				if scene.allNodes.Ok(i) {
					me.initNodeCamData(scene.allNodes, i)
				}
			}
		}
	}
}