[][src]Trait nphysics3d::object::Body

pub trait Body<N: Real>: Downcast + Send + Sync {
    fn name(&self) -> &str;
fn set_name(&mut self, name: String);
fn update_kinematics(&mut self);
fn update_dynamics(&mut self, dt: N);
fn update_acceleration(
        &mut self,
        gravity: &Vector<N>,
        params: &IntegrationParameters<N>
    );
fn clear_forces(&mut self);
fn clear_update_flags(&mut self);
fn update_status(&self) -> BodyUpdateStatus;
fn apply_displacement(&mut self, disp: &[N]);
fn handle(&self) -> BodyHandle;
fn status(&self) -> BodyStatus;
fn set_status(&mut self, status: BodyStatus);
fn activation_status(&self) -> &ActivationStatus<N>;
fn set_deactivation_threshold(&mut self, threshold: Option<N>);
fn ndofs(&self) -> usize;
fn generalized_acceleration(&self) -> DVectorSlice<N>;
fn generalized_velocity(&self) -> DVectorSlice<N>;
fn companion_id(&self) -> usize;
fn set_companion_id(&mut self, id: usize);
fn generalized_velocity_mut(&mut self) -> DVectorSliceMut<N>;
fn integrate(&mut self, params: &IntegrationParameters<N>);
fn activate_with_energy(&mut self, energy: N);
fn deactivate(&mut self);
fn part(&self, i: usize) -> Option<&dyn BodyPart<N>>;
fn deformed_positions(&self) -> Option<(DeformationsType, &[N])>;
fn deformed_positions_mut(&mut self) -> Option<(DeformationsType, &mut [N])>;
fn fill_constraint_geometry(
        &self,
        part: &dyn BodyPart<N>,
        ndofs: usize,
        center: &Point<N>,
        dir: &ForceDirection<N>,
        j_id: usize,
        wj_id: usize,
        jacobians: &mut [N],
        inv_r: &mut N,
        ext_vels: Option<&DVectorSlice<N>>,
        out_vel: Option<&mut N>
    );
fn world_point_at_material_point(
        &self,
        part: &dyn BodyPart<N>,
        point: &Point<N>
    ) -> Point<N>;
fn position_at_material_point(
        &self,
        part: &dyn BodyPart<N>,
        point: &Point<N>
    ) -> Isometry<N>;
fn material_point_at_world_point(
        &self,
        part: &dyn BodyPart<N>,
        point: &Point<N>
    ) -> Point<N>;
fn has_active_internal_constraints(&mut self) -> bool;
fn setup_internal_velocity_constraints(
        &mut self,
        ext_vels: &DVectorSlice<N>,
        params: &IntegrationParameters<N>
    );
fn warmstart_internal_velocity_constraints(
        &mut self,
        dvels: &mut DVectorSliceMut<N>
    );
fn step_solve_internal_velocity_constraints(
        &mut self,
        dvels: &mut DVectorSliceMut<N>
    );
fn step_solve_internal_position_constraints(
        &mut self,
        params: &IntegrationParameters<N>
    );
fn gravity_enabled(&self) -> bool;
fn enable_gravity(&mut self, enabled: bool);
fn apply_force(
        &mut self,
        part_id: usize,
        force: &Force<N>,
        force_type: ForceType,
        auto_wake_up: bool
    );
fn apply_local_force(
        &mut self,
        part_id: usize,
        force: &Force<N>,
        force_type: ForceType,
        auto_wake_up: bool
    );
fn apply_force_at_point(
        &mut self,
        part_id: usize,
        force: &Vector<N>,
        point: &Point<N>,
        force_type: ForceType,
        auto_wake_up: bool
    );
fn apply_local_force_at_point(
        &mut self,
        part_id: usize,
        force: &Vector<N>,
        point: &Point<N>,
        force_type: ForceType,
        auto_wake_up: bool
    );
fn apply_force_at_local_point(
        &mut self,
        part_id: usize,
        force: &Vector<N>,
        point: &Point<N>,
        force_type: ForceType,
        auto_wake_up: bool
    );
fn apply_local_force_at_local_point(
        &mut self,
        part_id: usize,
        force: &Vector<N>,
        point: &Point<N>,
        force_type: ForceType,
        auto_wake_up: bool
    ); fn is_ground(&self) -> bool { ... }
fn update_activation_status(&mut self) { ... }
fn add_local_inertia_and_com(
        &mut self,
        _part_index: usize,
        _com: Point<N>,
        _inertia: Inertia<N>
    ) { ... }
fn status_dependent_ndofs(&self) -> usize { ... }
fn status_dependent_body_part_velocity(
        &self,
        part: &dyn BodyPart<N>
    ) -> Velocity<N> { ... }
fn is_active(&self) -> bool { ... }
fn is_dynamic(&self) -> bool { ... }
fn is_kinematic(&self) -> bool { ... }
fn is_static(&self) -> bool { ... }
fn activate(&mut self) { ... } }

Trait implemented by all bodies supported by nphysics.

Required Methods

The name of this body.

Sets the name of this body.

Updates the kinematics, e.g., positions and jacobians, of this body.

Update the dynamics property of this body.

Update the acceleration of this body given the forces it is subject to and the gravity.

Reset the timestep-specific dynamic information of this body.

Clear all the update flags of this body.

The flags tracking what modifications were applied to a body.

Applies a generalized displacement to this body.

The handle of this body.

The status of this body.

Set the status of this body.

Information regarding activation and deactivation (sleeping) of this body.

Sets the energy bellow which this body is put to sleep.

If set to None the body will never sleep.

The number of degrees of freedom of this body.

The generalized accelerations at each degree of freedom of this body.

The generalized velocities of this body.

The companion ID of this body.

Set the companion ID of this body (may be reinitialized by nphysics).

The mutable generalized velocities of this body.

Integrate the position of this body.

Force the activation of this body with the given level of energy.

Put this body to sleep.

A reference to the specified body part.

If this is a deformable body, returns its deformed positions.

If this is a deformable body, returns a mutable reference to its deformed positions.

Fills all the jacobians (and the jacobians multiplied by the inverse augmented mass matrix) for a constraint applying a force at the point center (relative to the body part's center of mass) and the direction dir.

If the force is a torque, it is applied at the center of mass of the body part.

Transform the given point expressed in material coordinates to world-space.

Transform the given point expressed in material coordinates to world-space.

Transform the given point expressed in material coordinates to world-space.

Returns true if this bodies contains internal constraints that need to be solved.

Initializes the internal velocity constraints of a body.

For warmstarting the solver, modifies the delta velocity applied by the internal constraints of this body.

Execute one step for the iterative resolution of this body's internal velocity constraints.

Execute one step for the iterative resolution of this body's internal position constraints.

Whether this body is affected by gravity.

Enable or disable gravity for this body.

Apply a force at the center of mass of a part of this body.

Apply a local force at the center of mass of a part of this body.

Apply a force at a given point of a part of this body.

Apply a local force at a given point of a part of this body.

Apply a force at a given local point of a part of this body.

Apply a local force at a given local point of a part of this body.

Provided Methods

Returns true if this body is the ground.

Update whether this body needs to be waken up after a user-interaction.

Add the given inertia to the local inertia of this body part.

The number of degrees of freedom (DOF) of this body, taking its status into account.

In particular, this returns 0 for any body with a status different than BodyStatus::Dynamic.

The velocity of the specified body part, taking this body status into account.

This will return a zero velocity for any body with a status different than BodyStatus::Dynamic.

Check if this body is active.

Whether or not the status of this body is dynamic.

Whether or not the status of this body is kinematic.

Whether or not the status of this body is static.

Force the activation of this body.

Methods

impl<N> dyn Body<N> where
    N: Any + 'static,
    N: Real, 

Returns true if the trait object wraps an object of type __T.

Returns a boxed object from a boxed trait object if the underlying object is of type __T. Returns the original boxed trait if it isn't.

Returns a reference to the object within the trait object if it is of type __T, or None if it isn't.

Returns a mutable reference to the object within the trait object if it is of type __T, or None if it isn't.

Implementors

impl<N: Real> Body<N> for FEMVolume<N>
[src]

Update the dynamics property of this deformable volume.

impl<N: Real> Body<N> for Ground<N>
[src]

impl<N: Real> Body<N> for MassConstraintSystem<N>
[src]

impl<N: Real> Body<N> for MassSpringSystem<N>
[src]

impl<N: Real> Body<N> for Multibody<N>
[src]

impl<N: Real> Body<N> for RigidBody<N>
[src]