Skip to content

raisim::CollisionDefinition ​

struct · #include <raisim/object/ArticulatedSystem/JointAndBodies.hpp>

collision definition that is stored in Articulated System (see ArticulatedSystem::getCollisionBodies()). CollisionBody stores how the collision body should be displayed as well. This only stores physics part

Constructors & destructor ​

CollisionDefinition ​

cpp
CollisionDefinition(
    const raisim::Mat<3, 3> &rotOffsetI,
    const raisim::Vec<3> &posOffsetI,
    size_t localIdxI,
    std::string nameI)

Parameters

ParameterDescription
rotOffsetI (in)orientation offset relative to the body frame
posOffsetI (in)position offset in the body frame [m]
localIdxI (in)body index
nameI (in)collision body name

Public member functions ​

setMaterial ​

cpp
void setMaterial(const std::string &material)

Set the contact material (see World::setMaterialPairProp()).

Parameters

ParameterDescription
material (in)material name

getMaterial ​

cpp
const std::string &getMaterial()

Returns the contact material name

getCollisionBody ​

cpp
CollisionBodyHandleConstPtr getCollisionBody() const

Returns pointer to the collision body (owned by this definition)

cpp
CollisionBodyHandlePtr getCollisionBody()

Returns pointer to the collision body (owned by this definition)

setCollisionGroup ​

cpp
void setCollisionGroup(CollisionGroup group)

Parameters

ParameterDescription
group (in)collision group bits of this body

setCollisionMask ​

cpp
void setCollisionMask(CollisionGroup mask)

Parameters

ParameterDescription
mask (in)collision mask bits (groups this body can collide with)

getCollisionGroup ​

cpp
CollisionGroup getCollisionGroup() const

Returns collision group bits

getCollisionMask ​

cpp
CollisionGroup getCollisionMask() const

Returns collision mask bits

Public attributes ​

rotOffset ​

cpp
raisim::Mat<3, 3> rotOffset

Rotation offset from the body frame to the collision frame.

posOffset ​

cpp
raisim::Vec<3> posOffset

Position offset from the body frame to the collision frame, expressed in the body frame [m].

localIdx ​

cpp
size_t localIdx

Body index within the articulated system.

colBody ​

cpp
CollisionBodyHandle colBody

Collision body handle for this definition.

shape ​

cpp
Shape::Type shape

Shape type for the collision geometry.

shapeParam ​

cpp
raisim::Vec<4> shapeParam

Shape parameters [m]: box {x, y, z} (full lengths), sphere {radius}, cylinder/capsule {radius, length}.

scale ​

cpp
raisim::Vec<3> scale

Per-axis scale (used for mesh shapes).

meshIndex ​

cpp
int meshIndex

Internal: mesh index into the articulated system mesh list (-1 for primitives).

RaiSim — physics for robotics and AI.