raisim::Compound
class · #include <raisim/object/singleBodies/Compound.hpp>
Inherits: raisim::SingleBodyObject
A rigid body composed of primitive children (BOX, CYLINDER, CAPSULE, SPHERE) with user-given mass properties. Create it with World::addCompound().
Nested classes
structCompoundObjectChild — One primitive child of a compound.
Constructors & destructor
Compound
Compound(
const std::vector<CompoundObjectChild> &list,
double mass,
const Vec<3> &COM,
const Mat<3, 3> &inertia)Parameters
| Parameter | Description |
|---|---|
list (in) | children (at least two; fatal error otherwise) |
mass (in) | total mass (kg) |
COM (in) | center of mass in the body frame (m) |
inertia (in) | inertia about the COM in the body frame (kg m^2) |
Public member functions
getObjList
const std::vector<CompoundObjectChild> &getObjList()returns the children of the compound
Returns the children of the compound
getCollisionBodyList
const std::vector<CollisionBodyHandle> &getCollisionBodyList()returns the collision list of the compound
Returns one collision body per child, in the order of getObjList()
setBodyType
void setBodyType(BodyType type) finalset the body type. Dynamic means that object is free to move. Kinematic means that the object can have velocity but has an infinite mass (like a conveyor belt). A kinematic body moves with its set velocity and ignores forces, gravity and contacts. Static means that the object cannot move and has an infinite mass.
Parameters
| Parameter | Description |
|---|---|
type (in) | the body type |
destroyCollisionBodies
void destroyCollisionBodies() finalInternal: releases collision bodies before removal.
updateContactAabbs
void updateContactAabbs() overrideInternal: recomputes the world-frame AABBs used by the broadphase.
Inherited members
From raisim::SingleBodyObject: clearExternalForcesAndTorques, getAngularVelocity, getAppearance, getBodyToComPosition_rs, getCollisionBody, getCollisionGroup, getCollisionMask, getCom, getComPosition, getComPosition_rs, getContactPointVel, getDOF, getEnergy, getGeneralizedCoordinateDim, getGyroscopicMode, getInertiaMatrix_B, getInertiaMatrix_B_rs, getInertiaMatrix_W, getInertiaMatrix_W_rs, getKineticEnergy, getLinearMomentum, getLinearVelocity, getMass, getObjectType, getOrientation, getPosition, getPotentialEnergy, getQuaternion, getRotationMatrix, getVelocity, integrate, preContactSolverUpdate1, preContactSolverUpdate2, setAngularDamping, setAngularVelocity, setAppearance, setCom, setConstraintForce, setExternalForce, setExternalTorque, setGyroscopicMode, setInertia, setLinearDamping, setLinearVelocity, setMass, setOrientation, setPose, setPosition, setVelocity
From raisim::Object: addContactToPerObjectContact, clearPerObjectContact, getBodyType, getContactAabb, getContactAabbCount, getContacts, getExternalForce, getExternalForcePosition, getExternalTorque, getExternalTorquePosition, getId, getIndexInWorld, getName, getRenderRevision, Id, lock, lockMutex, setIndexInWorld, setName, try_lock, unlock, unlockMutex