Type Alias veloren_common::figure::Segment

source ·
pub type Segment = Dyna<Cell, ()>;
Expand description

A type representing a volume that may be part of an animated figure.

Figures are used to represent things like characters, NPCs, mobs, etc.

Aliased Type§

struct Segment {
    vox: Vec<Cell>,
    meta: (),
    pub sz: Vec3<u32>,
    _phantom: PhantomData<ColumnAccess>,
}

Fields§

§vox: Vec<Cell>§meta: ()§sz: Vec3<u32>§_phantom: PhantomData<ColumnAccess>

Implementations§

source§

impl Segment

source

pub fn from_voxes(data: &[(&DotVoxData, Vec3<i32>, bool)]) -> (Self, Vec3<i32>)

Take a list of voxel data, offsets, and x-mirror flags, and assembled them into a combined segment

source

pub fn from_vox_model_index( dot_vox_data: &DotVoxData, model_index: usize ) -> Self

source

pub fn from_vox( dot_vox_data: &DotVoxData, flipped: bool, model_index: usize ) -> Self

source

pub fn map(self, transform: impl Fn(Cell) -> Option<Cell>) -> Self

Transform cells

source

pub fn map_rgb(self, transform: impl Fn(Rgb<u8>) -> Rgb<u8>) -> Self

Transform cell colors