pub struct Sprites { /* private fields */ }Expand description
A set of sprites, ie. a set of quads that orients itself towards the camera. The sprites will always orient themselves towards the camera, but if a direction is specified, the sprite normals will also always be orthogonal to that direction. For example, if the up direction is specified, the sprites will rotate around the up direction trying to face the camera. Sprites are also known as billboards in the case where no direction is specified.
Implementations
sourceimpl Sprites
impl Sprites
sourcepub fn new(
context: &Context,
centers: &[Vec3],
direction: Option<Vec3>
) -> ThreeDResult<Self>
pub fn new(
context: &Context,
centers: &[Vec3],
direction: Option<Vec3>
) -> ThreeDResult<Self>
Create a new set of Sprites with the given centers. The centers also determines the number of sprites. The sprites will always orient themselves towards the camera, but if a direction is specified, the sprite normals will always be orthogonal to that direction.
sourcepub fn transformation(&self) -> Mat4
pub fn transformation(&self) -> Mat4
Returns the local to world transformation applied to all sprites.
sourcepub fn set_transformation(&mut self, transformation: Mat4)
pub fn set_transformation(&mut self, transformation: Mat4)
Set the local to world transformation applied to all sprites.
sourcepub fn set_direction(&mut self, direction: Option<Vec3>)
pub fn set_direction(&mut self, direction: Option<Vec3>)
Set a direction the sprite normals are always orthogonal to.
sourcepub fn set_centers(&mut self, centers: &[Vec3]) -> ThreeDResult<()>
pub fn set_centers(&mut self, centers: &[Vec3]) -> ThreeDResult<()>
Set the centers of the sprites. The centers also determines the number of sprites.
Trait Implementations
sourceimpl Geometry for Sprites
impl Geometry for Sprites
sourcefn render_with_material(
&self,
material: &dyn Material,
camera: &Camera,
lights: &[&dyn Light]
) -> ThreeDResult<()>
fn render_with_material(
&self,
material: &dyn Material,
camera: &Camera,
lights: &[&dyn Light]
) -> ThreeDResult<()>
Render the geometry with the given material.
Must be called in a render target render function,
for example in the callback function of Screen::write.
You can use an empty array for the lights argument, if you know the object does not require lights to be rendered. Read more
sourcefn aabb(&self) -> AxisAlignedBoundingBox
fn aabb(&self) -> AxisAlignedBoundingBox
Returns the AxisAlignedBoundingBox for this geometry in the global coordinate system. Read more
Auto Trait Implementations
impl !RefUnwindSafe for Sprites
impl !Send for Sprites
impl !Sync for Sprites
impl Unpin for Sprites
impl !UnwindSafe for Sprites
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more