diff options
author | Juan Linietsky <reduzio@gmail.com> | 2015-01-05 18:37:12 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2015-01-05 18:37:12 -0300 |
commit | b51f64571151cad5da8e5ed20ef52a8b0ffc3534 (patch) | |
tree | 265653ff8a5627321332c3a96cc2978dc516b5c3 /scene/resources | |
parent | 1ff0d5c4e57538463081c774dc40a6f8323e6cb9 (diff) |
Changes to 2D physics engine
-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-Removed "density" property
-Added instead more flexible "angular damp" and "linear damp"
-Added ability to override angular and linear damp in rigidbody
-Added gravity scale option rigidbody
Test well and iron out bugs, when it works the same will be moved to 3D
Diffstat (limited to 'scene/resources')
-rw-r--r-- | scene/resources/world_2d.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/scene/resources/world_2d.cpp b/scene/resources/world_2d.cpp index aee7ddde00..0dd6a3d5e7 100644 --- a/scene/resources/world_2d.cpp +++ b/scene/resources/world_2d.cpp @@ -364,12 +364,12 @@ World2D::World2D() { Physics2DServer::get_singleton()->space_set_active(space,true); Physics2DServer::get_singleton()->area_set_param(space,Physics2DServer::AREA_PARAM_GRAVITY,GLOBAL_DEF("physics_2d/default_gravity",98)); Physics2DServer::get_singleton()->area_set_param(space,Physics2DServer::AREA_PARAM_GRAVITY_VECTOR,GLOBAL_DEF("physics_2d/default_gravity_vector",Vector2(0,1))); - Physics2DServer::get_singleton()->area_set_param(space,Physics2DServer::AREA_PARAM_DENSITY,GLOBAL_DEF("physics_2d/default_density",0.1)); + Physics2DServer::get_singleton()->area_set_param(space,Physics2DServer::AREA_PARAM_LINEAR_DAMP,GLOBAL_DEF("physics_2d/default_density",0.1)); + Physics2DServer::get_singleton()->area_set_param(space,Physics2DServer::AREA_PARAM_ANGULAR_DAMP,GLOBAL_DEF("physics_2d/default_density",1)); Physics2DServer::get_singleton()->space_set_param(space,Physics2DServer::SPACE_PARAM_CONTACT_RECYCLE_RADIUS,1.0); Physics2DServer::get_singleton()->space_set_param(space,Physics2DServer::SPACE_PARAM_CONTACT_MAX_SEPARATION,1.5); Physics2DServer::get_singleton()->space_set_param(space,Physics2DServer::SPACE_PARAM_BODY_MAX_ALLOWED_PENETRATION,0.3); Physics2DServer::get_singleton()->space_set_param(space,Physics2DServer::SPACE_PARAM_BODY_LINEAR_VELOCITY_SLEEP_TRESHOLD,2); - Physics2DServer::get_singleton()->space_set_param(space,Physics2DServer::SPACE_PARAM_BODY_ANGULAR_VELOCITY_DAMP_RATIO,20); Physics2DServer::get_singleton()->space_set_param(space,Physics2DServer::SPACE_PARAM_CONSTRAINT_DEFAULT_BIAS,0.2); indexer = memnew( SpatialIndexer2D ); |