summaryrefslogtreecommitdiffstats
path: root/scene/2d/collision_shape_2d.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Use real_t in physics nodesAaron Franke2021-01-291-3/+3
|
* Fix collision shape update when changing shape propertiesPouleyKetchoupp2021-01-121-0/+4
| | | | | | | | | | | | | This change does two things: 1. Properly update the internal shape data using _update_in_shape_owner when updating a shape (in 2D it was resetting one way collision) 2. Avoid unnecessary updates when calling set_shape with the same shape, which happens each time a shape property is modified (e.g shape.extents.x = ...) Fixes #45090
* Update copyright statements to 2021Rémi Verschelde2021-01-011-2/+2
| | | | | | | | | | | | | | 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 🎆
* Reorganized core/ directory, it was too fatty alreadyreduz2020-11-071-1/+1
| | | | | | -Removed FuncRef, since Callable makes it obsolete -Removed int_types.h as its obsolete in c++11+ -Changed color names code
* Provide warning when using polygon shapes in `CollisionShape2D` nodeAndrii Doroshenko (Xrayez)2020-07-031-2/+5
| | | | | | | | | | `ConvexPolygonShape2D` and `ConcavePolygonShape2D` are only meant to be used directly in code and not in the editor for physics-based use cases specifically. Developers are advised to use `CollisionPolygon2D` instead, which does generate those shapes under the hood, handling polygon convexivity, proper orientation etc.
* Style: Enforce braces around if blocks and loopsRémi Verschelde2020-05-141-5/+10
| | | | | Using clang-tidy's `readability-braces-around-statements`. https://clang.llvm.org/extra/clang-tidy/checks/readability-braces-around-statements.html
* Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocksRémi Verschelde2020-05-141-15/+0
| | | | | | | | | | | | | | 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.
* Replace NULL with nullptrlupoDharkael2020-04-021-2/+2
|
* Renaming of servers for coherency.Juan Linietsky2020-03-271-1/+1
| | | | | | | | | | VisualServer -> RenderingServer PhysicsServer -> PhysicsServer3D Physics2DServer -> PhysicsServer2D NavigationServer -> NavigationServer3D Navigation2DServer -> NavigationServer2D Also renamed corresponding files.
* Signals: Port connect calls to use callable_mpRémi Verschelde2020-02-281-3/+2
| | | | | | | | | Remove now unnecessary bindings of signal callbacks in the public API. There might be some false positives that need rebinding if they were meant to be public. No regular expressions were harmed in the making of this commit. (Nah, just kidding.)
* Variant: Added 64-bit packed arrays, renamed Variant::REAL to FLOAT.Juan Linietsky2020-02-251-1/+1
| | | | | | | | | | | | | | | | | | | | | - Renames PackedIntArray to PackedInt32Array. - Renames PackedFloatArray to PackedFloat32Array. - Adds PackedInt64Array and PackedFloat64Array. - Renames Variant::REAL to Variant::FLOAT for consistency. Packed arrays are for storing large amount of data and creating stuff like meshes, buffers. textures, etc. Forcing them to be 64 is a huge waste of memory. That said, many users requested the ability to have 64 bits packed arrays for their games, so this is just an optional added type. For Variant, the float datatype is always 64 bits, and exposed as `float`. We still have `real_t` which is the datatype that can change from 32 to 64 bits depending on a compile flag (not entirely working right now, but that's the idea). It affects math related datatypes and code only. Neither Variant nor PackedArray make use of real_t, which is only intended for math precision, so the term is removed from there to keep only float.
* Reworked signal connection system, added support for Callable and Signal ↵Juan Linietsky2020-02-201-2/+2
| | | | objects and made them default.
* Bugfixes and ability to better specify filter and repeat modes everywhere.Juan Linietsky2020-02-111-1/+1
| | | | Removes antialiased flag for draw_* methods.
* Update copyright statements to 2020Rémi Verschelde2020-01-011-2/+2
| | | | | | | | | | | 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.
* Removed unused variables, add some constants numbersRafał Mikrut2019-12-101-2/+2
|
* Improve 2D RayCast and one-way collision drawingHugo Locurcio2019-07-121-13/+9
| | | | | | | | | | - 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
* Scene: Ensure classes match their header filenameRémi Verschelde2019-02-121-1/+1
| | | | | | | | | | | | | | | | | | Also drop some unused files. Renamed: - `scene/2d/navigation2d.h` -> `navigation_2d.h` - `scene/2d/screen_button.h` -> `touch_screen_button.h` - `scene/3d/scenario_fx.h` -> `world_environment.h` - `scene/audio/audio_player.h` -> `audio_stream_player.h` - `scene/resources/bit_mask.h` -> `bit_map.h` - `scene/resources/color_ramp.h` -> `gradient.h` - `scene/resources/shape_line_2d.h` -> `line_shape_2d.h` - `scene/resources/scene_format_text.h` -> `resource_format_text.h` - `scene/resources/sky_box.h` -> `sky.h` Dropped: - `scene/resources/bounds.h`
* -Re-added margins in one way collision (made in a more user friendly way ↵Juan Linietsky2019-01-181-0/+16
| | | | | | than in Godot 2.1), fixes #23860 -Fixed potential bug in OWC (i dont think anyone had it but..)
* Update copyright statements to 2019Rémi Verschelde2019-01-011-2/+2
| | | | Happy new year to the wonderful Godot community!
* -Moved EditorDefaultValue to ClassDB, made it coreJuan Linietsky2018-11-081-3/+3
| | | | -Removed one and zero hints for properties, replaced by default value
* Make core/ includes absolute, remove subfolders from include pathRémi Verschelde2018-09-121-1/+1
| | | | | | 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.
* Deprecate incorrect Color::gray()Rémi Verschelde2018-08-211-1/+1
| | | | | | | | | | | This average is not a proper approximation of a grayscale value, get_v() is better suited for that. If we want a real to_grayscale() conversion, it's somewhat more involved: https://en.wikipedia.org/wiki/Grayscale Remove the deprecated Gray() from C# bindings as it conflicts with new named color constants.
* Remove the selection rect for nodes that do not require itGilles Roudiere2018-04-031-5/+0
|
* Update collision shapes data on tree enteredPedro J. Estébanez2018-01-111-4/+18
| | | | | | This is needed because the final startup values for shapes may change between parenting and entering the scene tree. For instance, if the collision shape belongs to a inherited scene. Fixes #13835.
* Add missing copyright headers and fix formattingRémi Verschelde2018-01-051-0/+1
| | | | | | 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.
* Merge pull request #15191 from Jerome67000/z_renamingRémi Verschelde2018-01-041-1/+1
|\ | | | | renames "z" Node2D property to "z_index"
| * #15078 renamed "z" -> "z_index" property in Node2DJerome670002018-01-031-1/+1
| |
* | Merge pull request #15093 from poke1024/canvas-editor-selectRémi Verschelde2018-01-031-0/+8
|\ \ | | | | | | More exact picking for canvas editor
| * | More exact picking for canvas editorBernhard Liebl2017-12-271-0/+8
| |/
* / Update copyright statements to 2018Rémi Verschelde2018-01-011-2/+2
|/ | | | Happy new year to the wonderful Godot community!
* Rework the canvas_item API for further improves to the canvas item editorGilles Roudiere2017-11-191-1/+1
|
* Use HTTPS URL for Godot's website in the headersRémi Verschelde2017-08-271-1/+1
|
* Convert Object::cast_to() to the static versionHein-Pieter van Braam2017-08-241-2/+2
| | | | | | | | | | | | 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/
* Removes editor_hint from SceneTreeIgnacio Etcheverry2017-08-191-2/+4
|
* Removes type information from method bindsIgnacio Etcheverry2017-08-101-2/+2
|
* Add object type hint for docsPoommetee Ketson2017-07-191-2/+2
|
* -Trigger shapes removed in 2D, they became obsolete long ago when areas ↵Juan Linietsky2017-06-231-93/+83
| | | | | | | | | | | could detect their own overlap -Added ability to disable individual collisionshape/polygon -Moved One Way Collision to shape, allowing more flexibility -Changed internals of CollisionObject, shapes are generated from child nodes on the fly, not stored inside any longer. -Modifying a CollisionPolygon2D on the fly now works, it can even be animated. Will port this to 3D once well tested. Have fun!
* Add "Godot Engine contributors" copyright lineRémi Verschelde2017-04-081-0/+1
|
* A Whole New World (clang-format edition)Rémi Verschelde2017-03-051-60/+47
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Rename the _MD macro to D_METHODHein-Pieter van Braam2017-02-131-9/+9
| | | | | | This new name also makes its purpose a little clearer This is a step towards fixing #56
* Remove use of _SCS from ADD_METHODHein-Pieter van Braam2017-02-131-3/+3
| | | | This saves typing and is a step towards fixing #56
* CollisionShape2D: Fix warning icon not updating.Andreas Haas2017-01-221-0/+1
| | | | `CollisionPolygon2D` also had this problem.
* ObjectTypeDB was renamed to ClassDB. Types are meant to be more generic to ↵Juan Linietsky2017-01-021-9/+9
| | | | | | | | Variant. All usages of "type" to refer to classes were renamed to "class" ClassDB has been exposed to GDScript. OBJ_TYPE() macro is now GDCLASS()
* Welcome in 2017, dear changelog reader!Rémi Verschelde2017-01-011-1/+1
| | | | | | | | That year should bring the long-awaited OpenGL ES 3.0 compatible renderer with state-of-the-art rendering techniques tuned to work as low as middle end handheld devices - without compromising with the possibilities given for higher end desktop games of course. Great times ahead for the Godot community and the gamers that will play our games!
* -Added configuration warning system for nodesJuan Linietsky2016-05-171-0/+13
| | | | | -Added a new "add" and "instance" buttons for scene tree -Added a vformat() function to ease translation work
* Update copyright to 2016 in headersGeorge Marques2016-01-011-1/+1
|
* -collision debug is shown above all else, fixes #2985Juan Linietsky2015-12-121-0/+6
|
* Move the shape test to a little soonerGeorge Marques2015-09-221-3/+4
|
* Check if shape is valid before referencing itGeorge Marques2015-09-221-0/+3
| | | | See the comment from @MartiniMoe at #2366.
* Ability to visually debug geometry visually:Juan Linietsky2015-09-201-101/+62
|\ | | | | | | | | | | | | -Visible 2D and 3D Shapes, Polygons, Tile collisions, etc. -Visible Navmesh and Navpoly -Visible collision contacts for 2D and 3D as a red point -Customizable colors in project settings