def __init__(self, origin: Point3D, lookAt: Point3D, up: Point3D,
              backgroundColor: Vector, raysPerPixel: int, focusPoint: float,
              fov: float):
     Camera.__init__(self, origin, lookAt, up, backgroundColor,
                     raysPerPixel)
     self.focusPoint = focusPoint
     self.fov = fov
Beispiel #2
0
    def __init__(self, physic_world, config=None):
        logging.info("INIT PLAYER...")
        logging.info("INIT FSM...")
        FSM.__init__(self, "FSM-Player")
        logging.info("INIT CONFIG...")
        Config.__init__(self)
        # additional initial configuration settings set by the outher application
        self.physic_world = physic_world
        logging.info("INIT PHYSICS...")
        Physics.__init__(self)
        logging.info("INIT CONTROLS...")
        Control.__init__(self)
        logging.info("INIT CAMERA...")
        Camera.__init__(self, self.cam_near_clip, self.cam_far_clip,
                        self.cam_fov)
        logging.info("INIT ANIMATOR...")
        Animator.__init__(self)
        logging.info("INIT PLAYER DONE")

        #
        # STATES SETUP
        #
        self.on_ground_states = [
            self.STATE_IDLE, self.STATE_IDLE_TO_WALK, self.STATE_WALK,
            self.STATE_WALK_TO_IDLE, self.STATE_PLANT
        ]
        # set the possible transition in the FSM
        self.defaultTransitions = {
            self.STATE_IDLE: [self.STATE_IDLE_TO_WALK, self.STATE_PLANT],
            self.STATE_IDLE_TO_WALK: [self.STATE_IDLE, self.STATE_WALK],
            self.STATE_WALK: [self.STATE_IDLE, self.STATE_WALK_TO_IDLE],
            self.STATE_WALK_TO_IDLE: [self.STATE_IDLE, self.STATE_WALK],
            self.STATE_PLANT: [self.STATE_IDLE],
        }

        #
        # ACTOR SETUP
        #
        Actor.__init__(
            self, self.model, {
                self.IDLE: self.anim_idle,
                self.WALK: self.anim_walk,
                self.PLANT: self.anim_plant,
            })
        self.setBlend(frameBlend=self.enable_interpolation)

        alphaSettings = ColorBlendAttrib.make(ColorBlendAttrib.MAdd,
                                              ColorBlendAttrib.OIncomingAlpha,
                                              ColorBlendAttrib.OOne,
                                              (0, 0, 0, 0))
        #self.setAttrib(alphaSettings)
        self.setBin("fixed", 15)
        self.setDepthWrite(False)

        #
        # CONTROLS SETUP
        #
        self.isDown = base.mouseWatcherNode.isButtonDown
        self.mainNode = self
Beispiel #3
0
 def __init__(self, *args, **kwargs):
     self.params = {
         'sync': self.sync,
         'calibrate': self.calibrate,
         'max_raw': self.max_raw,
         'min_raw': self.min_raw,
         'auto_gain_hi': self.auto_gain_hi,
         'auto_gain_low': self.auto_gain_low,
         'bit_depth': self.bit_depth,
         'delay': self.delay
     }
     kwargs['y_length'] = Y_LENGTH_IMAGE
     kwargs['x_length'] = X_LENGTH_IMAGE
     Camera.__init__(self, *args, **kwargs)
Beispiel #4
0
    def __init__(self, physic_world, config=None):
        logging.info("INIT PLAYER...")
        logging.info("INIT FSM...")
        FSM.__init__(self, "FSM-Player")
        logging.info("INIT CONFIG...")
        Config.__init__(self)
        # additional initial configuration settings set by the outher application
        self.physic_world = physic_world
        logging.info("INIT PHYSICS...")
        Physics.__init__(self)
        logging.info("INIT CONTROLS...")
        Control.__init__(self)
        logging.info("INIT CAMERA...")
        Camera.__init__(
            self,
            self.cam_near_clip,
            self.cam_far_clip,
            self.cam_fov)
        logging.info("INIT ANIMATOR...")
        Animator.__init__(self)
        logging.info("INIT PLAYER DONE")

        #
        # STATES SETUP
        #
        self.on_ground_states = [
            self.STATE_IDLE,
            self.STATE_IDLE_TO_WALK,
            self.STATE_WALK,
            self.STATE_WALK_TO_IDLE,
            self.STATE_PLANT]
        # set the possible transition in the FSM
        self.defaultTransitions = {
            self.STATE_IDLE: [self.STATE_IDLE_TO_WALK, self.STATE_PLANT],
            self.STATE_IDLE_TO_WALK: [self.STATE_IDLE, self.STATE_WALK],
            self.STATE_WALK: [self.STATE_IDLE, self.STATE_WALK_TO_IDLE],
            self.STATE_WALK_TO_IDLE: [self.STATE_IDLE, self.STATE_WALK],
            self.STATE_PLANT: [self.STATE_IDLE],
            }

        #
        # ACTOR SETUP
        #
        Actor.__init__(
            self,
            self.model,
            {
                self.IDLE: self.anim_idle,
                self.WALK: self.anim_walk,
                self.PLANT: self.anim_plant,
            })
        self.setBlend(frameBlend=self.enable_interpolation)

        alphaSettings = ColorBlendAttrib.make(
            ColorBlendAttrib.MAdd,
            ColorBlendAttrib.OIncomingAlpha,
            ColorBlendAttrib.OOne,
            (0, 0, 0, 0))
        #self.setAttrib(alphaSettings)
        self.setBin("fixed", 15)
        self.setDepthWrite(False)

        #
        # CONTROLS SETUP
        #
        self.isDown = base.mouseWatcherNode.isButtonDown
        self.mainNode = self
Beispiel #5
0
 def __init__(self, w, h, limit_x, limit_y):
     Camera.__init__(self, w, h)
     self.x_speed = 3
     self.y_speed = 3
     self.limit_x = limit_x
     self.limit_y = limit_y
Beispiel #6
0
 def __init__(self, origin: Point3D, lookAt: Point3D, up: Point3D,
              fov: float):
     Camera.__init__(self, origin, lookAt, up)
     self.fov = fov
Beispiel #7
0
 def __init__(self, *args, **kwargs):
     kwargs['y_length'] = Y_LENGTH
     kwargs['x_length'] = X_LENGTH
     Camera.__init__(self, *args, **kwargs)
     self.x_lim = X_LENGTH
 def __init__(self, origin:Point3D, lookAt:Point3D, up:Point3D, backgroundColor:Vector, halfWidth:float, halfHeight:float):
     Camera.__init__(self, origin, lookAt, up, backgroundColor)
     self.halfWidth = halfWidth
     self.halfHeight = halfHeight
Beispiel #9
0
 def __init__(self, origin: Point3D, lookAt: Point3D, up: Point3D,
              halfWidth: float, halfHeight: float):
     Camera.__init__(self, origin, lookAt, up)
     self.halfWidth = halfWidth
     self.halfHeight = halfHeight
 def __init__(self, origin: Point3D, lookAt: Point3D, up: Point3D,
              backgroundColor: Vector, fov: float):
     Camera.__init__(self, origin, lookAt, up, backgroundColor)
     self.fov = fov