Structural deformable models
Main Page
Namespaces
Classes
Files
File List
File Members
src
PartParam.h
Go to the documentation of this file.
1
#ifndef _PARTPARAM_H_
2
#define _PARTPARAM_H_
3
4
#include <iostream>
5
6
//spring model parameters
7
#define PART_SPRINGCONST 50.0f
8
#define PART_DAMPING 5.0f
9
#define PART_MASS 1.0f
10
#define PART_GRAV 0.0f
11
#define PART_VISCOUS 2.0f
12
#define PART_IMGFORCE 70.0f
13
#define PART_TORQUE 100.0f
14
15
/* old set
16
#define PART_SPRINGCONST 0.1f
17
#define PART_DAMPING 0.1f
18
#define PART_MASS 0.05f
19
#define PART_GRAV 0.0f
20
#define PART_VISCOUS 0.1f
21
#define PART_IMGFORCE 1.0f
22
#define PART_TORQUE 5.0f
23
*/
24
25
class
ParticleParam
{
26
public
:
27
ParticleParam
() {
28
gravitational
=
PART_GRAV
;
29
viscousdrag
=
PART_VISCOUS
;
30
springconst
=
PART_SPRINGCONST
;
31
damping
=
PART_DAMPING
;
32
mass
=
PART_MASS
;
33
imgforce
=
PART_IMGFORCE
;
34
torque
=
PART_TORQUE
;
35
}
36
37
friend
std::ostream&
operator<<
(std::ostream &os,
const
ParticleParam
&p) {
38
if
(p.
springconst
==
PART_SPRINGCONST
)
39
os <<
"#"
;
40
os <<
"p springconst "
<< p.
springconst
<< std::endl;
41
if
(p.
damping
==
PART_DAMPING
)
42
os <<
"#"
;
43
os <<
"p damping "
<< p.
damping
<< std::endl;
44
if
(p.
mass
==
PART_MASS
)
45
os <<
"#"
;
46
os <<
"p mass "
<< p.
mass
<< std::endl;
47
if
(p.
gravitational
==
PART_GRAV
)
48
os <<
"#"
;
49
os <<
"p grav "
<< p.
gravitational
<< std::endl;
50
if
(p.
viscousdrag
==
PART_VISCOUS
)
51
os <<
"#"
;
52
os <<
"p viscousdrag "
<< p.
viscousdrag
<< std::endl;
53
if
(p.
imgforce
==
PART_IMGFORCE
)
54
os <<
"#"
;
55
os <<
"p imageforce "
<< p.
imgforce
<< std::endl;
56
if
(p.
torque
==
PART_TORQUE
)
57
os <<
"#"
;
58
os <<
"p torque "
<< p.
torque
<< std::endl;
59
return
os;
60
}
61
62
float
gravitational
;
63
float
viscousdrag
;
64
float
springconst
;
65
float
damping
;
66
float
mass
;
67
float
imgforce
;
68
float
torque
;
69
70
//static member needs to be initialized somewhere so the linker
71
//doesn't generate 'undefined reference'. This is done in Model.cpp
72
static
ParticleParam
global
;
73
};
74
75
#endif
ParticleParam::ParticleParam
ParticleParam()
Definition:
PartParam.h:27
PART_TORQUE
#define PART_TORQUE
Definition:
PartParam.h:13
ParticleParam::imgforce
float imgforce
Definition:
PartParam.h:67
ParticleParam::global
static ParticleParam global
Definition:
PartParam.h:72
ParticleParam
Definition:
PartParam.h:25
PART_IMGFORCE
#define PART_IMGFORCE
Definition:
PartParam.h:12
PART_GRAV
#define PART_GRAV
Definition:
PartParam.h:10
ParticleParam::mass
float mass
Definition:
PartParam.h:66
ParticleParam::operator<<
friend std::ostream & operator<<(std::ostream &os, const ParticleParam &p)
Definition:
PartParam.h:37
ParticleParam::damping
float damping
Definition:
PartParam.h:65
PART_MASS
#define PART_MASS
Definition:
PartParam.h:9
ParticleParam::viscousdrag
float viscousdrag
Definition:
PartParam.h:63
ParticleParam::torque
float torque
Definition:
PartParam.h:68
PART_SPRINGCONST
#define PART_SPRINGCONST
Definition:
PartParam.h:7
PART_DAMPING
#define PART_DAMPING
Definition:
PartParam.h:8
ParticleParam::springconst
float springconst
Definition:
PartParam.h:64
PART_VISCOUS
#define PART_VISCOUS
Definition:
PartParam.h:11
ParticleParam::gravitational
float gravitational
Definition:
PartParam.h:62
Generated by
1.8.11