63 LinkState(
bool isFirstOrder=
true,
bool isFold=
false,
64 bool hasMemorizedRestDist=
false,
bool isOriginal=
false):
65 isFirstOrder(isFirstOrder),isFold(isFold),
66 hasMemorizedRestDist(hasMemorizedRestDist),
67 isOriginal(isOriginal){}
71 bool hasMemorizedRestDist;
83 return ((
LinkState*)tag)->hasMemorizedRestDist;
92 typedef std::pair<utils::Point32f,utils::Point32f>
LinkCoords;
94 void updateSceneObject(btSoftBody *soft);
97 bool enableSelfCollision,
102 float initialStiffness=-1,
103 float initialMaxLinkDistnace=0.5);
119 void saveState(
const std::string &filename);
121 void restoreState(
const std::string &filename);
123 void setFaceAlpha(
float alpha01);
125 float getFaceAlpha()
const;
127 int getNumNodes()
const;
147 std::vector<NodeMovement> *dst=0);
154 SceneObject *approximateSurface(
int nx=100,
int ny=150)
const;
159 void createBendingConstraints(
float maxDistance,
float fixedStiffness=-1);
161 void setLinksVisible(
bool visible);
163 void simulateSelfCollision();
171 void setFacesVisible(
bool visible);
175 virtual void unlock();
177 const std::vector<utils::Point32f> getTexCoords()
const;
183 void adaptFoldStiffness(
const LinkCoords &coords,
float stiffness,
bool memorize=
false);
190 void setStraightenFolds(
bool enabled);
193 void setDoubleFolds(
bool enabled);
197 struct Face {
int a,b,c; };
198 std::vector<utils::Point32f> texCoords;
199 std::vector<geom::Vec> vertices;
200 std::vector<Face> faces;
203 void deserializeFrom(std::istream &
str);
204 void updateToSceneObject(SceneObject *obj);
208 void serializeStructureTo(std::ostream &
str);
220 void updateCollisionClusters();
222 void updateNodeAreas();
225 bool hitLink(btSoftBody::Link *l,
const utils::Point32f &a,
const utils::Point32f &b);
227 bool hitTriangle(btSoftBody::Face *f,
const utils::Point32f &a,
const utils::Point32f &b);
229 void addTriangle(
int a,
int b,
int c);
231 void addLink(
int a,
int b,
float stiffness=1.0f,
const LinkState &state=LinkState());
233 void addVertexOrReuseOldOne(utils::Point32f &t, btVector3 &v,
int &idx);
235 bool replaceTriangle(btSoftBody::Face *f,
const utils::Point32f &a,
const utils::Point32f &b);
241 void updateSmoothNormalGraph();
243 void computeSmoothNormals();
The General Function Template.
Definition: Function.h:284
static bool is_first_order(void *tag)
Definition: PhysicsPaper3.h:76
Definition: PhysicsPaper3.h:140
undocument this line if you encounter any issues!
Definition: Any.h:37
static bool is_original(void *tag)
Definition: PhysicsPaper3.h:85
A physical world that handles physical objects.
Definition: PhysicsWorld.h:56
static bool has_memorized_rest_dist(void *tag)
Definition: PhysicsPaper3.h:82
Definition: PhysicsPaper3 (copy).h:29
Camera class.
Definition: Camera.h:132
std::pair< utils::Point32f, utils::Point32f > LinkCoords
Definition: PhysicsPaper3.h:92
LinkState * p() const
Definition: PhysicsPaper3.h:74
Size class of the ICL.
Definition: Size.h:61
Definition: ShaderUtil.h:47
#define ICLPhysics_API
Definition: CompatMacros.h:181
ICLQt_API void pix(ImgQ &image, int x, int y)
draw a single pixel into an image
std::string str(const T &t)
convert a data type into a string using an std::ostringstream instance
Definition: StringUtils.h:136
Abstract class for visualization tasks.
Definition: VisualizationDescription.h:73
This is a view-ray's line equation in parameter form.
Definition: ViewRay.h:49
geom::Vec curr
Definition: PhysicsPaper3.h:141
Single precission 3D Vectors Point class of the ICL.
Definition: Point32f.h:41
static bool is_fold(void *tag)
Definition: PhysicsPaper3.h:79
bool isOriginal
Definition: PhysicsPaper3.h:72
core::Color4D32f GeomColor
color for geometry primitives
Definition: GeomDefs.h:45
LinkState(bool isFirstOrder=true, bool isFold=false, bool hasMemorizedRestDist=false, bool isOriginal=false)
Definition: PhysicsPaper3.h:63
static void free_link_state(void *p)
Definition: PhysicsPaper3.h:165
float alpha
Definition: PhysicsPaper3.h:143
Specialization of the SmartPtrBase class for Pointers.
Definition: SmartPtr.h:75
Definition: PhysicsPaper3 (copy).h:34
geom::Vec target
Definition: PhysicsPaper3.h:142