diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_physics_2d.cpp | 14 | ||||
-rw-r--r-- | tests/test_physics_3d.cpp | 13 |
2 files changed, 13 insertions, 14 deletions
diff --git a/tests/test_physics_2d.cpp b/tests/test_physics_2d.cpp index 61b8951afa..f63b866c3e 100644 --- a/tests/test_physics_2d.cpp +++ b/tests/test_physics_2d.cpp @@ -248,20 +248,20 @@ protected: return body; } - void _add_plane(const Vector2 &p_normal, real_t p_d) { + void _add_world_boundary(const Vector2 &p_normal, real_t p_d) { PhysicsServer2D *ps = PhysicsServer2D::get_singleton(); Array arr; arr.push_back(p_normal); arr.push_back(p_d); - RID plane = ps->world_margin_shape_create(); - ps->shape_set_data(plane, arr); + RID world_boundary = ps->world_boundary_shape_create(); + ps->shape_set_data(world_boundary, arr); RID plane_body = ps->body_create(); ps->body_set_mode(plane_body, PhysicsServer2D::BODY_MODE_STATIC); ps->body_set_space(plane_body, space); - ps->body_add_shape(plane_body, plane); + ps->body_add_shape(plane_body, world_boundary); } void _add_concave(const Vector<Vector2> &p_points, const Transform2D &p_xform = Transform2D()) { @@ -381,9 +381,9 @@ public: } _add_concave(parr); - //_add_plane(Vector2(0.0,-1).normalized(),-300); - //_add_plane(Vector2(1,0).normalized(),50); - //_add_plane(Vector2(-1,0).normalized(),-600); + //_add_world_boundary(Vector2(0.0,-1).normalized(),-300); + //_add_world_boundary(Vector2(1,0).normalized(),50); + //_add_world_boundary(Vector2(-1,0).normalized(),-600); } virtual bool process(double p_time) override { diff --git a/tests/test_physics_3d.cpp b/tests/test_physics_3d.cpp index ed49b60c71..3d1dad6545 100644 --- a/tests/test_physics_3d.cpp +++ b/tests/test_physics_3d.cpp @@ -100,18 +100,17 @@ protected: return body; } - RID create_static_plane(const Plane &p_plane) { + RID create_world_boundary(const Plane &p_plane) { PhysicsServer3D *ps = PhysicsServer3D::get_singleton(); - RID world_margin_shape = ps->shape_create(PhysicsServer3D::SHAPE_PLANE); - ps->shape_set_data(world_margin_shape, p_plane); + RID world_boundary_shape = ps->shape_create(PhysicsServer3D::SHAPE_WORLD_BOUNDARY); + ps->shape_set_data(world_boundary_shape, p_plane); RID b = ps->body_create(); ps->body_set_mode(b, PhysicsServer3D::BODY_MODE_STATIC); ps->body_set_space(b, space); - //todo set space - ps->body_add_shape(b, world_margin_shape); + ps->body_add_shape(b, world_boundary_shape); return b; } @@ -391,12 +390,12 @@ public: create_body(type, PhysicsServer3D::BODY_MODE_DYNAMIC, t); } - create_static_plane(Plane(Vector3(0, 1, 0), -1)); + create_world_boundary(Plane(Vector3(0, 1, 0), -1)); } void test_activate() { create_body(PhysicsServer3D::SHAPE_BOX, PhysicsServer3D::BODY_MODE_DYNAMIC, Transform3D(Basis(), Vector3(0, 2, 0)), true); - create_static_plane(Plane(Vector3(0, 1, 0), -1)); + create_world_boundary(Plane(Vector3(0, 1, 0), -1)); } virtual bool process(double p_time) override { |