pub struct BoneDesc {Show 19 fields
pub id: BoneId,
pub name: String,
pub role: BoneRole,
pub parent: BoneId,
pub children: Vec<BoneId>,
pub head: Vec3,
pub tail: Vec3,
pub roll: f32,
pub envelope_radius: f32,
pub envelope_head_dist: f32,
pub envelope_tail_dist: f32,
pub rest_rotation: Quat,
pub pose_rotation: Quat,
pub pose_translate: Vec3,
pub constraint: BoneConstraint,
pub ik_enabled: bool,
pub ik_stretch: f32,
pub visible: bool,
pub locked: bool,
}Expand description
Descriptor for a single bone in the skeleton.
Fields§
§id: BoneId§name: String§role: BoneRole§parent: BoneId§children: Vec<BoneId>§head: Vec3Head position in object (rest) space.
tail: Vec3Tail position in object (rest) space.
roll: f32Roll angle around the bone’s Y axis (radians).
envelope_radius: f32Envelope capsule radius (for weight painting).
envelope_head_dist: f32Envelope head/tail blending distances.
envelope_tail_dist: f32§rest_rotation: QuatRest rotation (local space).
pose_rotation: QuatCurrent pose rotation (local space, FK only).
pose_translate: Vec3Current pose translation offset from rest.
constraint: BoneConstraintConstraint on rotation angles.
ik_enabled: boolWhether this bone participates in IK.
ik_stretch: f32IK stretch factor [0, 1].
visible: bool§locked: boolImplementations§
Source§impl BoneDesc
impl BoneDesc
pub fn new(id: BoneId, name: impl Into<String>, head: Vec3, tail: Vec3) -> Self
Sourcepub fn bone_matrix(&self) -> Mat4
pub fn bone_matrix(&self) -> Mat4
Local bone-space matrix (bone Y = bone direction, X = perp).
Sourcepub fn envelope_weight(&self, p: Vec3) -> f32
pub fn envelope_weight(&self, p: Vec3) -> f32
Compute skinning weight for a surface point p using capsule envelope.
Sourcepub fn world_head(&self, parent_world: Mat4) -> Vec3
pub fn world_head(&self, parent_world: Mat4) -> Vec3
FK: compute world-space head position given parent’s world matrix.
Sourcepub fn world_tail(&self, parent_world: Mat4) -> Vec3
pub fn world_tail(&self, parent_world: Mat4) -> Vec3
FK: compute world-space tail position.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BoneDesc
impl RefUnwindSafe for BoneDesc
impl Send for BoneDesc
impl Sync for BoneDesc
impl Unpin for BoneDesc
impl UnsafeUnpin for BoneDesc
impl UnwindSafe for BoneDesc
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.