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

My Project

dgKinematicBody.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 #ifndef _DG_KINEMATIC_BODY_H_
23 #define _DG_KINEMATIC_BODY_H_
24
25 #include "dgPhysicsStdafx.h"
26 #include "dgBody.h"
27
28
29 DG_MSC_VECTOR_ALIGMENT
30 class dgKinematicBody: public dgBody
31 {
32 public:
33 dgKinematicBody();
34 dgKinematicBody (dgWorld* const world, const dgTree<const dgCollision*, dgInt32>* const collisionNode, dgDeserialize serializeCallback, void* const userData);
35 virtual ~dgKinematicBody ();
36
37 virtual const dgVector& GetForce() const {return m_dummy;}
38 virtual const dgVector& GetTorque() const {return m_dummy;}
39
40 virtual void AddForce (const dgVector& force) {}
41 virtual void AddTorque (const dgVector& torque) {}
42 virtual void SetForce (const dgVector& force) {}
43 virtual void SetTorque (const dgVector& torque) {}
44 virtual void ApplyExtenalForces (dgFloat32 timestep, dgInt32 threadIndex) {}
45 virtual OnApplyExtForceAndTorque GetExtForceAndTorqueCallback () const {return NULL;}
46 virtual void SetExtForceAndTorqueCallback (OnApplyExtForceAndTorque callback) {}
47
48 virtual dgFloat32 GetLinearDamping () const {return dgFloat32 (0.0f);}
49 virtual dgVector GetAngularDamping () const {return m_dummy;}
50 virtual void SetLinearDamping (dgFloat32 linearDamp) {}
51 virtual void SetAngularDamping (const dgVector& angularDamp) {}
52
53 virtual dgVector PredictLinearVelocity(dgFloat32 timestep) const {return m_veloc;}
54 virtual dgVector PredictAngularVelocity(dgFloat32 timestep) const {return m_omega;}
55
56 virtual bool IsInEquilibrium () const {return true;}
57 virtual void SetCollidable (bool state) {m_collidable = state;}
58 virtual void Serialize (const dgTree<dgInt32, const dgCollision*>* const collisionNode, dgSerialize serializeCallback, void* const userData);
59
60 virtual void AddDampingAcceleration() {}
61
62 /*
63 virtual dgConstraint* GetFirstJoint() const;
64 virtual dgConstraint* GetNextJoint(dgConstraint* const joint) const;
65 virtual dgConstraint* GetFirstContact() const;
66 virtual dgConstraint* GetNextContact(dgConstraint* const joint) const;
67 virtual dgVector CalculateInverseDynamicForce (const dgVector& desiredVeloc, dgFloat32 timestep) const;
68 */
69
70 static dgVector m_dummy;
71
72 friend class dgWorld;
73 friend class dgWorldDynamicUpdate;
74 friend class dgBroadPhase;
75 } DG_GCC_VECTOR_ALIGMENT;
76
77
78
79 #endif
80
dgKinematicBody::PredictAngularVelocity
virtual dgVector PredictAngularVelocity(dgFloat32 timestep) const
Definition: dgKinematicBody.h:54
dgKinematicBody::IsInEquilibrium
virtual bool IsInEquilibrium() const
Definition: dgKinematicBody.h:56
dgKinematicBody::SetTorque
virtual void SetTorque(const dgVector &torque)
Definition: dgKinematicBody.h:43
dgKinematicBody::AddDampingAcceleration
virtual void AddDampingAcceleration()
Definition: dgKinematicBody.h:60
dgBody
Definition: dgBody.h:44
userData
void *const userData
Definition: dgBroadPhase.h:35
DG_GCC_VECTOR_ALIGMENT
dgKinematicBody DG_GCC_VECTOR_ALIGMENT
dgKinematicBody::m_dummy
static dgVector m_dummy
Definition: dgKinematicBody.h:70
dgFloat32
float dgFloat32
Definition: dgTypes.h:233
dgInt32
int dgInt32
Definition: dgTypes.h:218
dgBody.h
dgVector
Definition: dgVector.h:639
dgBody::m_omega
dgVector m_omega
Definition: dgBody.h:209
dgKinematicBody::GetAngularDamping
virtual dgVector GetAngularDamping() const
Definition: dgKinematicBody.h:49
dgKinematicBody
Definition: dgKinematicBody.h:30
dgKinematicBody::Serialize
virtual void Serialize(const dgTree< dgInt32, const dgCollision *> *const collisionNode, dgSerialize serializeCallback, void *const userData)
Definition: dgKinematicBody.cpp:49
dgKinematicBody::SetExtForceAndTorqueCallback
virtual void SetExtForceAndTorqueCallback(OnApplyExtForceAndTorque callback)
Definition: dgKinematicBody.h:46
dgKinematicBody::SetForce
virtual void SetForce(const dgVector &force)
Definition: dgKinematicBody.h:42
dgWorldDynamicUpdate
Definition: dgWorldDynamicUpdate.h:252
dgSerialize
void(dgApi * dgSerialize)(void *const userData, const void *const buffer, size_t size)
Definition: dgTypes.h:280
dgTree
Definition: dgTree.h:88
DG_MSC_VECTOR_ALIGMENT
#define DG_MSC_VECTOR_ALIGMENT
Definition: dgTypes.h:194
dgKinematicBody::GetForce
virtual const dgVector & GetForce() const
Definition: dgKinematicBody.h:37
dgBroadPhase
Definition: dgBroadPhase.h:65
dgDeserialize
void(dgApi * dgDeserialize)(void *const userData, void *buffer, size_t size)
Definition: dgTypes.h:279
dgKinematicBody::PredictLinearVelocity
virtual dgVector PredictLinearVelocity(dgFloat32 timestep) const
Definition: dgKinematicBody.h:53
dgBody::m_collidable
dgUnsigned32 m_collidable
Definition: dgBody.h:238
dgKinematicBody::GetLinearDamping
virtual dgFloat32 GetLinearDamping() const
Definition: dgKinematicBody.h:48
dgKinematicBody::dgKinematicBody
dgKinematicBody()
Definition: dgKinematicBody.cpp:29
dgKinematicBody::SetCollidable
virtual void SetCollidable(bool state)
Definition: dgKinematicBody.h:57
dgBody::m_veloc
dgVector m_veloc
Definition: dgBody.h:208
threadIndex
dgFloat32 dgInt32 threadIndex
Definition: dgConstraint.h:44
timestep
dgFloat32 timestep
Definition: dgBallConstraint.h:34
dgKinematicBody::SetLinearDamping
virtual void SetLinearDamping(dgFloat32 linearDamp)
Definition: dgKinematicBody.h:50
dgKinematicBody::~dgKinematicBody
virtual ~dgKinematicBody()
Definition: dgKinematicBody.cpp:45
dgPhysicsStdafx.h
dgKinematicBody::ApplyExtenalForces
virtual void ApplyExtenalForces(dgFloat32 timestep, dgInt32 threadIndex)
Definition: dgKinematicBody.h:44
dgWorld
Definition: dgWorld.h:129
dgKinematicBody::GetExtForceAndTorqueCallback
virtual OnApplyExtForceAndTorque GetExtForceAndTorqueCallback() const
Definition: dgKinematicBody.h:45
dgKinematicBody::GetTorque
virtual const dgVector & GetTorque() const
Definition: dgKinematicBody.h:38
dgKinematicBody::AddTorque
virtual void AddTorque(const dgVector &torque)
Definition: dgKinematicBody.h:41
dgKinematicBody::AddForce
virtual void AddForce(const dgVector &force)
Definition: dgKinematicBody.h:40
dgKinematicBody::SetAngularDamping
virtual void SetAngularDamping(const dgVector &angularDamp)
Definition: dgKinematicBody.h:51
dgBody::OnApplyExtForceAndTorque
void(dgApi * OnApplyExtForceAndTorque)(dgBody &me, dgFloat32 timestep, dgInt32 threadIndex)
Definition: dgBody.h:48