Commit graph

67 commits

Author SHA1 Message Date
marxin c33a924c28 Fix new GCC 9 warnings: -Wdeprecated-copy.
(cherry picked from commit 6be77da7eb)
2019-04-20 22:04:25 +02:00
Juan Linietsky ee464f56c4 Add a minimum treshold for acquiring rest contacts to avoid numerical precision issues. Fixes #25074 2019-02-16 13:45:01 -03:00
Juan Linietsky f439b786ea Allow kinematic bodies without shapes to still move, fixes #24775 2019-02-16 11:06:44 -03:00
Juan Linietsky d8b702b566 -Re-added margins in one way collision (made in a more user friendly way than in Godot 2.1), fixes #23860
-Fixed potential bug in OWC (i dont think anyone had it but..)
2019-01-18 14:15:05 -03:00
Rémi Verschelde b16c309f82 Update copyright statements to 2019
Happy new year to the wonderful Godot community!
2019-01-01 12:58:10 +01:00
Juan Linietsky 0b1e93ccd4 -Make sure monitorable cant be flipped while flushing queries, fixes #17330
-Also added set_deferred, this was missing.
2018-11-16 08:49:26 -03:00
Juan Linietsky daa1686772
Merge pull request #21386 from RandomShaper/fix-picking-in-canvas-layers
Fix picking in CanvasLayer
2018-11-07 17:51:27 -03:00
Rémi Verschelde 7b081a7fc8 Fix warnings about unhandled enum value in switch [-Wswitch]
Fixes GCC 5 warnings of the form:

core/io/http_client.cpp:288:9: warning: enumeration value 'STATUS_SSL_HANDSHAKE_ERROR' not handled in switch [-Wswitch]
core/io/marshalls.cpp:806:9: warning: enumeration value 'AABB' not handled in switch [-Wswitch]

Those can be trivial cases where adding a default fallback is the solution,
or more complex issues/hidden bugs where missed values are actually meant
to be handled.
2018-09-27 18:34:30 +02:00
Rémi Verschelde 277b24dfb7 Make core/ includes absolute, remove subfolders from include path
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-09-12 09:52:22 +02:00
Pedro J. Estébanez 6d0f4a4ad7 Fix picking in CanvasLayer
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.
2018-08-25 00:03:26 +02:00
Juan Linietsky ee07fb5ebe Changes to ClippedCamera, RayCast,Raycast2D and 2D physics API to add ability to choose between bodies and areas when colliding. 2018-08-21 15:31:23 -03:00
Juan Linietsky 14fd797c53
Merge pull request #20381 from AndreaCatania/phymat_2
Improved Physics material
2018-08-07 15:31:26 -03:00
Andrea Catania 5e65e28eed Removed physics material combination mode. Added rough and absorbent parameter to material. Fixed 'change' signal connection 2018-08-07 19:38:04 +02:00
Tiger Caldwell 40c7716586 Modified RigidBody, PhysicsDirectBodyState, PhysicsServer, and their 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
2018-07-24 05:00:56 -04:00
Juan Linietsky 1ad20dc2f1
Merge pull request #12403 from AndreaCatania/phymat
Physics material
2018-07-23 07:37:03 -03:00
Juan Linietsky 063a22851a -Added support for raycast in KinematicBody2D
-Added support for snapping in KinematicBody2D
2018-07-16 20:04:07 -03:00
AndreaCatania 5f66734d2d Implemented physics material
Hidden a function

Fixed travis static check
2018-05-11 03:23:09 +02:00
Andrea Catania 6ed392f47a Improved kinematic body 2D and 3D, Now can move rigid body 2018-02-20 12:43:47 +01:00
Andrea Catania a42765dada Added physics API in order to enable/disable collisions between rigidbody attached to a joint with bullet physics bullet
Fixes #16424
2018-02-05 18:54:07 +01:00
Rémi Verschelde e4213e66b2 Add missing copyright headers and fix formatting
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-05 01:22:23 +01:00
Rémi Verschelde b50a9114b1 Update copyright statements to 2018
Happy new year to the wonderful Godot community!
2018-01-01 14:40:47 +01:00
Rémi Verschelde 13c2ff9320 Style: Apply new clang-format 5.0 style to all files 2017-12-07 08:02:00 +01:00
AndreaCatania d6e413bb9c Removed type_mask and fixed some variable name 2017-11-21 22:56:40 +01:00
Juan Linietsky 192a4d7de5 Reworked how servers preallocate RIDs, should fix #10970 2017-11-09 23:35:34 -03:00
AndreaCatania 7a9ca08f16 Implemented physics plug
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
2017-11-04 03:25:51 +01:00
AndreaCatania c56c67db39 Added new API to get body direct state 2017-09-29 17:33:30 +02:00
letheed 5ad9be4c24 Rename pos to position in user facing methods and variables
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.
2017-09-20 13:11:10 +02:00
Rémi Verschelde bd282ff43f Use HTTPS URL for Godot's website in the headers 2017-08-27 14:16:55 +02:00
Ignacio Etcheverry 32dd9a9f66 ClassDB: Provide the enum name of integer constants 2017-08-20 22:07:43 +02:00
Indah Sylvia 5ae78fdf6a Makes all Godot API's methods Lower Case 2017-08-07 18:24:35 +07:00
Poommetee Ketson 2fd204c35e Refactor 'treshold' to 'threshold' 2017-07-08 22:24:56 +07:00
Juan Linietsky bc509ac7bd Simplified 2D Kinematicbody.. 3D will wait a bit. 2017-06-24 12:34:29 -03:00
Juan Linietsky 6ba1e4677b -Trigger shapes removed in 2D, they became obsolete long ago when areas 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!
2017-06-23 23:39:52 -03:00
Poommetee Ketson 6c44fff508 Refactor layer_mask to collision_layer 2017-06-14 10:58:34 +07:00
Rémi Verschelde df61dc4b2b Add "Godot Engine contributors" copyright line 2017-04-08 00:11:42 +02:00
Rémi Verschelde 5dbf1809c6 A Whole New World (clang-format edition)
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-03-05 16:44:50 +01:00
Juan Linietsky bc26f90581 Type renames:
Matrix32 -> Transform2D
	Matrix3 -> Basis
	AABB -> Rect3
	RawArray -> PoolByteArray
	IntArray -> PoolIntArray
	FloatArray -> PoolFloatArray
	Vector2Array -> PoolVector2Array
	Vector3Array -> PoolVector3Array
	ColorArray -> PoolColorArray
2017-01-11 00:52:51 -03:00
Juan Linietsky 118eed485e ObjectTypeDB was renamed to ClassDB. Types are meant to be more generic to 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()
2017-01-02 23:03:46 -03:00
Rémi Verschelde c7bc44d5ad Welcome in 2017, dear changelog reader!
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!
2017-01-01 22:03:33 +01:00
Juan Linietsky 5fc084c28e -Fixed issue in Kinematicbody2D 2016-09-01 12:03:55 -03:00
Juan Linietsky a75f896338 First version of Profiler
It is now possible to profile GDScript as well as some parts of Godot
internals.
2016-05-21 21:18:16 -03:00
Josh Grams a7b4127481 RigidBody2D (add_force, set_inertia): new methods. 2016-04-26 08:15:15 -04:00
Josh Grams f7d31cec38 RigidBody2D: add and bind get_inertia() method.
You can't set this value very well, since it's automatically computed
from the mass and the collision shapes. But since the values are higher
than many people might suspect, so being able to read it helps estimate
the amount of torque you might need to apply.
2016-04-20 20:49:37 -04:00
Hubert Jarosz 4a4f247914
remove trailing whitespace 2016-03-09 00:00:52 +01:00
Biliogadafr e8c5b41dd8 Physics2D: Allow to use 'intersect_point' with objects which is not 'pickable' 2016-02-01 04:30:16 +03:00
George Marques 5be9ff7b67 Update copyright to 2016 in headers 2016-01-01 11:50:53 -02:00
Ovnuniarchos 89efebbf56 New and corrected are override modes. 2015-12-14 02:56:49 +01:00
Biliogadafr 2ffc90d8b4 Expose softness parameter of pin joint to the editor. 2015-10-10 23:28:05 +03:00
Juan Linietsky 83d9a692be Ability to visually debug geometry visually:
-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
2015-09-20 13:03:46 -03:00
Juan Linietsky 5064cc5006 Merge pull request #1932 from Faless/gravity_distance_full
Calculate gravity based on distance from body to gravity point
2015-06-07 00:25:37 -03:00