pub struct ArcBall { /* private fields */ }
Expand description

Arc-ball camera mode.

An arc-ball camera is a camera rotating around a fixed point (the focus point) and always looking at it. The following inputs are handled:

  • Left button press + drag - rotates the camera around the focus point
  • Right button press + drag - translates the focus point on the plane orthogonal to the view direction
  • Scroll in/out - zoom in/out
  • Enter key - set the focus point to the origin

Implementations

Create a new arc-ball camera.

Creates a new arc ball camera with default sensitivity values.

The point the arc-ball is looking at.

Get a mutable reference to the point the camera is looking at.

The arc-ball camera yaw.

Sets the camera yaw. Change this to modify the rotation along the up axis.

The arc-ball camera pitch.

Sets the camera pitch.

The minimum pitch of the camera.

Set the minimum pitch of the camera.

The maximum pitch of the camera.

Set the maximum pitch of the camera.

The distance from the camera position to its view point.

Move the camera such that it is at a given distance from the view point.

The minimum distance from the camera position to its view point.

Set the minimum distance from the camera position to its view point.

The maximum distance from the camera position to its view point.

Set the maximum distance from the camera position to its view point.

Set the distance change factor for a unit scroll (default at 1.01).

Move and orient the camera such that it looks at a specific point.

The button used to rotate the ArcBall camera.

Set the button used to rotate the ArcBall camera. Use None to disable rotation.

Modifiers that must be pressed for the camera rotation to occur.

Sets the modifiers that must be pressed for the camera rotation to occur.

If this is set to None, then pressing any modifier will not prevent rotation from occurring. If this is different from None then rotation will occur only if the exact specified set of modifiers is pressed. In particular, if this is set to Some(Modifiers::empty()) then, rotation will occur only of no modifier is pressed.

Modifiers that must be pressed for the camera drag to occur.

Sets the modifiers that must be pressed for the camera drag to occur.

If this is set to None, then pressing any modifier will not prevent dragging from occurring. If this is different from None then drag will occur only if the exact specified set of modifiers is pressed. In particular, if this is set to Some(Modifiers::empty()) then, drag will occur only of no modifier is pressed.

The button used to drag the ArcBall camera.

Set the button used to drag the ArcBall camera. Use None to disable dragging.

The key used to reset the ArcBall camera.

Set the key used to reset the ArcBall camera. Use None to disable reset.

Sets the up vector of this camera. Prefer using set_up_axis_dir if your up vector is already normalized.

Sets the up-axis direction of this camera.

Trait Implementations

The clipping planes, aka. (znear, zfar).

The camera view transform.

The camera position.

Handle a mouse event.

Upload the camera view and projection to the gpu. This can be called multiple times on the render loop. Read more

The transformation applied by the camera to transform a point in world coordinates to a point in device coordinates. Read more

The transformation applied by the camera to transform point in device coordinates to a point in world coordinate. Read more

Update the camera. This is called once at the beginning of the render loop.

The number of passes required by this camera.

Indicates that a pass will begin.

Indicates that the scene has been rendered and the post-processing is being run.

Converts a 3d point to 2d screen coordinates, assuming the screen has the size size.

Converts a point in 2d screen coordinates to a ray (a 3d position and a direction). Read more

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

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. Read more

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait. Read more

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s. Read more

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s. Read more

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

Should always be Self

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more

Checks if self is actually part of its subset T (and can be converted to it).

Use with care! Same as self.to_subset but without any property checks. Always succeeds.

The inclusion map: converts self to the equivalent element of its superset.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.