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

Bullet Collision Detection & Physics Library

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