summaryrefslogtreecommitdiffstats
path: root/servers/physics_2d/step_2d_sw.cpp
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2014-02-19 11:57:14 -0300
committerJuan Linietsky <reduzio@gmail.com>2014-02-19 11:57:14 -0300
commitd7d65fa2f2b51d03f7bdfcbceedca99188ce979c (patch)
treefecdf1bfa39ba5a4895b4dbf340a3b68098c109a /servers/physics_2d/step_2d_sw.cpp
parent8c1731b67995add31361ae526b0e6af76346181e (diff)
downloadredot-engine-d7d65fa2f2b51d03f7bdfcbceedca99188ce979c.tar.gz
-improved physics ccd
-html5 exporter works again -disable repeat on image loader by default -can change shape offset en tileset, texture offset was broken
Diffstat (limited to 'servers/physics_2d/step_2d_sw.cpp')
-rw-r--r--servers/physics_2d/step_2d_sw.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/servers/physics_2d/step_2d_sw.cpp b/servers/physics_2d/step_2d_sw.cpp
index 9f41fc94eb..29f4a58287 100644
--- a/servers/physics_2d/step_2d_sw.cpp
+++ b/servers/physics_2d/step_2d_sw.cpp
@@ -49,7 +49,7 @@ void Step2DSW::_populate_island(Body2DSW* p_body,Body2DSW** p_island,Constraint2
if (i==E->get())
continue;
Body2DSW *b = c->get_body_ptr()[i];
- if (b->get_island_step()==_step || b->get_mode()==Physics2DServer::BODY_MODE_STATIC)
+ if (b->get_island_step()==_step || b->get_mode()==Physics2DServer::BODY_MODE_STATIC || b->get_mode()==Physics2DServer::BODY_MODE_KINEMATIC)
continue; //no go
_populate_island(c->get_body_ptr()[i],p_island,p_constraint_island);
}
@@ -87,8 +87,10 @@ void Step2DSW::_check_suspend(Body2DSW *p_island,float p_delta) {
Body2DSW *b = p_island;
while(b) {
- if (b->get_mode()==Physics2DServer::BODY_MODE_STATIC)
+ if (b->get_mode()==Physics2DServer::BODY_MODE_STATIC || b->get_mode()==Physics2DServer::BODY_MODE_KINEMATIC) {
+ b=b->get_island_next();
continue; //ignore for static
+ }
if (!b->sleep_test(p_delta))
can_sleep=false;
@@ -101,8 +103,10 @@ void Step2DSW::_check_suspend(Body2DSW *p_island,float p_delta) {
b = p_island;
while(b) {
- if (b->get_mode()==Physics2DServer::BODY_MODE_STATIC)
+ if (b->get_mode()==Physics2DServer::BODY_MODE_STATIC || b->get_mode()==Physics2DServer::BODY_MODE_KINEMATIC) {
+ b=b->get_island_next();
continue; //ignore for static
+ }
bool active = b->is_active();
@@ -210,8 +214,9 @@ void Step2DSW::step(Space2DSW* p_space,float p_delta,int p_iterations) {
b = body_list->first();
while(b) {
+ const SelfList<Body2DSW>*n=b->next();
b->self()->integrate_velocities(p_delta);
- b=b->next();
+ b=n; // in case it shuts itself down
}
/* SLEEP / WAKE UP ISLANDS */