9 #include <argos3/plugins/simulator/physics_engines/dynamics3d/dynamics3d_model.h>
26 std::vector<std::shared_ptr<CDynamics3DModel::CAbstractBody> >& vecBodies = c_model.
GetBodies();
27 m_vecTargets.insert(std::end(m_vecTargets),
28 std::begin(vecBodies),
37 std::remove_if(std::begin(m_vecTargets),
38 std::end(m_vecTargets),
39 [&c_model] (
const std::shared_ptr<CDynamics3DModel::CAbstractBody>& ptr_body) {
40 return (&ptr_body->GetModel() == &c_model);
42 m_vecTargets.erase(itRemove, std::end(m_vecTargets));
49 for(std::shared_ptr<CDynamics3DModel::CAbstractBody>& ptr_body : m_vecTargets) {
50 btVector3 cGravity(0.0, -m_fAcceleration * ptr_body->GetData().Mass, 0.0);
51 ptr_body->ApplyForce(cGravity);
60 "Michael Allwright [allsey87@gmail.com]",
62 "Applies a gravity force to all bodies in the simulation",
63 "For a description on how to use this plugin, please consult the documentation\n"
64 "for the dynamics3d physics engine plugin",
The namespace containing all the ARGoS related code.
REGISTER_DYNAMICS3D_PLUGIN(CDynamics3DFloorPlugin, "floor", "Michael Allwright [allsey87@gmail.com]", "1.0", "Inserts a floor into the 3D dynamics engine", "For a description on how to use this plugin, please consult the documentation\n" "for the dynamics3d physics engine plugin", "Usable")
void GetNodeAttributeOrDefault(TConfigurationNode &t_node, const std::string &str_attribute, T &t_buffer, const T &t_default)
Returns the value of a node's attribute, or the passed default value.
ticpp::Element TConfigurationNode
The ARGoS configuration XML node.
virtual void Init(TConfigurationNode &t_tree)
virtual void UnregisterModel(CDynamics3DModel &c_model)
virtual void RegisterModel(CDynamics3DModel &c_model)
std::vector< std::shared_ptr< CAbstractBody > > & GetBodies()