Newton Dynamics  4.00
ndMultiBodyVehicleTireJoint.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_MULTIBODY_VEHICLE_TIRE_JOINT_H__
13 #define __ND_MULTIBODY_VEHICLE_TIRE_JOINT_H__
14 
15 #include "ndNewtonStdafx.h"
16 #include "ndJointWheel.h"
17 
19 {
20  public:
21  enum ndFrictionModel
22  {
23  m_coulomb,
24  m_brushModel,
25  m_pacejka,
26  m_coulombCicleOfFriction,
27  };
28 
30  :m_laterialStiffness(ndFloat32(10.0f))
31  ,m_longitudinalStiffness(ndFloat32(10.0f))
32  ,m_frictionModel(m_brushModel)
33  {
34  }
35 
36  ndFloat32 m_laterialStiffness;
37  ndFloat32 m_longitudinalStiffness;
38  ndFrictionModel m_frictionModel;
39 };
40 
42 {
43  public:
47  {
48  }
49 };
50 
52 {
53  public:
54  D_CLASS_REFLECTION(ndMultiBodyVehicleTireJoint);
56  D_NEWTON_API ndMultiBodyVehicleTireJoint(const ndMatrix& pinAndPivotFrame, ndBodyKinematic* const child, ndBodyKinematic* const parent, const ndMultiBodyVehicleTireJointInfo& desc, ndMultiBodyVehicle* const vehicle);
57  D_NEWTON_API virtual ~ndMultiBodyVehicleTireJoint();
58 
59  D_NEWTON_API ndFloat32 GetSideSlip() const;
60  D_NEWTON_API ndFloat32 GetLongitudinalSlip() const;
61 
62  protected:
63  D_NEWTON_API void JacobianDerivative(ndConstraintDescritor& desc);
64  D_NEWTON_API virtual void Save(const ndLoadSaveBase::ndSaveDescriptor& desc) const;
65 
66  ndMultiBodyVehicle* m_vehicle;
67  ndTireFrictionModel m_frictionModel;
68  ndFloat32 m_lateralSlip;
69  ndFloat32 m_longitudinalSlip;
70  ndFloat32 m_normalizedAligningTorque;
71  friend class ndMultiBodyVehicle;
72 };
73 
74 
75 #endif
76 
ndMultiBodyVehicle
Definition: ndMultiBodyVehicle.h:41
ndJointWheel
Definition: ndJointWheel.h:49
ndMultiBodyVehicleTireJoint
Definition: ndMultiBodyVehicleTireJoint.h:52
ndConstraintDescritor
Definition: ndConstraint.h:179
ndBodyKinematic
Definition: ndBodyKinematic.h:40
ndWheelDescriptor
Definition: ndJointWheel.h:19
ndTireFrictionModel
Definition: ndMultiBodyVehicleTireJoint.h:19
ndMatrix
Definition: ndMatrix.h:42
ndMultiBodyVehicleTireJointInfo
Definition: ndMultiBodyVehicleTireJoint.h:42
ndLoadSaveBase::ndLoadDescriptor
Definition: ndSaveLoadSytem.h:59
ndLoadSaveBase::ndSaveDescriptor
Definition: ndSaveLoadSytem.h:93