Bullet Collision Detection & Physics Library: btSoftBody.h Source File

Bullet Collision Detection & Physics Library

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

btSoftBody.h
Go to the documentation of this file.
1 /*
2 Bullet Continuous Collision Detection and Physics Library
3 Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/
4
5 This software is provided 'as-is', without any express or implied warranty.
6 In no event will the authors be held liable for any damages arising from the use of this software.
7 Permission is granted to anyone to use this software for any purpose,
8 including commercial applications, and to alter it and redistribute it freely,
9 subject to the following restrictions:
10
11 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
12 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
13 3. This notice may not be removed or altered from any source distribution.
14 */
16
17 #ifndef _BT_SOFT_BODY_H
18 #define _BT_SOFT_BODY_H
19
20 #include "LinearMath/btAlignedObjectArray.h"
21 #include "LinearMath/btTransform.h"
22 #include "LinearMath/btIDebugDraw.h"
23 #include "BulletDynamics/Dynamics/btRigidBody.h"
24
25 #include "BulletCollision/CollisionShapes/btConcaveShape.h"
26 #include "BulletCollision/CollisionDispatch/btCollisionCreateFunc.h"
27 #include "btSparseSDF.h"
28 #include "BulletCollision/BroadphaseCollision/btDbvt.h"
29
30 //#ifdef BT_USE_DOUBLE_PRECISION
31 //#define btRigidBodyData btRigidBodyDoubleData
32 //#define btRigidBodyDataName "btRigidBodyDoubleData"
33 //#else
34 #define btSoftBodyData btSoftBodyFloatData
35 #define btSoftBodyDataName "btSoftBodyFloatData"
36 //#endif //BT_USE_DOUBLE_PRECISION
37
38 class btBroadphaseInterface;
39 class btDispatcher;
40 class btSoftBodySolver;
41
42 /* btSoftBodyWorldInfo */
43 struct btSoftBodyWorldInfo
44 {
45 btScalar air_density;
46 btScalar water_density;
47 btScalar water_offset;
48 btScalar m_maxDisplacement;
49 btVector3 water_normal;
50 btBroadphaseInterface* m_broadphase;
51 btDispatcher* m_dispatcher;
52 btVector3 m_gravity;
53 btSparseSdf<3> m_sparsesdf;
54
55 btSoftBodyWorldInfo()
56 :air_density((btScalar)1.2),
57 water_density(0),
58 water_offset(0),
59 m_maxDisplacement(1000.f),//avoid soft body from 'exploding' so use some upper threshold of maximum motion that a node can travel per frame
60 water_normal(0,0,0),
61 m_broadphase(0),
62 m_dispatcher(0),
63 m_gravity(0,-10,0)
64 {
65 }
66 };
67
68
71 class btSoftBody : public btCollisionObject
72 {
73 public:
74 btAlignedObjectArray<const class btCollisionObject*> m_collisionDisabledObjects;
75
76 // The solver object that handles this soft body
77 btSoftBodySolver *m_softBodySolver;
78
79 //
80 // Enumerations
81 //
82
84 struct eAeroModel { enum _ {
85 V_Point,
86 V_TwoSided,
87 V_TwoSidedLiftDrag,
88 V_OneSided,
89 F_TwoSided,
90 F_TwoSidedLiftDrag,
91 F_OneSided,
92 END
93 };};
94
96 struct eVSolver { enum _ {
97 Linear,
98 END
99 };};
100
102 struct ePSolver { enum _ {
103 Linear,
104 Anchors,
105 RContacts,
106 SContacts,
107 END
108 };};
109
111 struct eSolverPresets { enum _ {
112 Positions,
113 Velocities,
114 Default = Positions,
115 END
116 };};
117
119 struct eFeature { enum _ {
120 None,
121 Node,
122 Link,
123 Face,
124 Tetra,
125 END
126 };};
127
128 typedef btAlignedObjectArray<eVSolver::_> tVSolverArray;
129 typedef btAlignedObjectArray<ePSolver::_> tPSolverArray;
130
131 //
132 // Flags
133 //
134
136 struct fCollision { enum _ {
137 RVSmask = 0x000f,
138 SDF_RS = 0x0001,
139 CL_RS = 0x0002,
140
141 SVSmask = 0x0030,
142 VF_SS = 0x0010,
143 CL_SS = 0x0020,
144 CL_SELF = 0x0040,
145 /* presets */
146 Default = SDF_RS,
147 END
148 };};
149
151 struct fMaterial { enum _ {
152 DebugDraw = 0x0001,
153 /* presets */
154 Default = DebugDraw,
155 END
156 };};
157
158 //
159 // API Types
160 //
161
162 /* sRayCast */
163 struct sRayCast
164 {
165 btSoftBody* body;
166 eFeature::_ feature;
167 int index;
168 btScalar fraction;
169 };
170
171 /* ImplicitFn */
172 struct ImplicitFn
173 {
174 virtual ~ImplicitFn() {}
175 virtual btScalar Eval(const btVector3& x)=0;
176 };
177
178 //
179 // Internal types
180 //
181
182 typedef btAlignedObjectArray<btScalar> tScalarArray;
183 typedef btAlignedObjectArray<btVector3> tVector3Array;
184
185 /* sCti is Softbody contact info */
186 struct sCti
187 {
188 const btCollisionObject* m_colObj; /* Rigid body */
189 btVector3 m_normal; /* Outward normal */
190 btScalar m_offset; /* Offset from origin */
191 };
192
193 /* sMedium */
194 struct sMedium
195 {
196 btVector3 m_velocity; /* Velocity */
197 btScalar m_pressure; /* Pressure */
198 btScalar m_density; /* Density */
199 };
200
201 /* Base type */
202 struct Element
203 {
204 void* m_tag; // User data
205 Element() : m_tag(0) {}
206 };
207 /* Material */
208 struct Material : Element
209 {
210 btScalar m_kLST; // Linear stiffness coefficient [0,1]
211 btScalar m_kAST; // Area/Angular stiffness coefficient [0,1]
212 btScalar m_kVST; // Volume stiffness coefficient [0,1]
213 int m_flags; // Flags
214 };
215
216 /* Feature */
217 struct Feature : Element
218 {
219 Material* m_material; // Material
220 };
221 /* Node */
222 struct Node : Feature
223 {
224 btVector3 m_x; // Position
225 btVector3 m_q; // Previous step position
226 btVector3 m_v; // Velocity
227 btVector3 m_f; // Force accumulator
228 btVector3 m_n; // Normal
229 btScalar m_im; // 1/mass
230 btScalar m_area; // Area
231 btDbvtNode* m_leaf; // Leaf data
232 int m_battach:1; // Attached
233 };
234 /* Link */
235 struct Link : Feature
236 {
237 Node* m_n[2]; // Node pointers
238 btScalar m_rl; // Rest length
239 int m_bbending:1; // Bending link
240 btScalar m_c0; // (ima+imb)*kLST
241 btScalar m_c1; // rl^2
242 btScalar m_c2; // |gradient|^2/c0
243 btVector3 m_c3; // gradient
244 };
245 /* Face */
246 struct Face : Feature
247 {
248 Node* m_n[3]; // Node pointers
249 btVector3 m_normal; // Normal
250 btScalar m_ra; // Rest area
251 btDbvtNode* m_leaf; // Leaf data
252 };
253 /* Tetra */
254 struct Tetra : Feature
255 {
256 Node* m_n[4]; // Node pointers
257 btScalar m_rv; // Rest volume
258 btDbvtNode* m_leaf; // Leaf data
259 btVector3 m_c0[4]; // gradients
260 btScalar m_c1; // (4*kVST)/(im0+im1+im2+im3)
261 btScalar m_c2; // m_c1/sum(|g0..3|^2)
262 };
263 /* RContact */
264 struct RContact
265 {
266 sCti m_cti; // Contact infos
267 Node* m_node; // Owner node
268 btMatrix3x3 m_c0; // Impulse matrix
269 btVector3 m_c1; // Relative anchor
270 btScalar m_c2; // ima*dt
271 btScalar m_c3; // Friction
272 btScalar m_c4; // Hardness
273 };
274 /* SContact */
275 struct SContact
276 {
277 Node* m_node; // Node
278 Face* m_face; // Face
279 btVector3 m_weights; // Weigths
280 btVector3 m_normal; // Normal
281 btScalar m_margin; // Margin
282 btScalar m_friction; // Friction
283 btScalar m_cfm[2]; // Constraint force mixing
284 };
285 /* Anchor */
286 struct Anchor
287 {
288 Node* m_node; // Node pointer
289 btVector3 m_local; // Anchor position in body space
290 btRigidBody* m_body; // Body
291 btScalar m_influence;
292 btMatrix3x3 m_c0; // Impulse matrix
293 btVector3 m_c1; // Relative anchor
294 btScalar m_c2; // ima*dt
295 };
296 /* Note */
297 struct Note : Element
298 {
299 const char* m_text; // Text
300 btVector3 m_offset; // Offset
301 int m_rank; // Rank
302 Node* m_nodes[4]; // Nodes
303 btScalar m_coords[4]; // Coordinates
304 };
305 /* Pose */
306 struct Pose
307 {
308 bool m_bvolume; // Is valid
309 bool m_bframe; // Is frame
310 btScalar m_volume; // Rest volume
311 tVector3Array m_pos; // Reference positions
312 tScalarArray m_wgh; // Weights
313 btVector3 m_com; // COM
314 btMatrix3x3 m_rot; // Rotation
315 btMatrix3x3 m_scl; // Scale
316 btMatrix3x3 m_aqq; // Base scaling
317 };
318 /* Cluster */
319 struct Cluster
320 {
321 tScalarArray m_masses;
322 btAlignedObjectArray<Node*> m_nodes;
323 tVector3Array m_framerefs;
324 btTransform m_framexform;
325 btScalar m_idmass;
326 btScalar m_imass;
327 btMatrix3x3 m_locii;
328 btMatrix3x3 m_invwi;
329 btVector3 m_com;
330 btVector3 m_vimpulses[2];
331 btVector3 m_dimpulses[2];
332 int m_nvimpulses;
333 int m_ndimpulses;
334 btVector3 m_lv;
335 btVector3 m_av;
336 btDbvtNode* m_leaf;
337 btScalar m_ndamping; /* Node damping */
338 btScalar m_ldamping; /* Linear damping */
339 btScalar m_adamping; /* Angular damping */
340 btScalar m_matching;
341 btScalar m_maxSelfCollisionImpulse;
342 btScalar m_selfCollisionImpulseFactor;
343 bool m_containsAnchor;
344 bool m_collide;
345 int m_clusterIndex;
346 Cluster() : m_leaf(0),m_ndamping(0),m_ldamping(0),m_adamping(0),m_matching(0)
347 ,m_maxSelfCollisionImpulse(100.f),
348 m_selfCollisionImpulseFactor(0.01f),
349 m_containsAnchor(false)
350 {}
351 };
352 /* Impulse */
353 struct Impulse
354 {
355 btVector3 m_velocity;
356 btVector3 m_drift;
357 int m_asVelocity:1;
358 int m_asDrift:1;
359 Impulse() : m_velocity(0,0,0),m_drift(0,0,0),m_asVelocity(0),m_asDrift(0) {}
360 Impulse operator -() const
361 {
362 Impulse i=*this;
363 i.m_velocity=-i.m_velocity;
364 i.m_drift=-i.m_drift;
365 return(i);
366 }
367 Impulse operator*(btScalar x) const
368 {
369 Impulse i=*this;
370 i.m_velocity*=x;
371 i.m_drift*=x;
372 return(i);
373 }
374 };
375 /* Body */
376 struct Body
377 {
378 Cluster* m_soft;
379 btRigidBody* m_rigid;
380 const btCollisionObject* m_collisionObject;
381
382 Body() : m_soft(0),m_rigid(0),m_collisionObject(0) {}
383 Body(Cluster* p) : m_soft(p),m_rigid(0),m_collisionObject(0) {}
384 Body(const btCollisionObject* colObj) : m_soft(0),m_collisionObject(colObj)
385 {
386 m_rigid = (btRigidBody*)btRigidBody::upcast(m_collisionObject);
387 }
388
389 void activate() const
390 {
391 if(m_rigid)
392 m_rigid->activate();
393 if (m_collisionObject)
394 m_collisionObject->activate();
395
396 }
397 const btMatrix3x3& invWorldInertia() const
398 {
399 static const btMatrix3x3 iwi(0,0,0,0,0,0,0,0,0);
400 if(m_rigid) return(m_rigid->getInvInertiaTensorWorld());
401 if(m_soft) return(m_soft->m_invwi);
402 return(iwi);
403 }
404 btScalar invMass() const
405 {
406 if(m_rigid) return(m_rigid->getInvMass());
407 if(m_soft) return(m_soft->m_imass);
408 return(0);
409 }
410 const btTransform& xform() const
411 {
412 static const btTransform identity=btTransform::getIdentity();
413 if(m_collisionObject) return(m_collisionObject->getWorldTransform());
414 if(m_soft) return(m_soft->m_framexform);
415 return(identity);
416 }
417 btVector3 linearVelocity() const
418 {
419 if(m_rigid) return(m_rigid->getLinearVelocity());
420 if(m_soft) return(m_soft->m_lv);
421 return(btVector3(0,0,0));
422 }
423 btVector3 angularVelocity(const btVector3& rpos) const
424 {
425 if(m_rigid) return(btCross(m_rigid->getAngularVelocity(),rpos));
426 if(m_soft) return(btCross(m_soft->m_av,rpos));
427 return(btVector3(0,0,0));
428 }
429 btVector3 angularVelocity() const
430 {
431 if(m_rigid) return(m_rigid->getAngularVelocity());
432 if(m_soft) return(m_soft->m_av);
433 return(btVector3(0,0,0));
434 }
435 btVector3 velocity(const btVector3& rpos) const
436 {
437 return(linearVelocity()+angularVelocity(rpos));
438 }
439 void applyVImpulse(const btVector3& impulse,const btVector3& rpos) const
440 {
441 if(m_rigid) m_rigid->applyImpulse(impulse,rpos);
442 if(m_soft) btSoftBody::clusterVImpulse(m_soft,rpos,impulse);
443 }
444 void applyDImpulse(const btVector3& impulse,const btVector3& rpos) const
445 {
446 if(m_rigid) m_rigid->applyImpulse(impulse,rpos);
447 if(m_soft) btSoftBody::clusterDImpulse(m_soft,rpos,impulse);
448 }
449 void applyImpulse(const Impulse& impulse,const btVector3& rpos) const
450 {
451 if(impulse.m_asVelocity)
452 {
453 // printf("impulse.m_velocity = %f,%f,%f\n",impulse.m_velocity.getX(),impulse.m_velocity.getY(),impulse.m_velocity.getZ());
454 applyVImpulse(impulse.m_velocity,rpos);
455 }
456 if(impulse.m_asDrift)
457 {
458 // printf("impulse.m_drift = %f,%f,%f\n",impulse.m_drift.getX(),impulse.m_drift.getY(),impulse.m_drift.getZ());
459 applyDImpulse(impulse.m_drift,rpos);
460 }
461 }
462 void applyVAImpulse(const btVector3& impulse) const
463 {
464 if(m_rigid) m_rigid->applyTorqueImpulse(impulse);
465 if(m_soft) btSoftBody::clusterVAImpulse(m_soft,impulse);
466 }
467 void applyDAImpulse(const btVector3& impulse) const
468 {
469 if(m_rigid) m_rigid->applyTorqueImpulse(impulse);
470 if(m_soft) btSoftBody::clusterDAImpulse(m_soft,impulse);
471 }
472 void applyAImpulse(const Impulse& impulse) const
473 {
474 if(impulse.m_asVelocity) applyVAImpulse(impulse.m_velocity);
475 if(impulse.m_asDrift) applyDAImpulse(impulse.m_drift);
476 }
477 void applyDCImpulse(const btVector3& impulse) const
478 {
479 if(m_rigid) m_rigid->applyCentralImpulse(impulse);
480 if(m_soft) btSoftBody::clusterDCImpulse(m_soft,impulse);
481 }
482 };
483 /* Joint */
484 struct Joint
485 {
486 struct eType { enum _ {
487 Linear=0,
488 Angular,
489 Contact
490 };};
491 struct Specs
492 {
493 Specs() : erp(1),cfm(1),split(1) {}
494 btScalar erp;
495 btScalar cfm;
496 btScalar split;
497 };
498 Body m_bodies[2];
499 btVector3 m_refs[2];
500 btScalar m_cfm;
501 btScalar m_erp;
502 btScalar m_split;
503 btVector3 m_drift;
504 btVector3 m_sdrift;
505 btMatrix3x3 m_massmatrix;
506 bool m_delete;
507 virtual ~Joint() {}
508 Joint() : m_delete(false) {}
509 virtual void Prepare(btScalar dt,int iterations);
510 virtual void Solve(btScalar dt,btScalar sor)=0;
511 virtual void Terminate(btScalar dt)=0;
512 virtual eType::_ Type() const=0;
513 };
514 /* LJoint */
515 struct LJoint : Joint
516 {
517 struct Specs : Joint::Specs
518 {
519 btVector3 position;
520 };
521 btVector3 m_rpos[2];
522 void Prepare(btScalar dt,int iterations);
523 void Solve(btScalar dt,btScalar sor);
524 void Terminate(btScalar dt);
525 eType::_ Type() const { return(eType::Linear); }
526 };
527 /* AJoint */
528 struct AJoint : Joint
529 {
530 struct IControl
531 {
532 virtual ~IControl() {}
533 virtual void Prepare(AJoint*) {}
534 virtual btScalar Speed(AJoint*,btScalar current) { return(current); }
535 static IControl* Default() { static IControl def;return(&def); }
536 };
537 struct Specs : Joint::Specs
538 {
539 Specs() : icontrol(IControl::Default()) {}
540 btVector3 axis;
541 IControl* icontrol;
542 };
543 btVector3 m_axis[2];
544 IControl* m_icontrol;
545 void Prepare(btScalar dt,int iterations);
546 void Solve(btScalar dt,btScalar sor);
547 void Terminate(btScalar dt);
548 eType::_ Type() const { return(eType::Angular); }
549 };
550 /* CJoint */
551 struct CJoint : Joint
552 {
553 int m_life;
554 int m_maxlife;
555 btVector3 m_rpos[2];
556 btVector3 m_normal;
557 btScalar m_friction;
558 void Prepare(btScalar dt,int iterations);
559 void Solve(btScalar dt,btScalar sor);
560 void Terminate(btScalar dt);
561 eType::_ Type() const { return(eType::Contact); }
562 };
563 /* Config */
564 struct Config
565 {
566 eAeroModel::_ aeromodel; // Aerodynamic model (default: V_Point)
567 btScalar kVCF; // Velocities correction factor (Baumgarte)
568 btScalar kDP; // Damping coefficient [0,1]
569 btScalar kDG; // Drag coefficient [0,+inf]
570 btScalar kLF; // Lift coefficient [0,+inf]
571 btScalar kPR; // Pressure coefficient [-inf,+inf]
572 btScalar kVC; // Volume conversation coefficient [0,+inf]
573 btScalar kDF; // Dynamic friction coefficient [0,1]
574 btScalar kMT; // Pose matching coefficient [0,1]
575 btScalar kCHR; // Rigid contacts hardness [0,1]
576 btScalar kKHR; // Kinetic contacts hardness [0,1]
577 btScalar kSHR; // Soft contacts hardness [0,1]
578 btScalar kAHR; // Anchors hardness [0,1]
579 btScalar kSRHR_CL; // Soft vs rigid hardness [0,1] (cluster only)
580 btScalar kSKHR_CL; // Soft vs kinetic hardness [0,1] (cluster only)
581 btScalar kSSHR_CL; // Soft vs soft hardness [0,1] (cluster only)
582 btScalar kSR_SPLT_CL; // Soft vs rigid impulse split [0,1] (cluster only)
583 btScalar kSK_SPLT_CL; // Soft vs rigid impulse split [0,1] (cluster only)
584 btScalar kSS_SPLT_CL; // Soft vs rigid impulse split [0,1] (cluster only)
585 btScalar maxvolume; // Maximum volume ratio for pose
586 btScalar timescale; // Time scale
587 int viterations; // Velocities solver iterations
588 int piterations; // Positions solver iterations
589 int diterations; // Drift solver iterations
590 int citerations; // Cluster solver iterations
591 int collisions; // Collisions flags
592 tVSolverArray m_vsequence; // Velocity solvers sequence
593 tPSolverArray m_psequence; // Position solvers sequence
594 tPSolverArray m_dsequence; // Drift solvers sequence
595 };
596 /* SolverState */
597 struct SolverState
598 {
599 btScalar sdt; // dt*timescale
600 btScalar isdt; // 1/sdt
601 btScalar velmrg; // velocity margin
602 btScalar radmrg; // radial margin
603 btScalar updmrg; // Update margin
604 };
606 struct RayFromToCaster : btDbvt::ICollide
607 {
608 btVector3 m_rayFrom;
609 btVector3 m_rayTo;
610 btVector3 m_rayNormalizedDirection;
611 btScalar m_mint;
612 Face* m_face;
613 int m_tests;
614 RayFromToCaster(const btVector3& rayFrom,const btVector3& rayTo,btScalar mxt);
615 void Process(const btDbvtNode* leaf);
616
617 static inline btScalar rayFromToTriangle(const btVector3& rayFrom,
618 const btVector3& rayTo,
619 const btVector3& rayNormalizedDirection,
620 const btVector3& a,
621 const btVector3& b,
622 const btVector3& c,
623 btScalar maxt=SIMD_INFINITY);
624 };
625
626 //
627 // Typedefs
628 //
629
630 typedef void (*psolver_t)(btSoftBody*,btScalar,btScalar);
631 typedef void (*vsolver_t)(btSoftBody*,btScalar);
632 typedef btAlignedObjectArray<Cluster*> tClusterArray;
633 typedef btAlignedObjectArray<Note> tNoteArray;
634 typedef btAlignedObjectArray<Node> tNodeArray;
635 typedef btAlignedObjectArray<btDbvtNode*> tLeafArray;
636 typedef btAlignedObjectArray<Link> tLinkArray;
637 typedef btAlignedObjectArray<Face> tFaceArray;
638 typedef btAlignedObjectArray<Tetra> tTetraArray;
639 typedef btAlignedObjectArray<Anchor> tAnchorArray;
640 typedef btAlignedObjectArray<RContact> tRContactArray;
641 typedef btAlignedObjectArray<SContact> tSContactArray;
642 typedef btAlignedObjectArray<Material*> tMaterialArray;
643 typedef btAlignedObjectArray<Joint*> tJointArray;
644 typedef btAlignedObjectArray<btSoftBody*> tSoftBodyArray;
645
646 //
647 // Fields
648 //
649
650 Config m_cfg; // Configuration
651 SolverState m_sst; // Solver state
652 Pose m_pose; // Pose
653 void* m_tag; // User data
654 btSoftBodyWorldInfo* m_worldInfo; // World info
655 tNoteArray m_notes; // Notes
656 tNodeArray m_nodes; // Nodes
657 tLinkArray m_links; // Links
658 tFaceArray m_faces; // Faces
659 tTetraArray m_tetras; // Tetras
660 tAnchorArray m_anchors; // Anchors
661 tRContactArray m_rcontacts; // Rigid contacts
662 tSContactArray m_scontacts; // Soft contacts
663 tJointArray m_joints; // Joints
664 tMaterialArray m_materials; // Materials
665 btScalar m_timeacc; // Time accumulator
666 btVector3 m_bounds[2]; // Spatial bounds
667 bool m_bUpdateRtCst; // Update runtime constants
668 btDbvt m_ndbvt; // Nodes tree
669 btDbvt m_fdbvt; // Faces tree
670 btDbvt m_cdbvt; // Clusters tree
671 tClusterArray m_clusters; // Clusters
672
673 btAlignedObjectArray<bool>m_clusterConnectivity;//cluster connectivity, for self-collision
674
675 btTransform m_initialWorldTransform;
676
677 btVector3 m_windVelocity;
678
679 btScalar m_restLengthScale;
680
681 //
682 // Api
683 //
684
685 /* ctor */
686 btSoftBody( btSoftBodyWorldInfo* worldInfo,int node_count, const btVector3* x, const btScalar* m);
687
688 /* ctor */
689 btSoftBody( btSoftBodyWorldInfo* worldInfo);
690
691 void initDefaults();
692
693 /* dtor */
694 virtual ~btSoftBody();
695 /* Check for existing link */
696
697 btAlignedObjectArray<int> m_userIndexMapping;
698
699 btSoftBodyWorldInfo* getWorldInfo()
700 {
701 return m_worldInfo;
702 }
703
705 virtual void setCollisionShape(btCollisionShape* collisionShape)
706 {
707
708 }
709
710 bool checkLink( int node0,
711 int node1) const;
712 bool checkLink( const Node* node0,
713 const Node* node1) const;
714 /* Check for existring face */
715 bool checkFace( int node0,
716 int node1,
717 int node2) const;
718 /* Append material */
719 Material* appendMaterial();
720 /* Append note */
721 void appendNote( const char* text,
722 const btVector3& o,
723 const btVector4& c=btVector4(1,0,0,0),
724 Node* n0=0,
725 Node* n1=0,
726 Node* n2=0,
727 Node* n3=0);
728 void appendNote( const char* text,
729 const btVector3& o,
730 Node* feature);
731 void appendNote( const char* text,
732 const btVector3& o,
733 Link* feature);
734 void appendNote( const char* text,
735 const btVector3& o,
736 Face* feature);
737 /* Append node */
738 void appendNode( const btVector3& x,btScalar m);
739 /* Append link */
740 void appendLink(int model=-1,Material* mat=0);
741 void appendLink( int node0,
742 int node1,
743 Material* mat=0,
744 bool bcheckexist=false);
745 void appendLink( Node* node0,
746 Node* node1,
747 Material* mat=0,
748 bool bcheckexist=false);
749 /* Append face */
750 void appendFace(int model=-1,Material* mat=0);
751 void appendFace( int node0,
752 int node1,
753 int node2,
754 Material* mat=0);
755 void appendTetra(int model,Material* mat);
756 //
757 void appendTetra(int node0,
758 int node1,
759 int node2,
760 int node3,
761 Material* mat=0);
762
763
764 /* Append anchor */
765 void appendAnchor( int node,
766 btRigidBody* body, bool disableCollisionBetweenLinkedBodies=false,btScalar influence = 1);
767 void appendAnchor(int node,btRigidBody* body, const btVector3& localPivot,bool disableCollisionBetweenLinkedBodies=false,btScalar influence = 1);
768 /* Append linear joint */
769 void appendLinearJoint(const LJoint::Specs& specs,Cluster* body0,Body body1);
770 void appendLinearJoint(const LJoint::Specs& specs,Body body=Body());
771 void appendLinearJoint(const LJoint::Specs& specs,btSoftBody* body);
772 /* Append linear joint */
773 void appendAngularJoint(const AJoint::Specs& specs,Cluster* body0,Body body1);
774 void appendAngularJoint(const AJoint::Specs& specs,Body body=Body());
775 void appendAngularJoint(const AJoint::Specs& specs,btSoftBody* body);
776 /* Add force (or gravity) to the entire body */
777 void addForce( const btVector3& force);
778 /* Add force (or gravity) to a node of the body */
779 void addForce( const btVector3& force,
780 int node);
781 /* Add aero force to a node of the body */
782 void addAeroForceToNode(const btVector3& windVelocity,int nodeIndex);
783
784 /* Add aero force to a face of the body */
785 void addAeroForceToFace(const btVector3& windVelocity,int faceIndex);
786
787 /* Add velocity to the entire body */
788 void addVelocity( const btVector3& velocity);
789
790 /* Set velocity for the entire body */
791 void setVelocity( const btVector3& velocity);
792
793 /* Add velocity to a node of the body */
794 void addVelocity( const btVector3& velocity,
795 int node);
796 /* Set mass */
797 void setMass( int node,
798 btScalar mass);
799 /* Get mass */
800 btScalar getMass( int node) const;
801 /* Get total mass */
802 btScalar getTotalMass() const;
803 /* Set total mass (weighted by previous masses) */
804 void setTotalMass( btScalar mass,
805 bool fromfaces=false);
806 /* Set total density */
807 void setTotalDensity(btScalar density);
808 /* Set volume mass (using tetrahedrons) */
809 void setVolumeMass( btScalar mass);
810 /* Set volume density (using tetrahedrons) */
811 void setVolumeDensity( btScalar density);
812 /* Transform */
813 void transform( const btTransform& trs);
814 /* Translate */
815 void translate( const btVector3& trs);
816 /* Rotate */
817 void rotate( const btQuaternion& rot);
818 /* Scale */
819 void scale( const btVector3& scl);
820 /* Get link resting lengths scale */
821 btScalar getRestLengthScale();
822 /* Scale resting length of all springs */
823 void setRestLengthScale(btScalar restLength);
824 /* Set current state as pose */
825 void setPose( bool bvolume,
826 bool bframe);
827 /* Set current link lengths as resting lengths */
828 void resetLinkRestLengths();
829 /* Return the volume */
830 btScalar getVolume() const;
831 /* Cluster count */
832 int clusterCount() const;
833 /* Cluster center of mass */
834 static btVector3 clusterCom(const Cluster* cluster);
835 btVector3 clusterCom(int cluster) const;
836 /* Cluster velocity at rpos */
837 static btVector3 clusterVelocity(const Cluster* cluster,const btVector3& rpos);
838 /* Cluster impulse */
839 static void clusterVImpulse(Cluster* cluster,const btVector3& rpos,const btVector3& impulse);
840 static void clusterDImpulse(Cluster* cluster,const btVector3& rpos,const btVector3& impulse);
841 static void clusterImpulse(Cluster* cluster,const btVector3& rpos,const Impulse& impulse);
842 static void clusterVAImpulse(Cluster* cluster,const btVector3& impulse);
843 static void clusterDAImpulse(Cluster* cluster,const btVector3& impulse);
844 static void clusterAImpulse(Cluster* cluster,const Impulse& impulse);
845 static void clusterDCImpulse(Cluster* cluster,const btVector3& impulse);
846 /* Generate bending constraints based on distance in the adjency graph */
847 int generateBendingConstraints( int distance,
848 Material* mat=0);
849 /* Randomize constraints to reduce solver bias */
850 void randomizeConstraints();
851 /* Release clusters */
852 void releaseCluster(int index);
853 void releaseClusters();
854 /* Generate clusters (K-mean) */
857 int generateClusters(int k,int maxiterations=8192);
858 /* Refine */
859 void refine(ImplicitFn* ifn,btScalar accurary,bool cut);
860 /* CutLink */
861 bool cutLink(int node0,int node1,btScalar position);
862 bool cutLink(const Node* node0,const Node* node1,btScalar position);
863
865 bool rayTest(const btVector3& rayFrom,
866 const btVector3& rayTo,
867 sRayCast& results);
868 /* Solver presets */
869 void setSolver(eSolverPresets::_ preset);
870 /* predictMotion */
871 void predictMotion(btScalar dt);
872 /* solveConstraints */
873 void solveConstraints();
874 /* staticSolve */
875 void staticSolve(int iterations);
876 /* solveCommonConstraints */
877 static void solveCommonConstraints(btSoftBody** bodies,int count,int iterations);
878 /* solveClusters */
879 static void solveClusters(const btAlignedObjectArray<btSoftBody*>& bodies);
880 /* integrateMotion */
881 void integrateMotion();
882 /* defaultCollisionHandlers */
883 void defaultCollisionHandler(const btCollisionObjectWrapper* pcoWrap);
884 void defaultCollisionHandler(btSoftBody* psb);
885
886
887
888 //
889 // Functionality to deal with new accelerated solvers.
890 //
891
895 void setWindVelocity( const btVector3 &velocity );
896
897
901 const btVector3& getWindVelocity();
902
903 //
904 // Set the solver that handles this soft body
905 // Should not be allowed to get out of sync with reality
906 // Currently called internally on addition to the world
907 void setSoftBodySolver( btSoftBodySolver *softBodySolver )
908 {
909 m_softBodySolver = softBodySolver;
910 }
911
912 //
913 // Return the solver that handles this soft body
914 //
915 btSoftBodySolver *getSoftBodySolver()
916 {
917 return m_softBodySolver;
918 }
919
920 //
921 // Return the solver that handles this soft body
922 //
923 btSoftBodySolver *getSoftBodySolver() const
924 {
925 return m_softBodySolver;
926 }
927
928
929 //
930 // Cast
931 //
932
933 static const btSoftBody* upcast(const btCollisionObject* colObj)
934 {
935 if (colObj->getInternalType()==CO_SOFT_BODY)
936 return (const btSoftBody*)colObj;
937 return 0;
938 }
939 static btSoftBody* upcast(btCollisionObject* colObj)
940 {
941 if (colObj->getInternalType()==CO_SOFT_BODY)
942 return (btSoftBody*)colObj;
943 return 0;
944 }
945
946 //
947 // ::btCollisionObject
948 //
949
950 virtual void getAabb(btVector3& aabbMin,btVector3& aabbMax) const
951 {
952 aabbMin = m_bounds[0];
953 aabbMax = m_bounds[1];
954 }
955 //
956 // Private
957 //
958 void pointersToIndices();
959 void indicesToPointers(const int* map=0);
960
961 int rayTest(const btVector3& rayFrom,const btVector3& rayTo,
962 btScalar& mint,eFeature::_& feature,int& index,bool bcountonly) const;
963 void initializeFaceTree();
964 btVector3 evaluateCom() const;
965 bool checkContact(const btCollisionObjectWrapper* colObjWrap,const btVector3& x,btScalar margin,btSoftBody::sCti& cti) const;
966 void updateNormals();
967 void updateBounds();
968 void updatePose();
969 void updateConstants();
970 void updateLinkConstants();
971 void updateArea(bool averageArea = true);
972 void initializeClusters();
973 void updateClusters();
974 void cleanupClusters();
975 void prepareClusters(int iterations);
976 void solveClusters(btScalar sor);
977 void applyClusters(bool drift);
978 void dampClusters();
979 void applyForces();
980 static void PSolve_Anchors(btSoftBody* psb,btScalar kst,btScalar ti);
981 static void PSolve_RContacts(btSoftBody* psb,btScalar kst,btScalar ti);
982 static void PSolve_SContacts(btSoftBody* psb,btScalar,btScalar ti);
983 static void PSolve_Links(btSoftBody* psb,btScalar kst,btScalar ti);
984 static void VSolve_Links(btSoftBody* psb,btScalar kst);
985 static psolver_t getSolver(ePSolver::_ solver);
986 static vsolver_t getSolver(eVSolver::_ solver);
987
988
989 virtual int calculateSerializeBufferSize() const;
990
992 virtual const char* serialize(void* dataBuffer, class btSerializer* serializer) const;
993
994 //virtual void serializeSingleObject(class btSerializer* serializer) const;
995
996
997 };
998
999
1000
1001
1002 #endif //_BT_SOFT_BODY_H
btSoftBody::Tetra::m_c1
btScalar m_c1
Definition: btSoftBody.h:260
btCollisionObject::CO_SOFT_BODY
Definition: btCollisionObject.h:140
btSoftBody::PSolve_RContacts
static void PSolve_RContacts(btSoftBody *psb, btScalar kst, btScalar ti)
Definition: btSoftBody.cpp:3022
btRigidBody::getInvMass
btScalar getInvMass() const
Definition: btRigidBody.h:270
btSoftBody::RayFromToCaster::RayFromToCaster
RayFromToCaster(const btVector3 &rayFrom, const btVector3 &rayTo, btScalar mxt)
Definition: btSoftBody.cpp:1995
btSoftBody::LJoint::m_rpos
btVector3 m_rpos[2]
Definition: btSoftBody.h:521
btSoftBody::eFeature
eFeature
Definition: btSoftBody.h:119
btSoftBody::sCti::m_colObj
const btCollisionObject * m_colObj
Definition: btSoftBody.h:188
btSoftBody::Impulse::m_velocity
btVector3 m_velocity
Definition: btSoftBody.h:355
btSoftBody::Config::piterations
int piterations
Definition: btSoftBody.h:588
btSoftBody::AJoint::Specs::icontrol
IControl * icontrol
Definition: btSoftBody.h:541
btRigidBody::upcast
static const btRigidBody * upcast(const btCollisionObject *colObj)
to keep collision detection and dynamics separate we don't store a rigidbody pointer but a rigidbody ...
Definition: btRigidBody.h:200
btSoftBody::Joint::Specs::cfm
btScalar cfm
Definition: btSoftBody.h:495
btSoftBody::generateBendingConstraints
int generateBendingConstraints(int distance, Material *mat=0)
Definition: btSoftBody.cpp:1038
btSoftBody::Pose::m_scl
btMatrix3x3 m_scl
Definition: btSoftBody.h:315
btSoftBody::vsolver_t
void(* vsolver_t)(btSoftBody *, btScalar)
Definition: btSoftBody.h:631
btSoftBody::solveClusters
static void solveClusters(const btAlignedObjectArray< btSoftBody * > &bodies)
Definition: btSoftBody.cpp:1959
btSoftBody::Cluster::m_idmass
btScalar m_idmass
Definition: btSoftBody.h:325
btSoftBody::LJoint::Specs
Definition: btSoftBody.h:517
btSoftBody::AJoint::Specs::axis
btVector3 axis
Definition: btSoftBody.h:540
btSoftBody::Link::m_bbending
int m_bbending
Definition: btSoftBody.h:239
btSoftBody::AJoint
Definition: btSoftBody.h:528
btSoftBody::Impulse::operator*
Impulse operator*(btScalar x) const
Definition: btSoftBody.h:367
btSoftBody::SContact::m_node
Node * m_node
Definition: btSoftBody.h:277
btSoftBody::AJoint::Specs
Definition: btSoftBody.h:537
btSoftBody::sRayCast::feature
eFeature::_ feature
soft body
Definition: btSoftBody.h:166
btSoftBody::ePSolver::SContacts
Rigid contacts solver.
Definition: btSoftBody.h:106
btSoftBody::Config::kSS_SPLT_CL
btScalar kSS_SPLT_CL
Definition: btSoftBody.h:584
btSoftBody::RayFromToCaster::m_mint
btScalar m_mint
Definition: btSoftBody.h:611
btSoftBody::Face
Definition: btSoftBody.h:246
btSoftBody::CJoint::m_life
int m_life
Definition: btSoftBody.h:553
btSoftBody::tLinkArray
btAlignedObjectArray< Link > tLinkArray
Definition: btSoftBody.h:636
btSoftBody::RayFromToCaster::Process
void Process(const btDbvtNode *leaf)
Definition: btSoftBody.cpp:2006
btSoftBody::ePSolver::_
_
Definition: btSoftBody.h:102
btSoftBody::sRayCast::index
int index
feature type
Definition: btSoftBody.h:167
btSoftBody::eAeroModel::V_TwoSided
Vertex normals are oriented toward velocity.
Definition: btSoftBody.h:86
btSoftBody::ePSolver::Anchors
Linear solver.
Definition: btSoftBody.h:104
btSoftBody::Link::m_rl
btScalar m_rl
Definition: btSoftBody.h:238
btSoftBody::Material::m_flags
int m_flags
Definition: btSoftBody.h:213
btSoftBody::updateConstants
void updateConstants()
Definition: btSoftBody.cpp:2460
btSoftBodyWorldInfo::m_maxDisplacement
btScalar m_maxDisplacement
Definition: btSoftBody.h:48
btSoftBody::LJoint::Prepare
void Prepare(btScalar dt, int iterations)
Definition: btSoftBody.cpp:2771
btSoftBody::RContact::m_c2
btScalar m_c2
Definition: btSoftBody.h:270
btSoftBodyWorldInfo::btSoftBodyWorldInfo
btSoftBodyWorldInfo()
Definition: btSoftBody.h:55
btSoftBody::Link
Definition: btSoftBody.h:235
btSoftBody::m_cfg
Config m_cfg
Definition: btSoftBody.h:650
btSoftBody::RContact::m_c0
btMatrix3x3 m_c0
Definition: btSoftBody.h:268
btSoftBody::LJoint::Specs::position
btVector3 position
Definition: btSoftBody.h:519
btSoftBody::Joint::eType::_
_
Definition: btSoftBody.h:486
btSoftBody::Body::linearVelocity
btVector3 linearVelocity() const
Definition: btSoftBody.h:417
btSoftBody::Cluster::m_clusterIndex
int m_clusterIndex
Definition: btSoftBody.h:345
btSoftBody::sCti::m_normal
btVector3 m_normal
Definition: btSoftBody.h:189
btSoftBody::Note
Definition: btSoftBody.h:297
btSoftBody::Node
Definition: btSoftBody.h:222
btSoftBody::Body::Body
Body(Cluster *p)
Definition: btSoftBody.h:383
btSoftBodyWorldInfo::water_offset
btScalar water_offset
Definition: btSoftBody.h:47
btSoftBody::defaultCollisionHandler
void defaultCollisionHandler(const btCollisionObjectWrapper *pcoWrap)
Definition: btSoftBody.cpp:3153
btRigidBody::applyTorqueImpulse
void applyTorqueImpulse(const btVector3 &torque)
Definition: btRigidBody.h:326
btSoftBody::sCti
Definition: btSoftBody.h:186
btSoftBody::CJoint
Definition: btSoftBody.h:551
btSoftBody::CJoint::m_rpos
btVector3 m_rpos[2]
Definition: btSoftBody.h:555
btSoftBody::Cluster::Cluster
Cluster()
Definition: btSoftBody.h:346
btSoftBody::SolverState::sdt
btScalar sdt
Definition: btSoftBody.h:599
btSoftBody::Config::kSKHR_CL
btScalar kSKHR_CL
Definition: btSoftBody.h:580
btSoftBody::cutLink
bool cutLink(int node0, int node1, btScalar position)
Definition: btSoftBody.cpp:1642
btSoftBody::Joint::eType::Angular
Definition: btSoftBody.h:488
btAlignedObjectArray< const class btCollisionObject * >
btSoftBody::SContact::m_normal
btVector3 m_normal
Definition: btSoftBody.h:280
btSoftBody::Cluster::m_locii
btMatrix3x3 m_locii
Definition: btSoftBody.h:327
btSoftBody::tPSolverArray
btAlignedObjectArray< ePSolver::_ > tPSolverArray
Definition: btSoftBody.h:129
btSoftBody::Joint::Specs
Definition: btSoftBody.h:491
btSoftBody::eAeroModel::V_Point
Definition: btSoftBody.h:85
btSoftBody::integrateMotion
void integrateMotion()
Definition: btSoftBody.cpp:1988
btSoftBody::Body::angularVelocity
btVector3 angularVelocity() const
Definition: btSoftBody.h:429
btSoftBody::eAeroModel::V_TwoSidedLiftDrag
Vertex normals are flipped to match velocity.
Definition: btSoftBody.h:87
btSoftBody::m_restLengthScale
btScalar m_restLengthScale
Definition: btSoftBody.h:679
btSoftBody::Body::m_soft
Cluster * m_soft
Definition: btSoftBody.h:378
btSoftBody::releaseClusters
void releaseClusters()
Definition: btSoftBody.cpp:1186
btSoftBody::Joint
Definition: btSoftBody.h:484
btSoftBody::Cluster::m_framerefs
tVector3Array m_framerefs
Definition: btSoftBody.h:323
btSoftBody::setSolver
void setSolver(eSolverPresets::_ preset)
Definition: btSoftBody.cpp:1713
btSoftBody::tVector3Array
btAlignedObjectArray< btVector3 > tVector3Array
Definition: btSoftBody.h:183
btSoftBody::clusterVelocity
static btVector3 clusterVelocity(const Cluster *cluster, const btVector3 &rpos)
Definition: btSoftBody.cpp:968
btSoftBody::Joint::m_delete
bool m_delete
Definition: btSoftBody.h:506
btSoftBody::Link::m_c0
btScalar m_c0
Definition: btSoftBody.h:240
btSoftBody::Body::Body
Body(const btCollisionObject *colObj)
Definition: btSoftBody.h:384
btSoftBody::Config::collisions
int collisions
Definition: btSoftBody.h:591
btSoftBody::Face::m_ra
btScalar m_ra
Definition: btSoftBody.h:250
btSoftBody::Config::kSK_SPLT_CL
btScalar kSK_SPLT_CL
Definition: btSoftBody.h:583
btCollisionObject::getInternalType
int getInternalType() const
reserved for Bullet internal usage
Definition: btCollisionObject.h:322
btSoftBody::eAeroModel::_
_
Definition: btSoftBody.h:84
btSoftBody::Anchor::m_c0
btMatrix3x3 m_c0
Definition: btSoftBody.h:292
btSoftBody::Joint::Specs::split
btScalar split
Definition: btSoftBody.h:496
btSoftBody::m_joints
tJointArray m_joints
Definition: btSoftBody.h:663
btSoftBody::m_clusterConnectivity
btAlignedObjectArray< bool > m_clusterConnectivity
Definition: btSoftBody.h:673
btSoftBody::Tetra::m_rv
btScalar m_rv
Definition: btSoftBody.h:257
btSoftBody::Impulse::Impulse
Impulse()
Definition: btSoftBody.h:359
btSoftBody::sMedium::m_pressure
btScalar m_pressure
Definition: btSoftBody.h:197
btSoftBody::Tetra
Definition: btSoftBody.h:254
btSoftBody::appendMaterial
Material * appendMaterial()
Definition: btSoftBody.cpp:174
btSoftBody::Joint::m_split
btScalar m_split
Definition: btSoftBody.h:502
btSoftBody::Joint::Prepare
virtual void Prepare(btScalar dt, int iterations)
Definition: btSoftBody.cpp:2764
btSoftBody::Config::kVCF
btScalar kVCF
Definition: btSoftBody.h:567
btSoftBody::RayFromToCaster::rayFromToTriangle
static btScalar rayFromToTriangle(const btVector3 &rayFrom, const btVector3 &rayTo, const btVector3 &rayNormalizedDirection, const btVector3 &a, const btVector3 &b, const btVector3 &c, btScalar maxt=SIMD_INFINITY)
Definition: btSoftBody.cpp:2022
btSoftBody::CJoint::Prepare
void Prepare(btScalar dt, int iterations)
Definition: btSoftBody.cpp:2859
btSoftBody::tClusterArray
btAlignedObjectArray< Cluster * > tClusterArray
Definition: btSoftBody.h:632
btSoftBody::fCollision::SVSmask
Cluster vs convex rigid vs soft.
Definition: btSoftBody.h:141
btSoftBody::Config::kVC
btScalar kVC
Definition: btSoftBody.h:572
btSoftBody::Body::angularVelocity
btVector3 angularVelocity(const btVector3 &rpos) const
Definition: btSoftBody.h:423
btSoftBody::Cluster::m_nodes
btAlignedObjectArray< Node * > m_nodes
Definition: btSoftBody.h:322
btSoftBody::tScalarArray
btAlignedObjectArray< btScalar > tScalarArray
Definition: btSoftBody.h:182
btSoftBody::clusterVImpulse
static void clusterVImpulse(Cluster *cluster, const btVector3 &rpos, const btVector3 &impulse)
Definition: btSoftBody.cpp:974
btSoftBodyWorldInfo::m_dispatcher
btDispatcher * m_dispatcher
Definition: btSoftBody.h:51
btDbvt
The btDbvt class implements a fast dynamic bounding volume tree based on axis aligned bounding boxes ...
Definition: btDbvt.h:194
btCollisionShape
The btCollisionShape class provides an interface for collision shapes that can be shared among btColl...
Definition: btCollisionShape.h:27
btSoftBody::m_tag
void * m_tag
Definition: btSoftBody.h:653
btSoftBody::SolverState::velmrg
btScalar velmrg
Definition: btSoftBody.h:601
btSoftBody::sRayCast::fraction
btScalar fraction
feature index
Definition: btSoftBody.h:168
btSoftBody::Impulse::m_asVelocity
int m_asVelocity
Definition: btSoftBody.h:357
btSoftBody::setVelocity
void setVelocity(const btVector3 &velocity)
Definition: btSoftBody.cpp:648
btSoftBody::Tetra::m_n
Node * m_n[4]
Definition: btSoftBody.h:256
btSoftBody::m_windVelocity
btVector3 m_windVelocity
Definition: btSoftBody.h:677
btSoftBody::CJoint::Solve
void Solve(btScalar dt, btScalar sor)
Definition: btSoftBody.cpp:2881
btSoftBody::Node::m_im
btScalar m_im
Definition: btSoftBody.h:229
btSoftBody::AJoint::IControl::Speed
virtual btScalar Speed(AJoint *, btScalar current)
Definition: btSoftBody.h:534
btSoftBody::Body::invWorldInertia
const btMatrix3x3 & invWorldInertia() const
Definition: btSoftBody.h:397
btSoftBody::m_scontacts
tSContactArray m_scontacts
Definition: btSoftBody.h:662
btSoftBody::ePSolver::END
Soft contacts solver.
Definition: btSoftBody.h:107
btSoftBody::tFaceArray
btAlignedObjectArray< Face > tFaceArray
Definition: btSoftBody.h:637
btSoftBody::tRContactArray
btAlignedObjectArray< RContact > tRContactArray
Definition: btSoftBody.h:640
btSoftBody::Cluster
Definition: btSoftBody.h:319
btSoftBody::fCollision::CL_RS
SDF based rigid vs soft.
Definition: btSoftBody.h:139
btSoftBody::Config::viterations
int viterations
Definition: btSoftBody.h:587
btSoftBody::m_fdbvt
btDbvt m_fdbvt
Definition: btSoftBody.h:669
btSoftBody::eSolverPresets::END
Definition: btSoftBody.h:115
btSoftBody::m_userIndexMapping
btAlignedObjectArray< int > m_userIndexMapping
Definition: btSoftBody.h:697
btSoftBody::AJoint::IControl::Default
static IControl * Default()
Definition: btSoftBody.h:535
btSoftBody::appendAnchor
void appendAnchor(int node, btRigidBody *body, bool disableCollisionBetweenLinkedBodies=false, btScalar influence=1)
Definition: btSoftBody.cpp:361
btSoftBody::tTetraArray
btAlignedObjectArray< Tetra > tTetraArray
Definition: btSoftBody.h:638
btTransform.h
btSoftBody::Config::kSSHR_CL
btScalar kSSHR_CL
Definition: btSoftBody.h:581
btSoftBody::SolverState::radmrg
btScalar radmrg
Definition: btSoftBody.h:602
btSoftBody::clusterImpulse
static void clusterImpulse(Cluster *cluster, const btVector3 &rpos, const Impulse &impulse)
Definition: btSoftBody.cpp:994
btSoftBodyWorldInfo::water_normal
btVector3 water_normal
Definition: btSoftBody.h:49
btSoftBody::Joint::Joint
Joint()
Definition: btSoftBody.h:508
btSoftBody::ePSolver::RContacts
Anchor solver.
Definition: btSoftBody.h:105
btSoftBody::Config::kDG
btScalar kDG
Definition: btSoftBody.h:569
btSoftBody::Config
Definition: btSoftBody.h:564
btSoftBody::Body::xform
const btTransform & xform() const
Definition: btSoftBody.h:410
btSoftBody::Link::m_c1
btScalar m_c1
Definition: btSoftBody.h:241
btSoftBody::clusterCom
static btVector3 clusterCom(const Cluster *cluster)
Definition: btSoftBody.cpp:951
btSoftBody::Pose::m_aqq
btMatrix3x3 m_aqq
Definition: btSoftBody.h:316
btSoftBody::eAeroModel::F_TwoSided
Vertex normals are taken as it is.
Definition: btSoftBody.h:89
btSoftBody::addForce
void addForce(const btVector3 &force)
Definition: btSoftBody.cpp:441
btSoftBody::setWindVelocity
void setWindVelocity(const btVector3 &velocity)
Set a wind velocity for interaction with the air.
Definition: btSoftBody.cpp:3244
btSoftBody::fCollision::CL_SELF
Cluster vs cluster soft vs soft handling.
Definition: btSoftBody.h:144
btSoftBody::m_initialWorldTransform
btTransform m_initialWorldTransform
Definition: btSoftBody.h:675
btSoftBody::fCollision
fCollision
Definition: btSoftBody.h:136
btRigidBody.h
btSoftBody::btSoftBody
btSoftBody(btSoftBodyWorldInfo *worldInfo, int node_count, const btVector3 *x, const btScalar *m)
btSoftBody implementation by Nathanael Presson
Definition: btSoftBody.cpp:24
btSoftBody::Face::m_leaf
btDbvtNode * m_leaf
Definition: btSoftBody.h:251
btSoftBody::upcast
static btSoftBody * upcast(btCollisionObject *colObj)
Definition: btSoftBody.h:939
btCollisionCreateFunc.h
btSoftBody::Config::kAHR
btScalar kAHR
Definition: btSoftBody.h:578
btSoftBody::appendLink
void appendLink(int model=-1, Material *mat=0)
Definition: btSoftBody.cpp:260
btSoftBody::Link::m_c3
btVector3 m_c3
Definition: btSoftBody.h:243
btSoftBody::CJoint::Terminate
void Terminate(btScalar dt)
Definition: btSoftBody.cpp:2923
btSoftBody::Joint::m_cfm
btScalar m_cfm
Definition: btSoftBody.h:500
btSoftBody::eVSolver::_
_
Definition: btSoftBody.h:96
btSoftBody::Pose
Definition: btSoftBody.h:306
btSoftBody::Material::m_kAST
btScalar m_kAST
Definition: btSoftBody.h:211
btSoftBody::rayTest
bool rayTest(const btVector3 &rayFrom, const btVector3 &rayTo, sRayCast &results)
Ray casting using rayFrom and rayTo in worldspace, (not direction!)
Definition: btSoftBody.cpp:1697
btSoftBody::applyForces
void applyForces()
Definition: btSoftBody.cpp:2933
btSoftBody::m_nodes
tNodeArray m_nodes
Definition: btSoftBody.h:656
btSoftBody::m_links
tLinkArray m_links
Definition: btSoftBody.h:657
btSoftBody::appendAngularJoint
void appendAngularJoint(const AJoint::Specs &specs, Cluster *body0, Body body1)
Definition: btSoftBody.cpp:414
btSoftBody::Body::Body
Body()
Definition: btSoftBody.h:382
btSoftBody::Face::m_n
Node * m_n[3]
Definition: btSoftBody.h:248
btSoftBody::Node::m_battach
int m_battach
Definition: btSoftBody.h:232
btSoftBody::Config::diterations
int diterations
Definition: btSoftBody.h:589
btSerializer
Definition: btSerializer.h:68
btSoftBody::Joint::Solve
virtual void Solve(btScalar dt, btScalar sor)=0
btSoftBody::Face::m_normal
btVector3 m_normal
Definition: btSoftBody.h:249
btSoftBody::Joint::Specs::Specs
Specs()
Definition: btSoftBody.h:493
btSoftBody::tLeafArray
btAlignedObjectArray< btDbvtNode * > tLeafArray
Definition: btSoftBody.h:635
btSoftBody::eSolverPresets
eSolverPresets
Definition: btSoftBody.h:111
btConcaveShape.h
btSoftBody::appendFace
void appendFace(int model=-1, Material *mat=0)
Definition: btSoftBody.cpp:297
btSoftBody::m_worldInfo
btSoftBodyWorldInfo * m_worldInfo
Definition: btSoftBody.h:654
btSoftBody::m_tetras
tTetraArray m_tetras
Definition: btSoftBody.h:659
btSoftBody::~btSoftBody
virtual ~btSoftBody()
Definition: btSoftBody.cpp:117
btSoftBody::fCollision::Default
Cluster soft body self collision.
Definition: btSoftBody.h:146
btSoftBody::getAabb
virtual void getAabb(btVector3 &aabbMin, btVector3 &aabbMax) const
Definition: btSoftBody.h:950
btSoftBody::Cluster::m_ldamping
btScalar m_ldamping
Definition: btSoftBody.h:338
btSoftBody::getTotalMass
btScalar getTotalMass() const
Definition: btSoftBody.cpp:685
btSoftBody::sMedium
Definition: btSoftBody.h:194
btSoftBody::eFeature::None
Definition: btSoftBody.h:120
btSoftBodyWorldInfo::m_sparsesdf
btSparseSdf< 3 > m_sparsesdf
Definition: btSoftBody.h:53
btSparseSdf< 3 >
btSoftBody::Config::kLF
btScalar kLF
Definition: btSoftBody.h:570
btSoftBody::generateClusters
int generateClusters(int k, int maxiterations=8192)
generateClusters with k=0 will create a convex cluster for each tetrahedron or triangle otherwise an ...
Definition: btSoftBody.cpp:1192
btSoftBody::addVelocity
void addVelocity(const btVector3 &velocity)
Definition: btSoftBody.cpp:642
btSoftBody::Note::m_text
const char * m_text
Definition: btSoftBody.h:299
btSoftBody::Cluster::m_ndimpulses
int m_ndimpulses
Definition: btSoftBody.h:333
btSoftBody::addAeroForceToNode
void addAeroForceToNode(const btVector3 &windVelocity, int nodeIndex)
Definition: btSoftBody.cpp:456
btCross
btVector3 btCross(const btVector3 &v1, const btVector3 &v2)
Return the cross product of two vectors.
Definition: btVector3.h:919
btSoftBody::fMaterial::Default
Enable debug draw.
Definition: btSoftBody.h:154
btSoftBody::appendLinearJoint
void appendLinearJoint(const LJoint::Specs &specs, Cluster *body0, Body body1)
Definition: btSoftBody.cpp:388
btSoftBody::Pose::m_bframe
bool m_bframe
Definition: btSoftBody.h:309
btSoftBody::sRayCast
Definition: btSoftBody.h:163
btSoftBody::AJoint::Specs::Specs
Specs()
Definition: btSoftBody.h:539
btSoftBody::fCollision::_
_
Definition: btSoftBody.h:136
btSoftBody::SolverState
Definition: btSoftBody.h:597
btSoftBody::RContact
Definition: btSoftBody.h:264
btSoftBody::initDefaults
void initDefaults()
Definition: btSoftBody.cpp:62
btVector4
Definition: btVector3.h:1077
btSoftBody::setCollisionShape
virtual void setCollisionShape(btCollisionShape *collisionShape)
Definition: btSoftBody.h:705
btSoftBody::Anchor::m_c1
btVector3 m_c1
Definition: btSoftBody.h:293
btSoftBody::getRestLengthScale
btScalar getRestLengthScale()
Definition: btSoftBody.cpp:844
btSoftBody::Tetra::m_c2
btScalar m_c2
Definition: btSoftBody.h:261
SIMD_INFINITY
#define SIMD_INFINITY
Definition: btScalar.h:495
btSoftBody::SContact::m_face
Face * m_face
Definition: btSoftBody.h:278
btCollisionObject::getWorldTransform
btTransform & getWorldTransform()
Definition: btCollisionObject.h:327
btSoftBody::Feature::m_material
Material * m_material
Definition: btSoftBody.h:219
btSoftBody::Body::applyDImpulse
void applyDImpulse(const btVector3 &impulse, const btVector3 &rpos) const
Definition: btSoftBody.h:444
btSoftBody::Note::m_offset
btVector3 m_offset
Definition: btSoftBody.h:300
btSoftBody::Config::kSR_SPLT_CL
btScalar kSR_SPLT_CL
Definition: btSoftBody.h:582
btSoftBody::Anchor
Definition: btSoftBody.h:286
btSoftBody::getWorldInfo
btSoftBodyWorldInfo * getWorldInfo()
Definition: btSoftBody.h:699
btSoftBody::ImplicitFn
Definition: btSoftBody.h:172
btSoftBody::Joint::~Joint
virtual ~Joint()
Definition: btSoftBody.h:507
btSoftBody::Pose::m_bvolume
bool m_bvolume
Definition: btSoftBody.h:308
btSoftBody::indicesToPointers
void indicesToPointers(const int *map=0)
Definition: btSoftBody.cpp:2098
btSoftBody::Joint::m_sdrift
btVector3 m_sdrift
Definition: btSoftBody.h:504
btSoftBody::Impulse::m_drift
btVector3 m_drift
Definition: btSoftBody.h:356
btSoftBody::setVolumeMass
void setVolumeMass(btScalar mass)
Definition: btSoftBody.cpp:739
btSoftBody::CJoint::m_normal
btVector3 m_normal
Definition: btSoftBody.h:556
btSoftBody::updatePose
void updatePose()
Definition: btSoftBody.cpp:2346
btSoftBody::Impulse
Definition: btSoftBody.h:353
btSoftBody::sMedium::m_velocity
btVector3 m_velocity
Definition: btSoftBody.h:196
btSoftBody::clusterCount
int clusterCount() const
Definition: btSoftBody.cpp:945
btSoftBody::Joint::Type
virtual eType::_ Type() const =0
btSoftBody::Impulse::operator-
Impulse operator-() const
Definition: btSoftBody.h:360
btSoftBody::randomizeConstraints
void randomizeConstraints()
Definition: btSoftBody.cpp:1158
btSoftBody::eFeature::Link
Definition: btSoftBody.h:122
btSoftBody::eAeroModel::V_OneSided
Vertex normals are flipped to match velocity and lift and drag forces are applied.
Definition: btSoftBody.h:88
btSoftBody::Config::kDP
btScalar kDP
Definition: btSoftBody.h:568
btSoftBody::AJoint::Prepare
void Prepare(btScalar dt, int iterations)
Definition: btSoftBody.cpp:2814
btSoftBody::tMaterialArray
btAlignedObjectArray< Material * > tMaterialArray
Definition: btSoftBody.h:642
btSoftBody::updateLinkConstants
void updateLinkConstants()
Definition: btSoftBody.cpp:2447
btSoftBody::getWindVelocity
const btVector3 & getWindVelocity()
Return the wind velocity for interaction with the air.
Definition: btSoftBody.cpp:3250
btSoftBody::m_materials
tMaterialArray m_materials
Definition: btSoftBody.h:664
btSoftBody::clusterDImpulse
static void clusterDImpulse(Cluster *cluster, const btVector3 &rpos, const btVector3 &impulse)
Definition: btSoftBody.cpp:984
btSoftBody::getSoftBodySolver
btSoftBodySolver * getSoftBodySolver() const
Definition: btSoftBody.h:923
btSoftBody::Config::kPR
btScalar kPR
Definition: btSoftBody.h:571
btSoftBody::upcast
static const btSoftBody * upcast(const btCollisionObject *colObj)
Definition: btSoftBody.h:933
btSoftBody::refine
void refine(ImplicitFn *ifn, btScalar accurary, bool cut)
Definition: btSoftBody.cpp:1385
btSoftBody::PSolve_SContacts
static void PSolve_SContacts(btSoftBody *psb, btScalar, btScalar ti)
Definition: btSoftBody.cpp:3052
btSoftBody::Body::m_collisionObject
const btCollisionObject * m_collisionObject
Definition: btSoftBody.h:380
btSoftBody::fMaterial::_
_
Definition: btSoftBody.h:151
btSoftBody::eFeature::_
_
Definition: btSoftBody.h:119
btSoftBody::Joint::Specs::erp
btScalar erp
Definition: btSoftBody.h:494
btSoftBody::Cluster::m_invwi
btMatrix3x3 m_invwi
Definition: btSoftBody.h:328
btSoftBody::Element::Element
Element()
Definition: btSoftBody.h:205
btSoftBody::staticSolve
void staticSolve(int iterations)
Definition: btSoftBody.cpp:1941
btSoftBody::RayFromToCaster
RayFromToCaster takes a ray from, ray to (instead of direction!)
Definition: btSoftBody.h:606
btSoftBody::RayFromToCaster::m_tests
int m_tests
Definition: btSoftBody.h:613
btSoftBody::Link::m_n
Node * m_n[2]
Definition: btSoftBody.h:237
btSoftBody::eSolverPresets::Positions
Definition: btSoftBody.h:112
btSoftBody::eVSolver
eVSolver : velocities solvers
Definition: btSoftBody.h:96
btSoftBody::getSolver
static psolver_t getSolver(ePSolver::_ solver)
Definition: btSoftBody.cpp:3120
btSoftBody::getSoftBodySolver
btSoftBodySolver * getSoftBodySolver()
Definition: btSoftBody.h:915
btSoftBody::releaseCluster
void releaseCluster(int index)
Definition: btSoftBody.cpp:1176
btRigidBody::getAngularVelocity
const btVector3 & getAngularVelocity() const
Definition: btRigidBody.h:362
btSoftBody::updateNormals
void updateNormals()
Definition: btSoftBody.cpp:2275
btSoftBody::updateBounds
void updateBounds()
Definition: btSoftBody.cpp:2304
btSoftBody::getMass
btScalar getMass(int node) const
Definition: btSoftBody.cpp:679
btSoftBody::appendTetra
void appendTetra(int model, Material *mat)
Definition: btSoftBody.cpp:332
btSoftBody::RContact::m_node
Node * m_node
Definition: btSoftBody.h:267
btCollisionObject
btCollisionObject can be used to manage collision detection objects.
Definition: btCollisionObject.h:49
btSoftBody::RContact::m_c4
btScalar m_c4
Definition: btSoftBody.h:272
btSoftBody::solveConstraints
void solveConstraints()
Definition: btSoftBody.cpp:1847
btSoftBody::predictMotion
void predictMotion(btScalar dt)
Definition: btSoftBody.cpp:1739
btSoftBody::fMaterial::DebugDraw
Definition: btSoftBody.h:152
btSoftBody::clusterVAImpulse
static void clusterVAImpulse(Cluster *cluster, const btVector3 &impulse)
Definition: btSoftBody.cpp:1001
btSoftBody::Config::kSHR
btScalar kSHR
Definition: btSoftBody.h:577
btSoftBody::appendNode
void appendNode(const btVector3 &x, btScalar m)
Definition: btSoftBody.cpp:240
btSoftBody::m_anchors
tAnchorArray m_anchors
Definition: btSoftBody.h:660
btSoftBody::Config::citerations
int citerations
Definition: btSoftBody.h:590
btSoftBody::appendNote
void appendNote(const char *text, const btVector3 &o, const btVector4 &c=btVector4(1, 0, 0, 0), Node *n0=0, Node *n1=0, Node *n2=0, Node *n3=0)
Definition: btSoftBody.cpp:186
btSoftBody::Tetra::m_leaf
btDbvtNode * m_leaf
Definition: btSoftBody.h:258
btSoftBody::ePSolver::Linear
Definition: btSoftBody.h:103
btRigidBody
The btRigidBody is the main class for rigid body objects.
Definition: btRigidBody.h:62
btSoftBody::VSolve_Links
static void VSolve_Links(btSoftBody *psb, btScalar kst)
Definition: btSoftBody.cpp:3107
btSoftBody::Anchor::m_influence
btScalar m_influence
Definition: btSoftBody.h:291
btSoftBody::Anchor::m_c2
btScalar m_c2
Definition: btSoftBody.h:294
btSoftBody::Joint::eType
Definition: btSoftBody.h:486
btSoftBody::setTotalMass
void setTotalMass(btScalar mass, bool fromfaces=false)
Definition: btSoftBody.cpp:696
btSoftBody::Cluster::m_vimpulses
btVector3 m_vimpulses[2]
Definition: btSoftBody.h:330
btSoftBody::m_pose
Pose m_pose
Definition: btSoftBody.h:652
btSoftBody::initializeClusters
void initializeClusters()
Definition: btSoftBody.cpp:2470
btSoftBody::SContact::m_friction
btScalar m_friction
Definition: btSoftBody.h:282
btSoftBody::Anchor::m_node
Node * m_node
Definition: btSoftBody.h:288
btSoftBody::Config::m_dsequence
tPSolverArray m_dsequence
Definition: btSoftBody.h:594
btSoftBody::Body::invMass
btScalar invMass() const
Definition: btSoftBody.h:404
btSoftBody::initializeFaceTree
void initializeFaceTree()
Definition: btSoftBody.cpp:2221
btSoftBody::SContact::m_cfm
btScalar m_cfm[2]
Definition: btSoftBody.h:283
btSoftBody::rotate
void rotate(const btQuaternion &rot)
Definition: btSoftBody.cpp:815
btBroadphaseInterface
The btBroadphaseInterface class provides an interface to detect aabb-overlapping object pairs...
Definition: btBroadphaseInterface.h:51
btSoftBody::Impulse::m_asDrift
int m_asDrift
Definition: btSoftBody.h:358
btSoftBody::RayFromToCaster::m_face
Face * m_face
Definition: btSoftBody.h:612
btSoftBody::AJoint::m_axis
btVector3 m_axis[2]
Definition: btSoftBody.h:543
btSoftBody::Joint::Terminate
virtual void Terminate(btScalar dt)=0
btSoftBody::setTotalDensity
void setTotalDensity(btScalar density)
Definition: btSoftBody.cpp:733
btSoftBody::Cluster::m_maxSelfCollisionImpulse
btScalar m_maxSelfCollisionImpulse
Definition: btSoftBody.h:341
btSoftBody::SolverState::isdt
btScalar isdt
Definition: btSoftBody.h:600
btSoftBodySolver
Definition: btSoftBodySolvers.h:30
btSoftBody::calculateSerializeBufferSize
virtual int calculateSerializeBufferSize() const
Definition: btSoftBody.cpp:3257
btCollisionObject::activate
void activate(bool forceActivation=false) const
Definition: btCollisionObject.cpp:63
btVector3
btVector3 can be used to represent 3D points and vectors.
Definition: btVector3.h:83
btSoftBody::tNoteArray
btAlignedObjectArray< Note > tNoteArray
Definition: btSoftBody.h:633
btSoftBody::fCollision::VF_SS
Rigid versus soft mask.
Definition: btSoftBody.h:142
btSoftBody::Body::activate
void activate() const
Definition: btSoftBody.h:389
btSoftBody::Note::m_coords
btScalar m_coords[4]
Definition: btSoftBody.h:303
btSoftBody::sCti::m_offset
btScalar m_offset
Definition: btSoftBody.h:190
btSoftBody::ImplicitFn::Eval
virtual btScalar Eval(const btVector3 &x)=0
btSoftBody::Body::applyVImpulse
void applyVImpulse(const btVector3 &impulse, const btVector3 &rpos) const
Definition: btSoftBody.h:439
btSoftBody::Joint::eType::Contact
Definition: btSoftBody.h:489
btSoftBody::Joint::m_erp
btScalar m_erp
Definition: btSoftBody.h:501
btSoftBody::Pose::m_com
btVector3 m_com
Definition: btSoftBody.h:313
btDbvt::ICollide
Definition: btDbvt.h:227
btSoftBody::RContact::m_cti
sCti m_cti
Definition: btSoftBody.h:266
btSoftBody::Material::m_kLST
btScalar m_kLST
Definition: btSoftBody.h:210
btSparseSDF.h
btTransform
The btTransform class supports rigid transforms with only translation and rotation and no scaling/she...
Definition: btTransform.h:34
btSoftBody::tSoftBodyArray
btAlignedObjectArray< btSoftBody * > tSoftBodyArray
Definition: btSoftBody.h:644
btSoftBody::CJoint::Type
eType::_ Type() const
Definition: btSoftBody.h:561
btSoftBody::Joint::m_refs
btVector3 m_refs[2]
Definition: btSoftBody.h:499
btSoftBody::tSContactArray
btAlignedObjectArray< SContact > tSContactArray
Definition: btSoftBody.h:641
btSoftBody::Joint::m_bodies
Body m_bodies[2]
Definition: btSoftBody.h:498
btSoftBody::ePSolver
ePSolver : positions solvers
Definition: btSoftBody.h:102
btSoftBody::SContact::m_weights
btVector3 m_weights
Definition: btSoftBody.h:279
btSoftBody::Note::m_nodes
Node * m_nodes[4]
Definition: btSoftBody.h:302
btSoftBody::Element::m_tag
void * m_tag
Definition: btSoftBody.h:204
btSoftBody::LJoint::Solve
void Solve(btScalar dt, btScalar sor)
Definition: btSoftBody.cpp:2791
btSoftBody::m_cdbvt
btDbvt m_cdbvt
Definition: btSoftBody.h:670
btSoftBody::eVSolver::END
Linear solver.
Definition: btSoftBody.h:98
btSoftBody::Cluster::m_lv
btVector3 m_lv
Definition: btSoftBody.h:334
btSoftBody::fCollision::END
Definition: btSoftBody.h:147
btIDebugDraw.h
btSoftBody::tJointArray
btAlignedObjectArray< Joint * > tJointArray
Definition: btSoftBody.h:643
btSoftBody::AJoint::Solve
void Solve(btScalar dt, btScalar sor)
Definition: btSoftBody.cpp:2834
btSoftBody::m_notes
tNoteArray m_notes
Definition: btSoftBody.h:655
btSoftBody::Link::m_c2
btScalar m_c2
Definition: btSoftBody.h:242
btSoftBody::AJoint::IControl::Prepare
virtual void Prepare(AJoint *)
Definition: btSoftBody.h:533
btTransform::getIdentity
static const btTransform & getIdentity()
Return an identity transform.
Definition: btTransform.h:203
btSoftBody::applyClusters
void applyClusters(bool drift)
Definition: btSoftBody.cpp:2687
btSoftBody::eAeroModel::F_TwoSidedLiftDrag
Face normals are flipped to match velocity.
Definition: btSoftBody.h:90
btSoftBody::transform
void transform(const btTransform &trs)
Definition: btSoftBody.cpp:784
btSoftBody::Body::applyDCImpulse
void applyDCImpulse(const btVector3 &impulse) const
Definition: btSoftBody.h:477
btSoftBody::CJoint::m_maxlife
int m_maxlife
Definition: btSoftBody.h:554
btSoftBody::eAeroModel::END
Face normals are taken as it is.
Definition: btSoftBody.h:92
btSoftBody::eFeature::Tetra
Definition: btSoftBody.h:124
btSoftBody::m_ndbvt
btDbvt m_ndbvt
Definition: btSoftBody.h:668
btSoftBody::Node::m_n
btVector3 m_n
Definition: btSoftBody.h:228
btSoftBody::Anchor::m_local
btVector3 m_local
Definition: btSoftBody.h:289
btSoftBody::Cluster::m_leaf
btDbvtNode * m_leaf
Definition: btSoftBody.h:336
btSoftBody::Config::timescale
btScalar timescale
Definition: btSoftBody.h:586
btSoftBody::m_sst
SolverState m_sst
Definition: btSoftBody.h:651
btSoftBody::AJoint::Terminate
void Terminate(btScalar dt)
Definition: btSoftBody.cpp:2849
btSoftBody::eFeature::Node
Definition: btSoftBody.h:121
btSoftBody::eAeroModel::F_OneSided
Face normals are flipped to match velocity and lift and drag forces are applied.
Definition: btSoftBody.h:91
btSoftBody::fCollision::SDF_RS
Rigid versus soft mask.
Definition: btSoftBody.h:138
btSoftBody::eAeroModel
eAeroModel
Definition: btSoftBody.h:84
btSoftBody::checkContact
bool checkContact(const btCollisionObjectWrapper *colObjWrap, const btVector3 &x, btScalar margin, btSoftBody::sCti &cti) const
Definition: btSoftBody.cpp:2246
btSoftBody::m_clusters
tClusterArray m_clusters
Definition: btSoftBody.h:671
btSoftBody::sRayCast::body
btSoftBody * body
Definition: btSoftBody.h:165
btSoftBody::Cluster::m_dimpulses
btVector3 m_dimpulses[2]
Definition: btSoftBody.h:331
btSoftBody::psolver_t
void(* psolver_t)(btSoftBody *, btScalar, btScalar)
Definition: btSoftBody.h:630
btSoftBody::Pose::m_rot
btMatrix3x3 m_rot
Definition: btSoftBody.h:314
btSoftBody::eSolverPresets::_
_
Definition: btSoftBody.h:111
btSoftBody::setSoftBodySolver
void setSoftBodySolver(btSoftBodySolver *softBodySolver)
Definition: btSoftBody.h:907
btSoftBody::RayFromToCaster::m_rayFrom
btVector3 m_rayFrom
Definition: btSoftBody.h:608
btSoftBody::clusterAImpulse
static void clusterAImpulse(Cluster *cluster, const Impulse &impulse)
Definition: btSoftBody.cpp:1017
btSoftBody::scale
void scale(const btVector3 &scl)
Definition: btSoftBody.cpp:824
btSoftBody::sMedium::m_density
btScalar m_density
Definition: btSoftBody.h:198
btSoftBody::Body::applyVAImpulse
void applyVAImpulse(const btVector3 &impulse) const
Definition: btSoftBody.h:462
btSoftBody::cleanupClusters
void cleanupClusters()
Definition: btSoftBody.cpp:2654
btRigidBody::getInvInertiaTensorWorld
const btMatrix3x3 & getInvInertiaTensorWorld() const
Definition: btRigidBody.h:271
btRigidBody::applyCentralImpulse
void applyCentralImpulse(const btVector3 &impulse)
Definition: btRigidBody.h:321
btSoftBody::Joint::m_massmatrix
btMatrix3x3 m_massmatrix
Definition: btSoftBody.h:505
btSoftBodyWorldInfo::water_density
btScalar water_density
Definition: btSoftBody.h:46
btSoftBody::m_bounds
btVector3 m_bounds[2]
Definition: btSoftBody.h:666
btSoftBody::eSolverPresets::Default
Definition: btSoftBody.h:114
btSoftBody::Pose::m_volume
btScalar m_volume
Definition: btSoftBody.h:310
btSoftBody::Note::m_rank
int m_rank
Definition: btSoftBody.h:301
btSoftBody::Node::m_v
btVector3 m_v
Definition: btSoftBody.h:226
btSoftBody::Config::m_vsequence
tVSolverArray m_vsequence
Definition: btSoftBody.h:592
btAlignedObjectArray.h
btSoftBodyWorldInfo
Definition: btSoftBody.h:43
btSoftBody::eVSolver::Linear
Definition: btSoftBody.h:97
btSoftBody::Body::applyImpulse
void applyImpulse(const Impulse &impulse, const btVector3 &rpos) const
Definition: btSoftBody.h:449
btSoftBody::m_timeacc
btScalar m_timeacc
Definition: btSoftBody.h:665
btSoftBody::dampClusters
void dampClusters()
Definition: btSoftBody.cpp:2738
btSoftBody::Config::m_psequence
tPSolverArray m_psequence
Definition: btSoftBody.h:593
btMatrix3x3
The btMatrix3x3 class implements a 3x3 rotation matrix, to perform linear algebra in combination with...
Definition: btMatrix3x3.h:48
btSoftBody::AJoint::Type
eType::_ Type() const
Definition: btSoftBody.h:548
btSoftBody::Cluster::m_ndamping
btScalar m_ndamping
Definition: btSoftBody.h:337
btSoftBody::Cluster::m_adamping
btScalar m_adamping
Definition: btSoftBody.h:339
btSoftBody::Config::kMT
btScalar kMT
Definition: btSoftBody.h:574
btSoftBody::Config::kSRHR_CL
btScalar kSRHR_CL
Definition: btSoftBody.h:579
btSoftBody::Cluster::m_collide
bool m_collide
Definition: btSoftBody.h:344
btSoftBody::Cluster::m_nvimpulses
int m_nvimpulses
Definition: btSoftBody.h:332
btSoftBody::Pose::m_wgh
tScalarArray m_wgh
Definition: btSoftBody.h:312
btRigidBody::getLinearVelocity
const btVector3 & getLinearVelocity() const
Definition: btRigidBody.h:359
btSoftBody::AJoint::m_icontrol
IControl * m_icontrol
Definition: btSoftBody.h:544
btSoftBodyWorldInfo::m_broadphase
btBroadphaseInterface * m_broadphase
Definition: btSoftBody.h:50
btSoftBody::translate
void translate(const btVector3 &trs)
Definition: btSoftBody.cpp:806
btSoftBody::Config::aeromodel
eAeroModel::_ aeromodel
Definition: btSoftBody.h:566
btSoftBodyWorldInfo::air_density
btScalar air_density
Definition: btSoftBody.h:45
btRigidBody::applyImpulse
void applyImpulse(const btVector3 &impulse, const btVector3 &rel_pos)
Definition: btRigidBody.h:331
btSoftBody::m_softBodySolver
btSoftBodySolver * m_softBodySolver
Definition: btSoftBody.h:77
btQuaternion
The btQuaternion implements quaternion to perform linear algebra rotations in combination with btMatr...
Definition: btQuaternion.h:55
btSoftBody::setRestLengthScale
void setRestLengthScale(btScalar restLength)
Definition: btSoftBody.cpp:850
btSoftBody::Node::m_q
btVector3 m_q
Definition: btSoftBody.h:225
btSoftBody::RayFromToCaster::m_rayTo
btVector3 m_rayTo
Definition: btSoftBody.h:609
btSoftBody::m_collisionDisabledObjects
btAlignedObjectArray< const class btCollisionObject * > m_collisionDisabledObjects
Definition: btSoftBody.h:74
btSoftBody::Cluster::m_com
btVector3 m_com
Definition: btSoftBody.h:329
btSoftBody::Cluster::m_selfCollisionImpulseFactor
btScalar m_selfCollisionImpulseFactor
Definition: btSoftBody.h:342
btSoftBody::serialize
virtual const char * serialize(void *dataBuffer, class btSerializer *serializer) const
fills the dataBuffer and returns the struct name (and 0 on failure)
Definition: btSoftBody.cpp:3264
btSoftBody::Config::kCHR
btScalar kCHR
Definition: btSoftBody.h:575
btSoftBody::Cluster::m_matching
btScalar m_matching
Definition: btSoftBody.h:340
btDbvt.h
btSoftBody::Joint::eType::Linear
Definition: btSoftBody.h:487
btDbvtNode
Definition: btDbvt.h:177
btSoftBody::Node::m_f
btVector3 m_f
Definition: btSoftBody.h:227
btSoftBody::RContact::m_c3
btScalar m_c3
Definition: btSoftBody.h:271
btSoftBody::prepareClusters
void prepareClusters(int iterations)
Definition: btSoftBody.cpp:2668
btSoftBodyWorldInfo::m_gravity
btVector3 m_gravity
Definition: btSoftBody.h:52
btSoftBody::Config::kDF
btScalar kDF
Definition: btSoftBody.h:573
btSoftBody::solveCommonConstraints
static void solveCommonConstraints(btSoftBody **bodies, int count, int iterations)
Definition: btSoftBody.cpp:1953
btSoftBody::m_bUpdateRtCst
bool m_bUpdateRtCst
Definition: btSoftBody.h:667
btSoftBody::eSolverPresets::Velocities
Definition: btSoftBody.h:113
btSoftBody::ImplicitFn::~ImplicitFn
virtual ~ImplicitFn()
Definition: btSoftBody.h:174
btSoftBody::Cluster::m_masses
tScalarArray m_masses
Definition: btSoftBody.h:321
btSoftBody::pointersToIndices
void pointersToIndices()
Definition: btSoftBody.cpp:2055
btSoftBody::Feature
Definition: btSoftBody.h:217
btSoftBody
The btSoftBody is an class to simulate cloth and volumetric soft bodies.
Definition: btSoftBody.h:71
btSoftBody::tNodeArray
btAlignedObjectArray< Node > tNodeArray
Definition: btSoftBody.h:634
btDispatcher
The btDispatcher interface class can be used in combination with broadphase to dispatch calculations ...
Definition: btDispatcher.h:69
btSoftBody::clusterDCImpulse
static void clusterDCImpulse(Cluster *cluster, const btVector3 &impulse)
Definition: btSoftBody.cpp:1024
btSoftBody::Anchor::m_body
btRigidBody * m_body
Definition: btSoftBody.h:290
btSoftBody::setPose
void setPose(bool bvolume, bool bframe)
Definition: btSoftBody.cpp:865
btSoftBody::PSolve_Anchors
static void PSolve_Anchors(btSoftBody *psb, btScalar kst, btScalar ti)
Definition: btSoftBody.cpp:3002
btSoftBody::eFeature::Face
Definition: btSoftBody.h:123
btSoftBody::Joint::m_drift
btVector3 m_drift
Definition: btSoftBody.h:503
btSoftBody::Body::m_rigid
btRigidBody * m_rigid
Definition: btSoftBody.h:379
btSoftBody::setMass
void setMass(int node, btScalar mass)
Definition: btSoftBody.cpp:672
btCollisionObjectWrapper
Definition: btCollisionObjectWrapper.h:17
btSoftBody::Body::applyAImpulse
void applyAImpulse(const Impulse &impulse) const
Definition: btSoftBody.h:472
btSoftBody::setVolumeDensity
void setVolumeDensity(btScalar density)
Definition: btSoftBody.cpp:769
btSoftBody::checkFace
bool checkFace(int node0, int node1, int node2) const
Definition: btSoftBody.cpp:153
btSoftBody::AJoint::IControl::~IControl
virtual ~IControl()
Definition: btSoftBody.h:532
btSoftBody::eFeature::END
Definition: btSoftBody.h:125
btSoftBody::Element
Definition: btSoftBody.h:202
btSoftBody::Body::applyDAImpulse
void applyDAImpulse(const btVector3 &impulse) const
Definition: btSoftBody.h:467
btSoftBody::Node::m_x
btVector3 m_x
Definition: btSoftBody.h:224
btSoftBody::m_rcontacts
tRContactArray m_rcontacts
Definition: btSoftBody.h:661
btSoftBody::tAnchorArray
btAlignedObjectArray< Anchor > tAnchorArray
Definition: btSoftBody.h:639
btSoftBody::Config::maxvolume
btScalar maxvolume
Definition: btSoftBody.h:585
btSoftBody::updateClusters
void updateClusters()
Definition: btSoftBody.cpp:2536
btSoftBody::evaluateCom
btVector3 evaluateCom() const
Definition: btSoftBody.cpp:2232
btSoftBody::PSolve_Links
static void PSolve_Links(btSoftBody *psb, btScalar kst, btScalar ti)
Definition: btSoftBody.cpp:3085
btSoftBody::Node::m_area
btScalar m_area
Definition: btSoftBody.h:230
btSoftBody::RayFromToCaster::m_rayNormalizedDirection
btVector3 m_rayNormalizedDirection
Definition: btSoftBody.h:610
btSoftBody::AJoint::IControl
Definition: btSoftBody.h:530
btSoftBody::Body
Definition: btSoftBody.h:376
btSoftBody::tVSolverArray
btAlignedObjectArray< eVSolver::_ > tVSolverArray
Definition: btSoftBody.h:128
btSoftBody::addAeroForceToFace
void addAeroForceToFace(const btVector3 &windVelocity, int faceIndex)
Definition: btSoftBody.cpp:545
btSoftBody::Body::velocity
btVector3 velocity(const btVector3 &rpos) const
Definition: btSoftBody.h:435
btSoftBody::Cluster::m_imass
btScalar m_imass
Definition: btSoftBody.h:326
btSoftBody::clusterDAImpulse
static void clusterDAImpulse(Cluster *cluster, const btVector3 &impulse)
Definition: btSoftBody.cpp:1009
btSoftBody::Tetra::m_c0
btVector3 m_c0[4]
Definition: btSoftBody.h:259
btSoftBody::SContact
Definition: btSoftBody.h:275
btSoftBody::Material::m_kVST
btScalar m_kVST
Definition: btSoftBody.h:212
btSoftBody::fMaterial
fMaterial
Definition: btSoftBody.h:151
btSoftBody::fCollision::CL_SS
Vertex vs face soft vs soft handling.
Definition: btSoftBody.h:143
btSoftBody::getVolume
btScalar getVolume() const
Definition: btSoftBody.cpp:926
btSoftBody::Node::m_leaf
btDbvtNode * m_leaf
Definition: btSoftBody.h:231
btSoftBody::Cluster::m_framexform
btTransform m_framexform
Definition: btSoftBody.h:324
btSoftBody::updateArea
void updateArea(bool averageArea=true)
Definition: btSoftBody.cpp:2382
btScalar
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
Definition: btScalar.h:278
btSoftBody::SContact::m_margin
btScalar m_margin
Definition: btSoftBody.h:281
btSoftBody::CJoint::m_friction
btScalar m_friction
Definition: btSoftBody.h:557
btSoftBody::RContact::m_c1
btVector3 m_c1
Definition: btSoftBody.h:269
btSoftBody::Cluster::m_av
btVector3 m_av
Definition: btSoftBody.h:335
btSoftBody::Pose::m_pos
tVector3Array m_pos
Definition: btSoftBody.h:311
btSoftBody::checkLink
bool checkLink(int node0, int node1) const
Definition: btSoftBody.cpp:131
btSoftBody::LJoint::Terminate
void Terminate(btScalar dt)
Definition: btSoftBody.cpp:2804
btSoftBody::LJoint
Definition: btSoftBody.h:515
btSoftBody::Config::kKHR
btScalar kKHR
Definition: btSoftBody.h:576
btSoftBody::LJoint::Type
eType::_ Type() const
Definition: btSoftBody.h:525
btSoftBody::fCollision::RVSmask
Definition: btSoftBody.h:137
btSoftBody::Cluster::m_containsAnchor
bool m_containsAnchor
Definition: btSoftBody.h:343
btSoftBody::fMaterial::END
Definition: btSoftBody.h:155
btSoftBody::resetLinkRestLengths
void resetLinkRestLengths()
Definition: btSoftBody.cpp:915
btSoftBody::m_faces
tFaceArray m_faces
Definition: btSoftBody.h:658
btSoftBody::Material
Definition: btSoftBody.h:208
btSoftBody::SolverState::updmrg
btScalar updmrg
Definition: btSoftBody.h:603