pub struct ElementRotation {
pub origin: [f32; 3],
pub axis: Axis,
pub angle: f32,
pub rescale: bool,
}Expand description
Element-level rotation from model element.
Fields§
§origin: [f32; 3]Origin point for rotation (in 0-16 Minecraft coordinates).
axis: AxisAxis to rotate around.
angle: f32Rotation angle in degrees (-45 to 45, in 22.5 increments).
rescale: boolWhether to rescale the element after rotation.
Implementations§
Source§impl ElementRotation
impl ElementRotation
Sourcepub fn normalized_origin(&self) -> [f32; 3]
pub fn normalized_origin(&self) -> [f32; 3]
Convert origin from Minecraft coordinates (0-16) to normalized (-0.5 to 0.5).
Sourcepub fn angle_radians(&self) -> f32
pub fn angle_radians(&self) -> f32
Get the angle in radians.
Sourcepub fn rescale_factor(&self) -> f32
pub fn rescale_factor(&self) -> f32
Get the rescale factor for this rotation. When rescale is true, the element is scaled to maintain its original size.
Trait Implementations§
Source§impl Clone for ElementRotation
impl Clone for ElementRotation
Source§fn clone(&self) -> ElementRotation
fn clone(&self) -> ElementRotation
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 ElementRotation
impl Debug for ElementRotation
Source§impl<'de> Deserialize<'de> for ElementRotation
impl<'de> Deserialize<'de> for ElementRotation
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 ElementRotation
impl RefUnwindSafe for ElementRotation
impl Send for ElementRotation
impl Sync for ElementRotation
impl Unpin for ElementRotation
impl UnwindSafe for ElementRotation
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