pub struct Viewer {
pub camera: CameraState,
pub current_mesh: Option<MeshUploadBuffer>,
/* private fields */
}Expand description
Stub viewer – will be replaced by wgpu surface in Phase 2.
Fields§
§camera: CameraState§current_mesh: Option<MeshUploadBuffer>Implementations§
Source§impl Viewer
impl Viewer
pub fn new(config: ViewerConfig) -> Self
Sourcepub fn upload_mesh(&mut self, buf: MeshUploadBuffer)
pub fn upload_mesh(&mut self, buf: MeshUploadBuffer)
Upload a mesh buffer to the viewer (CPU-side store; GPU upload in Phase 2).
Sourcepub fn render_frame(&mut self) -> ViewerStats
pub fn render_frame(&mut self) -> ViewerStats
Simulate a render tick. Returns ViewerStats for the current frame.
Sourcepub fn get_camera(&self) -> &CameraState
pub fn get_camera(&self) -> &CameraState
Return a reference to the current camera state.
Sourcepub fn orbit_camera(&mut self, yaw: f32, pitch: f32)
pub fn orbit_camera(&mut self, yaw: f32, pitch: f32)
Orbit the camera around its target.
Sourcepub fn config(&self) -> &ViewerConfig
pub fn config(&self) -> &ViewerConfig
Return a reference to the viewer configuration.
Auto Trait Implementations§
impl Freeze for Viewer
impl RefUnwindSafe for Viewer
impl Send for Viewer
impl Sync for Viewer
impl Unpin for Viewer
impl UnsafeUnpin for Viewer
impl UnwindSafe for Viewer
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
Mutably borrows from an owned value. Read more
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