summaryrefslogtreecommitdiff
path: root/scene/2d/ray_cast_2d.cpp
AgeCommit message (Collapse)Author
2022-02-15Use `switch` consistently in `_notification` (`scene` folder)Rémi Verschelde
2022-02-12Improve compilation speed (forward declarations/includes cleanup)Hendrik Brucker
2022-02-08Fix RayCast{2,3}D.clear_exceptions clears parentHaoyu Qiu
2022-01-28Improve some method bindings to use specific `Object` subtypesRémi Verschelde
This was made possible by changes to `VariantCaster` which now make it possible to pass any `Object`-derived type as pointer.
2022-01-12Use List Initializations for Vectors.Anilforextra
2022-01-03Update copyright statements to 2022Rémi Verschelde
Happy new year to the wonderful Godot community!
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-11-04Use parameter classes instead of arguments for all physics queriesPouleyKetchoupp
Same as what is already done for shape queries, applied to point and ray queries. Easier to document and more flexible to add more parameters. Also expose intersect_point method to script in 3D. Remove intersect_point_on_canvas in 2D, replaced with a parameter.
2021-10-23Fix unexpected crashes in `notification`Zae
2021-08-13Fix some unnecessary includesAaron Franke
2021-08-12Uniformize layer names, script methods and documentationPouleyKetchoupp
- Back to 1-based layer names to make it clearer in editor UI - Layer bit accessors are renamed to layer value and 1-based too - Uniform errors and documentation in render and physics - Fix a few remaining collision_layer used in place of collision_mask
2021-08-09Some work on double supportAaron Franke
2021-04-30Prevent setting too big or too small Collision Mask and LayerRafał Mikrut
2021-03-05add responsive arrows when the size is very small + fix a regression: ↵fabriceci
missing a translation on the line
2021-03-05Highlight collision, correct the size and make the arrow a bit less thick ↵fabriceci
for low-res game
2021-02-07Initialize class variables with default values in scene/ [1/2]Rafał Mikrut
2021-01-01Update copyright statements to 2021Rémi Verschelde
Happy new year to the wonderful Godot community! 2020 has been a tough year for most of us personally, but a good year for Godot development nonetheless with a huge amount of work done towards Godot 4.0 and great improvements backported to the long-lived 3.2 branch. We've had close to 400 contributors to engine code this year, authoring near 7,000 commit! (And that's only for the `master` branch and for the engine code, there's a lot more when counting docs, demos and other first-party repos.) Here's to a great year 2021 for all Godot users 🎆
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-09-10Rename RayCast's `cast_to` property to `target_position`Hugo Locurcio
`cast_to` is sometimes mistaken as a method rather than a property. `target_position` makes it more obvious that it's a property.
2020-05-27Enable raycast nodes by defaultAndrii Doroshenko (Xrayez)
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: Enforce separation line between function definitionsRémi Verschelde
I couldn't find a tool that enforces it, so I went the manual route: ``` find -name "thirdparty" -prune \ -o -name "*.cpp" -o -name "*.h" -o -name "*.m" -o -name "*.mm" \ -o -name "*.glsl" > files perl -0777 -pi -e 's/\n}\n([^#])/\n}\n\n\1/g' $(cat files) misc/scripts/fix_style.sh -c ``` This adds a newline after all `}` on the first column, unless they are followed by `#` (typically `#endif`). This leads to having lots of places with two lines between function/class definitions, but clang-format then fixes it as we enforce max one line of separation. This doesn't fix potential occurrences of function definitions which are indented (e.g. for a helper class defined in a .cpp), but it's better than nothing. Also can't be made to run easily on CI/hooks so we'll have to be careful with new code. Part of #33027.
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-04-02Replace NULL with nullptrlupoDharkael
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-12ObjectID converted to a structure, fixes many bugs where used incorrectly as ↵Juan Linietsky
32 bits.
2020-02-11Bugfixes and ability to better specify filter and repeat modes everywhere.Juan Linietsky
Removes antialiased flag for draw_* methods.
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-10Removed unused variables, add some constants numbersRafał Mikrut
2019-07-12Improve 2D RayCast and one-way collision drawingHugo Locurcio
- Make RayCast2D gray when it's disabled - Make the one-way collision arrow use the inverted shape debugging color (will result in an orange color by default) - This makes it easier to distinguish it from RayCast2D arrows - Make lines slightly thinner - Make the RayCast2D arrow tip larger - Use anti-aliasing for the RayCast2D and one-way collision lines
2019-01-01Update copyright statements to 2019Rémi Verschelde
Happy new year to the wonderful Godot community!
2018-09-12Make core/ includes absolute, remove subfolders from include pathRémi Verschelde
This allows more consistency in the manner we include core headers, where previously there would be a mix of absolute, relative and include path-dependent includes.
2018-08-30RayCast2D: Fix reporting old collider after collision endedRémi Verschelde
It now behaves the same as RayCast (3D). Fixed documentation accordingly and documented new configuration options. Supersedes and closes #20567.
2018-08-21Changes to ClippedCamera, RayCast,Raycast2D and 2D physics API to add ↵Juan Linietsky
ability to choose between bodies and areas when colliding.
2018-04-11Use internal physics processing for Nodes' internal logicRémi Verschelde
2018-01-05Add missing copyright headers and fix formattingRémi Verschelde
Using `misc/scripts/fix_headers.py` on all Godot files. Some missing header guards were added, and the header inclusion order was fixed in the Bullet module.
2018-01-01Update copyright statements to 2018Rémi Verschelde
Happy new year to the wonderful Godot community!
2017-11-28Change RayCast2D 'Exclude Parent' to include Area2DChris Bradfield
2017-11-21Removed type_mask and fixed some variable nameAndreaCatania
2017-10-23missing set/get_collision_mask_bit() for RayCastJakub Grzesik
in the same fastion how it's implemented in Area or Bodies
2017-10-21Rename RayCasts collision_layer to collision_maskPedro J. Estébanez
The point is that `RayCast`s are checked against objects' `collision_layer`(s), but they themselves are considered no to _belong_ to any layer. Therefore, the correct name for their property is `collision_mask`, rather than `collision_layer`. Only renaming is needed since the behavior was already the right one, only that it wasn't matching what users would expect from the name and description of the property. Fixes #7589, where it's also discussed.
2017-09-30Renamed fixed_process to physics_processAndreaCatania
2017-08-27Use HTTPS URL for Godot's website in the headersRémi Verschelde
2017-08-24Convert Object::cast_to() to the static versionHein-Pieter van Braam
Currently we rely on some undefined behavior when Object->cast_to() gets called with a Null pointer. This used to work fine with GCC < 6 but newer versions of GCC remove all codepaths in which the this pointer is Null. However, the non-static cast_to() was supposed to be null safe. This patch makes cast_to() Null safe and removes the now redundant Null checks where they existed. It is explained in this article: https://www.viva64.com/en/b/0226/
2017-08-19Removes editor_hint from SceneTreeIgnacio Etcheverry
2017-06-14Refactor layer_mask to collision_layerPoommetee Ketson
2017-05-08RayCast2D: fix detached arrow tipPoommetee Ketson
2017-04-08Add "Godot Engine contributors" copyright lineRémi Verschelde
2017-03-05A Whole New World (clang-format edition)Rémi Verschelde
I can show you the code Pretty, with proper whitespace Tell me, coder, now when did You last write readable code? I can open your eyes Make you see your bad indent Force you to respect the style The core devs agreed upon A whole new world A new fantastic code format A de facto standard With some sugar Enforced with clang-format A whole new world A dazzling style we all dreamed of And when we read it through It's crystal clear That now we're in a whole new world of code
2017-02-13Rename the _MD macro to D_METHODHein-Pieter van Braam
This new name also makes its purpose a little clearer This is a step towards fixing #56