Struct CameraState
pub struct CameraState {
pub near_plane: f32,
pub yaw: f32,
pub pitch: f32,
pub zoom: f32,
pub target: [f32; 3],
pub sun_dir: [f32; 3],
pub sun_intensity: f32,
pub ambient_intensity: f32,
}Expand description
Interactive orbit state driven from JS (set_camera, set_camera_pan, set_camera_target).
Fields§
§near_plane: f32§yaw: f32§pitch: f32§zoom: f32§target: [f32; 3]§sun_dir: [f32; 3]§sun_intensity: f32§ambient_intensity: f32Implementations§
§impl CameraState
impl CameraState
pub fn with_near_plane(self, near: f32) -> CameraState
pub fn with_near_plane(self, near: f32) -> CameraState
Builder: sets near_plane.
pub fn new(yaw: f32, pitch: f32, zoom: f32) -> CameraState
pub fn new(yaw: f32, pitch: f32, zoom: f32) -> CameraState
Creates CameraState with the given state.
pub fn with_target(self, target: [f32; 3]) -> CameraState
pub fn with_target(self, target: [f32; 3]) -> CameraState
Builder: target.
pub fn with_lighting(
self,
sun_dir: [f32; 3],
sun_intensity: f32,
ambient_intensity: f32,
) -> CameraState
pub fn with_lighting( self, sun_dir: [f32; 3], sun_intensity: f32, ambient_intensity: f32, ) -> CameraState
Builder: lighting.
pub fn clamped(self) -> CameraState
pub fn clamped(self) -> CameraState
CameraState::clamped.
pub fn to_uniform(&self, aspect: f32, tensor_mode: bool) -> CameraUniform
pub fn to_uniform(&self, aspect: f32, tensor_mode: bool) -> CameraUniform
Build GPU uniform block (128 B) including pre-multiplied view×projection.
pub fn view_projection(&self, aspect: f32) -> [[f32; 4]; 4]
pub fn view_projection(&self, aspect: f32) -> [[f32; 4]; 4]
View-projection matrix.
Trait Implementations§
§impl Clone for CameraState
impl Clone for CameraState
§fn clone(&self) -> CameraState
fn clone(&self) -> CameraState
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 moreimpl Copy for CameraState
§impl Debug for CameraState
impl Debug for CameraState
§impl Default for CameraState
impl Default for CameraState
§fn default() -> CameraState
fn default() -> CameraState
Returns the “default value” for a type. Read more
§impl PartialEq for CameraState
impl PartialEq for CameraState
impl StructuralPartialEq for CameraState
Auto Trait Implementations§
impl Freeze for CameraState
impl RefUnwindSafe for CameraState
impl Send for CameraState
impl Sync for CameraState
impl Unpin for CameraState
impl UnsafeUnpin for CameraState
impl UnwindSafe for CameraState
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
Aggregate shares in an MPC protocol.
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> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
The none-equivalent value.