pub struct SkeletonBuilder { /* private fields */ }Expand description
Fluent builder for constructing a Skeleton.
ⓘ
let skeleton = SkeletonBuilder::new()
.add_bone("root", None, Transform3D::identity())
.add_bone("hip", Some("root"), Transform3D::new(Vec3::new(0.0, 1.0, 0.0), Quat::IDENTITY, Vec3::ONE))
.add_bone("spine", Some("hip"), Transform3D::new(Vec3::new(0.0, 0.3, 0.0), Quat::IDENTITY, Vec3::ONE))
.build();Implementations§
Source§impl SkeletonBuilder
impl SkeletonBuilder
pub fn new() -> Self
Sourcepub fn add_bone(
self,
name: impl Into<String>,
parent: Option<&str>,
local_bind_pose: Transform3D,
) -> Self
pub fn add_bone( self, name: impl Into<String>, parent: Option<&str>, local_bind_pose: Transform3D, ) -> Self
Add a bone with an optional parent name.
Bones must be added in topological order (parent before child).
Trait Implementations§
Source§impl Debug for SkeletonBuilder
impl Debug for SkeletonBuilder
Source§impl Default for SkeletonBuilder
impl Default for SkeletonBuilder
Source§fn default() -> SkeletonBuilder
fn default() -> SkeletonBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SkeletonBuilder
impl RefUnwindSafe for SkeletonBuilder
impl Send for SkeletonBuilder
impl Sync for SkeletonBuilder
impl Unpin for SkeletonBuilder
impl UnsafeUnpin for SkeletonBuilder
impl UnwindSafe for SkeletonBuilder
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
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.