pub struct CameraController {
pub camera_node_id: NodeHandle,
pub target: CameraTarget,
pub distance: f32,
pub min_distance: f32,
pub max_distance: f32,
pub elevation: f32,
pub min_elevation: f32,
pub max_elevation: f32,
pub rotate_speed: f32,
pub zoom_speed: f32,
pub pan_speed: f32,
/* private fields */
}Expand description
A simple camera controller which is a node behavior.
- Press left mouse button and move mouse to rotate.
- Press right mouse button and move mouse to zoom.
- Press middle mouse button and move to pan.
Fields§
§camera_node_id: NodeHandle§target: CameraTargetcamera target
distance: f32§min_distance: f32§max_distance: f32§elevation: f32§min_elevation: f32§max_elevation: f32§rotate_speed: f32§zoom_speed: f32§pan_speed: f32Implementations§
Source§impl CameraController
impl CameraController
pub fn new(camera_node_id: NodeHandle, target: CameraTarget) -> Self
Trait Implementations§
Source§impl Behavior for CameraController
impl Behavior for CameraController
fn as_any(&self) -> &dyn Any
fn as_any_mut(&mut self) -> &mut dyn Any
fn on_start(&mut self, logic_context: &mut LogicContext<'_>)
fn on_update(&mut self, logic_context: &mut LogicContext<'_>)
fn on_destroy(&mut self, _logic_context: &mut LogicContext<'_>)
fn on_gui(&mut self, logic_context: &mut LogicContext<'_>, ui_context: &Context)
Auto Trait Implementations§
impl Freeze for CameraController
impl RefUnwindSafe for CameraController
impl Send for CameraController
impl Sync for CameraController
impl Unpin for CameraController
impl UnsafeUnpin for CameraController
impl UnwindSafe for CameraController
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.