|
Flatland
|
#include <joint.h>

Public Member Functions | |
| Joint (b2World *physics_world, Model *model, const std::string &name, const Color &color, const b2JointDef &joint_def) | |
| Constructor for the joint. More... | |
| Joint (const Joint &)=delete | |
| Disallow copying of joints, problematic for constructors and destructors. | |
| Joint & | operator= (const Joint &)=delete |
| void | DebugOutput () const |
| logs the debugging information for the joint | |
| Model * | GetModel () |
| const std::string & | GetName () const |
| const Color & | GetColor () const |
| void | SetColor (const Color &color) |
| b2Joint * | GetPhysicsJoint () |
| b2World * | GetphysicsWorld () |
Static Public Member Functions | |
| static Joint * | MakeJoint (b2World *physics_world, Model *model, YamlReader &joint_reader) |
| Creates a joint for the given params, throws exceptions upon failure. More... | |
| 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. More... | |
| 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. More... | |
Public Attributes | |
| Model * | model_ |
| Model the joint belongs to. | |
| std::string | name_ |
| Name of the joint. | |
| b2World * | physics_world_ |
| Box2D physics world. | |
| Color | color_ |
| Color for visualization. | |
| b2Joint * | physics_joint_ |
| Box2D physics joint. | |
This class defines a joint in the simulation world. It wraps around the Box2D physics joints providing extra data and useful methods
| const Color & flatland_server::Joint::GetColor | ( | ) | const |
| Model * flatland_server::Joint::GetModel | ( | ) |
| const std::string & flatland_server::Joint::GetName | ( | ) | const |
| b2Joint * flatland_server::Joint::GetPhysicsJoint | ( | ) |
| b2World * flatland_server::Joint::GetphysicsWorld | ( | ) |
|
static |
Creates a joint for the given params, throws exceptions upon failure.
| [in] | physics_world | Box2D physics world |
| [in] | model | Model the joint belongs to |
| [in] | joint_reader | YAML reader for node that contains joint information |
|
static |
Creates a revolute joint for the given params, throws exceptions upon failure.
| [in] | physics_world | Box2D physics world |
| [in] | model | Model the joint belongs to |
| [in] | joint_reader | YAML reader for node that contains joint information |
| [in] | name | Name of the joint |
| [in] | color | Color to visualize the joint |
| [in] | body_A | pointer to the first body |
| [in] | anchor_B | anchor point on the first body |
| [in] | body_B | pointer to the second body |
| [in] | anchor_B | anchor point on the second body |
| [in] | collide_connected | Should two bodies connected by this joint collide |
|
static |
Creates a weld joint for the given params, throws exceptions upon failure.
| [in] | physics_world | Box2D physics world |
| [in] | model | Model the joint belongs to |
| [in] | joint_reader | YAML reader for node that contains joint information |
| [in] | name | Name of the joint |
| [in] | color | Color to visualize the joint |
| [in] | body_A | pointer to the first body |
| [in] | anchor_B | anchor point on the first body |
| [in] | body_B | pointer to the second body |
| [in] | anchor_B | anchor point on the second body |
| [in] | collide_connected | Should two bodies connected by this joint collide |
| void flatland_server::Joint::SetColor | ( | const Color & | color | ) |
1.8.11