tiramisu/camera

Camera extension attributes and runtime integration.

Cameras are scene nodes, not renderer configuration. They can live anywhere in the scene hierarchy and inherit parent transforms like other objects.

A typical setup looks like this:

tiramisu.camera(
  "main-camera",
  [
    camera.active(True),
    camera.fov(60.0),
    transform.position(vec3.Vec3(0.0, 2.0, 6.0)),
  ],
  [],
)

Values

pub fn active(bool: Bool) -> attribute.Attribute(msg)

Mark a camera as active.

A scene should have at most one active camera.

If multiple cameras are marked active the runtime will still pick one, but that configuration is not considered part of the stable public API.

pub fn bottom(value: Float) -> attribute.Attribute(msg)

Set the bottom bound for orthographic cameras.

pub fn ext() -> extension.Extension

Build the internal extension used to reconcile camera nodes.

Most applications should not call this directly; use tiramisu.builtin_extensions() instead.

pub fn far(distance: Float) -> attribute.Attribute(msg)

Set the far clipping plane.

pub fn fov(degrees: Float) -> attribute.Attribute(msg)

Set the field of view for perspective cameras.

pub fn left(value: Float) -> attribute.Attribute(msg)

Set the left bound for orthographic cameras.

pub fn near(distance: Float) -> attribute.Attribute(msg)

Set the near clipping plane.

pub fn orthographic() -> attribute.Attribute(msg)
pub fn perspective() -> attribute.Attribute(msg)
pub fn right(value: Float) -> attribute.Attribute(msg)

Set the right bound for orthographic cameras.

pub const tag: String

The custom element tag used for camera nodes.

pub fn top(value: Float) -> attribute.Attribute(msg)

Set the top bound for orthographic cameras.

Search Document