![]() |
Jopnal Engine
alpha 0.4
Simple Component Based 2D/3D Game Engine
|
#include <Joint2D.hpp>
Public Member Functions | |
Joint2D (World2D &worldRef, RigidBody2D &bodyA, RigidBody2D &bodyB, const bool collide) | |
Joint2D constructor. More... | |
virtual | ~Joint2D ()=0 |
unsigned int | getID () const |
Get joint ID. More... | |
Joint2D & | setID (const unsigned int id) |
Set new ID for the joint. More... | |
Public Attributes | |
World2D * | m_worldRef |
Pointer to the world. More... | |
RigidBody2D * | m_bodyA |
Pointer to bodyA. More... | |
RigidBody2D * | m_bodyB |
Pointer to bodyB. More... | |
Static Protected Member Functions | |
static b2Body * | getBody (RigidBody2D &body) |
Return engine internal pointer to body. More... | |
Protected Attributes | |
bool | m_collide |
Should the linked bodies collide. More... | |
b2Joint * | m_joint |
Pointer to Box2D joint. More... | |
unsigned int | m_ID |
Joint ID. More... | |
Friends | |
class | RigidBody2D |
class | GearJoint2D |
Definition at line 39 of file Joint2D.hpp.
jop::Joint2D::Joint2D | ( | World2D & | worldRef, |
RigidBody2D & | bodyA, | ||
RigidBody2D & | bodyB, | ||
const bool | collide | ||
) |
Joint2D constructor.
worldRef | Reference to the current world. Obtained and handled by the engine. |
bodyA | RigidBody2D where to attach this joint. Received automatically from the calling function. |
bodyB | RigidBody2D in which to attach the second end of the joint. Given by user as an argument. |
collide | Boolean whether the linked bodies should collide with each other. |
|
pure virtual |
|
staticprotected |
Return engine internal pointer to body.
body | RigidBody2D. |
unsigned int jop::Joint2D::getID | ( | ) | const |
Get joint ID.
Joint2D& jop::Joint2D::setID | ( | const unsigned int | id | ) |
Set new ID for the joint.
id | New ID to set. |
|
friend |
Definition at line 42 of file Joint2D.hpp.
|
friend |
Definition at line 41 of file Joint2D.hpp.
RigidBody2D* jop::Joint2D::m_bodyA |
Pointer to bodyA.
Definition at line 72 of file Joint2D.hpp.
RigidBody2D* jop::Joint2D::m_bodyB |
Pointer to bodyB.
Definition at line 73 of file Joint2D.hpp.
|
protected |
Should the linked bodies collide.
Definition at line 85 of file Joint2D.hpp.
|
protected |
Joint ID.
Definition at line 87 of file Joint2D.hpp.
|
protected |
Pointer to Box2D joint.
Definition at line 86 of file Joint2D.hpp.
World2D* jop::Joint2D::m_worldRef |
Pointer to the world.
Definition at line 71 of file Joint2D.hpp.