summaryrefslogtreecommitdiffstats
path: root/servers/physics_2d_server.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Renaming of servers for coherency.Juan Linietsky2020-03-271-840/+0
| | | | | | | | | | VisualServer -> RenderingServer PhysicsServer -> PhysicsServer3D Physics2DServer -> PhysicsServer2D NavigationServer -> NavigationServer3D Navigation2DServer -> NavigationServer2D Also renamed corresponding files.
* Variant: Added 64-bit packed arrays, renamed Variant::REAL to FLOAT.Juan Linietsky2020-02-251-7/+7
| | | | | | | | | | | | | | | | | | | | | - 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.
* ObjectID converted to a structure, fixes many bugs where used incorrectly as ↵Juan Linietsky2020-02-121-1/+1
| | | | 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.
* Properly expose PhysicsServer methodsLATRio2019-04-301-4/+4
|
* Add a minimum treshold for acquiring rest contacts to avoid numerical ↵Juan Linietsky2019-02-161-0/+1
| | | | precision issues. Fixes #25074
* doc: Sync classref with current sourceRémi Verschelde2019-01-261-1/+1
|
* 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-2/+24
|\ | | | | Fix picking in CanvasLayer
| * Fix picking in CanvasLayerPedro J. Estébanez2018-08-251-2/+24
| | | | | | | | 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.
* | Make core/ includes absolute, remove subfolders from include pathRémi Verschelde2018-09-121-1/+2
| | | | | | | | | | | | 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.
* | PhysicsServer: Add validity checks for shape query parametersRémi Verschelde2018-09-101-16/+8
|/ | | | Fixes #17439.
* Changes to ClippedCamera, RayCast,Raycast2D and 2D physics API to add ↵Juan Linietsky2018-08-211-10/+36
| | | | ability to choose between bodies and areas when colliding.
* doc: Sync classref with current sourceRémi Verschelde2018-07-261-1/+1
| | | | Fix various missing arguments in bindings.
* 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.
* Modified RigidBody, PhysicsDirectBodyState, PhysicsServer, and their ↵Tiger Caldwell2018-07-241-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | respective 2D counterparts to be more consistent and to include more useful methods. RigidBody: - Added add_central_force - Added add_force - Added add_torque - Added apply_central_impulse RigidBody2D: - Added add_central_force - Added add_torque - Added apply_central_impulse - Added apply_torque_impulse PhysicsDirectBodyState: - Added apply_central_impulse Physics2DDirectBodyState: - Added add_central_force - Added add_force - Added add_torque - Added apply_central_impulse - Added apply_impulse - Added apply_torque_impulse PhysicsServer: - Added body_add_force - Added body_add_torque - Added body_add_central_force - Added body_apply_central_impulse Physics2DServer: - Added body_add_torque - Added body_add_central_force - Added body_apply_central_impulse - Added body_apply_torque_impulse Also fixed some small bugs along the way
* Expose methods area_set_area_monitor_callback and area_set_monitorable in ↵MrCdK2018-05-251-0/+2
| | | | PhysicsServer and Physics2DServer
* Improved kinematic body 2D and 3D, Now can move rigid bodyAndrea Catania2018-02-201-3/+4
|
* Fix inconsistencies and typos in argument namesPaolo Perkovic2018-02-011-2/+2
|
* Bind many more properties to scriptsBojidar Marinov2018-01-121-0/+29
| | | | | | | Notable potentially breaking changes: - PROPERTY_USAGE_NOEDITOR is now PROPERTY_USAGE_STORAGE | PROPERTY_USAGE_NETWORK, without PROPERTY_USAGE_INTERNAL - Some properties were renamed, and sometimes even shadowed by new ones - New getter methods (some virtual) were added
* 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!
* Mono: Make the bindings generator output enumsIgnacio Etcheverry2017-12-241-0/+4
| | | | - Switch to PascalCase for constants names
* Made Vector::ptrw explicit for writing, compiler was sometimes using the ↵Juan Linietsky2017-11-251-3/+3
| | | | | | wrong function, leading to unnecesary copy on writes and reduced performance.
* Removed type_mask and fixed some variable nameAndreaCatania2017-11-211-36/+17
|
* Remove node from list before calling queries, fixes #10886Juan Linietsky2017-11-101-1/+1
|
* Reworked how servers preallocate RIDs, should fix #10970Juan Linietsky2017-11-091-1/+9
|
* Merge pull request #12262 from AndreaCatania/pplugJuan Linietsky2017-11-031-0/+67
|\ | | | | Physics server plug
| * Implemented physics plugAndreaCatania2017-11-041-0/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Moved init_physics Implemented physics 2D plug Fix clang Fix clang Fix static check Fix clang Fix static check Moved physics server initialization Moved physics server settings initialization
* | Bind unbound enums, rearrange some by valuePoommetee Ketson2017-10-221-1/+2
|/
* Added new API to get body direct stateAndreaCatania2017-09-291-0/+2
|
* Rename pos to position in user facing methods and variablesletheed2017-09-201-4/+4
| | | | | | | | | | | Rename user facing methods and variables as well as the corresponding C++ methods according to the folloming changes: * pos -> position * rot -> rotation * loc -> location C++ variables are left as is.
* Use HTTPS URL for Godot's website in the headersRémi Verschelde2017-08-271-1/+1
|
* ClassDB: Provide the enum name of integer constantsIgnacio Etcheverry2017-08-201-79/+79
|
* Synchronize parameter names in definition and declarationTwistedTwigleg2017-08-161-8/+8
| | | | Fixes #10244.
* Removes type information from method bindsIgnacio Etcheverry2017-08-101-10/+10
|
* Makes all Godot API's methods Lower CaseIndah Sylvia2017-08-071-4/+4
|
* Refactor 'treshold' to 'threshold'Poommetee Ketson2017-07-081-2/+2
|
* -Trigger shapes removed in 2D, they became obsolete long ago when areas ↵Juan Linietsky2017-06-231-8/+3
| | | | | | | | | | | 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!
* Refactor layer_mask to collision_layerPoommetee Ketson2017-06-141-16/+16
|
* Add "Godot Engine contributors" copyright lineRémi Verschelde2017-04-081-0/+1
|
* A Whole New World (clang-format edition)Rémi Verschelde2017-03-051-373/+331
| | | | | | | | | | | | | | | | | | | | | | | | 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-155/+155
| | | | | | This new name also makes its purpose a little clearer This is a step towards fixing #56
* Style: Fix statements ending with ';;'Rémi Verschelde2017-01-161-1/+1
|
* Style: Fix whole-line commented codeRémi Verschelde2017-01-141-6/+6
| | | | | 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.
* Both Array and Dictionary are always in shared mode (removed copy on write).Juan Linietsky2017-01-111-4/+4
|
* Type renames:Juan Linietsky2017-01-111-5/+5
| | | | | | | | | | | | Matrix32 -> Transform2D Matrix3 -> Basis AABB -> Rect3 RawArray -> PoolByteArray IntArray -> PoolIntArray FloatArray -> PoolFloatArray Vector2Array -> PoolVector2Array Vector3Array -> PoolVector3Array ColorArray -> PoolColorArray
* ObjectTypeDB was renamed to ClassDB. Types are meant to be more generic to ↵Juan Linietsky2017-01-021-155/+155
| | | | | | | | 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!
* -Fixed issue in Kinematicbody2DJuan Linietsky2016-09-011-3/+3
|