pub struct Instance {
pub position: Vec3,
pub rotation: Vec3,
pub scale: Vec3,
}Expand description
Instance buffer data storage
Fields§
§position: Vec3The position of the instance
rotation: Vec3The rotation of the instance
scale: Vec3The scale of the instance
Implementations§
Source§impl Instance
impl Instance
Sourcepub fn new(
position: impl Into<Vec3>,
rotation: impl Into<Vec3>,
scale: impl Into<Vec3>,
) -> Instance
👎Deprecated
pub fn new( position: impl Into<Vec3>, rotation: impl Into<Vec3>, scale: impl Into<Vec3>, ) -> Instance
Creates a new instance
Sourcepub fn build(&self) -> InstanceRaw
pub fn build(&self) -> InstanceRaw
Gathers all information and builds a Raw Instance to be sent to GPU
Sourcepub fn set_position(&mut self, position: impl Into<Vec3>)
pub fn set_position(&mut self, position: impl Into<Vec3>)
Sets the position
Sourcepub fn set_rotation(&mut self, rotation: impl Into<Vec3>)
pub fn set_rotation(&mut self, rotation: impl Into<Vec3>)
Sets the rotation
Trait Implementations§
impl Copy for Instance
Auto Trait Implementations§
impl Freeze for Instance
impl RefUnwindSafe for Instance
impl Send for Instance
impl Sync for Instance
impl Unpin for Instance
impl UnwindSafe for Instance
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().