basic implementation of self-collision for btSoftBody with collision clusters: perform regular soft body versus soft body, but disable collision detection between clusters that are connected/share any node (vertex).

currently self-collision is always enabled for soft bodies that use clusters collision detectoin. to disable, call 'softbody.m_clusterConnectivity.clear' after 'generateClusters(...) call.
This commit is contained in:
erwin.coumans
2009-03-02 05:13:26 +00:00
parent 210fe36106
commit 5be9f8f301
4 changed files with 73 additions and 12 deletions

View File

@@ -296,6 +296,7 @@ public:
btScalar m_adamping; /* Angular damping */
btScalar m_matching;
bool m_collide;
int m_clusterIndex;
Cluster() : m_leaf(0),m_ndamping(0),m_ldamping(0),m_adamping(0),m_matching(0) {}
};
/* Impulse */
@@ -603,6 +604,7 @@ public:
btDbvt m_fdbvt; // Faces tree
btDbvt m_cdbvt; // Clusters tree
tClusterArray m_clusters; // Clusters
btAlignedObjectArray<bool>m_clusterConnectivity;//cluster connectivity, for self-collision
//
// Api