godot/scene
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
..
2d Add missing check for 2d physics bounce and friction setters 2019-03-18 15:30:26 +01:00
3d KinematicBody performance and quality improvements 2019-03-27 00:39:47 +01:00
animation Removed some prints 2019-03-02 12:15:48 -03:00
audio Pause AudioStreamPlayer on SceneTree pause 2019-03-05 15:04:29 +01:00
gui Merge pull request #26788 from mo7sener/master 2019-03-16 11:08:29 -07:00
main Merge pull request #26484 from Andrettin/Configurable-Tooltip-Offset 2019-03-13 20:12:22 +01:00
resources Merge pull request #26308 from bojidar-bg/11722-meshlibrary-transforms 2019-03-16 11:15:15 -07:00
SCsub Move Penner easing equations to thirdparty/misc 2018-09-28 16:01:26 +02:00
register_scene_types.cpp Scene: Ensure classes match their header filename 2019-02-12 17:21:48 +01:00
register_scene_types.h Update copyright statements to 2019 2019-01-01 12:58:10 +01:00
scene_string_names.cpp -Fixes to undo redo to avoid crash, closes #24251 2019-02-14 10:22:34 -03:00
scene_string_names.h -Fixes to undo redo to avoid crash, closes #24251 2019-02-14 10:22:34 -03:00