21 lines
382 B
Python
21 lines
382 B
Python
import pybullet as p
|
|
from time import sleep
|
|
|
|
physicsClient = p.connect(p.GUI)
|
|
|
|
p.setGravity(0,0,-10)
|
|
planeId = p.loadURDF("plane.urdf")
|
|
bunnyId = p.loadSoftBody("bunny.obj")
|
|
|
|
useRealTimeSimulation = 1
|
|
|
|
if (useRealTimeSimulation):
|
|
p.setRealTimeSimulation(1)
|
|
|
|
while 1:
|
|
if (useRealTimeSimulation):
|
|
p.setGravity(0,0,-10)
|
|
sleep(0.01) # Time in seconds.
|
|
else:
|
|
p.stepSimulation()
|