Struct PartPose
#[non_exhaustive]pub struct PartPose {
pub x: f32,
pub y: f32,
pub z: f32,
pub x_rot: f32,
pub y_rot: f32,
pub z_rot: f32,
pub x_scale: f32,
pub y_scale: f32,
pub z_scale: f32,
}Expand description
PartPose: where a part sits in its parent, in texels from the parent’s
pivot (+y down, as a model’s frame is), its rotation in radians (about z,
then y, then x, as ModelPart.translateAndRotate turns it) and its scale.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.x: f32Position on the x axis, in texels.
y: f32Position on the y axis, in texels.
z: f32Position on the z axis, in texels.
x_rot: f32Rotation around x, in radians.
y_rot: f32Rotation around y, in radians.
z_rot: f32Rotation around z, in radians.
x_scale: f32Scale on the x axis.
y_scale: f32Scale on the y axis.
z_scale: f32Scale on the z axis.
Implementations§
§impl PartPose
impl PartPose
pub const fn offset(x: f32, y: f32, z: f32) -> PartPose
pub const fn offset(x: f32, y: f32, z: f32) -> PartPose
A position with zero rotation and unit scale.
pub const fn rotation(x_rot: f32, y_rot: f32, z_rot: f32) -> PartPose
pub const fn rotation(x_rot: f32, y_rot: f32, z_rot: f32) -> PartPose
A rotation about the origin with unit scale.
pub const fn offset_and_rotation(
x: f32,
y: f32,
z: f32,
x_rot: f32,
y_rot: f32,
z_rot: f32,
) -> PartPose
pub const fn offset_and_rotation( x: f32, y: f32, z: f32, x_rot: f32, y_rot: f32, z_rot: f32, ) -> PartPose
A position and rotation with unit scale.
pub fn translated(self, x: f32, y: f32, z: f32) -> PartPose
pub fn translated(self, x: f32, y: f32, z: f32) -> PartPose
This pose moved by x, y and z texels (translated).
pub fn with_scale(self, scale: f32) -> PartPose
pub fn with_scale(self, scale: f32) -> PartPose
This pose at scale on every axis (withScale).
Trait Implementations§
impl Copy for PartPose
§impl<'de> Deserialize<'de> for PartPose
impl<'de> Deserialize<'de> for PartPose
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<PartPose, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<PartPose, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl Serialize for PartPose
impl Serialize for PartPose
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for PartPose
Auto Trait Implementations§
impl Freeze for PartPose
impl RefUnwindSafe for PartPose
impl Send for PartPose
impl Sync for PartPose
impl Unpin for PartPose
impl UnsafeUnpin for PartPose
impl UnwindSafe for PartPose
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