virtualx-engine/servers/physics
Daniel Rakos 6dd65c0d67 KinematicBody performance and quality improvements
With this change finally one can use compound collisions (like those created
by Gridmaps) without serious performance issues. The previous KinematicBody
code for Bullet was practically doing a whole bunch of unnecessary
calculations. Gridmaps with fairly large octant sizes (in my case 32) can get
up to 10000x speedup with this change (literally!). I expect the FPS demo to
get a fair speedup as well.

List of fixes and improvements:

- Fixed a general bug in move_and_slide that affects both GodotPhysics and
  Bullet, where ray shapes would be ignored unless the stop_on_slope parameter
  is disabled. Not sure where that came from, but looking at the 2D physics
  code it was obvious there's a difference.
- Enabled the dynamic AABB tree that Bullet uses to allow broadphase collision
  tests against individual shapes of compound shapes. This is crucial to get
  good performance with Gridmaps and in general improves the performance
  whenever a KinematicBody collides with compound collision shapes.
- Added code to the broadphase collision detection code used by the Bullet
  module for KinematicBodies to also do broadphase on the sub-shapes of
  compound collision shapes. This is possible thanks to the dynamic AABB
  tree that was previously disabled and it's the change that provides the
  biggest performance boost.
- Now broadphase test is only done once per KinematicBody in Bullet instead of
  once per each of its shapes which was completely unnecessary.
- Fixed the way how the ray separation results are populated in Bullet which
  was completely broken previously, overwriting previous results and similar
  non-sense.
- Fixed ray shapes for good now. Previously the margin set in the editor was
  not respected at all, and the KinematicBody code for ray separation was
  complete bogus, thus all previous attempts to fix it were mislead.
- Fixed an obvious bug also in GodotPhysics where an out-of-bounds index was
  used in the ray result array.

There are a whole set of other problems with the KinematicBody code of Bullet
which cost performance and may cause unexpected behavior, but those are not
addressed in this change (need to keep it "simple").

Not sure whether this fixes any outstanding Github issues but I wouldn't be
surprised.
2019-03-27 00:39:47 +01:00
..
joints Add -Wshadow=local to warnings and fix reported issues. 2019-02-20 19:44:12 +01:00
area_pair_sw.cpp Update copyright statements to 2019 2019-01-01 12:58:10 +01:00
area_pair_sw.h Update copyright statements to 2019 2019-01-01 12:58:10 +01:00
area_sw.cpp Update copyright statements to 2019 2019-01-01 12:58:10 +01:00
area_sw.h Update copyright statements to 2019 2019-01-01 12:58:10 +01:00
body_pair_sw.cpp Update copyright statements to 2019 2019-01-01 12:58:10 +01:00
body_pair_sw.h Update copyright statements to 2019 2019-01-01 12:58:10 +01:00
body_sw.cpp [Core] Rename Matrix3 file to Basis 2019-02-09 14:42:23 -05:00
body_sw.h Update copyright statements to 2019 2019-01-01 12:58:10 +01:00
broad_phase_basic.cpp Update copyright statements to 2019 2019-01-01 12:58:10 +01:00
broad_phase_basic.h Update copyright statements to 2019 2019-01-01 12:58:10 +01:00
broad_phase_octree.cpp Update copyright statements to 2019 2019-01-01 12:58:10 +01:00
broad_phase_octree.h Update copyright statements to 2019 2019-01-01 12:58:10 +01:00
broad_phase_sw.cpp Update copyright statements to 2019 2019-01-01 12:58:10 +01:00
broad_phase_sw.h Update copyright statements to 2019 2019-01-01 12:58:10 +01:00
collision_object_sw.cpp Update copyright statements to 2019 2019-01-01 12:58:10 +01:00
collision_object_sw.h Fix warnings seen with -Wignored-qualifiers. 2019-02-21 20:24:29 +01:00
collision_solver_sat.cpp Add -Wshadow=local to warnings and fix reported issues. 2019-02-20 19:44:12 +01:00
collision_solver_sat.h Update copyright statements to 2019 2019-01-01 12:58:10 +01:00
collision_solver_sw.cpp Update copyright statements to 2019 2019-01-01 12:58:10 +01:00
collision_solver_sw.h Update copyright statements to 2019 2019-01-01 12:58:10 +01:00
constraint_sw.h Update copyright statements to 2019 2019-01-01 12:58:10 +01:00
gjk_epa.cpp Update copyright statements to 2019 2019-01-01 12:58:10 +01:00
gjk_epa.h Update copyright statements to 2019 2019-01-01 12:58:10 +01:00
joints_sw.h Update copyright statements to 2019 2019-01-01 12:58:10 +01:00
physics_server_sw.cpp Make query checks less agressive, fixes #24694 2019-03-02 08:48:47 -03:00
physics_server_sw.h Update copyright statements to 2019 2019-01-01 12:58:10 +01:00
SCsub SCons: Build thirdparty code in own env, disable warnings 2018-09-28 14:07:39 +02:00
shape_sw.cpp Core: Ensure classes match their header filename 2019-02-12 13:34:25 +01:00
shape_sw.h Update copyright statements to 2019 2019-01-01 12:58:10 +01:00
space_sw.cpp KinematicBody performance and quality improvements 2019-03-27 00:39:47 +01:00
space_sw.h Add a minimum treshold for acquiring rest contacts to avoid numerical precision issues. Fixes #25074 2019-02-16 13:45:01 -03:00
step_sw.cpp Update copyright statements to 2019 2019-01-01 12:58:10 +01:00
step_sw.h Update copyright statements to 2019 2019-01-01 12:58:10 +01:00