Skip to main content

CameraShot

Struct CameraShot 

Source
pub struct CameraShot {
    pub path: Vec<Mark>,
    pub seconds: Option<u32>,
    pub look_at: Option<Mark>,
    pub shot_style: Option<ShotStyle>,
    pub subject: Option<CameraSubject>,
    pub subject_b: Option<CameraSubject>,
    pub dist: Option<f64>,
    pub degrees: Option<f64>,
    pub bearing: Option<f64>,
}
Expand description

One shot of a Verb::Cutscene (DSL v0.6): a camera dolly with its own duration and optional subject. A cutscene plays its shots back-to-back — a hard cut between them — inside a single gamemode/position save-restore bracket, so a wide establishing move can be followed by an interior close-up without the players ever leaving the cinematic.

Fields§

§path: Vec<Mark>

Ordered camera waypoints (straight-line lerp between them). A one-waypoint path is a static shot. Required without shot_style; with one, optional — an explicit path always overrides the style’s expanded dolly.

§seconds: Option<u32>

This shot’s duration in seconds. Required without shot_style; with one, optional — the style’s default duration applies (see ShotStyle::default_seconds), and an explicit value always overrides.

§look_at: Option<Mark>

Optional subject the camera keeps framed for this shot. Absent = face along the direction of travel (or, under a shot_style, the style’s own aim at its subject). An explicit look_at always overrides a style’s aim.

§shot_style: Option<ShotStyle>

Shot-style preset (DSL v0.6, spec-0015 shot-grammar library): the compiler expands the style deterministically into a camera dolly + per-keyframe aim from the subject’s resolved geometry. Requires subject; path/look_at/seconds remain legal and always override the corresponding expanded part (DW0348 polices the combinations).

§subject: Option<CameraSubject>

The styled shot’s subject — what the shot is about. Required with shot_style, rejected without one (DW0348).

§subject_b: Option<CameraSubject>

two-shot only: the second framed subject (DW0348 elsewhere).

§dist: Option<f64>

Styled shots only: the style’s characteristic camera distance in blocks (its start distance for the dolly styles). Default per style — see the shot_style table in docs/reference/compiler.md. Clamped range 1..=48 (DW0348).

§degrees: Option<f64>

orbit-arc only: the sweep in degrees, 45..=120 (dossier range), default 90 (DW0348 elsewhere or out of range).

§bearing: Option<f64>

Styled shots only: placement bearing in degrees — where the camera sits (or starts) relative to the subject, measured like a Minecraft yaw from the subject: 0 puts the camera south of the subject (+Z), 90 west (−X), -90 east (+X), 180 north (−Z). Default 0. For side-track the bearing picks which side of the subject’s travel the camera runs abeam (0 = right of travel, 180 = left).

Implementations§

Source§

impl CameraShot

Source

pub fn resolved_seconds(&self) -> u32

The shot’s resolved duration in seconds: explicit seconds, else the style default, else 1 (a shape-invalid shot — DW0199 reports it; the fallback only keeps downstream passes total).

Trait Implementations§

Source§

impl Clone for CameraShot

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CameraShot

Debug is hand-written because it is a stable content-key rendering: the compiler’s payload_verb_key (FNV over a verb’s own {:?}) names the generated volley_, collapse_ and teleport_ functions from it, so a shot that uses none of the v0.6 style fields must render byte-identically to the pre-style struct (seconds prints its inner value; absent style fields print nothing) — otherwise a purely additive schema change would silently churn the content key of every payload that carries a cutscene.

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for CameraShot

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl JsonSchema for CameraShot

Source§

fn schema_name() -> Cow<'static, str>

The name of the generated JSON Schema. Read more
Source§

fn schema_id() -> Cow<'static, str>

Returns a string that uniquely identifies the schema produced by this type. Read more
Source§

fn json_schema(generator: &mut SchemaGenerator) -> Schema

Generates a JSON Schema for this type. Read more
Source§

fn inline_schema() -> bool

Whether JSON Schemas generated for this type should be included directly in parent schemas, rather than being re-used where possible using the $ref keyword. Read more
Source§

impl PartialEq for CameraShot

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for CameraShot

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for CameraShot

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.