Files
bullet3/examples/pybullet/examples/load_soft_body.py
2019-06-17 21:43:38 -07:00

25 lines
585 B
Python

import pybullet as p
from time import sleep
physicsClient = p.connect(p.DIRECT)
p.setGravity(0, 0, -10)
planeId = p.loadURDF("plane.urdf")
bunnyId = p.loadSoftBody("bunny.obj")
#meshData = p.getMeshData(bunnyId)
#print("meshData=",meshData)
p.loadURDF("cube_small.urdf", [1, 0, 1])
useRealTimeSimulation = 1
if (useRealTimeSimulation):
p.setRealTimeSimulation(1)
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()