summaryrefslogtreecommitdiff
path: root/servers/physics_3d/godot_shape_3d.cpp
AgeCommit message (Collapse)Author
2023-01-21Use range iterators in LocalVector loopskobewi
2023-01-07Merge pull request #70858 from Malcolmnixon/fast-concave-supportRémi Verschelde
Optimize GodotConvexPolygonShape3D::get_support
2023-01-05One Copyright Update to rule them allRémi Verschelde
As many open source projects have started doing it, we're removing the current year from the copyright notice, so that we don't need to bump it every year. It seems like only the first year of publication is technically relevant for copyright notices, and even that seems to be something that many companies stopped listing altogether (in a version controlled codebase, the commits are a much better source of date of publication than a hardcoded copyright statement). We also now list Godot Engine contributors first as we're collectively the current maintainers of the project, and we clarify that the "exclusive" copyright of the co-founders covers the timespan before opensourcing (their further contributions are included as part of Godot Engine contributors). Also fixed "cf." Frenchism - it's meant as "refer to / see".
2023-01-02Micro-optimizations of the GodotConvexPolygonShape3D::get_support function. ↵Malcolm Nixon
Specifically this uses pointer-array-dereference rather than LocalVector<T> dereference as this performs range-checking on known-good indexes. Added more comments. Changed loops back to classic for-iteration style.
2022-12-11Merge pull request #69852 from rburing/heightmap_shape_typo_bugfixRémi Verschelde
Fix typo bug in heightmap shape
2022-12-10Fix typo bug in heightmap shapeRicardo 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-10-18Optimized support function for large meshesPeter Eastman
2022-10-13Optimize Convex CollisionJuan Linietsky
Implements the Gauss Mapping optimization to SAT convex collision test. * Described [here](https://ubm-twvideo01.s3.amazonaws.com/o1/vault/gdc2013/slides/822403Gregorius_Dirk_TheSeparatingAxisTest.pdf) by Dirk Gregorius. * Requires adding of face information to edges in MeshData * Took the chance to convert MeshData to LocalVector for performance.
2022-10-07Fix MSVC warnings, rename shadowed variables, fix uninitialized values, ↵bruvzg
change warnings=all to use /W4.
2022-09-28GodotCylinderShape3D::get_supports: delete dead codeRicardo Buring
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-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-06Fix some issues found by cppcheck.bruvzg
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-01-20Rename or refactor macros to avoid leading underscoresOmar Polo
These are not used consistently and some can conflict with system-specific defines. While here, also delete some unused macros.
2022-01-03Update copyright statements to 2022Rémi Verschelde
Happy new year to the wonderful Godot community!
2021-11-17Fix contact generation with backface collision disabledPouleyKetchoupp
Replaced the previous implementation for backface collision handling (in test_axis function from SAT algorithm) with much simpler logic in the collision generation phase with face shapes, in order to get rid of wrong contacts when backface collision is disabled. Now it just ignores the generated collision if the contact normal is against the face normal, with a threshold to keep edge contacts. Added a special case for soft bodies to invert the collision instead of ignoring it, because for now it's the best solution to avoid soft bodies to go through concave shapes (they use small spheres). This might be replaced with a better algorithm for soft bodies later.
2021-11-16Rename built-in `SGN()` macro to `SIGN()`Hugo Locurcio
This matches the name of the GDScript function (except it's uppercase here).
2021-11-10Add raycast options to hit when starting inside / hit back facesPouleyKetchoupp
Makes the results consistent for all shape types with options to set the desired behavior.
2021-10-18Rename Godot Physics classes from *SW to Godot*PouleyKetchoupp
Also moved MT physics server wrappers to the main servers folder, since they don't have to be implementation specific.