mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
add doc comments
This commit is contained in:
parent
61ecd2c178
commit
a0ed18c3db
@ -1470,6 +1470,7 @@ impl Client {
|
||||
}
|
||||
}
|
||||
|
||||
/// Mount a block at a `VolumePos`.
|
||||
pub fn mount_volume(&mut self, volume_pos: VolumePos) {
|
||||
self.send_msg(ClientGeneral::ControlEvent(ControlEvent::MountVolume(
|
||||
volume_pos,
|
||||
|
@ -21,7 +21,7 @@ pub type TerrainSegment = Dyna<Block, ()>;
|
||||
impl From<Segment> for TerrainSegment {
|
||||
fn from(value: Segment) -> Self {
|
||||
TerrainSegment::from_fn(value.sz, (), |pos| match value.get(pos) {
|
||||
Err(_) | Ok(Cell::Empty) => Block::empty(),
|
||||
Err(_) | Ok(Cell::Empty) => Block::air(SpriteKind::Empty),
|
||||
Ok(cell) => {
|
||||
if cell.is_hollow() {
|
||||
Block::air(SpriteKind::Empty)
|
||||
|
@ -191,6 +191,10 @@ impl VolumePos {
|
||||
}
|
||||
|
||||
impl VolumePos {
|
||||
/// Retrieves the block and matrix transformation for this `VolumeBlock`
|
||||
///
|
||||
/// The transform is located in the blocks minimum position relative to the
|
||||
/// volume.
|
||||
pub fn get_block_and_transform(
|
||||
&self,
|
||||
terrain: &TerrainGrid,
|
||||
@ -226,6 +230,7 @@ impl VolumePos {
|
||||
}
|
||||
}
|
||||
|
||||
/// Get the block at this `VolumePos`.
|
||||
pub fn get_block(
|
||||
&self,
|
||||
terrain: &TerrainGrid,
|
||||
|
@ -854,6 +854,7 @@ pub fn attempt_swap_equipped_weapons(data: &JoinData<'_>, update: &mut StateUpda
|
||||
}
|
||||
}
|
||||
|
||||
/// Checks if a block can be reached from a position.
|
||||
fn can_reach_block(
|
||||
player_pos: Vec3<f32>,
|
||||
block_pos: Vec3<i32>,
|
||||
|
@ -157,8 +157,11 @@ where
|
||||
let greedy_size_cross = greedy_size;
|
||||
let draw_delta = lower_bound;
|
||||
|
||||
let get_light = |vol: &mut V, pos: Vec3<i32>| vol.get(pos).map_or(true, |vox| vox.is_fluid()) as i32 as f32;
|
||||
let get_ao = |vol: &mut V, pos: Vec3<i32>| vol.get(pos).map_or(false, |vox| vox.is_opaque()) as i32 as f32;
|
||||
let get_light =
|
||||
|vol: &mut V, pos: Vec3<i32>| vol.get(pos).map_or(true, |vox| vox.is_fluid()) as i32 as f32;
|
||||
let get_ao = |vol: &mut V, pos: Vec3<i32>| {
|
||||
vol.get(pos).map_or(false, |vox| vox.is_opaque()) as i32 as f32
|
||||
};
|
||||
let get_glow = |vol: &mut V, pos: Vec3<i32>| {
|
||||
vol.get(pos)
|
||||
.ok()
|
||||
|
Loading…
Reference in New Issue
Block a user