pub struct ModelElement {
pub from: [f32; 3],
pub to: [f32; 3],
pub rotation: Option<ElementRotation>,
pub shade: bool,
pub faces: HashMap<Direction, ModelFace>,
}Expand description
A cuboid element within a model.
Fields§
§from: [f32; 3]Minimum corner (0-16 range).
to: [f32; 3]Maximum corner (0-16 range).
rotation: Option<ElementRotation>Optional rotation.
shade: boolWhether this element receives shade.
faces: HashMap<Direction, ModelFace>Face definitions.
Implementations§
Source§impl ModelElement
impl ModelElement
Sourcepub fn normalized_from(&self) -> [f32; 3]
pub fn normalized_from(&self) -> [f32; 3]
Convert from Minecraft coordinates (0-16) to normalized (-0.5 to 0.5).
Sourcepub fn normalized_to(&self) -> [f32; 3]
pub fn normalized_to(&self) -> [f32; 3]
Convert to Minecraft coordinates (0-16) to normalized (-0.5 to 0.5).
Sourcepub fn normalized_center(&self) -> [f32; 3]
pub fn normalized_center(&self) -> [f32; 3]
Get the normalized center.
Sourcepub fn normalized_size(&self) -> [f32; 3]
pub fn normalized_size(&self) -> [f32; 3]
Get the normalized size.
Trait Implementations§
Source§impl Clone for ModelElement
impl Clone for ModelElement
Source§fn clone(&self) -> ModelElement
fn clone(&self) -> ModelElement
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 ModelElement
impl Debug for ModelElement
Source§impl<'de> Deserialize<'de> for ModelElement
impl<'de> Deserialize<'de> for ModelElement
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ModelElement
impl RefUnwindSafe for ModelElement
impl Send for ModelElement
impl Sync for ModelElement
impl Unpin for ModelElement
impl UnwindSafe for ModelElement
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