pub struct CameraView { /* private fields */ }Expand description
A camera view structure for visualizing camera poses.
Implementations§
Source§impl CameraView
impl CameraView
Sourcepub fn new(name: impl Into<String>, params: CameraParameters) -> Self
pub fn new(name: impl Into<String>, params: CameraParameters) -> Self
Creates a new camera view from camera parameters.
Sourcepub fn from_look_at(
name: impl Into<String>,
position: Vec3,
look_at: Vec3,
up: Vec3,
fov_vertical_degrees: f32,
aspect_ratio: f32,
) -> Self
pub fn from_look_at( name: impl Into<String>, position: Vec3, look_at: Vec3, up: Vec3, fov_vertical_degrees: f32, aspect_ratio: f32, ) -> Self
Creates a camera view with position and look direction.
Sourcepub fn params(&self) -> &CameraParameters
pub fn params(&self) -> &CameraParameters
Gets the camera parameters.
Sourcepub fn set_params(&mut self, params: CameraParameters) -> &mut Self
pub fn set_params(&mut self, params: CameraParameters) -> &mut Self
Updates the camera parameters.
Sourcepub fn widget_focal_length(&self) -> f32
pub fn widget_focal_length(&self) -> f32
Gets the widget focal length (distance from camera origin to frame).
Sourcepub fn set_widget_focal_length(
&mut self,
length: f32,
is_relative: bool,
) -> &mut Self
pub fn set_widget_focal_length( &mut self, length: f32, is_relative: bool, ) -> &mut Self
Sets the widget focal length.
Sourcepub fn widget_thickness(&self) -> f32
pub fn widget_thickness(&self) -> f32
Gets the widget thickness (line/sphere radius relative to focal length).
Sourcepub fn set_widget_thickness(&mut self, thickness: f32) -> &mut Self
pub fn set_widget_thickness(&mut self, thickness: f32) -> &mut Self
Sets the widget thickness.
Sourcepub fn needs_reinit(&self, length_scale: f32) -> bool
pub fn needs_reinit(&self, length_scale: f32) -> bool
Returns true if geometry needs to be (re-)initialized because length_scale changed.
Sourcepub fn init_render_data(
&mut self,
device: &Device,
bind_group_layout: &BindGroupLayout,
camera_buffer: &Buffer,
queue: &Queue,
length_scale: f32,
)
pub fn init_render_data( &mut self, device: &Device, bind_group_layout: &BindGroupLayout, camera_buffer: &Buffer, queue: &Queue, length_scale: f32, )
Initializes GPU render data.
Sourcepub fn render_data(&self) -> Option<&CurveNetworkRenderData>
pub fn render_data(&self) -> Option<&CurveNetworkRenderData>
Returns the render data if available.
Sourcepub fn take_fly_to_request(&mut self) -> bool
pub fn take_fly_to_request(&mut self) -> bool
Returns true if the user has requested to fly to this camera view. The flag is automatically cleared after reading.
Sourcepub fn build_egui_ui(&mut self, ui: &mut Ui)
pub fn build_egui_ui(&mut self, ui: &mut Ui)
Builds the egui UI for this camera view.
Trait Implementations§
Source§impl HasQuantities for CameraView
impl HasQuantities for CameraView
Source§fn add_quantity(&mut self, quantity: Box<dyn Quantity>)
fn add_quantity(&mut self, quantity: Box<dyn Quantity>)
Adds a quantity to this structure.
Source§fn get_quantity_mut(&mut self, name: &str) -> Option<&mut Box<dyn Quantity>>
fn get_quantity_mut(&mut self, name: &str) -> Option<&mut Box<dyn Quantity>>
Gets a mutable quantity by name.
Source§fn remove_quantity(&mut self, name: &str) -> Option<Box<dyn Quantity>>
fn remove_quantity(&mut self, name: &str) -> Option<Box<dyn Quantity>>
Removes a quantity by name.
Source§fn quantities(&self) -> &[Box<dyn Quantity>]
fn quantities(&self) -> &[Box<dyn Quantity>]
Returns all quantities attached to this structure.
Source§fn num_quantities(&self) -> usize
fn num_quantities(&self) -> usize
Returns the number of quantities attached.
Source§impl Structure for CameraView
impl Structure for CameraView
Source§fn as_any_mut(&mut self) -> &mut dyn Any
fn as_any_mut(&mut self) -> &mut dyn Any
Returns a mutable reference to self as
Any for downcasting.Source§fn type_name(&self) -> &'static str
fn type_name(&self) -> &'static str
Returns the type name of this structure (e.g., “
PointCloud”, “SurfaceMesh”).Source§fn bounding_box(&self) -> Option<(Vec3, Vec3)>
fn bounding_box(&self) -> Option<(Vec3, Vec3)>
Returns the axis-aligned bounding box in world coordinates. Read more
Source§fn length_scale(&self) -> f32
fn length_scale(&self) -> f32
Returns a characteristic length scale for this structure.
Source§fn set_transform(&mut self, transform: Mat4)
fn set_transform(&mut self, transform: Mat4)
Sets the model transform matrix.
Source§fn is_enabled(&self) -> bool
fn is_enabled(&self) -> bool
Returns whether this structure is currently visible.
Source§fn set_enabled(&mut self, enabled: bool)
fn set_enabled(&mut self, enabled: bool)
Sets the visibility of this structure.
Source§fn draw(&self, _ctx: &mut dyn RenderContext)
fn draw(&self, _ctx: &mut dyn RenderContext)
Draws this structure to the scene. Read more
Source§fn draw_pick(&self, _ctx: &mut dyn RenderContext)
fn draw_pick(&self, _ctx: &mut dyn RenderContext)
Draws this structure for picking/selection. Read more
Source§fn build_pick_ui(&self, _ui: &dyn Any, _pick: &PickResult)
fn build_pick_ui(&self, _ui: &dyn Any, _pick: &PickResult)
Builds the
ImGui UI for a picked element.Source§fn clear_gpu_resources(&mut self)
fn clear_gpu_resources(&mut self)
Clears all GPU resources (render data, pick buffers, etc.). Read more
Source§fn center_bounding_box(&mut self)
fn center_bounding_box(&mut self)
Centers the camera on this structure’s bounding box.
Source§fn reset_transform(&mut self)
fn reset_transform(&mut self)
Resets the transform to identity.
Source§fn material(&self) -> &str
fn material(&self) -> &str
Returns the material name for this structure (e.g., “clay”, “wax”).
Source§fn set_material(&mut self, _material: &str)
fn set_material(&mut self, _material: &str)
Sets the material for this structure by name.
Auto Trait Implementations§
impl Freeze for CameraView
impl !RefUnwindSafe for CameraView
impl Send for CameraView
impl Sync for CameraView
impl Unpin for CameraView
impl UnsafeUnpin for CameraView
impl !UnwindSafe for CameraView
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> 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