pub struct BlockHitResult {
pub location: Vec3,
pub miss: bool,
pub direction: Direction,
pub block_pos: BlockPos,
pub inside: bool,
pub world_border: bool,
}Expand description
The result of raycasting on the blocks in the world.
Also see [HitResult].
Fields§
§location: Vec3The exact position that the raycast ended at.
miss: bool§direction: Direction§block_pos: BlockPosThe block position that was hit.
If Self::miss is true, then this will be the position that the
raycast ended at.
inside: bool§world_border: boolImplementations§
Source§impl BlockHitResult
impl BlockHitResult
Sourcepub fn miss(location: Vec3, direction: Direction) -> Self
pub fn miss(location: Vec3, direction: Direction) -> Self
Create a new BlockHitResult for when nothing was hit.
pub fn with_direction(&self, direction: Direction) -> Self
pub fn with_position(&self, block_pos: BlockPos) -> Self
Trait Implementations§
Source§impl Clone for BlockHitResult
impl Clone for BlockHitResult
Source§fn clone(&self) -> BlockHitResult
fn clone(&self) -> BlockHitResult
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BlockHitResult
impl Debug for BlockHitResult
Source§impl PartialEq for BlockHitResult
impl PartialEq for BlockHitResult
impl StructuralPartialEq for BlockHitResult
Auto Trait Implementations§
impl Freeze for BlockHitResult
impl RefUnwindSafe for BlockHitResult
impl Send for BlockHitResult
impl Sync for BlockHitResult
impl Unpin for BlockHitResult
impl UnsafeUnpin for BlockHitResult
impl UnwindSafe for BlockHitResult
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