My Project: dynamics.mod/NewtonDynamics/source/physics/dgUniversalConstraint.h Source File

My Project

dgUniversalConstraint.h
Go to the documentation of this file.
1 /* Copyright (c) <2003-2011> <Julio Jerez, 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, subject to the following restrictions:
10 *
11 * 1. The origin of this software must not be misrepresented; you must not
12 * claim that you wrote the original software. If you use this software
13 * in a product, an acknowledgment in the product documentation would be
14 * appreciated but is not required.
15 *
16 * 2. Altered source versions must be plainly marked as such, and must not be
17 * misrepresented as being the original software.
18 *
19 * 3. This notice may not be removed or altered from any source distribution.
20 */
21
22 #if !defined(AFX_DGUNIVERSALCONSTRAINT_H__3FA456TR_INCLUDED)
23 #define AFX_DGUNIVERSALCONSTRAINT_H__3FA456TR_INCLUDED
24 #include "dgBilateralConstraint.h"
25
26 //template<class T> class dgPool;
27
28 class dgUniversalConstraint;
29
30
31 typedef dgUnsigned32 (dgApi *dgUniversalJointAcceleration) (const dgUniversalConstraint& hinge, dgJointCallbackParam* param);
32
33 class dgUniversalConstraint: public dgBilateralConstraint
34 {
35 public:
36 dgFloat32 GetJointAngle0 () const;
37 dgFloat32 GetJointAngle1 () const;
38 dgFloat32 GetJointOmega0 () const;
39 dgFloat32 GetJointOmega1 () const;
40
41 dgVector GetJointForce () const;
42 dgFloat32 CalculateStopAlpha0 (dgFloat32 angle, const dgJointCallbackParam* param) const;
43 dgFloat32 CalculateStopAlpha1 (dgFloat32 angle, const dgJointCallbackParam* param) const;
44 void SetJointParameterCallback (dgUniversalJointAcceleration callback);
45
46 private:
47 virtual dgUnsigned32 JacobianDerivative (dgContraintDescritor& params);
48 // virtual void Remove(dgWorld* world);
49
50
51 dgUniversalConstraint();
52 virtual ~dgUniversalConstraint();
53 // static dgUniversalConstraint* Create(dgWorld* world);
54
55 dgFloat32 m_angle0;
56 dgFloat32 m_angle1;
57 dgUniversalJointAcceleration m_jointAccelFnt;
58
59 //#ifdef _NEWTON_USE_DOUBLE
60 // dgUnsigned32 m_reserve[3];
61 //#else
62 // dgUnsigned32 m_reserve[1];
63 //#endif
64
65
66 friend class dgWorld;
67 // friend class dgPool<dgUniversalConstraint>;
68 };
69
70 //class dgUniversalConstraintArray: public dgPoolContainer<dgUniversalConstraint>
71 //{
72 //};
73
74 #endif // !defined(AFX_DGUNIVERSALCONSTRAINT_H__3FA456TR_INCLUDED)
75
dgUniversalConstraint::GetJointForce
dgVector GetJointForce() const
Definition: dgUniversalConstraint.cpp:191
dgApi
#define dgApi
Definition: dgTypes.h:263
dgFloat32
float dgFloat32
Definition: dgTypes.h:233
dgVector
Definition: dgVector.h:639
dgUnsigned32
typedef dgUnsigned32(dgApi *dgUniversalJointAcceleration)(const dgUniversalConstraint &hinge
dgUniversalConstraint::GetJointOmega1
dgFloat32 GetJointOmega1() const
Definition: dgUniversalConstraint.cpp:114
dgUniversalConstraint::CalculateStopAlpha1
dgFloat32 CalculateStopAlpha1(dgFloat32 angle, const dgJointCallbackParam *param) const
Definition: dgUniversalConstraint.cpp:162
dgContraintDescritor
Definition: dgConstraint.h:118
dgBilateralConstraint
Definition: dgBilateralConstraint.h:29
dgJointCallbackParam
Definition: dgConstraint.h:63
dgBilateralConstraint.h
dgUniversalConstraint::GetJointAngle1
dgFloat32 GetJointAngle1() const
Definition: dgUniversalConstraint.cpp:91
dgUniversalConstraint::SetJointParameterCallback
void SetJointParameterCallback(dgUniversalJointAcceleration callback)
Definition: dgUniversalConstraint.cpp:80
dgUniversalConstraint::GetJointOmega0
dgFloat32 GetJointOmega0() const
Definition: dgUniversalConstraint.cpp:97
dgUnsigned32
unsigned dgUnsigned32
Definition: dgTypes.h:219
dgUniversalConstraint::CalculateStopAlpha0
dgFloat32 CalculateStopAlpha0(dgFloat32 angle, const dgJointCallbackParam *param) const
Definition: dgUniversalConstraint.cpp:134
param
dgJointCallbackParam * param
Definition: dgUniversalConstraint.h:31
dgUniversalConstraint::GetJointAngle0
dgFloat32 GetJointAngle0() const
Definition: dgUniversalConstraint.cpp:86
dgUniversalConstraint
Definition: dgUniversalConstraint.h:33
dgWorld
Definition: dgWorld.h:129