TestStart.py 925 B

123456789101112131415161718192021222324252627282930313233
  1. print('TestStart: Starting up test environment.')
  2. from panda3d.core import *
  3. from direct.showbase.PythonUtil import *
  4. from direct.showbase import ShowBase
  5. base = ShowBase.ShowBase()
  6. # Put an axis in the world:
  7. loader.loadModel("models/misc/xyzAxis").reparentTo(render)
  8. if 0:
  9. # Hack:
  10. # Enable drive mode but turn it off, and reset the camera
  11. # This is here because ShowBase sets up a drive interface, this
  12. # can be removed if ShowBase is changed to not set that up.
  13. base.useDrive()
  14. base.disableMouse()
  15. if base.mouseInterface:
  16. base.mouseInterface.reparentTo(base.dataUnused)
  17. if base.mouse2cam:
  18. base.mouse2cam.reparentTo(base.dataUnused)
  19. # end of hack.
  20. camera.setPosHpr(0, -10.0, 0, 0, 0, 0)
  21. base.camLens.setFov(52.0)
  22. base.camLens.setNearFar(1.0, 10000.0)
  23. globalClock.setMaxDt(0.2)
  24. base.enableParticles()
  25. # Force the screen to update:
  26. base.graphicsEngine.renderFrame()