pub struct Camera {
pub x: f32,
pub y: f32,
pub zoom: f32,
pub rotation: f32,
pub origin: Option<CameraOrigin>,
pub focus: f32,
pub aperture: f32,
pub rotate_x: f32,
pub rotate_y: f32,
pub perspective: f32,
pub keyframes: Vec<CameraKeyframe>,
pub motion_blur: Option<CameraMotionBlurConfig>,
}Expand description
Virtual camera for pan/zoom/rotation effects at the scene level.
Fields§
§x: f32Camera center X offset from scene center (pixels). Default: 0.
y: f32Camera center Y offset from scene center (pixels). Default: 0.
zoom: f32Zoom factor. 1.0 = no zoom, 2.0 = 2x zoom in, 0.5 = zoom out.
rotation: f32Rotation in degrees around the camera origin. Default: 0.
origin: Option<CameraOrigin>Focal point for zoom/rotation, in frame pixels. Absent = frame centre
(the historical behaviour). When the object is present, x/y
default to 0 (top-left corner) — set both explicitly.
focus: f32Depth the camera is focused on, on the same scale as style.depth.
Default 1.0 — the plane an element sits on when it declares no
depth, so a scenario that never mentions focus is focused on
everything it has.
aperture: f32How fast sharpness falls off away from focus, in blur pixels per
unit of depth difference. Default 0.0 — no depth of field at all,
which is what every scenario written before this rendered. 4.0 is
a visible but readable separation; past 20.0 an out-of-focus plane
reads as a colour wash.
Animate focus through keyframes for a rack focus; animating
aperture instead opens and closes the effect without moving the
focal plane.
rotate_x: f32Tilt of the whole shot about the horizontal axis, in degrees, applied
to each direct child of the scene scaled by its style.depth — the
same rule parallax and focus already follow. Default 0.
rotate_y: f32Tilt about the vertical axis, same convention. Default 0.
perspective: f32Viewing distance for rotate_x/rotate_y, in pixels. One vanishing
point for the whole shot — which is the difference from copying the
same rotation onto every group, where each group gets its own. 0
means no perspective, an orthographic tilt. Default 0.
keyframes: Vec<CameraKeyframe>Keyframe animations for camera properties.
motion_blur: Option<CameraMotionBlurConfig>Blurs the frame across a shutter window when the camera itself is
moving (pan, zoom, rotation or shake) — opt-in, since it renders
samples sub-frame exposures and averages them instead of one.
Absent (the default) renders exactly as before. Skipped on any frame
where the resolved camera pose does not change across the window, so
a static shot never pays the extra cost.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Camera
impl<'de> Deserialize<'de> for Camera
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for Camera
impl JsonSchema for Camera
Source§fn schema_name() -> String
fn schema_name() -> String
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref keyword. Read moreAuto Trait Implementations§
impl Freeze for Camera
impl RefUnwindSafe for Camera
impl Send for Camera
impl Sync for Camera
impl Unpin for Camera
impl UnsafeUnpin for Camera
impl UnwindSafe for Camera
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more