#[repr(C)]pub struct VertexTetBinding {
pub tet_element_index: u32,
pub barycentric_unorm16: [u16; 4],
pub normal_rotation_oct16: [i16; 2],
}Expand description
16-byte POD record binding one surface vertex to a volumetric tetrahedron.
Fields§
§tet_element_index: u32Index of the host tetrahedron in the volumetric element array (4B).
barycentric_unorm16: [u16; 4]Quantized barycentric weights [w0, w1, w2, w3] summing to 65535 (8B).
normal_rotation_oct16: [i16; 2]Rest-pose surface normal or local frame axis in octahedral snorm16 (4B).
Implementations§
Source§impl VertexTetBinding
impl VertexTetBinding
Sourcepub fn from_barycentric(
tet_element_index: u32,
weights: [f32; 4],
normal_dir: [f32; 3],
) -> Self
pub fn from_barycentric( tet_element_index: u32, weights: [f32; 4], normal_dir: [f32; 3], ) -> Self
Quantize floating-point barycentric weights [w0, w1, w2, w3] and a 3D normal
into a 16-byte VertexTetBinding whose barycentric_unorm16 sums to 65535.
Sourcepub fn barycentric_weights(&self) -> [f32; 4]
pub fn barycentric_weights(&self) -> [f32; 4]
Convert quantized unorm16 weights back to normalized [f32; 4] weights.
Sourcepub fn interpolate_deformed_vertex(
&self,
tet_corners: [[f32; 3]; 4],
) -> [f32; 3]
pub fn interpolate_deformed_vertex( &self, tet_corners: [[f32; 3]; 4], ) -> [f32; 3]
Interpolate the deformed 3D surface vertex position from deformed tetrahedron corners.
Sourcepub fn decoded_normal_dir(&self) -> [f32; 3]
pub fn decoded_normal_dir(&self) -> [f32; 3]
Decode the octahedral normal rotation field back into a unit 3D vector.
Trait Implementations§
Source§impl Clone for VertexTetBinding
impl Clone for VertexTetBinding
impl Copy for VertexTetBinding
Source§impl Debug for VertexTetBinding
impl Debug for VertexTetBinding
impl Eq for VertexTetBinding
Source§impl PartialEq for VertexTetBinding
impl PartialEq for VertexTetBinding
impl Pod for VertexTetBinding
impl StructuralPartialEq for VertexTetBinding
Auto Trait Implementations§
impl Freeze for VertexTetBinding
impl RefUnwindSafe for VertexTetBinding
impl Send for VertexTetBinding
impl Sync for VertexTetBinding
impl Unpin for VertexTetBinding
impl UnsafeUnpin for VertexTetBinding
impl UnwindSafe for VertexTetBinding
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
Aggregate shares in an MPC protocol.
impl<T> AnyBitPattern for Twhere
T: Pod,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
§type Bits = T
type Bits = T
Self must have the same layout as the specified Bits except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern.§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
If this function returns true, then it must be valid to reinterpret
bits
as &Self.Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
impl<T> Interleave for Twhere
T: Pod,
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> ⓘ
Converts
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> ⓘ
Converts
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