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

My Project

dgCollisionDeformableSolidMesh.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
23 #ifndef __DGCOLLISION_DEFORMABLE_SOLID_MESH_H__
24 #define __DGCOLLISION_DEFORMABLE_SOLID_MESH_H__
25
26
27 #include "dgCollision.h"
28 #include "dgCollisionConvex.h"
29 #include "dgCollisionDeformableMesh.h"
30
31
32
33 class dgCollisionDeformableSolidMesh: public dgCollisionDeformableMesh
34 {
35 public:
36 class dgCluster;
37 class dgClusterBuilder;
38
39 dgCollisionDeformableSolidMesh (const dgCollisionDeformableSolidMesh& source);
40 dgCollisionDeformableSolidMesh (dgWorld* const world, dgMeshEffect* const mesh);
41 dgCollisionDeformableSolidMesh (dgWorld* const world, dgDeserialize deserialization, void* const userData);
42 virtual ~dgCollisionDeformableSolidMesh(void);
43
44 void InitClusters();
45 void Serialize(dgSerialize callback, void* const userData) const;
46 virtual dgInt32 CalculateSignature () const;
47
48 virtual void SetMass (dgFloat32 mass);
49 virtual void SetMatrix(const dgMatrix& matrix);
50 virtual void ApplyExternalForces (dgFloat32 timestep);
51 virtual void ResolvePositionsConstraints (dgFloat32 timestep);
52
53 virtual void CreateClusters (dgInt32 count, dgFloat32 overlaringWidth);
54
55 virtual void EndConfiguration ();
56 virtual void ConstraintParticle (dgInt32 particleIndex, const dgVector& posit, const dgBody* const body);
57 virtual void DebugCollision (const dgMatrix& matrixPtr, dgCollision::OnDebugCollisionMeshCallback callback, void* const userData) const;
58
59
60 dgVector* m_posit;
61 dgVector* m_shapePosit;
62 dgFloat32* m_clusterWeight;
63 dgMatrix* m_clusterAqqInv;
64 dgMatrix* m_clusterRotationInitialGuess;
65 dgVector* m_clusterCom0;
66 dgFloat32* m_clusterMass;
67 dgInt32* m_clusterPosit;
68 dgInt32* m_clusterPositStart;
69
70 dgInt32 m_clustersCount;
71 dgFloat32 m_stiffness;
72 friend class dgWorld;
73 };
74
75
76
77 #endif
78
dgCollisionDeformableSolidMesh::m_clusterAqqInv
dgMatrix * m_clusterAqqInv
Definition: dgCollisionDeformableSolidMesh.h:63
dgCollisionDeformableSolidMesh::m_posit
dgVector * m_posit
Definition: dgCollisionDeformableSolidMesh.h:60
dgCollisionDeformableSolidMesh::SetMatrix
virtual void SetMatrix(const dgMatrix &matrix)
Definition: dgCollisionDeformableSolidMesh.cpp:456
dgCollision::OnDebugCollisionMeshCallback
void(dgApi * OnDebugCollisionMeshCallback)(void *userData, int vertexCount, const dgFloat32 *FaceArray, int faceId)
Definition: dgCollision.h:220
dgBody
Definition: dgBody.h:44
dgCollisionDeformableSolidMesh::m_clusterRotationInitialGuess
dgMatrix * m_clusterRotationInitialGuess
Definition: dgCollisionDeformableSolidMesh.h:64
userData
void *const userData
Definition: dgBroadPhase.h:35
dgFloat32
float dgFloat32
Definition: dgTypes.h:233
dgCollisionDeformableSolidMesh::CalculateSignature
virtual dgInt32 CalculateSignature() const
Definition: dgCollisionDeformableSolidMesh.cpp:426
dgInt32
int dgInt32
Definition: dgTypes.h:218
dgVector
Definition: dgVector.h:639
dgCollisionDeformableMesh.h
dgCollisionDeformableSolidMesh::m_clusterPositStart
dgInt32 * m_clusterPositStart
Definition: dgCollisionDeformableSolidMesh.h:68
dgCollisionDeformableSolidMesh::DebugCollision
virtual void DebugCollision(const dgMatrix &matrixPtr, dgCollision::OnDebugCollisionMeshCallback callback, void *const userData) const
Definition: dgCollisionDeformableSolidMesh.cpp:467
dgCollisionDeformableSolidMesh::m_clusterPosit
dgInt32 * m_clusterPosit
Definition: dgCollisionDeformableSolidMesh.h:67
dgCollisionDeformableSolidMesh::m_shapePosit
dgVector * m_shapePosit
Definition: dgCollisionDeformableSolidMesh.h:61
dgCollisionDeformableSolidMesh::m_clustersCount
dgInt32 m_clustersCount
Definition: dgCollisionDeformableSolidMesh.h:70
dgCollisionDeformableSolidMesh::m_clusterCom0
dgVector * m_clusterCom0
Definition: dgCollisionDeformableSolidMesh.h:65
dgMeshEffect
Definition: dgMeshEffect.h:45
dgSerialize
void(dgApi * dgSerialize)(void *const userData, const void *const buffer, size_t size)
Definition: dgTypes.h:280
dgCollisionDeformableSolidMesh::CreateClusters
virtual void CreateClusters(dgInt32 count, dgFloat32 overlaringWidth)
Definition: dgCollisionDeformableSolidMesh.cpp:160
dgDeserialize
void(dgApi * dgDeserialize)(void *const userData, void *buffer, size_t size)
Definition: dgTypes.h:279
dgCollisionDeformableSolidMesh::~dgCollisionDeformableSolidMesh
virtual ~dgCollisionDeformableSolidMesh(void)
Definition: dgCollisionDeformableSolidMesh.cpp:144
dgCollisionDeformableSolidMesh::ApplyExternalForces
virtual void ApplyExternalForces(dgFloat32 timestep)
Definition: dgCollisionDeformableSolidMesh.cpp:505
dgCollisionDeformableSolidMesh::m_stiffness
dgFloat32 m_stiffness
Definition: dgCollisionDeformableSolidMesh.h:71
dgCollisionDeformableSolidMesh::dgCollisionDeformableSolidMesh
dgCollisionDeformableSolidMesh(const dgCollisionDeformableSolidMesh &source)
Definition: dgCollisionDeformableSolidMesh.cpp:113
dgCollisionDeformableSolidMesh::dgCluster
Definition: dgCollisionDeformableSolidMesh.cpp:48
dgCollisionDeformableMesh
Definition: dgCollisionDeformableMesh.h:36
dgCollisionDeformableSolidMesh::Serialize
void Serialize(dgSerialize callback, void *const userData) const
Definition: dgCollisionDeformableSolidMesh.cpp:421
dgCollisionDeformableSolidMesh::InitClusters
void InitClusters()
Definition: dgCollisionDeformableSolidMesh.cpp:364
dgCollisionDeformableSolidMesh
Definition: dgCollisionDeformableSolidMesh.h:33
dgCollisionDeformableSolidMesh::EndConfiguration
virtual void EndConfiguration()
Definition: dgCollisionDeformableSolidMesh.cpp:432
timestep
dgFloat32 timestep
Definition: dgBallConstraint.h:34
dgCollisionDeformableSolidMesh::ConstraintParticle
virtual void ConstraintParticle(dgInt32 particleIndex, const dgVector &posit, const dgBody *const body)
Definition: dgCollisionDeformableSolidMesh.cpp:437
dgCollisionDeformableSolidMesh::ResolvePositionsConstraints
virtual void ResolvePositionsConstraints(dgFloat32 timestep)
Definition: dgCollisionDeformableSolidMesh.cpp:588
dgCollision.h
dgCollisionDeformableSolidMesh::m_clusterWeight
dgFloat32 * m_clusterWeight
Definition: dgCollisionDeformableSolidMesh.h:62
dgCollisionDeformableSolidMesh::dgClusterBuilder
Definition: dgCollisionDeformableSolidMesh.cpp:69
dgCollisionDeformableSolidMesh::SetMass
virtual void SetMass(dgFloat32 mass)
Definition: dgCollisionDeformableSolidMesh.cpp:443
dgMatrix
Definition: dgMatrix.h:40
dgWorld
Definition: dgWorld.h:129
dgCollisionDeformableSolidMesh::m_clusterMass
dgFloat32 * m_clusterMass
Definition: dgCollisionDeformableSolidMesh.h:66
dgCollisionConvex.h