-
Notifications
You must be signed in to change notification settings - Fork 384
Expand file tree
/
Copy pathTriangleModel.h
More file actions
62 lines (49 loc) · 1.47 KB
/
TriangleModel.h
File metadata and controls
62 lines (49 loc) · 1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#ifndef __TRIANGLEMODEL_H__
#define __TRIANGLEMODEL_H__
#include "Common/Common.h"
#include <vector>
#include "Simulation/RigidBody.h"
#include "Utils/IndexedFaceMesh.h"
#include "Simulation/ParticleData.h"
#include "Constraints.h"
namespace PBD
{
class TriangleModel
{
public:
TriangleModel();
virtual ~TriangleModel();
typedef Utilities::IndexedFaceMesh ParticleMesh;
protected:
/** offset which must be added to get the correct index in the particles array */
unsigned int m_indexOffset;
/** Face mesh of particles which represents the simulation model */
ParticleMesh m_particleMesh;
Real m_restitutionCoeff;
Real m_frictionCoeff;
public:
ParticleMesh &getParticleMesh() { return m_particleMesh; }
const ParticleMesh& getParticleMesh() const { return m_particleMesh; }
void cleanupModel();
unsigned int getIndexOffset() const;
void initMesh(const unsigned int nPoints, const unsigned int nFaces, const unsigned int indexOffset, unsigned int* indices, const ParticleMesh::UVIndices& uvIndices, const ParticleMesh::UVs& uvs);
void updateMeshNormals(const ParticleData &pd);
FORCE_INLINE Real getRestitutionCoeff() const
{
return m_restitutionCoeff;
}
FORCE_INLINE void setRestitutionCoeff(Real val)
{
m_restitutionCoeff = val;
}
FORCE_INLINE Real getFrictionCoeff() const
{
return m_frictionCoeff;
}
FORCE_INLINE void setFrictionCoeff(Real val)
{
m_frictionCoeff = val;
}
};
}
#endif