summaryrefslogtreecommitdiff
path: root/servers/physics_2d
AgeCommit message (Collapse)Author
2022-12-13Fix Physics3D and Physics2D CCD sometimes adjusting velocity too much ↵Geekotron
(preventing collision) or not enough (allowing tunneling)
2022-12-07Merge pull request #69674 from rburing/conStraintRémi Verschelde
Fix typo in physics step: contraint -> constraint
2022-12-06Fix typo in physics step: contraint -> constraintRicardo Buring
2022-12-06Fix collision detection for degenerate capsulesRicardo Buring
In GodotCapsuleShape3D::get_supports and GodotCapsuleShape2D::get_supports, return a point instead of an edge of length zero in case the capsule degenerates to a sphere or circle.
2022-11-08Remove duplicate project settings definitionskobewi
2022-10-07Fix MSVC warnings, rename shadowed variables, fix uninitialized values, ↵bruvzg
change warnings=all to use /W4.
2022-10-05Merge pull request #66720 from qarmin/unintialized_memoryRémi Verschelde
Remove usage of unitialized variables
2022-10-01Remove usage of unitialized variablesRafał Mikrut
2022-09-30Fix crash when executing `PhysicsServer2D.joint_clear`Haoyu Qiu
2022-09-29Use `constexpr` in the conditions with template parameters and `sizeof`s to ↵bruvzg
suppress C4127 warnings.
2022-09-28Merge pull request #66548 from akien-mga/msvc-warnings-c4701-c4703Rémi Verschelde
Fix MSVC warnings C4701 and C4703: Potentially uninitialized variable used
2022-09-28Fix MSVC warnings C4701 and C4703: Potentially uninitialized variable usedRémi Verschelde
2022-09-28Fix MSVC warning C4702: unreachable codeRémi Verschelde
Part of #66537.
2022-09-25Add `area_get_collision_layer` and `area_get_collision_mask`Mansur Isaev
2022-09-21Merge pull request #65828 from rburing/body_state_sync_callableRémi Verschelde
make `body_set_state_sync_callback` take a `Callable`
2022-09-19Warn users when collisions are not supportedfabriceci
2022-09-15PhysicsServer2D and PhysicsServer3D: make body_set_state_sync_callback take ↵Ricardo Buring
a Callable Prefer Callable to a C-style callback. This is helpful for GDExtension.
2022-09-14Merge pull request #65048 from rburing/solve_static_world_boundary_motion_2dRémi Verschelde
2022-09-02Add `is_zero_approx` methods to `Vector2`, `3`, and `4`Jonathan Nicholl
2022-08-29Fix collision solving between world boundary and shapes in motion (2D)Ricardo Buring
2022-08-26Merge pull request #64367 from Mickeon/rename-var-to-strRémi Verschelde
Rename `str2var` to `str_to_var` and similar
2022-08-26Rename `str2var` to `str_to_var` and similarMicky
Affects the Math class, a good chunk of the audio code, and a lot of other miscellaneous classes, too. - `var2str` -> `var_to_str` - `str2var` -> `str_to_var` - `bytes2var` -> `bytes_to_var` - `bytes2var_with_objects` -> `bytes_to_var_with_objects` - `var2bytes` -> `var_to_bytes` - `var2bytes_with_objects` -> `var_to_bytes_with_objects` - `linear2db` -> `linear_to_db` - `db2linear` -> `db_to_linear` - `deg2rad` -> `deg_to_rad` - `rad2deg` -> `rad_to_deg` - `dict2inst` -> `dict_to_inst` - `inst2dict` -> `inst_to_dict`
2022-08-26Restore RigidBody2/3D, SoftBody names in physicsfabriceci
2022-08-18Add collision weight to PhysicsBody for penetrations must be avoidedSilc Renew
Co-authored-by: Juan Linietsky <reduzio@gmail.com>
2022-08-07Add area monitor callback error checkingRyan Heath
2022-07-29Remove Signal connect bindsJuan Linietsky
Remove the optional argument p_binds from `Object::connect` since it was deprecated by Callable.bind(). Changed all uses of it to Callable.bind()
2022-07-25Remove ThreadWorkPool, replace by WorkerThreadPoolJuan Linietsky
The former needs to be allocated once per usage. The later is shared for all threads, which is more efficient. It can also be better debugged.
2022-06-20Clean up Hash Functionsreduz
Clean up and do fixes to hash functions and newly introduced murmur3 hashes in #61934 * Clean up usage of murmur3 * Fixed usages of binary murmur3 on floats (this is invalid) * Changed DJB2 to use xor (which seems to be better)
2022-05-20Add a new HashSet templatereduz
* Intended to replace RBSet in most cases. * Optimized for iteration speed
2022-05-19Use range iterators for RBSet in most casesAaron Record
2022-05-18Add motion parameter to toggle whether recovery is reported as a collisionRicardo Buring
This makes the intent explicit in each use case.
2022-05-16Replace most uses of Map by HashMapreduz
* Map is unnecessary and inefficient in almost every case. * Replaced by the new HashMap. * Renamed Map to RBMap and Set to RBSet for cases that still make sense (order matters) but use is discouraged. There were very few cases where replacing by HashMap was undesired because keeping the key order was intended. I tried to keep those (as RBMap) as much as possible, but might have missed some. Review appreciated!
2022-05-03Rename Basis get_axis to get_column, remove redundant methodsAaron Franke
2022-05-03Merge pull request #60627 from aaronfranke/rename-elementsRémi Verschelde
Rename Transform2D and Basis `elements` to `columns` and `rows` respectively
2022-05-02Style: Partially apply clang-tidy's `cppcoreguidelines-pro-type-member-init`Rémi Verschelde
Didn't commit all the changes where it wants to initialize a struct with `{}`. Should be reviewed in a separate PR. Option `IgnoreArrays` enabled for now to be conservative, can be disabled to see if it proposes more useful changes. Also fixed manually a handful of other missing initializations / moved some from constructors.
2022-04-29Rename Transform2D "elements" to "columns"Aaron Franke
2022-04-20Fix more issues found by cppcheck.bruvzg
2022-04-06Fix some issues found by cppcheck.bruvzg
2022-03-23Add protective checks for invalid handle use in BVHlawnjelly
Adds DEV_ASSERTS that will halt at runtime if the BVH is misused with invalid IDs, and adds ERR_FAIL macros to prevent calling with invalid IDs. Any such misuse is a bug in the physics, but this should flag any errors quickly.
2022-03-20Raycasts hitting from inside: return collision point in global coordinatesRicardo Buring
2022-03-16PinJoint2D: fix inertia tensor, taking center of mass into accountRicardo Buring
2022-03-06[4.x] BVH - Fix area-area collision regressionlawnjelly
Minimal approach to fixing regression whereby static areas where not detect dynamic areas.
2022-03-04Merge pull request #57630 from lawnjelly/bvh4_templated_checksRémi Verschelde
[4.x] BVH - Sync BVH with 3.x
2022-02-18In final phase of test_body_motion, move and cull AABB for body once, ↵Ricardo Buring
instead of for every shape
2022-02-16Style: Cleanup single-line blocks, semicolons, dead codeRémi Verschelde
Remove currently unused implementation of TextureBasisU, could be re-added later on if needed and ported.
2022-02-04BVH - Sync BVH with 3.xlawnjelly
Templated mask checks and generic NUM_TREES Fix leaking leaves
2022-01-03Update copyright statements to 2022Rémi Verschelde
Happy new year to the wonderful Godot community!
2021-12-10Merge pull request #55736 from nekomatata/physics-apply-forcesCamille Mohr-Daurat
Improve RigidDynamicBody force and torque API
2021-12-10Merge pull request #55773 from nekomatata/fix-raycast-ccdCamille Mohr-Daurat
Fix rigid body ray cast CCD in 2D and 3D Godot Physics
2021-12-10Fix rigid body ray cast CCD in 2D and 3D Godot PhysicsPouleyKetchoupp
For 2D: Raycast CCD now works the same as in 3D, it changes the body's velocity to place it at the impact position instead of generating a contact point that causes a wrong push back. For both 2D and 3D: The raycast CCD process reads and modifies body velocities, so it needs to be moved to pre_solve() instead of setup() to be processed linearly on the main thread, otherwise multithreading can cause some CCD results to be randomly lost when multiple collisions occur.