diff options
| author | Juan Linietsky | 2014-02-09 22:10:30 -0300 |
|---|---|---|
| committer | Juan Linietsky | 2014-02-09 22:10:30 -0300 |
| commit | 0b806ee0fc9097fa7bda7ac0109191c9c5e0a1ac (patch) | |
| tree | 276c4d099e178eb67fbd14f61d77b05e3808e9e3 /doc/examples/physics/script/test_fall.sq | |
| parent | 0e49da1687bc8192ed210947da52c9e5c5f301bb (diff) | |
| download | godot-0b806ee.tar.gz godot-0b806ee.tar.zst godot-0b806ee.zip | |
GODOT IS OPEN SOURCE
Diffstat (limited to '')
| -rw-r--r-- | doc/examples/physics/script/test_fall.sq | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/doc/examples/physics/script/test_fall.sq b/doc/examples/physics/script/test_fall.sq new file mode 100644 index 000000000..79526da8b --- /dev/null +++ b/doc/examples/physics/script/test_fall.sq @@ -0,0 +1,42 @@ + +include("test_base.sq") + +class TestFall extends PhysicsTestBase { + + + fall_elements=10 + + function init_internal() { + + for (local i=0;i<10;i++) { + + local shape_idx=[ + PhysicsServer.SHAPE_SPHERE, + PhysicsServer.SHAPE_BOX, + PhysicsServer.SHAPE_CAPSULE, + PhysicsServer.SHAPE_CYLINDER, + PhysicsServer.SHAPE_CONVEX_POLYGON + ]; + + local stype=shape_idx[i%5]; +// stype=PhysicsServer.SHAPE_SPHERE; + + local t=Transform() + t.set_origin(Vector3(-0.7+0.0*i,3.5+4.1*i,0)) + t.rotate_basis(Vector3(1,0,0),Math.PI/4*i) + + local b = create_body(stype,PhysicsServer.BODY_MODE_RIGID,t); + + } + + create_static_plane( Plane( Vector3(0,1,0), -1) ); + + } + + constructor() { + PhysicsTestBase.constructor() + } +} + + +return TestFall |
