12 #ifndef __ND_JOINT_KINEMATIC_CONTROLLER_H__
13 #define __ND_JOINT_KINEMATIC_CONTROLLER_H__
15 #include "ndNewtonStdafx.h"
16 #include "ndJointBilateralConstraint.h"
25 m_linearPlusAngularFriction,
34 virtual bool IsBilateral()
const;
35 void SetControlMode(ndControlModes mode);
36 void SetMaxSpeed(ndFloat32 speedInMetersPerSeconds);
37 void SetMaxOmega(ndFloat32 speedInRadiansPerSeconds);
38 void SetMaxLinearFriction(ndFloat32 force);
39 void SetMaxAngularFriction(ndFloat32 torque);
40 void SetAngularViscousFrictionCoefficient(ndFloat32 coefficient);
43 void SetTargetPosit(
const ndVector& posit);
46 D_NEWTON_API
void SetTargetMatrix(
const ndMatrix& matrix);
51 D_NEWTON_API
void CheckSleep()
const;
58 ndFloat32 m_maxLinearFriction;
59 ndFloat32 m_maxAngularFriction;
60 ndFloat32 m_angularFrictionCoefficient;
61 ndControlModes m_controlMode;
62 bool m_autoSleepState;
65 inline void ndJointKinematicController::SetControlMode(ndControlModes mode)
70 inline void ndJointKinematicController::SetMaxSpeed(ndFloat32 speedInMetersPerSeconds)
72 m_maxSpeed = ndAbs(speedInMetersPerSeconds);
75 inline void ndJointKinematicController::SetMaxLinearFriction(ndFloat32 frictionForce)
77 m_maxLinearFriction = ndAbs(frictionForce);
80 inline void ndJointKinematicController::SetMaxAngularFriction(ndFloat32 frictionTorque)
82 m_maxAngularFriction = ndAbs(frictionTorque);
85 inline void ndJointKinematicController::SetMaxOmega(ndFloat32 speedInRadiansPerSeconds)
87 m_maxOmega = ndAbs(speedInRadiansPerSeconds);
90 inline void ndJointKinematicController::SetAngularViscousFrictionCoefficient(ndFloat32 coefficient)
92 ndVector mass (GetBody0()->GetMassMatrix());
93 m_angularFrictionCoefficient = ndAbs(coefficient) * ndMax(mass.m_x, ndMax(mass.m_y, mass.m_z));
96 inline void ndJointKinematicController::SetTargetPosit(
const ndVector& posit)
99 matrix.m_posit = posit;
100 SetTargetMatrix(matrix);
103 inline void ndJointKinematicController::SetTargetRotation(
const ndQuaternion& rotation)
105 ndMatrix matrix(rotation, m_localMatrix1.m_posit);
106 SetTargetMatrix(matrix);
109 inline ndMatrix ndJointKinematicController::GetTargetMatrix()
const
112 return m_localMatrix0;
115 inline bool ndJointKinematicController::IsBilateral()
const