Bullet appendLinearJoint to attach softbody with rigidbody

Dear our colleagues,

I am working with Bullet of Panda3d and trying to attach softbody with rigidboy.
But, it has been not yet.

On the other hand, the original Bullet physics can do it, its demo video is shown on
youtube.com/watch?v=9sh-D0nejUY

I investigated the source code of the demo, then found that the attachment of softbody is realized by using

    void btSoftBody::appendLinearJoint()

bulletphysics.org/Bullet/BulletF … f1dc412d1f

However, I have not found the similar member function within Bullet class in Panda3D API reference
panda3d.org/reference/devel … /annotated

Can I get it ? or, someone will provide it ?
I strongly hope to use it . Please, someone help me.

Hiroshi

Good research. Thank you for pointing me to this information.

It might be possible to expose linear (and maybe angular) joints for softbodies. However, clusters are handles transparent, so if using a setup like in the example the user would have to know the right cluster index. Or, like in the sample, generate only one cluster. Or use direkt positioning (via LPoint3).

Might be that we need to update the build servers to Bullet 2.81 before I can check in. This is something rdb should decide.

EDIT: seems like we can go with 2.80 too. Give me a few days…

Dear enn0x

I and our colleagues have big expectations for you !
Of course we wait !

See you :smiley:

Hmm… I checked in a first version (linear & angular joints, without drive) a few days ago, but it seems the buildbot servers are not running, so there is no snapshot build yet. You could compile yourself until the snapshot builds are back again.

Here is a snippet for setting up something simular to the Bullet sample with the disk and the three soft bodies connected to it.

    # Disk
    p0 = Point3(0, 0, 4)
    v1 = Vec3(-3,-3,0)
    v2 = Vec3(3,-3,0)
    v3 = Vec3(0,3,0)
    size = Vec3(1.5,1.5,1.5)

    np = self.worldNP.attachNewNode(BulletRigidBodyNode('Cylinder'))
    np.node().setMass(1.0)
    np.node().addShape(BulletCylinderShape(3.0, 0.6, ZUp))
    np.setPos(p0 + Point3(0,0,4))
    np.setCollideMask(BitMask32.allOn())
    self.world.attachRigidBody(np.node())

    # Three softbodies
    def makeBall(p, v, size):
      np = self.worldNP.attachNewNode(BulletSoftBodyNode.makeEllipsoid(info, p+v, size, 128))
      np.node().getMaterial(0).setLinearStiffness(0.1)
      np.node().getCfg().setDynamicFrictionCoefficient(1)
      np.node().getCfg().setDampingCoefficient(0.001)
      np.node().getCfg().setPressureCoefficient(1500)
      np.node().setTotalMass(30, True)
      np.node().setPose(True, False)
      np.node().generateClusters(1)
      np.showTightBounds()

      geom = BulletHelper.makeGeomFromFaces(np.node())
      nodeVis = GeomNode('')
      nodeVis.addGeom(geom)
      npVis = np.attachNewNode(nodeVis)
      np.node().linkGeom(geom)

      return np

    np1 = makeBall(p0, v1, size)
    np2 = makeBall(p0, v2, size)
    np3 = makeBall(p0, v3, size)
    self.world.attachSoftBody(np1.node())
    self.world.attachSoftBody(np2.node())
    self.world.attachSoftBody(np3.node())

    # Links by cluster
    np1.node().appendLinearJoint(np.node(), 0, erp=0.5)
    np2.node().appendLinearJoint(np.node(), 0, erp=0.5)
    np3.node().appendLinearJoint(np.node(), 0, erp=0.5)

    # Same result, but by transform and not by cluster
    #np1.node().appendLinearJoint(np.node(), p0+v1, erp=0.5)
    #np2.node().appendLinearJoint(np.node(), p0+v2, erp=0.5)
    #np3.node().appendLinearJoint(np.node(), p0+v3, erp=0.5)

Dear enn0x

O.K. I will try it,
and I am waiting your next reply.

I think one of the most advantages of Bullet is to manage softbody and control it,
so I am sure that your help will enhance the value of Panda3D.

Sincerely yours
Hiroshi