bullet3
bullet3 copied to clipboard
Is springElasticStiffness of loadSoftBody() working?
Is springElasticStiffness
of loadSoftBody()
working?
I made a little change of load_soft_body example (https://github.com/bulletphysics/bullet3/blob/master/examples/pybullet/examples/load_soft_body.py) to check the performance of softbody. The cube will fall down on the bunny in the code below.
Even when I made springElasticStiffness
parameter to 100 or anything, the compression of the bunny didn't changed at all. Why?
import pybullet as p
from time import sleep
import pybullet_data
physicsClient = p.connect(p.GUI)
p.setAdditionalSearchPath(pybullet_data.getDataPath())
p.setGravity(0, 0, -10)
planeId = p.loadURDF("plane.urdf", [0,0,-2])
boxId = p.loadURDF("cube.urdf", [0,0,2],useMaximalCoordinates = True)
bunnyId = p.loadSoftBody("bunny.obj",
springElasticStiffness = 0.01,
mass = 1
)
#meshData = p.getMeshData(bunnyId)
#print("meshData=",meshData)
#p.loadURDF("cube_small.urdf", [1, 0, 1])
useRealTimeSimulation = 1
if (useRealTimeSimulation):
p.setRealTimeSimulation(1)
p.changeDynamics(boxId,-1,mass=10)
while p.isConnected():
p.setGravity(0, 0, -10)
if (useRealTimeSimulation):
sleep(0.01) # Time in seconds.
#p.getCameraImage(320,200,renderer=p.ER_BULLET_HARDWARE_OPENGL )
else:
p.stepSimulation()