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

#include <PistonJoint.hpp>

Inheritance diagram for jop::PistonJoint:
jop::Joint

Public Member Functions

 PistonJoint (World &worldRef, RigidBody &bodyA, RigidBody &bodyB, const bool collide, const glm::vec3 &anchor=glm::vec3(0.f, 0.f, FLT_MAX), const glm::quat &jRot=glm::quat(1.f, 0.f, 0.f, 0.f))
 PistonJoint constructor. More...
 
std::pair< float, float > getAngLimits () const
 
std::pair< float, float > getMoveLimits () const
 
PistonJointsetAngLimits (const float min, const float max)
 
PistonJointsetMoveLimits (const float min, const float max)
 
- Public Member Functions inherited from jop::Joint
 Joint (World &worldRef, RigidBody &bodyA, RigidBody &bodyB, const bool collide)
 Joint constructor. More...
 
virtual ~Joint ()=0
 
unsigned int getID () const
 Get joint ID. More...
 
JointsetID (const unsigned int id)
 Set new ID for the joint. More...
 

Additional Inherited Members

- Public Attributes inherited from jop::Joint
Worldm_worldRef
 Pointer to the world. More...
 
RigidBodym_bodyA
 Pointer to bodyA. More...
 
RigidBodym_bodyB
 Pointer to bodyB. More...
 
- Protected Member Functions inherited from jop::Joint
btRigidBody * getBody (RigidBody &body) const
 Return engine internal pointer to body. More...
 
btDiscreteDynamicsWorld & getWorld (World &world) const
 Return engine internal pointer to world. More...
 
glm::vec3 defaultCenter (const glm::vec3 &jPos) const
 
glm::vec3 computeCenter () const
 Calculates the point in the middle between this' m_bodies. More...
 
- Protected Attributes inherited from jop::Joint
bool m_collide
 
std::unique_ptr< btTypedConstraint > m_joint
 < Should the linked bodies collide. More...
 
unsigned int m_ID
 Joint ID. More...
 

Detailed Description

Definition at line 38 of file PistonJoint.hpp.

Constructor & Destructor Documentation

jop::PistonJoint::PistonJoint ( World worldRef,
RigidBody bodyA,
RigidBody bodyB,
const bool  collide,
const glm::vec3 &  anchor = glm::vec3(0.f, 0.f, FLT_MAX),
const glm::quat &  jRot = glm::quat(1.f, 0.f, 0.f, 0.f) 
)

PistonJoint constructor.

Parameters
anchorPosition of the joint in world coordinates. Default in the middle between the bodies.
jRotRotation of the joint. Default axis-aligned.

Member Function Documentation

std::pair<float, float> jop::PistonJoint::getAngLimits ( ) const
Returns
Returns current rotational limits of the piston: first = minimum, second = maximum.
std::pair<float, float> jop::PistonJoint::getMoveLimits ( ) const
Returns
Returns current translation limits of the piston: first = minimum, second = maximum.
PistonJoint& jop::PistonJoint::setAngLimits ( const float  min,
const float  max 
)

Set new rotation limits for the piston in radians.

Returns
Returns reference to self.
PistonJoint& jop::PistonJoint::setMoveLimits ( const float  min,
const float  max 
)

Set new limits where translation is allowed. 0 is the center of the bodyA.

Returns
Returns reference to self.

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