CameraUnreal

Inheritance diagram of CameraUnreal

Inheritance diagram


class xrfeitoria.camera.camera_unreal.CameraUnreal(name: str)[source]

Camera class for Unreal.

__init__(name: str) None
Parameters:

name (str) – name of the object

delete()

Delete the object from the world.

dump_params(output_path: str | Path) None

Dump the intrinsic and extrinsic parameters of the camera to a file.

Parameters:

output_path (PathLike) – path to the camera parameter file

get_KRT() Tuple[List, List, Tuple[float, float, float]]

Get the intrinsic and extrinsic parameters of the camera.

Returns:

Tuple[Matrix, Matrix, Vector] – K, R, T

get_transform() Tuple[List, List, List]

Get the transform of the object in the world.

Returns:

Transform – location, rotation, scale

look_at(target: Tuple[float, float, float]) None[source]

Set the camera to look at the target.

Parameters:

target (Vector) – [x, y, z] coordinates of the target, in units of meters.

set_KRT(K: List, R: List, T: Tuple[float, float, float]) None

Set the intrinsic and extrinsic parameters of the camera.

Parameters:
  • K (Matrix) – 3x3 intrinsic matrix

  • R (Matrix) – 3x3 rotation matrix

  • T (Vector) – 3x1 translation vector

set_transform(location: Tuple[float, float, float], rotation: Tuple[float, float, float], scale: Tuple[float, float, float]) None

Set the transform of the object in the world.

Parameters:
  • location (Tuple[float, float, float]) – in meters

  • rotation (Tuple[float, float, float]) – in degrees

  • scale (Tuple[float, float, float]) – no units, 1.0 is default

classmethod spawn(camera_name: str | None = None, location: Tuple[float, float, float] = (0, 0, 0), rotation: Tuple[float, float, float] = (0, 0, 0), fov: float = 90.0) CameraBase

Spawn a camera in the engine.

Parameters:
  • name (str, optional) – name of the camera

  • location (Vector, optional) – location of the camera. Defaults to (0, 0, 0).

  • rotation (Vector, optional) – rotation of the camera. Defaults to (0, 0, 0).

  • fov (float, optional) – field of view of the camera. Defaults to 90.0.

Returns:

CameraBase – New camera

property aspect_ratio: float

Aspect of ratio, Width / Height.

property fov: float

Field of view of the camera lens, in degrees.

property location: Tuple[float, float, float]

Location of the object in the world, in meters.

property name: str

Name of the object.

property rotation: Tuple[float, float, float]

Rotation of the object in the world, in degrees.

property scale: Tuple[float, float, float]

Scale of the object in the world, no units, 1.0 is default.