47 #ifndef FLATLAND_SERVER_JOINT_H 48 #define FLATLAND_SERVER_JOINT_H 50 #include <flatland_server/model.h> 51 #include <flatland_server/types.h> 52 #include <flatland_server/yaml_reader.h> 53 #include <yaml-cpp/yaml.h> 79 Joint(b2World *physics_world,
Model *model,
const std::string &name,
80 const Color &color,
const b2JointDef &joint_def);
100 const std::string &
GetName()
const;
152 const std::string &name,
const Color &color,
153 b2Body *body_A, b2Vec2 anchor_A,
154 b2Body *body_B, b2Vec2 anchor_B,
155 bool collide_connected);
175 YamlReader &joint_reader,
const std::string &name,
176 const Color &color, b2Body *body_A,
177 b2Vec2 anchor_A, b2Body *body_B, b2Vec2 anchor_B,
178 bool collide_connected);
181 #endif // FLATLAND_MODEL_JOINT_H b2Joint * GetPhysicsJoint()
Definition: joint.cpp:70
void DebugOutput() const
logs the debugging information for the joint
Definition: joint.cpp:189
void SetColor(const Color &color)
Definition: joint.cpp:68
static Joint * MakeRevoluteJoint(b2World *physics_world, Model *model, YamlReader &joint_reader, const std::string &name, const Color &color, b2Body *body_A, b2Vec2 anchor_A, b2Body *body_B, b2Vec2 anchor_B, bool collide_connected)
Creates a revolute joint for the given params, throws exceptions upon failure.
Definition: joint.cpp:134
b2World * physics_world_
Box2D physics world.
Definition: joint.h:67
const Color & GetColor() const
Definition: joint.cpp:66
Model * model_
Model the joint belongs to.
Definition: joint.h:65
b2World * GetphysicsWorld()
Definition: joint.cpp:72
b2Joint * physics_joint_
Box2D physics joint.
Definition: joint.h:69
static Joint * MakeWeldJoint(b2World *physics_world, Model *model, YamlReader &joint_reader, const std::string &name, const Color &color, b2Body *body_A, b2Vec2 anchor_A, b2Body *body_B, b2Vec2 anchor_B, bool collide_connected)
Creates a weld joint for the given params, throws exceptions upon failure.
Definition: joint.cpp:167
Definition: yaml_reader.h:76
Color color_
Color for visualization.
Definition: joint.h:68
static Joint * MakeJoint(b2World *physics_world, Model *model, YamlReader &joint_reader)
Creates a joint for the given params, throws exceptions upon failure.
Definition: joint.cpp:74
Model * GetModel()
Definition: joint.cpp:62
std::string name_
Name of the joint.
Definition: joint.h:66
Joint(b2World *physics_world, Model *model, const std::string &name, const Color &color, const b2JointDef &joint_def)
Constructor for the joint.
Definition: joint.cpp:53
const std::string & GetName() const
Definition: joint.cpp:64