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

My Project

dgHingeConstraint.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_DGHINGECONSTRAINT_H__3FF7D7AA_90CC_4BA5_B2A4_D3BA51AD2FFD_H)
23 #define AFX_DGHINGECONSTRAINT_H__3FF7D7AA_90CC_4BA5_B2A4_D3BA51AD2FFD_H
24 #include "dgBilateralConstraint.h"
25
26 //template<class T> class dgPool;
27
28 class dgHingeConstraint;
29
30
31 typedef dgUnsigned32 (dgApi *dgHingeJointAcceleration) (const dgHingeConstraint& hinge, dgJointCallbackParam* param);
32
33 class dgHingeConstraint: public dgBilateralConstraint
34 {
35 public:
36 dgFloat32 GetJointAngle () const;
37 dgFloat32 GetJointOmega () const;
38 dgVector GetJointForce () const;
39 dgFloat32 CalculateStopAlpha (dgFloat32 angle, const dgJointCallbackParam* param) const;
40 void SetJointParameterCallback (dgHingeJointAcceleration callback);
41
42
43
44 private:
45 virtual dgUnsigned32 JacobianDerivative (dgContraintDescritor& params);
46 // virtual void Remove(dgWorld* world);
47
48 dgHingeConstraint();
49 virtual ~dgHingeConstraint();
50 // static dgHingeConstraint* Create(dgWorld* world);
51
52 dgFloat32 m_angle;
53 dgHingeJointAcceleration m_jointAccelFnt;
54
55
56 //#ifdef _NEWTON_USE_DOUBLE
57 // dgUnsigned32 m_reserve[1];
58 //#else
59 // dgUnsigned32 m_reserve[2];
60 //#endif
61
62 friend class dgWorld;
63 // friend class dgPool<dgHingeConstraint>;
64 };
65
66 //class dgHingeConstraintArray: public dgPoolContainer<dgHingeConstraint>
67 //{
68 //};
69
70
71 #endif // !defined(AFX_DGHINGECONSTRAINT_H__3FF7D7AA_90CC_4BA5_B2A4_D3BA51AD2FFD_H)
72
dgHingeConstraint::GetJointAngle
dgFloat32 GetJointAngle() const
Definition: dgHingeConstraint.cpp:81
dgUnsigned32
typedef dgUnsigned32(dgApi *dgHingeJointAcceleration)(const dgHingeConstraint &hinge
dgApi
#define dgApi
Definition: dgTypes.h:263
dgFloat32
float dgFloat32
Definition: dgTypes.h:233
dgHingeConstraint::CalculateStopAlpha
dgFloat32 CalculateStopAlpha(dgFloat32 angle, const dgJointCallbackParam *param) const
Definition: dgHingeConstraint.cpp:97
dgVector
Definition: dgVector.h:639
dgHingeConstraint::SetJointParameterCallback
void SetJointParameterCallback(dgHingeJointAcceleration callback)
Definition: dgHingeConstraint.cpp:76
dgContraintDescritor
Definition: dgConstraint.h:118
dgBilateralConstraint
Definition: dgBilateralConstraint.h:29
dgHingeConstraint::GetJointOmega
dgFloat32 GetJointOmega() const
Definition: dgHingeConstraint.cpp:86
dgJointCallbackParam
Definition: dgConstraint.h:63
dgBilateralConstraint.h
dgHingeConstraint
Definition: dgHingeConstraint.h:33
param
dgJointCallbackParam * param
Definition: dgHingeConstraint.h:31
dgUnsigned32
unsigned dgUnsigned32
Definition: dgTypes.h:219
dgHingeConstraint::GetJointForce
dgVector GetJointForce() const
Definition: dgHingeConstraint.cpp:124
dgWorld
Definition: dgWorld.h:129