summaryrefslogtreecommitdiffstats
path: root/scene/2d/collision_object_2d.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Use real_t in physics nodesAaron Franke2021-01-291-2/+2
|
* 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 🎆
* Rename empty() to is_empty()Marcel Admiraal2020-12-281-2/+2
|
* Style: Enforce braces around if blocks and loopsRémi Verschelde2020-05-141-16/+27
| | | | | Using clang-tidy's `readability-braces-around-statements`. https://clang.llvm.org/extra/clang-tidy/checks/readability-braces-around-statements.html
* Style: Enforce separation line between function definitionsRémi Verschelde2020-05-141-0/+4
| | | | | | | | | | | | | | | | | | | | | | | 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.
* Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocksRémi Verschelde2020-05-141-38/+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-1/+1
|
* Renaming of servers for coherency.Juan Linietsky2020-03-271-28/+28
| | | | | | | | | | VisualServer -> RenderingServer PhysicsServer -> PhysicsServer3D Physics2DServer -> PhysicsServer2D NavigationServer -> NavigationServer3D Navigation2DServer -> NavigationServer2D Also renamed corresponding files.
* ObjectID converted to a structure, fixes many bugs where used incorrectly as ↵Juan Linietsky2020-02-121-2/+2
| | | | 32 bits.
* 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.
* fix kinematicBody2D jitters when sync_to_physics is turned on, closes #28181RaphaelHunter2019-09-231-7/+3
|
* Remove some unneeded checks in CollisionObject(2D)Michael Alexsander Silva Dias2019-08-301-3/+4
|
* Improve the node configuration warning displayHugo Locurcio2019-07-091-1/+1
| | | | | | | - Refer to properties explicitly when possible - When multiple warnings are returned, always separate them by one blank line to make them easier to distinguish - Improve grammar and formatting
* Allow ColisionObject2D to get shapes from tilemapsBojidar Marinov2019-06-271-3/+4
| | | | Fixes #4454 and likely resolves #22285
* Allow adding disabled shapesShyRed2019-04-231-2/+2
| | | | Adds the ability to directly add disabled shapes to a collision object. Before this commit a shape has always been assumed to be enabled and had to be disabled in an extra step.
* Fix -Wimplicit-fallthrough warnings from GCC 8Rémi Verschelde2019-04-051-3/+4
| | | | | | | | | | | | Adds `FALLTHROUGH` macro to specify when a fallthrough is intentional. Can be replaced by `[[fallthrough]]` if/when we switch to C++17. The warning is now enabled by default for GCC on `extra` warnings level (part of GCC's `-Wextra`). It's not enabled in Clang's `-Wextra` yet, but we could enable it manually once we switch to C++11. There's no equivalent feature in MSVC for now. Fixes #26135.
* -Re-added margins in one way collision (made in a more user friendly way ↵Juan Linietsky2019-01-181-1/+24
| | | | | | 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!
* Merge pull request #21386 from RandomShaper/fix-picking-in-canvas-layersJuan Linietsky2018-11-071-0/+16
|\ | | | | Fix picking in CanvasLayer
| * Fix picking in CanvasLayerPedro J. Estébanez2018-08-251-0/+16
| | | | | | | | New APIs in 2D physics allow intersection queries filtered by CanvasLayer object instance id. Viewport keep an inventory of its descendant CanvasLayers and takes advantage of all that to test picking with the mouse/touch position correctly transformed for each CanvasLayer.
* | Improve ClassDB information for some some signal parametersKelly Thomas2018-09-011-1/+1
|/
* Revert "Take CanvasLayer transform into account for 2D physics"Rémi Verschelde2018-08-231-2/+2
| | | | | | This reverts commit 4839e5f6d9ed1c0afee933009ab44b9913310d27. Fixes #21289.
* Take CanvasLayer transform into account for 2D physicsPedro J. Estébanez2018-08-211-2/+2
| | | | Fixes #18073.
* Reduce unnecessary COW on Vector by make writing explicitHein-Pieter van Braam2018-07-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | This commit makes operator[] on Vector const and adds a write proxy to it. From now on writes to Vectors need to happen through the .write proxy. So for instance: Vector<int> vec; vec.push_back(10); std::cout << vec[0] << std::endl; vec.write[0] = 20; Failing to use the .write proxy will cause a compilation error. In addition COWable datatypes can now embed a CowData pointer to their data. This means that String, CharString, and VMap no longer use or derive from Vector. _ALWAYS_INLINE_ and _FORCE_INLINE_ are now equivalent for debug and non-debug builds. This is a lot faster for Vector in the editor and while running tests. The reason why this difference used to exist is because force-inlined methods used to give a bad debugging experience. After extensive testing with modern compilers this is no longer the case.
* Further fixes to KinematicBody2D API, support for sync motion in moving objectsJuan Linietsky2018-07-171-4/+21
|
* Improve CollisionObject/CollisionObject2D warning messageChris Bradfield2018-02-191-1/+1
|
* Fix minor typo: it's -> itsYuri Chornoivan2018-01-201-1/+1
|
* Before I forget, add warnings on areas without children (should not break ↵Juan Linietsky2018-01-181-0/+14
| | | | | | anything). Seen too many users misunderstanding the edit rect is the shape.
* 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.
* Update copyright statements to 2018Rémi Verschelde2018-01-011-2/+2
| | | | Happy new year to the wonderful Godot community!
* Fix: CollisionObject shape owner indexing is inconsistentdamarindra2017-09-241-1/+1
|
* Use HTTPS URL for Godot's website in the headersRémi Verschelde2017-08-271-1/+1
|
* Removes type information from method bindsIgnacio Etcheverry2017-08-101-3/+3
|
* Makes all Godot API's methods Lower CaseIndah Sylvia2017-08-071-2/+2
|
* expose missing CollisionShape API for CollisionObjectJakub Grzesik2017-07-241-0/+27
|
* Readd tilemap's shape_transform and bugfixesBojidar Marinov2017-07-011-3/+3
| | | | This reverts commit a808f53020aa710ff81392e2349b8a39c55d2717.
* Revert "Fix Tileset/tilemap issues related to my adding of one-way ↵Juan Linietsky2017-07-011-3/+3
| | | | collisions to them"
* Fix #9409, fixup #9370; tileset now has shape transform instead of offsetBojidar Marinov2017-06-301-3/+3
| | | | | | Fix bad return type in CollisionObject2D, Shape -> Shape2D. Was causing unintended null when casting. (9409) Fix a misplaced ++ operator. (9370) Fix merging with exiting tileset duplicating shapes. (9370)
* Simplified 2D Kinematicbody.. 3D will wait a bit.Juan Linietsky2017-06-241-2/+2
|
* -Trigger shapes removed in 2D, they became obsolete long ago when areas ↵Juan Linietsky2017-06-231-166/+173
| | | | | | | | | | | 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!
* Removal of InputEvent as built-in Variant type..Juan Linietsky2017-05-201-3/+3
| | | | this might cause bugs I haven't found yet..
* Add "Godot Engine contributors" copyright lineRémi Verschelde2017-04-081-0/+1
|
* A Whole New World (clang-format edition)Rémi Verschelde2017-03-051-124/+104
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Many fixes to make exported scenes work better, still buggy.Juan Linietsky2017-02-151-0/+2
|
* Rename the _MD macro to D_METHODHein-Pieter van Braam2017-02-131-14/+14
| | | | | | 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-1/+1
| | | | This saves typing and is a step towards fixing #56
* Style: Fix whole-line commented codeRémi Verschelde2017-01-141-2/+2
| | | | | They do not play well with clang-format which aligns the `//` part with the rest of the code block, thus producing badly indented commented code.
* New API for visibility in both CanvasItem and SpatialJuan Linietsky2017-01-131-1/+1
| | | | | | visible (property) - access set_visible(bool) is_visible() is_visible_in_tree() - true when visible and parents visible show() hide() - for convenience
* Must now register with set_transform_notify() to get ↵Juan Linietsky2017-01-121-0/+1
| | | | NOTIFICATION_TRANSFORM_CHANGED
* Renamed most signals so they refer to:Juan Linietsky2017-01-121-4/+4
| | | | | -An action being requested to the user in present tense: (ie, draw, gui_input, etc) -A notification that an action happened, in past tense (ie, area_entered, modal_closed, etc).