pub struct Instance {
pub position: Vector3,
pub rotation: Vector3,
pub scale: Vector3,
}Expand description
Instance buffer data storage
Fields§
§position: Vector3The position of the instance
rotation: Vector3The rotation of the instance
scale: Vector3The scale of the instance
Implementations§
Source§impl Instance
impl Instance
Sourcepub fn new(
position: impl Into<Vector3>,
rotation: impl Into<Vector3>,
scale: impl Into<Vector3>,
) -> Self
👎Deprecated
pub fn new( position: impl Into<Vector3>, rotation: impl Into<Vector3>, scale: impl Into<Vector3>, ) -> Self
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<Vector3>)
pub fn set_position(&mut self, position: impl Into<Vector3>)
Sets the position
Sourcepub fn set_rotation(&mut self, rotation: impl Into<Vector3>)
pub fn set_rotation(&mut self, rotation: impl Into<Vector3>)
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().