BlockWithShape

Trait BlockWithShape 

Source
pub trait BlockWithShape {
    // Required methods
    fn collision_shape(&self) -> &'static VoxelShape;
    fn outline_shape(&self) -> &'static VoxelShape;
    fn is_collision_shape_empty(&self) -> bool;
    fn is_collision_shape_full(&self) -> bool;
}

Required Methods§

Source

fn collision_shape(&self) -> &'static VoxelShape

The hitbox for blocks that’s used when simulating physics.

Source

fn outline_shape(&self) -> &'static VoxelShape

The hitbox for blocks that’s used for determining whether we’re looking at it.

This is often but not always the same as the collision shape. For example, tall grass has a normal outline shape but an empty collision shape.

Source

fn is_collision_shape_empty(&self) -> bool

Tells you whether the block has an empty shape.

This is slightly more efficient than calling shape() and comparing against EMPTY_SHAPE.

Source

fn is_collision_shape_full(&self) -> bool

Implementations on Foreign Types§

Source§

impl BlockWithShape for BlockState

Implementors§