raisim::Constraints
class · #include <raisim/constraints/Constraints.hpp>
Derived by: raisim::LengthConstraint
Base class of world-level constraints (see LengthConstraint). Holds the name, visualization color and a mutex.
Constructors & destructor
Constraints
cpp
Constraints()~Constraints
cpp
virtual ~Constraints() = defaultPublic member functions
getColor
cpp
const Vec<4> &getColor() constReturns RGBA color used by the visualizer.
setColor
cpp
void setColor(const Vec<4> &color)Set the RGBA color used by the visualizer.
Parameters
| Parameter | Description |
|---|---|
color (in) | RGBA color. |
lockMutex
cpp
void lockMutex()locks the constraint mutex. This can be used if you use raisim in a multi-threaded environment.
lock
cpp
void lock()Same as lockMutex(); lets std::lock_guard / std::unique_lock be used with a constraint.
try_lock
cpp
bool try_lock()Try to lock the mutex without blocking.
Returns true if the lock was acquired.
unlockMutex
cpp
void unlockMutex()unlocks the constraint mutex. This can be used if you use raisim in a multi-threaded environment.
unlock
cpp
void unlock()Same as unlockMutex().