-
Notifications
You must be signed in to change notification settings - Fork 384
Expand file tree
/
Copy pathLineModel.h
More file actions
76 lines (62 loc) · 1.63 KB
/
LineModel.h
File metadata and controls
76 lines (62 loc) · 1.63 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#ifndef __LINEMODEL_H__
#define __LINEMODEL_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 LineModel
{
struct OrientedEdge
{
OrientedEdge(){}
OrientedEdge(unsigned int p0, unsigned int p1, unsigned int q0)
{
m_vert[0] = p0;
m_vert[1] = p1;
m_quat = q0;
}
unsigned int m_vert[2];
unsigned int m_quat;
};
public:
typedef std::vector<OrientedEdge> Edges;
LineModel();
virtual ~LineModel();
protected:
/** offset which must be added to get the correct index in the particles array */
unsigned int m_indexOffset;
/** offset which must be added to get the correct index in the quaternions array */
unsigned int m_indexOffsetQuaternions;
unsigned int m_nPoints, m_nQuaternions;
Edges m_edges;
Real m_restitutionCoeff;
Real m_frictionCoeff;
public:
void updateConstraints();
Edges &getEdges();
unsigned int getIndexOffset() const;
unsigned int getIndexOffsetQuaternions() const;
void initMesh(const unsigned int nPoints, const unsigned int nQuaternions, const unsigned int indexOffset, const unsigned int indexOffsetQuaternions, unsigned int* indices, unsigned int* indicesQuaternions);
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