test_fall.sq 736 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. include("test_base.sq")
  2. class TestFall extends PhysicsTestBase {
  3. fall_elements=10
  4. function init_internal() {
  5. for (local i=0;i<10;i++) {
  6. local shape_idx=[
  7. PhysicsServer.SHAPE_SPHERE,
  8. PhysicsServer.SHAPE_BOX,
  9. PhysicsServer.SHAPE_CAPSULE,
  10. PhysicsServer.SHAPE_CYLINDER,
  11. PhysicsServer.SHAPE_CONVEX_POLYGON
  12. ];
  13. local stype=shape_idx[i%5];
  14. // stype=PhysicsServer.SHAPE_SPHERE;
  15. local t=Transform()
  16. t.set_origin(Vector3(-0.7+0.0*i,3.5+4.1*i,0))
  17. t.rotate_basis(Vector3(1,0,0),Math.PI/4*i)
  18. local b = create_body(stype,PhysicsServer.BODY_MODE_RIGID,t);
  19. }
  20. create_static_plane( Plane( Vector3(0,1,0), -1) );
  21. }
  22. constructor() {
  23. PhysicsTestBase.constructor()
  24. }
  25. }
  26. return TestFall