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 )
def __init__(self,camNode): self.camNode = camNode self.movement = Movement() self.rotation = Rotation(self.camNode, self.camNode)