Struct ModelInstance
#[non_exhaustive]pub struct ModelInstance {
pub origin: [f64; 3],
pub transform: [f32; 12],
pub tint: u32,
pub light: LightCoords,
pub overlay: Overlay,
}Expand description
One copy. origin is world blocks; transform is row-major 3×4 in that local space.
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.origin: [f64; 3]World-space origin, in blocks. The camera is subtracted in f64.
transform: [f32; 12]Row-major 3×4 affine transform, applied before origin.
tint: u32Packed 0xAARRGGBB, the same convention as crate::WorldQuad::color.
light: LightCoordsBlock and sky light in vanilla’s 0..=15 convention.
overlay: OverlayHurt tint and white flash, in vanilla’s overlay convention.
Implementations§
§impl ModelInstance
impl ModelInstance
pub fn new(
origin: [f64; 3],
transform: [f32; 12],
tint: u32,
light: LightCoords,
overlay: Overlay,
) -> ModelInstance
pub fn new( origin: [f64; 3], transform: [f32; 12], tint: u32, light: LightCoords, overlay: Overlay, ) -> ModelInstance
One copy. The draw call checks finiteness, light range and the view budget.
pub fn at(origin: [f64; 3], tint: u32) -> ModelInstance
pub fn at(origin: [f64; 3], tint: u32) -> ModelInstance
Identity transform at origin, full bright, with no overlay.
Trait Implementations§
§impl Clone for ModelInstance
impl Clone for ModelInstance
§fn clone(&self) -> ModelInstance
fn clone(&self) -> ModelInstance
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for ModelInstance
§impl Debug for ModelInstance
impl Debug for ModelInstance
§impl PartialEq for ModelInstance
impl PartialEq for ModelInstance
impl StructuralPartialEq for ModelInstance
Auto Trait Implementations§
impl Freeze for ModelInstance
impl RefUnwindSafe for ModelInstance
impl Send for ModelInstance
impl Sync for ModelInstance
impl Unpin for ModelInstance
impl UnsafeUnpin for ModelInstance
impl UnwindSafe for ModelInstance
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