Jopnal Engine  alpha 0.4
Simple Component Based 2D/3D Game Engine
Public Member Functions | List of all members
jop::PistonJoint2D Class Reference

#include <PistonJoint2D.hpp>

Inheritance diagram for jop::PistonJoint2D:
jop::Joint2D

Public Member Functions

 PistonJoint2D (World2D &worldRef, RigidBody2D &bodyA, RigidBody2D &bodyB, const bool collide, const glm::vec2 &axis)
 PistonJoint2D constructor. More...
 
PistonJoint2Dlimit (const bool enable)
 
PistonJoint2DsetLimits (const float min, const float max)
 
std::pair< float, float > getLimits () const
 
- Public Member Functions inherited from jop::Joint2D
 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...
 

Additional Inherited Members

- Public Attributes inherited from jop::Joint2D
World2Dm_worldRef
 Pointer to the world. More...
 
RigidBody2Dm_bodyA
 Pointer to bodyA. More...
 
RigidBody2Dm_bodyB
 Pointer to bodyB. More...
 
- Static Protected Member Functions inherited from jop::Joint2D
static b2Body * getBody (RigidBody2D &body)
 Return engine internal pointer to body. More...
 
- Protected Attributes inherited from jop::Joint2D
bool m_collide
 Should the linked bodies collide. More...
 
b2Joint * m_joint
 Pointer to Box2D joint. More...
 
unsigned int m_ID
 Joint ID. More...
 

Detailed Description

Definition at line 38 of file PistonJoint2D.hpp.

Constructor & Destructor Documentation

jop::PistonJoint2D::PistonJoint2D ( World2D worldRef,
RigidBody2D bodyA,
RigidBody2D bodyB,
const bool  collide,
const glm::vec2 &  axis 
)

PistonJoint2D constructor.

Creates a piston using bodyB as the 'head' of the piston. Movement limits can be set for the bodyB.

Parameters
axisA single axis where movement is permitted.

Member Function Documentation

std::pair<float, float> jop::PistonJoint2D::getLimits ( ) const
Returns
Returns current movement limits of the piston: first = minimum, second = maximum.
PistonJoint2D& jop::PistonJoint2D::limit ( const bool  enable)
Parameters
enableEnables/disables obeying of movement limits.
Returns
Returns reference to self.
PistonJoint2D& jop::PistonJoint2D::setLimits ( const float  min,
const float  max 
)

Set new limits in world coordinates in relation to current position. Enables limiting when called.

Returns
Returns reference to self.

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