You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-24 15:26:15 +00:00
3D Physics and Other Stuff
-=-=-=-=-=-=-=-=-=-=-=-=-= -New Vehicle (Based on Bullet's RaycastVehicle) - Vehiclebody/VehicleWheel. Demo will come soon, old vehicle (CarBody) will go away soon too. -A lot of fixes to the 3D physics engine -Added KinematicBody with demo -Fixed the space query API for 2D (demo will come soon). 3D is WIP. -Fixed long-standing bug with body_enter/body_exit for Area and Area2D -Performance variables now includes physics (active bodies, collision pairs and islands) -Ability to see what's inside of instanced scenes! -Fixed Blend Shapes (no bs+skeleton yet) -Added an Android JavaClassWrapper singleton for using Android native classes directly from GDScript. This is very Alpha!
This commit is contained in:
@@ -49,7 +49,7 @@ void StepSW::_populate_island(BodySW* p_body,BodySW** p_island,ConstraintSW **p_
|
||||
if (i==E->get())
|
||||
continue;
|
||||
BodySW *b = c->get_body_ptr()[i];
|
||||
if (b->get_island_step()==_step || b->get_mode()==PhysicsServer::BODY_MODE_STATIC)
|
||||
if (b->get_island_step()==_step || b->get_mode()==PhysicsServer::BODY_MODE_STATIC || b->get_mode()==PhysicsServer::BODY_MODE_KINEMATIC)
|
||||
continue; //no go
|
||||
_populate_island(c->get_body_ptr()[i],p_island,p_constraint_island);
|
||||
}
|
||||
@@ -86,8 +86,10 @@ void StepSW::_check_suspend(BodySW *p_island,float p_delta) {
|
||||
BodySW *b = p_island;
|
||||
while(b) {
|
||||
|
||||
if (b->get_mode()==PhysicsServer::BODY_MODE_STATIC)
|
||||
if (b->get_mode()==PhysicsServer::BODY_MODE_STATIC || b->get_mode()==PhysicsServer::BODY_MODE_KINEMATIC) {
|
||||
b=b->get_island_next();
|
||||
continue; //ignore for static
|
||||
}
|
||||
|
||||
if (!b->sleep_test(p_delta))
|
||||
can_sleep=false;
|
||||
@@ -100,8 +102,10 @@ void StepSW::_check_suspend(BodySW *p_island,float p_delta) {
|
||||
b = p_island;
|
||||
while(b) {
|
||||
|
||||
if (b->get_mode()==PhysicsServer::BODY_MODE_STATIC)
|
||||
if (b->get_mode()==PhysicsServer::BODY_MODE_STATIC || b->get_mode()==PhysicsServer::BODY_MODE_KINEMATIC) {
|
||||
b=b->get_island_next();
|
||||
continue; //ignore for static
|
||||
}
|
||||
|
||||
bool active = b->is_active();
|
||||
|
||||
@@ -131,6 +135,7 @@ void StepSW::step(SpaceSW* p_space,float p_delta,int p_iterations) {
|
||||
active_count++;
|
||||
}
|
||||
|
||||
p_space->set_active_objects(active_count);
|
||||
|
||||
|
||||
/* GENERATE CONSTRAINT ISLANDS */
|
||||
@@ -164,6 +169,8 @@ void StepSW::step(SpaceSW* p_space,float p_delta,int p_iterations) {
|
||||
b=b->next();
|
||||
}
|
||||
|
||||
p_space->set_island_count(island_count);
|
||||
|
||||
const SelfList<AreaSW>::List &aml = p_space->get_moved_area_list();
|
||||
|
||||
while(aml.first()) {
|
||||
@@ -207,9 +214,9 @@ void StepSW::step(SpaceSW* p_space,float p_delta,int p_iterations) {
|
||||
|
||||
b = body_list->first();
|
||||
while(b) {
|
||||
|
||||
const SelfList<BodySW>*n=b->next();
|
||||
b->self()->integrate_velocities(p_delta);
|
||||
b=b->next();
|
||||
b=n;
|
||||
}
|
||||
|
||||
/* SLEEP / WAKE UP ISLANDS */
|
||||
|
||||
Reference in New Issue
Block a user