peng3d.camera - Camera System¶
-
class
peng3d.camera.Camera(world, name, pos=None, rot=None)[source]¶ Camera object representing a location to draw from.
Each
Cameraobject is bound to a world and has three properties: a name,posandrot.The name of the camera can be any string and is used to identify the camera and thus should be unique.
-
on_activate(old)[source]¶ Fake event handler called when this camera is made current by a
WorldView()object.
-
on_move(old, new)[source]¶ Fake event handler called when this camera moves.
The
oldandnewparameters are both 3D Locations and are not equal. Each parameter is a 3-tuple of(x,y,z)in world coordinates.
-
on_rotate(old, new)[source]¶ Fake event handler called when this camera is rotated.
The
oldandnewparameters are both rotations and are not equal. Each parameter is a 2-tuple of(yaw,pitch).
-
pos¶ Property for accessing the position of the camera.
This property uses a setter to call the
on_move()method if set and the new location is not equal to the old location.
-
rot¶ Property for accessing the rotation of the camera.
This property uses a setter to call the
on_rotate()method if set and the new location is not equal to the old location.
-
-
class
peng3d.camera.CameraActorFollower(world, name, actor)[source]¶ Special Camera that follows the specified
Actor().Note that neither the
on_move()nor theon_rotate()event handlers are called due to the way the updating works.-
pos¶ This property always equals the value of
self.actor.pos.This property may also be written to.
-
rot¶ This property always equals the value of
self.actor.rot.This property may also be written to.
-