Skip to main content

HandRender

Struct HandRender 

pub struct HandRender<'a> {
    pub player: u128,
    pub player_entity_id: i32,
    pub hand: Hand,
    pub stack: Option<&'a ItemStack>,
    pub partial: f32,
    pub interpolated_pitch: f32,
    pub swing: f32,
    pub equip: f32,
    pub packed_light: u32,
    pub translation: [f32; 3],
    pub rotation: [f32; 3],
    pub scale: f32,
}
Expand description

Context and adjustable pose for a first-person hand render.

Translation is in blocks and rotation is in degrees (pitch, yaw, roll). The renderer applies the transform before the ordinary hand and item poses.

Fields§

§player: u128

The UUID of the player whose hand is drawn.

§player_entity_id: i32

The network id of that player.

§hand: Hand

Which hand is drawn.

§stack: Option<&'a ItemStack>

The stack shown in the hand; None for the empty main-hand arm.

§partial: f32

The fraction of the current tick elapsed, 0 to 1.

§interpolated_pitch: f32

The player pitch interpolated for this frame, in degrees.

§swing: f32

The swing progress, 0 to 1.

§equip: f32

The inverse equip height, including the swap animation scale.

§packed_light: u32

Vanilla packed light at the eyes (LightCoordsUtil.pack: block << 4 | sky << 20).

§translation: [f32; 3]

A mod-set offset in blocks; applied before the hand is drawn.

§rotation: [f32; 3]

A mod-set rotation as pitch, yaw and roll in degrees.

§scale: f32

A mod-set uniform scale; 1 leaves the size alone.

Auto Trait Implementations§

§

impl<'a> Freeze for HandRender<'a>

§

impl<'a> RefUnwindSafe for HandRender<'a>

§

impl<'a> Send for HandRender<'a>

§

impl<'a> Sync for HandRender<'a>

§

impl<'a> Unpin for HandRender<'a>

§

impl<'a> UnsafeUnpin for HandRender<'a>

§

impl<'a> UnwindSafe for HandRender<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.