Newton Dynamics  4.00
ndJointBallAndSocket.h
1 /* Copyright (c) <2003-2019> <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 __D_JOINT_BALLANDSOCKET_H__
13 #define __D_JOINT_BALLANDSOCKET_H__
14 
15 #include "ndNewtonStdafx.h"
16 #include "ndJointBilateralConstraint.h"
17 
19 {
20  public:
21  D_NEWTON_API ndJointBallAndSocket(const dMatrix& pinAndPivotFrame, ndBodyKinematic* const child, ndBodyKinematic* const parent);
22  D_NEWTON_API virtual ~ndJointBallAndSocket();
23 
24  protected:
25  D_NEWTON_API void JacobianDerivative(ndConstraintDescritor& desc);
26 
27 #if 0
28  D_NEWTON_API ndJointBallAndSocket(const dMatrix& pinAndPivotFrame0, const dMatrix& pinAndPivotFrame1, ndBodyKinematic* const child, ndBodyKinematic* const parent);
29  D_NEWTON_API void EnableTwist(bool state);
30  D_NEWTON_API void SetTwistLimits(dFloat32 minAngle, dFloat32 maxAngle);
31  D_NEWTON_API void GetTwistLimits(dFloat32& minAngle, dFloat32& maxAngle) const;
32 
33  D_NEWTON_API void EnableCone(bool state);
34  D_NEWTON_API dFloat32 GetConeLimits() const;
35  D_NEWTON_API void SetConeLimits(dFloat32 maxAngle);
36 
37  D_NEWTON_API void SetTwistFriction (dFloat32 frictionTorque);
38  D_NEWTON_API dFloat32 GetTwistFriction (dFloat32 frictionTorque) const;
39 
40  D_NEWTON_API void SetConeFriction(dFloat32 frictionTorque);
41  D_NEWTON_API dFloat32 GetConeFriction(dFloat32 frictionTorque) const;
42 
43  D_NEWTON_API virtual void Debug(dDebugDisplay* const debugDisplay) const;
44 
45  protected:
46  D_NEWTON_API virtual void Deserialize (NewtonDeserializeCallback callback, void* const userData);
47  D_NEWTON_API virtual void Serialize (NewtonSerializeCallback callback, void* const userData) const;
48  D_NEWTON_API virtual void SubmitConstraints (dFloat32 timestep, dInt32 threadIndex);
49 
50  void SubmitTwistAngle(const dVector& pin, dFloat32 pitchAngle, dFloat32 timestep);
51  void SubmitAngularAxis(const dMatrix& matrix0, const dMatrix& matrix1, dFloat32 timestep);
52  void SubmitAngularAxisCartisianApproximation(const dMatrix& matrix0, const dMatrix& matrix1, dFloat32 timestep);
53 
54  dAngularIntegration m_twistAngle;
55  dFloat32 m_minTwistAngle;
56  dFloat32 m_maxTwistAngle;
57  dFloat32 m_maxConeAngle;
58  dFloat32 m_coneFriction;
59  dFloat32 m_twistFriction;
60 #endif
61 };
62 
63 #endif
64 
ndConstraintDescritor
Definition: ndConstraint.h:174
ndJointBilateralConstraint
Definition: ndJointBilateralConstraint.h:43
ndBodyKinematic
Definition: ndBodyKinematic.h:37
dVector
Definition: dVectorArmNeon.h:1104
dMatrix
Definition: dMatrix.h:39
ndJointBallAndSocket
Definition: ndJointBallAndSocket.h:19