pub struct ModelBuilder { /* private fields */ }Expand description
Builder for constructing models.
Implementations§
Source§impl ModelBuilder
impl ModelBuilder
Sourcepub fn new() -> ModelBuilder
pub fn new() -> ModelBuilder
Start building a new model.
Sourcepub fn gravity(
self,
g: Matrix<f64, Const<3>, Const<1>, ArrayStorage<f64, 3, 1>>,
) -> ModelBuilder
pub fn gravity( self, g: Matrix<f64, Const<3>, Const<1>, ArrayStorage<f64, 3, 1>>, ) -> ModelBuilder
Set the gravity vector.
Sourcepub fn dt(self, dt: f64) -> ModelBuilder
pub fn dt(self, dt: f64) -> ModelBuilder
Set the timestep.
Sourcepub fn add_revolute_body(
self,
name: &str,
parent: i32,
parent_to_joint: SpatialTransform,
inertia: SpatialInertia,
) -> ModelBuilder
pub fn add_revolute_body( self, name: &str, parent: i32, parent_to_joint: SpatialTransform, inertia: SpatialInertia, ) -> ModelBuilder
Add a body with a revolute joint attached to the given parent.
parent is the index of the parent body, or -1 for world.
parent_to_joint is the transform from parent body frame to joint frame.
inertia is the body’s spatial inertia in its own frame.
Sourcepub fn add_prismatic_body(
self,
name: &str,
parent: i32,
parent_to_joint: SpatialTransform,
axis: Matrix<f64, Const<3>, Const<1>, ArrayStorage<f64, 3, 1>>,
inertia: SpatialInertia,
) -> ModelBuilder
pub fn add_prismatic_body( self, name: &str, parent: i32, parent_to_joint: SpatialTransform, axis: Matrix<f64, Const<3>, Const<1>, ArrayStorage<f64, 3, 1>>, inertia: SpatialInertia, ) -> ModelBuilder
Add a body with a prismatic joint attached to the given parent.
Sourcepub fn add_spherical_body(
self,
name: &str,
parent: i32,
parent_to_joint: SpatialTransform,
inertia: SpatialInertia,
) -> ModelBuilder
pub fn add_spherical_body( self, name: &str, parent: i32, parent_to_joint: SpatialTransform, inertia: SpatialInertia, ) -> ModelBuilder
Add a body with a spherical (ball) joint attached to the given parent.
Sourcepub fn add_free_body(
self,
name: &str,
parent: i32,
parent_to_joint: SpatialTransform,
inertia: SpatialInertia,
) -> ModelBuilder
pub fn add_free_body( self, name: &str, parent: i32, parent_to_joint: SpatialTransform, inertia: SpatialInertia, ) -> ModelBuilder
Add a body with a free joint (6 DOF) attached to the given parent.
Sourcepub fn add_fixed_body(
self,
name: &str,
parent: i32,
parent_to_joint: SpatialTransform,
inertia: SpatialInertia,
) -> ModelBuilder
pub fn add_fixed_body( self, name: &str, parent: i32, parent_to_joint: SpatialTransform, inertia: SpatialInertia, ) -> ModelBuilder
Add a body with a fixed joint (0 DOF) attached to the given parent.
Sourcepub fn add_body(
self,
name: &str,
parent: i32,
joint: Joint,
inertia: SpatialInertia,
) -> ModelBuilder
pub fn add_body( self, name: &str, parent: i32, joint: Joint, inertia: SpatialInertia, ) -> ModelBuilder
Add a generic joint and body.
Sourcepub fn add_free_body_with_geometry(
self,
name: &str,
parent: i32,
parent_to_joint: SpatialTransform,
inertia: SpatialInertia,
geometry: Body,
) -> ModelBuilder
pub fn add_free_body_with_geometry( self, name: &str, parent: i32, parent_to_joint: SpatialTransform, inertia: SpatialInertia, geometry: Body, ) -> ModelBuilder
Add a free body with collision geometry (useful for dropping objects).
Trait Implementations§
Source§impl Default for ModelBuilder
impl Default for ModelBuilder
Source§fn default() -> ModelBuilder
fn default() -> ModelBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ModelBuilder
impl RefUnwindSafe for ModelBuilder
impl Send for ModelBuilder
impl Sync for ModelBuilder
impl Unpin for ModelBuilder
impl UnsafeUnpin for ModelBuilder
impl UnwindSafe for ModelBuilder
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<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.