![]() |
Jopnal Engine
alpha 0.4
Simple Component Based 2D/3D Game Engine
|
#include <PistonJoint2D.hpp>
Public Member Functions | |
PistonJoint2D (World2D &worldRef, RigidBody2D &bodyA, RigidBody2D &bodyB, const bool collide, const glm::vec2 &axis) | |
PistonJoint2D constructor. More... | |
PistonJoint2D & | limit (const bool enable) |
PistonJoint2D & | setLimits (const float min, const float max) |
std::pair< float, float > | getLimits () const |
![]() | |
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... | |
Additional Inherited Members | |
![]() | |
World2D * | m_worldRef |
Pointer to the world. More... | |
RigidBody2D * | m_bodyA |
Pointer to bodyA. More... | |
RigidBody2D * | m_bodyB |
Pointer to bodyB. More... | |
![]() | |
static b2Body * | getBody (RigidBody2D &body) |
Return engine internal pointer to body. More... | |
![]() | |
bool | m_collide |
Should the linked bodies collide. More... | |
b2Joint * | m_joint |
Pointer to Box2D joint. More... | |
unsigned int | m_ID |
Joint ID. More... | |
Definition at line 38 of file PistonJoint2D.hpp.
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.
axis | A single axis where movement is permitted. |
std::pair<float, float> jop::PistonJoint2D::getLimits | ( | ) | const |
PistonJoint2D& jop::PistonJoint2D::limit | ( | const bool | enable | ) |
enable | Enables/disables obeying of movement limits. |
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.