summaryrefslogtreecommitdiff
path: root/modules/bullet/space_bullet.cpp
AgeCommit message (Collapse)Author
2020-11-26Remove any constraints connected to a Bullet body when removing itMarcel Admiraal
2020-11-07Reorganized core/ directory, it was too fatty alreadyreduz
-Removed FuncRef, since Callable makes it obsolete -Removed int_types.h as its obsolete in c++11+ -Changed color names code
2020-10-08Fixed #41040 in an alternative way now that #39726 is revertedAndrea Catania
2020-10-08Revert "Optimized physics object spawn time and optimized shape usage when ↵Andrea Catania
the shape is not scaled" This reverts commit 7709a8349354b469361ec7e1429af0dc8af80b2a.
2020-10-08Revert "- Enhanced the flush mechanism by flushing only needed thing."Andrea Catania
This reverts commit 8d0d6d6921d5dfb398f4ab04e4d3937ab550c4ff.
2020-10-02Updated getters and setters names for toplevelDuroxxigar
2020-08-05Fixes leak when creating bullet shapeRafał Mikrut
2020-07-27Merge pull request #40252 from AndreaCatania/flushRémi Verschelde
Improved Bullet Physics flush algorithm, Lazy collision filter reload, Shape reload regression fix.
2020-07-27- Enhanced the flush mechanism by flushing only needed thing.Andrea Catania
- Flushing Areas before anything else. - Make sure to correctly fetch gravity when the integrate_forces function is used - Lazy reload body when layer and mask changes - Shapes are reloaded just before the physics step starts. - Improved some other parts of the code. - Added override keyword - Using LocalVector
2020-07-18Use difference in position to check whether motion in Bullet is too closeMarcel Admiraal
to zero.
2020-07-08Move Bullet physics query flush from Bullet space pre-tick callback toMarcel Admiraal
Bullet physics flush_queries() as is done in Godot physics, and remove the pre-tick callback.
2020-07-07Merge pull request #39726 from AndreaCatania/add_body_impr_physicsRémi Verschelde
Optimized physics object spawn time
2020-07-07Merge pull request #39735 from AndreaCatania/bullet_phy_add_apiRémi Verschelde
Added BulletPhysics APIs to return internal objects.
2020-06-24Added BulletPhysics APIs to return internal objects and fixed a typo.Andrea Catania
2020-06-24Optimized physics object spawn time and optimized shape usage when the shape ↵Andrea Catania
is not scaled
2020-06-22Merge pull request #39747 from nekomatata/fix-crash-space-queryRémi Verschelde
Fix crashes with invalid shapes in BulletPhysicsDirectSpaceState queries
2020-06-22Fix crashes with invalid shapes in BulletPhysicsDirectSpaceState queriesPouleyKetchoupp
2020-06-21Check for motion in cast_motion() before doing Bullet convexSweepTest().Marcel Admiraal
Also ensure that default closest_safe and closest_unsafe values are defined in cast_motion() and before cast_motion() is called.
2020-05-14Style: Enforce braces around if blocks and loopsRémi Verschelde
Using clang-tidy's `readability-braces-around-statements`. https://clang.llvm.org/extra/clang-tidy/checks/readability-braces-around-statements.html
2020-05-14Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocksRémi Verschelde
Which means that reduz' beloved style which we all became used to will now be changed automatically to remove the first empty line. This makes us lean closer to 1TBS (the one true brace style) instead of hybridating it with some Allman-inspired spacing. There's still the case of braces around single-statement blocks that needs to be addressed (but clang-format can't help with that, but clang-tidy may if we agree about it). Part of #33027.
2020-05-14Enforce use of bool literals instead of integersRémi Verschelde
Using clang-tidy's `modernize-use-bool-literals`. https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-bool-literals.html
2020-05-14Port member initialization from constructor to declaration (C++11)Rémi Verschelde
Using `clang-tidy`'s `modernize-use-default-member-init` check and manual review of the changes, and some extra manual changes that `clang-tidy` failed to do. Also went manually through all of `core` to find occurrences that `clang-tidy` couldn't handle, especially all initializations done in a constructor without using initializer lists.
2020-04-27Better damping implementation for Bullet rigid bodiesPouleyKetchoupp
Apply old method for linear & angular damping in Bullet, in order to make it easier to tweak and consistent with Godot Physics.
2020-04-02Replace NULL with nullptrlupoDharkael
2020-03-30doc: Update classref with node renamesRémi Verschelde
A few extra renames for classes which were missed in last week's PRs.
2020-03-27Renaming of servers for coherency.Juan Linietsky
VisualServer -> RenderingServer PhysicsServer -> PhysicsServer3D Physics2DServer -> PhysicsServer2D NavigationServer -> NavigationServer3D Navigation2DServer -> NavigationServer2D Also renamed corresponding files.
2020-02-26Merge pull request #33690 from Phischermen/area-enhancementRémi Verschelde
Bullet: Fix detection of concave shape in Area
2020-02-24Enabled concave collision detection with Areas in Bullet.Phischermen
2020-02-12ObjectID converted to a structure, fixes many bugs where used incorrectly as ↵Juan Linietsky
32 bits.
2020-02-11Modernized default 3D material, fixes material bugs.Juan Linietsky
2020-02-11Refactored RID/RID_Owner to always use O(1) allocation.Juan Linietsky
* Implements a growing chunked allocator * Removed redudant methods get and getptr, only getornull is supported now.
2020-02-05Remove duplicate WARN_PRINT macro.Marcel Admiraal
2020-02-05Remove duplicate ERR_PRINT macro.Marcel Admiraal
2020-01-11Merge pull request #34225 from madmiraal/fix-34210Rémi Verschelde
Add check for zero length motion at beginning of each sweep test loop in SpaceBullet::test_body_motion
2020-01-01Update copyright statements to 2020Rémi Verschelde
Happy new year to the wonderful Godot community! We're starting a new decade with a well-established, non-profit, free and open source game engine, and tons of further improvements in the pipeline from hundreds of contributors. Godot will keep getting better, and we're looking forward to all the games that the community will keep developing and releasing with it.
2019-12-10Add check for zero length motion at beginning of each sweep test loopMarcel Admiraal
in SpaceBullet::test_body_motion.
2019-12-09Check that motion is not zero before doing a sweep test.Marcel Admiraal
Fixes #25476.
2019-10-08Fixed RigidBody stuttering when changing collision layer/maskPouleyKetchoupp
- Changing collision layer/mask now only updates the broadphase proxy to avoid the velocity to be reset each time (also avoids unnecessary computations) - No rigid body update at all when the collision layer/mask stays the same - Same changes for Area for optimization purpose Fixes #32577
2019-08-12Replace 'ERR_EXPLAIN' with 'ERR_FAIL_*_MSG' in rest of 'modules/'Robin Hübner
2019-08-07Fixed KinematicCollision.get_local_shape() - the local shape id was never ↵PouleyKetchoupp
set during move_and_collide() Fixes #31144
2019-07-23Fix some code found by Coverity Scan and PVS Studioqarmin
2019-05-19Fix typos with codespellRémi Verschelde
Using codespell 1.15.0. Method: ``` $ cat > ../godot-word-whitelist.txt << EOF ang curvelinear doubleclick leapyear lod merchantibility nd numer ois ony que seeked synching te uint unselect webp EOF $ codespell -w -q 3 -I ../godot-word-whitelist.txt --skip="./thirdparty,*.po" $ git diff // undo unwanted changes ```
2019-03-27KinematicBody performance and quality improvementsDaniel Rakos
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-02-22Revert "Optimized area check"Rémi Verschelde
2019-02-21Merge pull request #26111 from AndreaCatania/areaoptiRémi Verschelde
Optimized area check
2019-02-21Optimized area checkAndrea Catania
2019-02-19Merge pull request #25788 from aqnuep/rayshape_fixRémi Verschelde
Fix RayShape collision when used with a KinematicBody (Bullet Physics)
2019-02-19Fix RayShape collision when used with a KinematicBody (Bullet Physics)Daniel Rakos
- Added code handling non-compound collision to recover_from_penetration_ray() which is now needed due to the optimization avoiding the use of compound collisions when only a single collision shape is used. - Removed arbitrary margin applied in the collision algorithm of RayShapes which causes jittered movement. For lack of a better replacement and for lack of any explanation on why it has been introduced, it's now using the shape's margin property instead which is small enough to not show visible jitter. - Tried to get rid of inconsistent uses of the collision margin. - Removed hack from GodotDeepPenetrationContactResultCallback::addContactPoint for RayShape collision as it's no longer needed as the collision algorithm of RayShapes correctly calculates the contact normal for a while now. Fixes #25227.
2019-02-18Fixed area collision report with concaveAndrea Catania
2019-02-18Added support to scale areasAndrea Catania