Skip to main content

GpuDraw

Struct GpuDraw 

Source
pub struct GpuDraw<'a> {
    pub primitive_id: PrimitiveId,
    pub node_id: NodeId,
    pub material_id: Option<MaterialId>,
    pub evaluated_material: Option<&'a EvaluatedMaterial>,
    pub skin_id: Option<SkinId>,
    pub primitive: &'a RenderPrimitive,
    pub world_matrix: Mat4,
    pub morph_weights: &'a [f32],
    pub joint_matrices: &'a [Mat4],
    /* private fields */
}
Expand description

One GPU draw with stable asset identifiers and frame-local values.

Fields§

§primitive_id: PrimitiveId

Stable identifier of the source primitive.

§node_id: NodeId

Stable identifier of the node that instantiates the primitive.

§material_id: Option<MaterialId>

Stable identifier of the primitive material, if present.

§evaluated_material: Option<&'a EvaluatedMaterial>

Dynamic material values matching material_id, when the draw has one.

§skin_id: Option<SkinId>

Stable identifier of the skin used by the draw, if present.

§primitive: &'a RenderPrimitive

Immutable geometry and attribute data for the draw.

§world_matrix: Mat4

Current world transform of the primitive node.

Apply this matrix to unskinned primitives. Self::joint_matrices already produce world-space output for skinned primitives, so applying both would transform those vertices twice.

§morph_weights: &'a [f32]

Current morph weights in the order of RenderPrimitive::morph_targets.

§joint_matrices: &'a [Mat4]

Current world-space joint matrices in the selected crate::Skin joint order.

The slice is empty for an unskinned draw. A shader indexes it through every consecutive JOINTS_n / WEIGHTS_n set on Self::primitive.

Implementations§

Source§

impl<'a> GpuDraw<'a>

Source

pub fn indices(&self, camera: CameraMode) -> Cow<'a, [u32]>

Returns the source indices visible to the selected camera.

Auto Trait Implementations§

§

impl<'a> Freeze for GpuDraw<'a>

§

impl<'a> RefUnwindSafe for GpuDraw<'a>

§

impl<'a> Send for GpuDraw<'a>

§

impl<'a> Sync for GpuDraw<'a>

§

impl<'a> Unpin for GpuDraw<'a>

§

impl<'a> UnsafeUnpin for GpuDraw<'a>

§

impl<'a> UnwindSafe for GpuDraw<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.