Struct three_d::CameraControl [−][src]
3D controls for a camera. Use this to add additional control functionality to a camera.
Implementations
impl CameraControl
[src]
pub fn new(camera: Camera) -> Self
[src]
pub fn translate(&mut self, change: &Vec3) -> Result<(), Error>
[src]
pub fn rotate(&mut self, x: f32, y: f32) -> Result<(), Error>
[src]
pub fn rotate_around_up(&mut self, x: f32, y: f32) -> Result<(), Error>
[src]
pub fn pan(&mut self, x: f32, y: f32) -> Result<(), Error>
[src]
pub fn zoom(&mut self, wheel: f32) -> Result<(), Error>
[src]
Methods from Deref<Target = Camera>
pub fn set_perspective_projection(
&mut self,
field_of_view_y: Degrees,
aspect: f32,
z_near: f32,
z_far: f32
) -> Result<(), Error>
[src]
&mut self,
field_of_view_y: Degrees,
aspect: f32,
z_near: f32,
z_far: f32
) -> Result<(), Error>
Specify the camera to use perspective projection with the given field of view in the y-direction, aspect and near and far plane.
pub fn set_orthographic_projection(
&mut self,
width: f32,
height: f32,
depth: f32
) -> Result<(), Error>
[src]
&mut self,
width: f32,
height: f32,
depth: f32
) -> Result<(), Error>
Specify the camera to use orthographic projection with the given width, height and depth. The view frustum width is +/- width/2, height is +/- height/2 and depth is 0 to depth.
pub fn set_aspect(&mut self, value: f32) -> Result<bool, Error>
[src]
Change the current projection to abide to the given aspect ratio.
pub fn set_view(
&mut self,
position: Vec3,
target: Vec3,
up: Vec3
) -> Result<(), Error>
[src]
&mut self,
position: Vec3,
target: Vec3,
up: Vec3
) -> Result<(), Error>
Change the view of the camera. The camera is placed at the given position, looking at the given target and with the given up direction.
pub fn mirror_in_xz_plane(&mut self) -> Result<(), Error>
[src]
pub fn in_frustum(&self, aabb: &AxisAlignedBoundingBox) -> bool
[src]
Returns whether or not the given bounding box is within the camera frustum. It returns false if it is fully outside and true if it is inside or intersects.
pub fn view_direction_at(&self, screen_coordinates: (f64, f64)) -> Vec3
[src]
Returns the view direction at the given screen/image plane coordinates. The coordinates must be between 0 and 1, where (0, 0) indicate the top left corner of the screen and (1, 1) indicate the bottom right corner.
pub fn projection_type(&self) -> &ProjectionType
[src]
pub fn view(&self) -> &Mat4
[src]
pub fn projection(&self) -> &Mat4
[src]
pub fn position(&self) -> &Vec3
[src]
pub fn target(&self) -> &Vec3
[src]
pub fn up(&self) -> &Vec3
[src]
pub fn matrix_buffer(&self) -> &UniformBuffer
[src]
Trait Implementations
impl Deref for CameraControl
[src]
impl DerefMut for CameraControl
[src]
Auto Trait Implementations
impl !RefUnwindSafe for CameraControl
impl !Send for CameraControl
impl !Sync for CameraControl
impl Unpin for CameraControl
impl UnwindSafe for CameraControl
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,