예제 #1
0
class FlyCamera(DirectObject):
	enabled = False
	
	def __init__(self,camNode):
		self.camNode = camNode
		
		self.movement = Movement()
		self.rotation = Rotation(self.camNode, self.camNode)
		
	def isEnabled(self):
		return self.enabled
		
	def toggleEnabled(self):
		if self.isEnabled():
			self.disable()
		else:
			self.enable()
	
	def enable(self):
		self.movement.enable()
		self.rotation.enable()
		self.enabled = True
		base.camera.reparentTo( self.camNode )
	
	def disable(self):
		self.movement.disable()
		self.rotation.disable()
		self.enabled = False
		base.camera.reparentTo( render )
예제 #2
0
	def __init__(self,camNode):
		self.camNode = camNode
		
		self.movement = Movement()
		self.rotation = Rotation(self.camNode, self.camNode)