6 #ifndef CNOID_BODY_WORLD_H_INCLUDED
7 #define CNOID_BODY_WORLD_H_INCLUDED
28 inline int numBodies() {
return bodyInfoArray.size(); }
42 BodyPtr body(
const std::string& name);
50 return bodyInfoArray[index].forwardDynamics;
58 int bodyIndex(
const std::string& name);
76 void clearCollisionPairs();
82 void setTimeStep(
double dt);
88 double timeStep(
void)
const {
return timeStep_; }
94 void setCurrentTime(
double tm);
106 void setGravityAcceleration(
const Vector3& g);
119 void enableSensors(
bool on);
124 void setEulerMethod();
129 void setRungeKuttaMethod();
139 virtual void calcNextState();
147 std::pair<int,bool> getIndexOfLinkPairs(
Link* link1,
Link* link2);
163 typedef std::map<std::string, int> NameToIndexMap;
164 NameToIndexMap nameToBodyIndexMap;
166 typedef std::map<BodyPtr, int> BodyToIndexMap;
167 BodyToIndexMap bodyToIndexMap;
172 bool operator<(
const LinkPairKey& pair2)
const;
174 typedef std::map<LinkPairKey, int> LinkPairKeyToIndexMap;
175 LinkPairKeyToIndexMap linkPairKeyToIndexMap;
177 int numRegisteredLinkPairs;