68 public:
virtual ~
Link();
72 public:
virtual void Load(sdf::ElementPtr _sdf);
75 public:
virtual void Init();
84 public:
void ResetPhysicsStates();
88 public:
virtual void UpdateParameters(sdf::ElementPtr _sdf);
101 public:
virtual void SetEnabled(
bool _enable)
const = 0;
105 public:
virtual bool GetEnabled()
const = 0;
110 public:
virtual bool SetSelected(
bool _set);
114 public:
virtual void SetGravityMode(
bool _mode) = 0;
118 public:
virtual bool GetGravityMode()
const = 0;
123 public:
virtual void SetSelfCollide(
bool _collide) = 0;
133 public:
void SetCollideMode(
const std::string &_mode);
138 public:
bool GetSelfCollide()
const;
142 public:
void SetLaserRetro(
float _retro);
146 public:
virtual void SetLinearVel(
const math::Vector3 &_vel) = 0;
150 public:
virtual void SetAngularVel(
const math::Vector3 &_vel) = 0;
162 public:
virtual void SetForce(
const math::Vector3 &_force) = 0;
166 public:
virtual void SetTorque(
const math::Vector3 &_torque) = 0;
170 public:
virtual void AddForce(
const math::Vector3 &_force) = 0;
175 public:
virtual void AddRelativeForce(
const math::Vector3 &_force) = 0;
180 public:
virtual void AddForceAtWorldPosition(
const math::Vector3 &_force,
187 public:
virtual void AddForceAtRelativePosition(
193 public:
virtual void AddTorque(
const math::Vector3 &_torque) = 0;
198 public:
virtual void AddRelativeTorque(
const math::Vector3 &_torque) = 0;
237 public:
virtual math::Vector3 GetWorldCoGLinearVel()
const = 0;
290 public:
void SetInertial(
const InertialPtr &_inertial);
297 public:
math::Pose GetWorldInertialPose()
const;
309 public:
CollisionPtr GetCollisionById(
unsigned int _id)
const;
315 public:
CollisionPtr GetCollision(
const std::string &_name);
320 public:
CollisionPtr GetCollision(
unsigned int _index)
const;
329 public:
virtual math::Box GetBoundingBox()
const;
333 public:
virtual void SetLinearDamping(
double _damping) = 0;
337 public:
virtual void SetAngularDamping(
double _damping) = 0;
341 public:
double GetLinearDamping()
const;
345 public:
double GetAngularDamping()
const;
350 public:
virtual void SetKinematic(
const bool &_kinematic);
363 public:
unsigned int GetSensorCount()
const;
376 public: std::string GetSensorName(
unsigned int _index)
const;
381 public:
template<
typename T>
383 {
return enabledSignal.Connect(_subscriber);}
388 {enabledSignal.Disconnect(_conn);}
392 public:
void FillMsg(msgs::Link &_msg);
396 public:
void ProcessMsg(
const msgs::Link &_msg);
400 public:
void AddChildJoint(
JointPtr _joint);
404 public:
void AddParentJoint(
JointPtr _joint);
408 public:
void RemoveParentJoint(
const std::string &_jointName);
412 public:
void RemoveChildJoint(
const std::string &_jointName);
415 public:
virtual void RemoveChild(
EntityPtr _child);
421 public:
void AttachStaticModel(
ModelPtr &_model,
426 public:
void DetachStaticModel(
const std::string &_modelName);
429 public:
void DetachAllStaticModels();
433 public:
virtual void OnPoseChange();
437 public:
void SetState(
const LinkState &_state);
447 public:
virtual void SetAutoDisable(
bool _disable) = 0;
451 public:
Link_V GetChildJointsLinks()
const;
455 public:
Link_V GetParentJointsLinks()
const;
459 public:
void SetPublishData(
bool _enable);
462 public:
Joint_V GetParentJoints()
const;
465 public:
Joint_V GetChildJoints()
const;
469 public:
void RemoveCollision(
const std::string &_name);
474 public:
double GetWorldEnergyPotential()
const;
479 public:
double GetWorldEnergyKinetic()
const;
485 public:
double GetWorldEnergy()
const;
490 public:
virtual void SetLinkStatic(
bool _static) = 0;
493 private:
void PublishData();
497 private:
void LoadCollision(sdf::ElementPtr _sdf);
501 private:
void SetInertialFromCollisions();
505 private:
void OnCollision(ConstContactsPtr &_msg);
508 private:
void ParseVisuals();
539 private:
bool enabled;
542 private: std::vector<std::string> sensors;
545 private: std::vector<JointPtr> parentJoints;
548 private: std::vector<JointPtr> childJoints;
551 private: std::vector<ModelPtr> attachedModels;
557 private: msgs::LinkData linkDataMsg;
560 private:
bool publishData;
563 private: boost::recursive_mutex *publishDataMutex;
569 private: std::vector<util::OpenALSourcePtr> audioSources;