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

My Project

dgCollisionDeformableClothPatch.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_CLOTH_PATCH_MESH_H__
24 #define __DGCOLLISION_DEFORMABLE_CLOTH_PATCH_MESH_H__
25
26
27 #include "dgCollision.h"
28 #include "dgCollisionConvex.h"
29 #include "dgCollisionDeformableMesh.h"
30
31
32
33 class dgCollisionDeformableClothPatch: public dgCollisionDeformableMesh
34 {
35 public:
36 class dgEdgePair;
37 class dgClothLink;
38 class dgSoftBodyEdge;
39
40
41 dgCollisionDeformableClothPatch (const dgCollisionDeformableClothPatch& source);
42 dgCollisionDeformableClothPatch (dgWorld* const world, dgMeshEffect* const mesh, const dgClothPatchMaterial& structuralMaterial, const dgClothPatchMaterial& bendMaterial);
43 dgCollisionDeformableClothPatch (dgWorld* const world, dgDeserialize deserialization, void* const userData);
44 virtual ~dgCollisionDeformableClothPatch(void);
45
46 // void SetStiffness (dgFloat32 stiffness);
47 // void SetPlasticity (dgFloat32 plasticity);
48 // void SetSkinThickness (dgFloat32 skinThickness);
49 // virtual void SetParticlesMasses (dgFloat32 totalMass);
50 // virtual void SetParticlesVelocities (const dgVector& velocity);
51 // virtual void SetMatrix (const dgMatrix& matrix);
52 // virtual void ApplyExternalAndInternalForces (dgDeformableBody* const myBody, dgFloat32 timestep, dgInt32 threadIndex);
53
54 protected:
55 // virtual void GetCollisionInfo(dgCollisionInfo* const info) const;
56 // virtual void GetCollidingFaces (dgPolygonMeshDesc* const data) const;
57 // virtual void GetCollidingFacesSimd (dgPolygonMeshDesc* const data) const;
58 // virtual void DebugCollision (const dgMatrix& matrixPtr, OnDebugCollisionMeshCallback callback, void* const userData) const;
59
60 void Serialize(dgSerialize callback, void* const userData) const;
61 virtual dgInt32 CalculateSignature () const;
62
63 virtual void SetMass (dgFloat32 mass);
64 virtual void SetMatrix(const dgMatrix& matrix);
65 virtual void ApplyExternalForces (dgFloat32 timestep);
66 virtual void ResolvePositionsConstraints (dgFloat32 timestep);
67
68 virtual void CreateClusters (dgInt32 count, dgFloat32 overlaringWidth);
69
70 virtual void EndConfiguration ();
71 virtual void ConstraintParticle (dgInt32 particleIndex, const dgVector& posit, const dgBody* const body);
72
73 dgClothPatchMaterial m_materials[2];
74 dgInt32 m_linksCount;
75 dgInt32 m_graphCount;
76 dgVector* m_posit;
77 dgInt32* m_linkOrder;
78 dgClothLink* m_links;
79 dgSoftBodyEdge* m_graph;
80 dgSoftBodyEdge** m_particleToEddgeMap;
81 friend class dgWorld;
82 };
83
84
85
86 #endif
87
dgCollisionDeformableClothPatch::m_particleToEddgeMap
dgSoftBodyEdge ** m_particleToEddgeMap
Definition: dgCollisionDeformableClothPatch.h:80
dgCollisionDeformableClothPatch
Definition: dgCollisionDeformableClothPatch.h:33
dgCollisionDeformableClothPatch::m_graph
dgSoftBodyEdge * m_graph
Definition: dgCollisionDeformableClothPatch.h:79
dgCollisionDeformableClothPatch::dgClothLink
Definition: dgCollisionDeformableClothPatch.cpp:36
dgCollisionDeformableClothPatch::m_linksCount
dgInt32 m_linksCount
Definition: dgCollisionDeformableClothPatch.h:74
dgBody
Definition: dgBody.h:44
dgCollisionDeformableClothPatch::EndConfiguration
virtual void EndConfiguration()
Definition: dgCollisionDeformableClothPatch.cpp:320
userData
void *const userData
Definition: dgBroadPhase.h:35
dgClothPatchMaterial
Definition: dgContact.h:129
dgCollisionDeformableClothPatch::dgEdgePair
Definition: dgCollisionDeformableClothPatch.cpp:53
dgCollisionDeformableClothPatch::m_materials
dgClothPatchMaterial m_materials[2]
Definition: dgCollisionDeformableClothPatch.h:73
dgFloat32
float dgFloat32
Definition: dgTypes.h:233
dgInt32
int dgInt32
Definition: dgTypes.h:218
dgCollisionDeformableClothPatch::ConstraintParticle
virtual void ConstraintParticle(dgInt32 particleIndex, const dgVector &posit, const dgBody *const body)
Definition: dgCollisionDeformableClothPatch.cpp:289
dgVector
Definition: dgVector.h:639
dgCollisionDeformableMesh.h
dgCollisionDeformableClothPatch::CalculateSignature
virtual dgInt32 CalculateSignature() const
Definition: dgCollisionDeformableClothPatch.cpp:69
dgCollisionDeformableClothPatch::ResolvePositionsConstraints
virtual void ResolvePositionsConstraints(dgFloat32 timestep)
Definition: dgCollisionDeformableClothPatch.cpp:420
dgCollisionDeformableClothPatch::dgCollisionDeformableClothPatch
dgCollisionDeformableClothPatch(const dgCollisionDeformableClothPatch &source)
Definition: dgCollisionDeformableClothPatch.cpp:75
dgMeshEffect
Definition: dgMeshEffect.h:45
dgCollisionDeformableClothPatch::m_posit
dgVector * m_posit
Definition: dgCollisionDeformableClothPatch.h:76
dgSerialize
void(dgApi * dgSerialize)(void *const userData, const void *const buffer, size_t size)
Definition: dgTypes.h:280
dgCollisionDeformableClothPatch::SetMatrix
virtual void SetMatrix(const dgMatrix &matrix)
Definition: dgCollisionDeformableClothPatch.cpp:356
dgCollisionDeformableClothPatch::m_links
dgClothLink * m_links
Definition: dgCollisionDeformableClothPatch.h:78
dgDeserialize
void(dgApi * dgDeserialize)(void *const userData, void *buffer, size_t size)
Definition: dgTypes.h:279
dgCollisionDeformableClothPatch::Serialize
void Serialize(dgSerialize callback, void *const userData) const
Definition: dgCollisionDeformableClothPatch.cpp:60
dgCollisionDeformableClothPatch::m_linkOrder
dgInt32 * m_linkOrder
Definition: dgCollisionDeformableClothPatch.h:77
dgCollisionDeformableMesh
Definition: dgCollisionDeformableMesh.h:36
dgCollisionDeformableClothPatch::m_graphCount
dgInt32 m_graphCount
Definition: dgCollisionDeformableClothPatch.h:75
dgCollisionDeformableClothPatch::dgSoftBodyEdge
Definition: dgCollisionDeformableClothPatch.cpp:47
timestep
dgFloat32 timestep
Definition: dgBallConstraint.h:34
dgCollision.h
dgCollisionDeformableClothPatch::~dgCollisionDeformableClothPatch
virtual ~dgCollisionDeformableClothPatch(void)
Definition: dgCollisionDeformableClothPatch.cpp:278
dgMatrix
Definition: dgMatrix.h:40
dgWorld
Definition: dgWorld.h:129
dgCollisionDeformableClothPatch::SetMass
virtual void SetMass(dgFloat32 mass)
Definition: dgCollisionDeformableClothPatch.cpp:361
dgCollisionDeformableClothPatch::ApplyExternalForces
virtual void ApplyExternalForces(dgFloat32 timestep)
Definition: dgCollisionDeformableClothPatch.cpp:372
dgCollisionDeformableClothPatch::CreateClusters
virtual void CreateClusters(dgInt32 count, dgFloat32 overlaringWidth)
Definition: dgCollisionDeformableClothPatch.cpp:367
dgCollisionConvex.h