pub struct Cursor { /* private fields */ }Expand description
Data collected by cursor_raycast about the blocks struck by the ray; intended to be
sufficient for various player interactions with blocks.
Implementations§
Source§impl Cursor
impl Cursor
Sourcepub fn preceding_cube(&self) -> Cube
pub fn preceding_cube(&self) -> Cube
The cube the ray passed through immediately before the selected cube.
This may be the same cube if the ray started there.
Sourcepub fn face_selected(&self) -> Face7
pub fn face_selected(&self) -> Face7
Which face of the block the cursor ray selected/hit.
Note that this is not necessarily the same as the face of the enclosing cube, in the case where the block occupies less than the full volume; rather it is intended to make sense to the human who does not get to see the cube grid. It is currently defined to be the hit face of the bounding box of the block data (which is often but not always tightly bounding the visible voxels, so this will have the unsurprising value for any box-shaped block).
Will be Face7::Within if the ray started inside the block.
Sourcepub fn hit(&self) -> &CubeSnapshot
pub fn hit(&self) -> &CubeSnapshot
Returns data about the cube the cursor selected/hit.
Trait Implementations§
impl StructuralPartialEq for Cursor
Auto Trait Implementations§
impl Freeze for Cursor
impl RefUnwindSafe for Cursor
impl Send for Cursor
impl Sync for Cursor
impl Unpin for Cursor
impl UnwindSafe for Cursor
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
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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