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

#include <WheelJoint2D.hpp>

Inheritance diagram for jop::WheelJoint2D:
jop::Joint2D

Public Member Functions

 WheelJoint2D (World2D &worldRef, RigidBody2D &bodyA, RigidBody2D &bodyB, const bool collide, const glm::vec2 &axis, const glm::vec2 &localAnchorA, const glm::vec2 &localAnchorB=glm::vec2(0.f, 0.f))
 WheelJoint2D constructor. More...
 
WheelJoint2DsetDamping (const float frequency, const float damping)
 
std::pair< float, float > getDamping () 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 WheelJoint2D.hpp.

Constructor & Destructor Documentation

jop::WheelJoint2D::WheelJoint2D ( World2D worldRef,
RigidBody2D bodyA,
RigidBody2D bodyB,
const bool  collide,
const glm::vec2 &  axis,
const glm::vec2 &  localAnchorA,
const glm::vec2 &  localAnchorB = glm::vec2(0.f, 0.f) 
)

WheelJoint2D constructor.

Used to create rotating wheels.

Parameters
axisSingle axis where movement is allowed.
localAnchorAGiven in world units in relation to the target body center.
localAnchorBGiven in local units. Defaults to the center of the wheel. Should be left empty unless user wants funny wheels.

Member Function Documentation

std::pair<float, float> jop::WheelJoint2D::getDamping ( ) const
Returns
Returns current damping values: first = frequency, second = damping.
WheelJoint2D& jop::WheelJoint2D::setDamping ( const float  frequency,
const float  damping 
)

Set new damping values.

Parameters
frequencyDamping frequency in Hz.
dampingDamping value. Please use values between 0.f - 1.f.
Returns
Returns reference to self.

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