pub struct CameraShot {
pub preset: String,
pub fov_y_degrees: f32,
pub near: f32,
pub far: f32,
pub position: [f32; 3],
pub yaw: f32,
pub pitch: f32,
}Expand description
A reusable Camera3D preset: reference it from a
Scene’s camera_shot, or use it standalone.
Used standalone, it expands into a Camera3D with the same parameters.
Examples
With Scenes: camera switches per scene (declared on each Scene):
From library preset (standalone, replaces Camera3D):
CameraShot {
fov_y_degrees: 80.0,
position: [0.0, 1.75, 8.0],
yaw: 3.14,
..Default::default()
};Fields§
§preset: StringName of a built-in or file-backed preset (e.g. “shot_eye_level”). Preset values are used as defaults; any inline fields override them.
fov_y_degrees: f32Vertical field of view in degrees.
near: f32Near clip plane distance in world units.
far: f32Far clip plane distance in world units.
position: [f32; 3]World-space camera position.
yaw: f32Yaw rotation in radians (Y-axis, applied first).
pitch: f32Pitch rotation in radians (X-axis, applied second).
Trait Implementations§
Source§impl Authored for CameraShot
impl Authored for CameraShot
impl BuildOnlyAsset for CameraShot
Source§impl Clone for CameraShot
impl Clone for CameraShot
Source§fn clone(&self) -> CameraShot
fn clone(&self) -> CameraShot
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CameraShot
impl Debug for CameraShot
Source§impl Default for CameraShot
impl Default for CameraShot
Source§fn default() -> CameraShot
fn default() -> CameraShot
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for CameraShotwhere
CameraShot: Default,
impl<'de> Deserialize<'de> for CameraShotwhere
CameraShot: Default,
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<CameraShot, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<CameraShot, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for CameraShot
impl Serialize for CameraShot
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for CameraShot
impl RefUnwindSafe for CameraShot
impl Send for CameraShot
impl Sync for CameraShot
impl Unpin for CameraShot
impl UnsafeUnpin for CameraShot
impl UnwindSafe for CameraShot
Blanket Implementations§
impl<T> AutoreleaseSafe for Twhere
T: ?Sized,
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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>,
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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> ⓘ
Converts
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> ⓘ
Converts
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