Jopnal Engine  alpha 0.4
Simple Component Based 2D/3D Game Engine
Public Member Functions | Public Attributes | Static Protected Member Functions | Protected Attributes | Friends | List of all members
jop::Joint2D Class Referenceabstract

#include <Joint2D.hpp>

Inheritance diagram for jop::Joint2D:
jop::GearJoint2D jop::PistonJoint2D jop::PulleyJoint2D jop::RopeJoint2D jop::RotationJoint2D jop::WeldJoint2D jop::WheelJoint2D

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...
 
Joint2DsetID (const unsigned int id)
 Set new ID for the joint. More...
 

Public Attributes

World2Dm_worldRef
 Pointer to the world. More...
 
RigidBody2Dm_bodyA
 Pointer to bodyA. More...
 
RigidBody2Dm_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
 

Detailed Description

Definition at line 39 of file Joint2D.hpp.

Constructor & Destructor Documentation

jop::Joint2D::Joint2D ( World2D worldRef,
RigidBody2D bodyA,
RigidBody2D bodyB,
const bool  collide 
)

Joint2D constructor.

Parameters
worldRefReference to the current world. Obtained and handled by the engine.
bodyARigidBody2D where to attach this joint. Received automatically from the calling function.
bodyBRigidBody2D in which to attach the second end of the joint. Given by user as an argument.
collideBoolean whether the linked bodies should collide with each other.
virtual jop::Joint2D::~Joint2D ( )
pure virtual

Member Function Documentation

static b2Body* jop::Joint2D::getBody ( RigidBody2D body)
staticprotected

Return engine internal pointer to body.

Parameters
bodyRigidBody2D.
Returns
Returns pointer to Box2D body.
unsigned int jop::Joint2D::getID ( ) const

Get joint ID.

Returns
Returns ID of the joint.
Joint2D& jop::Joint2D::setID ( const unsigned int  id)

Set new ID for the joint.

Parameters
idNew ID to set.
Returns
Returns reference to self.

Friends And Related Function Documentation

friend class GearJoint2D
friend

Definition at line 42 of file Joint2D.hpp.

friend class RigidBody2D
friend

Definition at line 41 of file Joint2D.hpp.

Member Data Documentation

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.

bool jop::Joint2D::m_collide
protected

Should the linked bodies collide.

Definition at line 85 of file Joint2D.hpp.

unsigned int jop::Joint2D::m_ID
protected

Joint ID.

Definition at line 87 of file Joint2D.hpp.

b2Joint* jop::Joint2D::m_joint
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.


The documentation for this class was generated from the following file: