class documentation

class Camera(engine.Camera):

Constructor: Camera(position, direction, plane, height, ...)

View In Hierarchy

Store camera parameters for 3D rendering.

Methods

  • set_position(position)
    Set the camera position.
  • set_direction(direction)
    Set the camera view direction.
  • set_plane(plane)
    Set the camera projection plane.
  • set_height(height)
    Set the camera height.
  • set_distance(distance)
    Set the camera projection distance.
  • set_perspective(perspective)
    Set the camera perspective mode.
  • position_set(x, y, z, integer)
    Set the camera position with individual components.
  • direction_set(x, y, z, integer)
    Set the camera view direction with individual components.
  • plane_set(x, y, z, integer)
    Set the camera projection plane with individual components.
  • __del__()
    Release the native camera resources.
Parameters
positionCamera position. Defaults to Vector(0, 0, 0).
directionView direction. Defaults to Vector(1, 0, 0).
planeCamera plane. Defaults to Vector(0, 0.66, 0).
heightCamera height. Defaults to 1.0.
distanceView distance. Defaults to 2.0.
perspectiveCamera perspective type. Defaults to CAMERA_FIRST_PERSON.
Method __init__ Initialize the Camera.
Method __setattr__ Set a camera attribute, routing to the matching setter.
Instance Variable CAMERA_FIRST_PERSON First-person camera perspective.
Instance Variable CAMERA_THIRD_PERSON Third-person camera perspective.
Instance Variable direction Camera view direction. Writable.
Instance Variable distance Distance to the projection plane. Writable.
Instance Variable height Camera height above the ground. Writable.
Instance Variable perspective Camera perspective mode. Writable.
Instance Variable plane Camera plane used for projection. Writable.
Instance Variable position World-space camera position. Writable.
def __init__(self, position=Vector(0, 0, 0), direction=Vector(1, 0, 0), plane=Vector(0, 0.66, 0), height=1.0, distance=2.0, perspective=CAMERA_FIRST_PERSON):

Initialize the Camera.

Override so users can pick the perspective.

Parameters
position:VectorCamera position. Defaults to Vector(0, 0, 0).
direction:VectorView direction. Defaults to Vector(1, 0, 0).
plane:VectorCamera plane. Defaults to Vector(0, 0.66, 0).
height:floatCamera height. Defaults to 1.0.
distance:floatView distance. Defaults to 2.0.
perspective:intCamera perspective type. Defaults to CAMERA_FIRST_PERSON.
def __setattr__(self, name, value):

Set a camera attribute, routing to the matching setter.

Parameters
name:strAttribute name to set.
value:objectNew value for the attribute.
CAMERA_FIRST_PERSON: int =

First-person camera perspective.

CAMERA_THIRD_PERSON: int =

Third-person camera perspective.

direction: Vector =

Camera view direction. Writable.

distance: float =

Distance to the projection plane. Writable.

height: float =

Camera height above the ground. Writable.

perspective: int =

Camera perspective mode. Writable.

plane: Vector =

Camera plane used for projection. Writable.

position: Vector =

World-space camera position. Writable.