pub struct EntityDimensions {
pub width: f32,
pub height: f32,
pub eye_height: f32,
pub attachments: EntityAttachments,
}Expand description
Entity dimensions used for bounding box calculation. Bounding box is centered on X/Z with Y at entity feet.
Fields§
§width: f32§height: f32§eye_height: f32§attachments: EntityAttachmentsImplementations§
Source§impl EntityDimensions
impl EntityDimensions
Sourcepub const fn new(width: f32, height: f32, eye_height: f32) -> Self
pub const fn new(width: f32, height: f32, eye_height: f32) -> Self
Creates new entity dimensions.
Sourcepub const fn new_with_attachments(
width: f32,
height: f32,
eye_height: f32,
attachments: EntityAttachments,
) -> Self
pub const fn new_with_attachments( width: f32, height: f32, eye_height: f32, attachments: EntityAttachments, ) -> Self
Creates new entity dimensions with vanilla attachment points.
Sourcepub fn scale(&self, factor: f32) -> Self
pub fn scale(&self, factor: f32) -> Self
Scale dimensions by a factor (for baby entities, etc.)
Sourcepub fn half_width(&self) -> f32
pub fn half_width(&self) -> f32
Get the half-width for bounding box calculation.
Trait Implementations§
Source§impl Clone for EntityDimensions
impl Clone for EntityDimensions
Source§fn clone(&self) -> EntityDimensions
fn clone(&self) -> EntityDimensions
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 EntityDimensions
Source§impl Debug for EntityDimensions
impl Debug for EntityDimensions
Source§impl PartialEq for EntityDimensions
impl PartialEq for EntityDimensions
Source§fn eq(&self, other: &EntityDimensions) -> bool
fn eq(&self, other: &EntityDimensions) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for EntityDimensions
Auto Trait Implementations§
impl Freeze for EntityDimensions
impl RefUnwindSafe for EntityDimensions
impl Send for EntityDimensions
impl Sync for EntityDimensions
impl Unpin for EntityDimensions
impl UnsafeUnpin for EntityDimensions
impl UnwindSafe for EntityDimensions
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