pub struct InstancedModelPart<M: Material> { /* private fields */ }
Expand description
Part of an InstancedModel consisting of a InstancedMesh, some type of material and a set of possible animations.
Implementations§
Source§impl<M: Material> InstancedModelPart<M>
impl<M: Material> InstancedModelPart<M>
Sourcepub fn animations(&self) -> Vec<Option<String>>
pub fn animations(&self) -> Vec<Option<String>>
Returns a list of unique names for the animations for this model part. Use these names as input to Self::choose_animation.
Sourcepub fn choose_animation(&mut self, animation_name: Option<&str>)
pub fn choose_animation(&mut self, animation_name: Option<&str>)
Specifies the animation to use when Geometry::animate is called. Use the Self::animations method to get a list of possible animations.
Trait Implementations§
Source§impl<M: Material> Deref for InstancedModelPart<M>
impl<M: Material> Deref for InstancedModelPart<M>
Source§impl<M: Material> DerefMut for InstancedModelPart<M>
impl<M: Material> DerefMut for InstancedModelPart<M>
Source§impl<M: Material> Geometry for InstancedModelPart<M>
impl<M: Material> Geometry for InstancedModelPart<M>
Source§fn draw(
&self,
viewer: &dyn Viewer,
program: &Program,
render_states: RenderStates,
)
fn draw( &self, viewer: &dyn Viewer, program: &Program, render_states: RenderStates, )
Draw this geometry.
Source§fn vertex_shader_source(&self) -> String
fn vertex_shader_source(&self) -> String
Returns the vertex shader source for this geometry given that the fragment shader needs the given vertex attributes.
Source§fn id(&self) -> GeometryId
fn id(&self) -> GeometryId
Returns a unique ID for each variation of the shader source returned from
Geometry::vertex_shader_source
. Read moreSource§fn render_with_material(
&self,
material: &dyn Material,
viewer: &dyn Viewer,
lights: &[&dyn Light],
)
fn render_with_material( &self, material: &dyn Material, viewer: &dyn Viewer, lights: &[&dyn Light], )
Render the geometry with the given Material.
Must be called in the callback given as input to a RenderTarget, ColorTarget or DepthTarget write method.
Use an empty array for the
lights
argument, if the material does not require lights to be rendered.Source§fn render_with_effect(
&self,
material: &dyn Effect,
viewer: &dyn Viewer,
lights: &[&dyn Light],
color_texture: Option<ColorTexture<'_>>,
depth_texture: Option<DepthTexture<'_>>,
)
fn render_with_effect( &self, material: &dyn Effect, viewer: &dyn Viewer, lights: &[&dyn Light], color_texture: Option<ColorTexture<'_>>, depth_texture: Option<DepthTexture<'_>>, )
Render the geometry with the given Effect.
Must be called in the callback given as input to a RenderTarget, ColorTarget or DepthTarget write method.
Use an empty array for the
lights
argument, if the material does not require lights to be rendered.Source§fn aabb(&self) -> AxisAlignedBoundingBox
fn aabb(&self) -> AxisAlignedBoundingBox
Returns the AxisAlignedBoundingBox for this geometry in the global coordinate system.
Source§impl<'a, M: Material> IntoIterator for &'a InstancedModelPart<M>
impl<'a, M: Material> IntoIterator for &'a InstancedModelPart<M>
Source§impl<M: Material> Object for InstancedModelPart<M>
impl<M: Material> Object for InstancedModelPart<M>
Source§fn render(&self, viewer: &dyn Viewer, lights: &[&dyn Light])
fn render(&self, viewer: &dyn Viewer, lights: &[&dyn Light])
Render the object.
Use an empty array for the
lights
argument, if the objects does not require lights to be rendered.
Must be called in the callback given as input to a RenderTarget, ColorTarget or DepthTarget write method.Source§fn material_type(&self) -> MaterialType
fn material_type(&self) -> MaterialType
Returns the type of material applied to this object.
Auto Trait Implementations§
impl<M> !Freeze for InstancedModelPart<M>
impl<M> !RefUnwindSafe for InstancedModelPart<M>
impl<M> Send for InstancedModelPart<M>where
M: Send,
impl<M> Sync for InstancedModelPart<M>where
M: Sync,
impl<M> Unpin for InstancedModelPart<M>where
M: Unpin,
impl<M> !UnwindSafe for InstancedModelPart<M>
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