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

#include <GearJoint.hpp>

Inheritance diagram for jop::GearJoint:
jop::Joint

Public Member Functions

 GearJoint (World &worldRef, RigidBody &bodyA, RigidBody &bodyB, const bool collide, const glm::vec3 &rotAxisA, const glm::vec3 &rotAxisB, const float ratio=1.f)
 GearJoint constructor. More...
 
glm::vec3 getAxis (const bool bodyA=true) const
 
float getRatio () const
 
GearJointsetAxis (const glm::vec3 &axis, const bool bodyA=true)
 
GearJointsetRatio (const float ratio)
 
- 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 36 of file GearJoint.hpp.

Constructor & Destructor Documentation

jop::GearJoint::GearJoint ( World worldRef,
RigidBody bodyA,
RigidBody bodyB,
const bool  collide,
const glm::vec3 &  rotAxisA,
const glm::vec3 &  rotAxisB,
const float  ratio = 1.f 
)

GearJoint constructor.

Parameters
rotAxisALocal axis of bodyA in which to apply and observe rotation.
rotAxisBLocal axis of bodyB in which to apply and observe rotation.
ratioRatio between the linked bodies.

Member Function Documentation

glm::vec3 jop::GearJoint::getAxis ( const bool  bodyA = true) const
Parameters
bodyABody which axis to get. True for bodyA, false for bodyB. Default true.
Returns
Returns current target vector
float jop::GearJoint::getRatio ( ) const
Returns
Returns current ratio of the joint.
GearJoint& jop::GearJoint::setAxis ( const glm::vec3 &  axis,
const bool  bodyA = true 
)
Parameters
axisAxis to use
bodyABody which axis to get. True for bodyA, false for bodyB. Default true.
Returns
Returns reference to self.
GearJoint& jop::GearJoint::setRatio ( const float  ratio)
Parameters
ratioNew ratio to use in the joint.
Returns
Returns reference to self.

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