Commit graph

57 commits

Author SHA1 Message Date
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
Juan Linietsky
9df77d2765 ability to run 2D physics in a thread
also, 2D physics is now thread safe too.
see physics_2d/thread_model
2015-05-26 01:06:05 -03:00
Fabio Alessandrelli
590afbcac4 Calculate gravity based on distance from body to gravity point (2D) 2015-05-18 01:32:26 +00:00
Juan Linietsky
af06843982 -new collision layer & mask system for 2D, for more flexible collision masking 2015-05-03 16:47:21 -03:00
Juan Linietsky
28c4afeb57 -Rewritten KinematicBody2D::move to MUCH more efficient code.
-KinematicBody2D::move now properly recognizes collision exceptions and masks, fixes #1649
-Removed object type masking for KinematicBody2D
-Added a test_motion() function to RigidBody2D, allowing simlar behavior to KinematicBody2D::move there.
2015-04-19 20:50:55 -03:00
Juan Linietsky
fdaa2920eb Updated copyright year in all headers 2015-04-18 14:38:54 -03:00
Juan Linietsky
dac2017dee fixes/cleans up
-input now correctly works when using viewport scaling
-added function to get areas/bodies in given point
-added function to get space state directly from world
2015-03-22 09:40:26 -03:00
Juan Linietsky
c6c72a3c37 input events on Area2D is now supported
also added a demo showing how this works
2015-03-22 01:46:18 -03:00
Juan Linietsky
a969e2e6f1 Area2D can now detect overlap with other areas
this should make everything simpler, specially for newcomers to Godot
2015-03-17 00:45:25 -03:00
Juan Linietsky
9012cd408e -Add support for one-way collision in 2D (only works for kinematic body so far)
-Solve drawing order bug introduced in previous commit: solves #1214
2015-01-13 21:19:11 -03:00
Juan Linietsky
2ef5a342e3 -begin work on unidirectional collision detection
-fixed performance issue in new 2D engine
-texscreen() working in shader 2D
2015-01-13 10:49:26 -03:00