19 #ifndef B2_WHEEL_JOINT_H 20 #define B2_WHEEL_JOINT_H 97 float32 GetJointTranslation()
const;
103 bool IsMotorEnabled()
const;
106 void EnableMotor(
bool flag);
109 void SetMotorSpeed(
float32 speed);
115 void SetMaxMotorTorque(
float32 torque);
116 float32 GetMaxMotorTorque()
const;
122 void SetSpringFrequencyHz(
float32 hz);
123 float32 GetSpringFrequencyHz()
const;
126 void SetSpringDampingRatio(
float32 ratio);
127 float32 GetSpringDampingRatio()
const;
187 return m_maxMotorTorque;
197 return m_frequencyHz;
202 m_dampingRatio = ratio;
207 return m_dampingRatio;
virtual void SolveVelocityConstraints(const b2SolverData &data)=0
void SetSpringFrequencyHz(float32 hz)
Set/Get the spring frequency in hertz. Setting the frequency to zero disables the spring...
float32 GetSpringDampingRatio() const
Joint definitions are used to construct joints.
float32 GetMaxMotorTorque() const
const b2Vec2 & GetLocalAnchorB() const
The local anchor point relative to bodyB's origin.
void SetSpringDampingRatio(float32 ratio)
Set/Get the spring damping ratio.
void Initialize(b2Body *bodyA, b2Body *bodyB, const b2Vec2 &anchor, const b2Vec2 &axis)
void SetZero()
Set this vector to all zeros.
float32 frequencyHz
Suspension frequency, zero indicates no suspension.
A rigid body. These are created via b2World::CreateBody.
float32 motorSpeed
The desired motor speed in radians per second.
b2Vec2 localAnchorA
The local anchor point relative to bodyA's origin.
virtual void InitVelocityConstraints(const b2SolverData &data)=0
b2Vec2 localAxisA
The local translation axis in bodyA.
virtual bool SolvePositionConstraints(const b2SolverData &data)=0
GLint GLenum GLsizei GLint GLsizei const GLvoid * data
bool enableMotor
Enable/disable the joint motor.
const b2Vec2 & GetLocalAnchorA() const
The local anchor point relative to bodyA's origin.
float32 GetMotorSpeed() const
Get the motor speed, usually in radians per second.
float32 maxMotorTorque
The maximum motor torque, usually in N-m.
const b2Vec2 & GetLocalAxisA() const
The local joint axis relative to bodyA.
b2Vec2 localAnchorB
The local anchor point relative to bodyB's origin.
GLuint GLuint GLsizei GLenum type
float32 GetSpringFrequencyHz() const
b2Body * bodyA
The first attached body.
void Set(float32 x_, float32 y_)
Set this vector to some specified coordinates.
b2Body * bodyB
The second attached body.
float32 dampingRatio
Suspension damping ratio, one indicates critical damping.
GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble f