|
@@ -680,7 +680,7 @@ append_anchor(int node, BulletRigidBodyNode *body, bool disable) {
|
|
|
|
|
|
|
|
body->sync_p2b();
|
|
body->sync_p2b();
|
|
|
|
|
|
|
|
- btRigidBody *ptr =(btRigidBody *)body->get_object();
|
|
|
|
|
|
|
+ btRigidBody *ptr = (btRigidBody *)body->get_object();
|
|
|
_soft->appendAnchor(node, ptr, disable);
|
|
_soft->appendAnchor(node, ptr, disable);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -698,7 +698,7 @@ append_anchor(int node, BulletRigidBodyNode *body, const LVector3 &pivot, bool d
|
|
|
|
|
|
|
|
body->sync_p2b();
|
|
body->sync_p2b();
|
|
|
|
|
|
|
|
- btRigidBody *ptr =(btRigidBody *)body->get_object();
|
|
|
|
|
|
|
+ btRigidBody *ptr = (btRigidBody *)body->get_object();
|
|
|
_soft->appendAnchor(node, ptr, LVecBase3_to_btVector3(pivot), disable);
|
|
_soft->appendAnchor(node, ptr, LVecBase3_to_btVector3(pivot), disable);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1070,3 +1070,66 @@ make_tet_mesh(BulletSoftBodyWorldInfo &info, const char *ele, const char *face,
|
|
|
return sbnode;
|
|
return sbnode;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+////////////////////////////////////////////////////////////////////
|
|
|
|
|
+// Function: BulletSoftBodyNode::append_linear_joint
|
|
|
|
|
+// Access: Published
|
|
|
|
|
+// Description:
|
|
|
|
|
+////////////////////////////////////////////////////////////////////
|
|
|
|
|
+void BulletSoftBodyNode::
|
|
|
|
|
+append_linear_joint(BulletBodyNode *body, int cluster, PN_stdfloat erp, PN_stdfloat cfm, PN_stdfloat split) {
|
|
|
|
|
+
|
|
|
|
|
+ nassertv(body);
|
|
|
|
|
+
|
|
|
|
|
+ btCollisionObject *ptr = body->get_object();
|
|
|
|
|
+
|
|
|
|
|
+ btSoftBody::LJoint::Specs ls;
|
|
|
|
|
+ ls.erp = erp;
|
|
|
|
|
+ ls.cfm = cfm;
|
|
|
|
|
+ ls.split = split;
|
|
|
|
|
+ ls.position = _soft->clusterCom(cluster);
|
|
|
|
|
+
|
|
|
|
|
+ _soft->appendLinearJoint(ls, ptr);
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+////////////////////////////////////////////////////////////////////
|
|
|
|
|
+// Function: BulletSoftBodyNode::append_linear_joint
|
|
|
|
|
+// Access: Published
|
|
|
|
|
+// Description:
|
|
|
|
|
+////////////////////////////////////////////////////////////////////
|
|
|
|
|
+void BulletSoftBodyNode::
|
|
|
|
|
+append_linear_joint(BulletBodyNode *body, const LPoint3 &pos, PN_stdfloat erp, PN_stdfloat cfm, PN_stdfloat split) {
|
|
|
|
|
+
|
|
|
|
|
+ nassertv(body);
|
|
|
|
|
+
|
|
|
|
|
+ btCollisionObject *ptr = body->get_object();
|
|
|
|
|
+
|
|
|
|
|
+ btSoftBody::LJoint::Specs ls;
|
|
|
|
|
+ ls.erp = erp;
|
|
|
|
|
+ ls.cfm = cfm;
|
|
|
|
|
+ ls.split = split;
|
|
|
|
|
+ ls.position = LVecBase3_to_btVector3(pos);
|
|
|
|
|
+
|
|
|
|
|
+ _soft->appendLinearJoint(ls, ptr);
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+////////////////////////////////////////////////////////////////////
|
|
|
|
|
+// Function: BulletSoftBodyNode::append_angular_joint
|
|
|
|
|
+// Access: Published
|
|
|
|
|
+// Description:
|
|
|
|
|
+////////////////////////////////////////////////////////////////////
|
|
|
|
|
+void BulletSoftBodyNode::
|
|
|
|
|
+append_angular_joint(BulletBodyNode *body, const LVector3 &axis, PN_stdfloat erp, PN_stdfloat cfm, PN_stdfloat split) {
|
|
|
|
|
+
|
|
|
|
|
+ nassertv(body);
|
|
|
|
|
+
|
|
|
|
|
+ btCollisionObject *ptr = body->get_object();
|
|
|
|
|
+
|
|
|
|
|
+ btSoftBody::AJoint::Specs as;
|
|
|
|
|
+ as.erp = erp;
|
|
|
|
|
+ as.cfm = cfm;
|
|
|
|
|
+ as.split = split;
|
|
|
|
|
+ as.axis = LVecBase3_to_btVector3(axis);
|
|
|
|
|
+
|
|
|
|
|
+ _soft->appendAngularJoint(as, ptr);
|
|
|
|
|
+}
|
|
|
|
|
+
|