RobWorkProject  23.9.11-
Public Member Functions | List of all members
BtConstraint Class Reference

Allows constraining the motion between two bodies in Bullet simulation. More...

#include <BtConstraint.hpp>

Public Member Functions

 BtConstraint (rw::core::Ptr< const rwsim::dynamics::Constraint > constraint, const BtBody *const parent, const BtBody *const child, btDynamicsWorld *btWorld)
 Construct a new Bullet implementation of a Constraint. More...
 
virtual ~BtConstraint ()
 Destructor.
 
btTypedConstraint * getBtConstraint () const
 Get the Bullet constraint that this class is wrapping. More...
 
rw::core::Ptr< const rwsim::dynamics::ConstraintgetRWConstraint () const
 Get the RobWork constraint. More...
 
btRigidBody * getBtParent () const
 Get the Bullet parent body. More...
 
btRigidBody * getBtChild () const
 Get the Bullet child body. More...
 
rw::math::Vector3D getRefA () const
 Get the position where feedback force and torque act on first body. More...
 
rw::math::Vector3D getRefB () const
 Get the position where feedback force and torque act on second body. More...
 
void update (const double dt, rw::kinematics::State &state)
 Update spring forces based on given position and velocities. More...
 
void postUpdate (rw::kinematics::State &state)
 Update RobWork state with forces. More...
 
btJointFeedback * getFeedback ()
 Get the feedback for the constraint. More...
 

Detailed Description

Allows constraining the motion between two bodies in Bullet simulation.

This is the Bullet implementation of rwsim::dynamics::Constraint

Constructor & Destructor Documentation

◆ BtConstraint()

BtConstraint ( rw::core::Ptr< const rwsim::dynamics::Constraint constraint,
const BtBody *const  parent,
const BtBody *const  child,
btDynamicsWorld *  btWorld 
)

Construct a new Bullet implementation of a Constraint.

Parameters
constraint[in] the RobWork constraint.
parent[in] the parent Bullet body.
child[in] the child Bullet body.
btWorld[in] the Bullet world that this constraint should belong to.

Member Function Documentation

◆ getBtChild()

btRigidBody* getBtChild ( ) const

Get the Bullet child body.

Returns
a pointer to a btRigidBody.

◆ getBtConstraint()

btTypedConstraint* getBtConstraint ( ) const

Get the Bullet constraint that this class is wrapping.

Returns
a pointer to a btTypedConstraint.

◆ getBtParent()

btRigidBody* getBtParent ( ) const

Get the Bullet parent body.

Returns
a pointer to a btRigidBody.

◆ getFeedback()

btJointFeedback* getFeedback ( )

Get the feedback for the constraint.

Returns
the bullet feedback.

◆ getRefA()

rw::math::Vector3D getRefA ( ) const

Get the position where feedback force and torque act on first body.

Returns
the position in world coordinates.

◆ getRefB()

rw::math::Vector3D getRefB ( ) const

Get the position where feedback force and torque act on second body.

Returns
the position in world coordinates.

◆ getRWConstraint()

rw::core::Ptr<const rwsim::dynamics::Constraint> getRWConstraint ( ) const

Get the RobWork constraint.

Returns
a pointer to a constant Constraint object.

◆ postUpdate()

void postUpdate ( rw::kinematics::State state)

Update RobWork state with forces.

Parameters
state[in/out] the state to update.

◆ update()

void update ( const double  dt,
rw::kinematics::State state 
)

Update spring forces based on given position and velocities.

Parameters
dt[in] information about the step size.
state[in/out] the state.

The documentation for this class was generated from the following file: