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

My Project

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