pub enum VoxelShape {
Array(ArrayVoxelShape),
Cube(CubeVoxelShape),
}
Variants§
Array(ArrayVoxelShape)
Cube(CubeVoxelShape)
Implementations§
Source§impl VoxelShape
impl VoxelShape
pub fn shape(&self) -> &DiscreteVoxelShape
pub fn get_coords(&self, axis: Axis) -> &[f64]
pub fn is_empty(&self) -> bool
pub fn move_relative(&self, x: f64, y: f64, z: f64) -> VoxelShape
pub fn get(&self, axis: Axis, index: usize) -> f64
pub fn find_index(&self, axis: Axis, coord: f64) -> i32
pub fn clip( &self, from: &Vec3, to: &Vec3, block_pos: &BlockPos, ) -> Option<BlockHitResult>
pub fn collide(&self, axis: &Axis, entity_box: &AABB, movement: f64) -> f64
pub fn collide_x( &self, axis_cycle: AxisCycle, entity_box: &AABB, movement: f64, ) -> f64
pub fn for_all_boxes(&self, consumer: impl FnMut(f64, f64, f64, f64, f64, f64))where
Self: Sized,
pub fn to_aabbs(&self) -> Vec<AABB>
Trait Implementations§
Source§impl Clone for VoxelShape
impl Clone for VoxelShape
Source§fn clone(&self) -> VoxelShape
fn clone(&self) -> VoxelShape
Returns a copy 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 VoxelShape
impl Debug for VoxelShape
Source§impl From<AABB> for VoxelShape
impl From<AABB> for VoxelShape
Source§impl PartialEq for VoxelShape
impl PartialEq for VoxelShape
impl StructuralPartialEq for VoxelShape
Auto Trait Implementations§
impl Freeze for VoxelShape
impl RefUnwindSafe for VoxelShape
impl Send for VoxelShape
impl Sync for VoxelShape
impl Unpin for VoxelShape
impl UnwindSafe for VoxelShape
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§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
.§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
.§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.§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.