alias_api.AlPerspectiveCamera
- class alias_api.AlPerspectiveCamera
Bases:
AlCamera,AlPickableEncapsulates creation, deletion and manipulation of perspective cameras
This class encapsulates all the functionality for creating, deleting and manipulating a perspective camera. The user cannot create, delete or manipulate orthographic cameras.
A camera is made of 4 parts - an AlPerspectiveCamera object and 3 attached AlCameraNodes which represent eye, view and up position of the camera. These camera nodes are members of the universe’s dag structure.
The view direction vector is the vector between the eye position and the view position. The up direction vector is the vector between the eye position and the up position. There are methods to get these positions and to access the attached camera nodes.
To create a perspective camera, the user must instantiate and call the create method on an AlPerspectiveCamera object. This creates the necessary eye, view and up AlCameraNodes, groups them under an AlGroupNode and inserts the group into the universe’s dag structure. The user cannot instantiate an AlCameraNode directly.
When a camera is created, if the coordinate system is specified as kZUp (when initializing the universe) the camera’s default eye, view and up positions are respectively (0.0, -12.0, 0.0), (0.0, 0.0, 0.0), (0.0, -12.0, 1.0). If the coordinate system is specified as kYUp, then eye, view and up positions are (0.0, 0.0, 12.0), (0.0, 0.0, 0.0), (0.0, 1.0, 12.0).
There are two ways to delete a camera object. When the deleteObejct() method of an AlPerspectiveCamera object is called, its three camera nodes are deleted. Alternatively, when a camera node is deleted, its associated camera (and other camera nodes) are deleted. The group node that originally grouped the eye, view and up nodes is not deleted.
- property angle_of_view
Get or set the angle of view of the camera.
- copy_wrapper(self: alias_api.AlPerspectiveCamera) alias_api.AlObject
Return an exact duplicate of this AlPerspectiveCamera wrapper.
- create(self: alias_api.AlPerspectiveCamera) int
Creates a camera and all associated eye, view, and up camera nodes and attaches them to the camera.
- delete_object(self: alias_api.AlPerspectiveCamera) int
Delete the AlPerspectiveCamera from the Alias Universe.
- eye(self: alias_api.AlPerspectiveCamera) AlCameraNode
Return the eye node object attached to the camera.
- property focus_length
Get or set the focus length of the camera.
- property name
Get or set the AlPerspectiveCamera name.
- set_world_eye(*args, **kwargs)
Overloaded function.
set_world_eye(self: alias_api.AlPerspectiveCamera, p: alPyMath::Vec3) -> int
Set the world eye position and return the status code result of the operation.
set_world_eye(self: alias_api.AlPerspectiveCamera, x: typing.SupportsFloat, y: typing.SupportsFloat, z: typing.SupportsFloat) -> int
Sets the camera’s world eye position to be x,y, & z in world space. The value will be set in the camera’s eye node.
- param x
The new world eye position along the x axis.
- type x
float
- param y
The new world eye position along the y axis.
- type y
float
- param z
The new world eye position along the z axis.
- type z
float
- return
The status code result: Success - the position was successfully set InvalidObject - the camera is not valid.
- rtype
int(StatusCode)
- set_world_up(*args, **kwargs)
Overloaded function.
set_world_up(self: alias_api.AlPerspectiveCamera, p: alPyMath::Vec3) -> int
Set the world up position and return the status code result of the operation.
- param p
A vec3 containing the new world up position.
- return
The status code result: Success - the position was successfully set InvalidObject - the camera is not valid.
- rtype
int(StatusCode)
set_world_up(self: alias_api.AlPerspectiveCamera, x: typing.SupportsFloat, y: typing.SupportsFloat, z: typing.SupportsFloat) -> int
Sets the camera’s world up position to be x,y, & z in world space. The value will be set in the camera’s up node.
- param x
The new world up position along the x axis.
- type x
float
- param y
The new world up position along the y axis.
- type y
float
- param z
The new world up position along the z axis.
- type z
float
- return
The status code result: Success - the position was successfully set InvalidObject - the camera is not valid.
- rtype
int(StatusCode)
- set_world_view(*args, **kwargs)
Overloaded function.
set_world_view(self: alias_api.AlPerspectiveCamera, p: alPyMath::Vec3) -> int
Set the world view position and return the status code result of the operation.
set_world_view(self: alias_api.AlPerspectiveCamera, x: typing.SupportsFloat, y: typing.SupportsFloat, z: typing.SupportsFloat) -> int
Sets the camera’s world view position to be x,y, & z in world space. The value will be set in the camera’s view node.
- param x
The new world view position along the x axis.
- type x
float
- param y
The new world view position along the y axis.
- type y
float
- param z
The new world view position along the z axis.
- type z
float
- return
The status code result: Success - the position was successfully set InvalidObject - the camera is not valid.
- rtype
int(StatusCode)
- type(self: alias_api.AlPerspectiveCamera) alias_api.AlObjectType
Return the AlPerspectiveCamera type identifier.
- up(self: alias_api.AlPerspectiveCamera) AlCameraNode
Return the up node object attached to the camera.
- view(self: alias_api.AlPerspectiveCamera) AlCameraNode
Return the view node object attached to the camera.
- world_eye(self: alias_api.AlPerspectiveCamera) tuple[int, float, float, float]
Find the world coordinates of the camera’s eye location.
- Returns
A tuple (status, x, y, z), where status [AlStatusCode] - the status code result
Success - the coordinates was found InvalidObject - the point is not valid
x [float] - the x world coordinate of the eye position y [float] - the y world coordinate of the eye position z [float] - the z world coordinate of the eye position
- Return type
tuple
- world_up(self: alias_api.AlPerspectiveCamera) tuple[int, float, float, float]
Find the world coordinates of the camera’s up location.
- Returns
A tuple (status, x, y, z), where status [AlStatusCode] - the status code result
Success - the coordinates was found InvalidObject - the point is not valid
x [float] - the x world coordinate of the up position y [float] - the y world coordinate of the up position z [float] - the z world coordinate of the up position
- Return type
tuple
- world_view(self: alias_api.AlPerspectiveCamera) tuple[int, float, float, float]
Find the world coordinates of the camera’s view location.
- Returns
A tuple (status, x, y, z), where status [AlStatusCode] - the status code result
Success - the coordinates was found InvalidObject - the point is not valid
x [float] - the x world coordinate of the view position y [float] - the y world coordinate of the view position z [float] - the z world coordinate of the view position
- Return type
tuple