pub struct PrimitiveDescriptor {
pub visible: bool,
pub vertices_array: Array<Vertex>,
pub bounds: BoundingSphere,
pub indices_array: Array<u32>,
pub transform_id: Id<TransformDescriptor>,
pub material_id: Id<MaterialDescriptor>,
pub skin_id: Id<SkinDescriptor>,
pub morph_targets: Array<Array<MorphTarget>>,
pub morph_weights: Array<f32>,
pub geometry_descriptor_id: Id<GeometryDescriptor>,
}
Expand description
A draw call used to render some geometry.
Fields§
§visible: bool
§vertices_array: Array<Vertex>
§bounds: BoundingSphere
Bounding sphere of the entire primitive, in local space.
indices_array: Array<u32>
§transform_id: Id<TransformDescriptor>
§material_id: Id<MaterialDescriptor>
§skin_id: Id<SkinDescriptor>
§morph_targets: Array<Array<MorphTarget>>
§morph_weights: Array<f32>
§geometry_descriptor_id: Id<GeometryDescriptor>
Implementations§
Source§impl PrimitiveDescriptor
Offsets into the slab buffer for each field.
impl PrimitiveDescriptor
Offsets into the slab buffer for each field.
pub const OFFSET_OF_VISIBLE: Offset<bool, Self>
pub const SLAB_SIZE_OF_VISIBLE: usize = 1usize
pub const OFFSET_OF_VERTICES_ARRAY: Offset<Array<Vertex>, Self>
pub const SLAB_SIZE_OF_VERTICES_ARRAY: usize = 2usize
pub const OFFSET_OF_BOUNDS: Offset<BoundingSphere, Self>
pub const SLAB_SIZE_OF_BOUNDS: usize = 4usize
pub const OFFSET_OF_INDICES_ARRAY: Offset<Array<u32>, Self>
pub const SLAB_SIZE_OF_INDICES_ARRAY: usize = 2usize
pub const OFFSET_OF_TRANSFORM_ID: Offset<Id<TransformDescriptor>, Self>
pub const SLAB_SIZE_OF_TRANSFORM_ID: usize = 1usize
pub const OFFSET_OF_MATERIAL_ID: Offset<Id<MaterialDescriptor>, Self>
pub const SLAB_SIZE_OF_MATERIAL_ID: usize = 1usize
pub const OFFSET_OF_SKIN_ID: Offset<Id<SkinDescriptor>, Self>
pub const SLAB_SIZE_OF_SKIN_ID: usize = 1usize
pub const OFFSET_OF_MORPH_TARGETS: Offset<Array<Array<MorphTarget>>, Self>
pub const SLAB_SIZE_OF_MORPH_TARGETS: usize = 2usize
pub const OFFSET_OF_MORPH_WEIGHTS: Offset<Array<f32>, Self>
pub const SLAB_SIZE_OF_MORPH_WEIGHTS: usize = 2usize
pub const OFFSET_OF_GEOMETRY_DESCRIPTOR_ID: Offset<Id<GeometryDescriptor>, Self>
pub const SLAB_SIZE_OF_GEOMETRY_DESCRIPTOR_ID: usize = 1usize
Source§impl PrimitiveDescriptor
impl PrimitiveDescriptor
Sourcepub fn get_vertex_info(
&self,
vertex_index: u32,
geometry_slab: &[u32],
) -> VertexInfo
pub fn get_vertex_info( &self, vertex_index: u32, geometry_slab: &[u32], ) -> VertexInfo
Returns the vertex at the given index and its related values.
These values are often used in shaders, so they are grouped together.
Sourcepub fn get_transform(&self, vertex: Vertex, slab: &[u32]) -> TransformDescriptor
pub fn get_transform(&self, vertex: Vertex, slab: &[u32]) -> TransformDescriptor
Retrieve the transform of this primitive
.
This takes into consideration all skinning matrices.
Sourcepub fn get_vertex(&self, vertex_index: u32, slab: &[u32]) -> Vertex
pub fn get_vertex(&self, vertex_index: u32, slab: &[u32]) -> Vertex
Retrieve the vertex from the slab, calculating any displacement due to morph targets.
pub fn get_vertex_count(&self) -> u32
Trait Implementations§
Source§impl Clone for PrimitiveDescriptor
impl Clone for PrimitiveDescriptor
Source§fn clone(&self) -> PrimitiveDescriptor
fn clone(&self) -> PrimitiveDescriptor
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for PrimitiveDescriptor
impl Debug for PrimitiveDescriptor
Source§impl Default for PrimitiveDescriptor
impl Default for PrimitiveDescriptor
Source§impl PartialEq for PrimitiveDescriptor
impl PartialEq for PrimitiveDescriptor
Source§impl SlabItem for PrimitiveDescriptorwhere
bool: SlabItem,
Array<Vertex>: SlabItem,
BoundingSphere: SlabItem,
Array<u32>: SlabItem,
Id<TransformDescriptor>: SlabItem,
Id<MaterialDescriptor>: SlabItem,
Id<SkinDescriptor>: SlabItem,
Array<Array<MorphTarget>>: SlabItem,
Array<f32>: SlabItem,
Id<GeometryDescriptor>: SlabItem,
impl SlabItem for PrimitiveDescriptorwhere
bool: SlabItem,
Array<Vertex>: SlabItem,
BoundingSphere: SlabItem,
Array<u32>: SlabItem,
Id<TransformDescriptor>: SlabItem,
Id<MaterialDescriptor>: SlabItem,
Id<SkinDescriptor>: SlabItem,
Array<Array<MorphTarget>>: SlabItem,
Array<f32>: SlabItem,
Id<GeometryDescriptor>: SlabItem,
impl Copy for PrimitiveDescriptor
impl StructuralPartialEq for PrimitiveDescriptor
Auto Trait Implementations§
impl Freeze for PrimitiveDescriptor
impl RefUnwindSafe for PrimitiveDescriptor
impl Send for PrimitiveDescriptor
impl Sync for PrimitiveDescriptor
impl Unpin for PrimitiveDescriptor
impl UnwindSafe for PrimitiveDescriptor
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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 more§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self
with the foreground set to
value
.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red()
and
green()
, which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg()
:
use yansi::{Paint, Color};
painted.fg(Color::White);
Set foreground color to white using white()
.
use yansi::Paint;
painted.white();
§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self
with the background set to
value
.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red()
and
on_green()
, which have the same functionality but
are pithier.
§Example
Set background color to red using fg()
:
use yansi::{Paint, Color};
painted.bg(Color::Red);
Set background color to red using on_red()
.
use yansi::Paint;
painted.on_red();
§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling [Attribute
] value
.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold()
and
underline()
, which have the same functionality
but are pithier.
§Example
Make text bold using attr()
:
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);
Make text bold using using bold()
.
use yansi::Paint;
painted.bold();
§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi
[Quirk
] value
.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask()
and
wrap()
, which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk()
:
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);
Enable wrapping using wrap()
.
use yansi::Paint;
painted.wrap();
§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting()
due to conflicts with Vec::clear()
.
The clear()
method will be removed in a future release.
fn clear(&self) -> Painted<&T>
resetting()
due to conflicts with Vec::clear()
.
The clear()
method will be removed in a future release.§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the [Condition
] value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted
only when both stdout
and stderr
are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);
§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>
ReadEndian::read_from_little_endian()
.