pub struct ChannelDesc {
pub name: String,
pub width: usize,
pub kind: ChannelKind,
pub policy: TopologyPolicy,
pub default: f32,
pub topology_bound: bool,
}Expand description
Describes a per-vertex attribute channel.
Fields§
§name: String§width: usizeValues per vertex, 1 to 4.
kind: ChannelKind§policy: TopologyPolicy§default: f32Value for new vertices without usable parents, and for derived channels.
topology_bound: boolThe values describe the mesh as it was when they were written, so they
stop being true when it changes in ways they cannot follow. A commit that
changes topology drops the channel, as
Transaction::drop_channel would (its
undo brings it back), unless the writes ran under
Transaction::keeping_bound_channels.
Undoing or redoing a patch recorded before the channel was added removes
the channel for good: that takes the mesh to a state it never described.
Implementations§
Source§impl ChannelDesc
impl ChannelDesc
Sourcepub fn source(name: impl Into<String>, width: usize) -> Self
pub fn source(name: impl Into<String>, width: usize) -> Self
A source channel that interpolates values for new vertices and defaults to 0.
Sourcepub fn derived(name: impl Into<String>, width: usize) -> Self
pub fn derived(name: impl Into<String>, width: usize) -> Self
A derived channel whose new values are NaN until computed.
Sourcepub fn uv() -> Self
pub fn uv() -> Self
The UV channel: UV_CHANNEL, a source channel of 2 interpolated values.
Sourcepub fn bound_to_topology(self) -> Self
pub fn bound_to_topology(self) -> Self
Makes the channel topology_bound.
pub fn with_policy(self, policy: TopologyPolicy) -> Self
pub fn with_default(self, default: f32) -> Self
Trait Implementations§
Source§impl Clone for ChannelDesc
impl Clone for ChannelDesc
Source§fn clone(&self) -> ChannelDesc
fn clone(&self) -> ChannelDesc
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more