Newton Dynamics  4.00
ndJointGear.h
1 /* Copyright (c) <2003-2022> <Newton Game Dynamics>
2 *
3 * This software is provided 'as-is', without any express or implied
4 * warranty. In no event will the authors be held liable for any damages
5 * arising from the use of this software.
6 *
7 * Permission is granted to anyone to use this software for any purpose,
8 * including commercial applications, and to alter it and redistribute it
9 * freely
10 */
11 
12 #ifndef __ND_JOINT_GEAR_H__
13 #define __ND_JOINT_GEAR_H__
14 
15 #include "ndNewtonStdafx.h"
16 #include "ndJointBilateralConstraint.h"
17 
19 {
20  public:
21  D_CLASS_REFLECTION(ndJointGear);
22  D_NEWTON_API ndJointGear(const ndLoadSaveBase::ndLoadDescriptor& desc);
23  D_NEWTON_API ndJointGear(ndFloat32 gearRatio,
24  const ndVector& body0Pin, ndBodyKinematic* const body0,
25  const ndVector& body1Pin, ndBodyKinematic* const body1);
26  D_NEWTON_API virtual ~ndJointGear();
27 
28  ndFloat32 GetRatio() const;
29  void SetRatio(ndFloat32 ratio);
30 
31  protected:
32  D_NEWTON_API void JacobianDerivative(ndConstraintDescritor& desc);
33  D_NEWTON_API void Save(const ndLoadSaveBase::ndSaveDescriptor& desc) const;
34 
35  ndFloat32 m_gearRatio;
36 };
37 
38 inline ndFloat32 ndJointGear::GetRatio() const
39 {
40  return m_gearRatio;
41 }
42 
43 inline void ndJointGear::SetRatio(ndFloat32 ratio)
44 {
45  m_gearRatio = ratio;
46 }
47 
48 
49 #endif
50 
ndJointGear
Definition: ndJointGear.h:19
ndConstraintDescritor
Definition: ndConstraint.h:179
ndJointBilateralConstraint
Definition: ndJointBilateralConstraint.h:53
ndBodyKinematic
Definition: ndBodyKinematic.h:40
ndLoadSaveBase::ndLoadDescriptor
Definition: ndSaveLoadSytem.h:59
ndLoadSaveBase::ndSaveDescriptor
Definition: ndSaveLoadSytem.h:93
ndVector
Definition: ndVectorArmNeon.h:41