Commit graph

144 commits

Author SHA1 Message Date
alexholly
935f730170 renamed all Rect3.pos to Rect3.position 2017-06-09 15:54:02 +02:00
Rémi Verschelde
c8aea60324 Improve documentation of thirdparty code snippets 2017-05-07 11:42:37 +02:00
Rémi Verschelde
5ae1e172da Merge pull request #8277 from tagcup/math_checks
Added various functions basic math classes. Also enabled math checks …
2017-04-24 11:16:20 +02:00
Rémi Verschelde
df61dc4b2b Add "Godot Engine contributors" copyright line 2017-04-08 00:11:42 +02:00
Ferenc Arn
9a37ff1e34 Added various functions basic math classes. Also enabled math checks only for debug builds.
Added set_scale, set_rotation_euler, set_rotation_axis_angle. Addresses #2565 directly.
Added an euler angle constructor for Basis in GDScript and also exposed is_normalized for vectors and quaternions.
Various other changes mostly cosmetic in nature.
2017-04-06 13:03:56 -05:00
Rémi Verschelde
debeee56f7 Fix typos in source code using codespell
From https://github.com/lucasdemarchi/codespell
2017-03-24 21:45:31 +01: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
Rémi Verschelde
45438e9918 Style: prevent bogus macro formatting by clang-format
Also prevent formatting of thirdparty snippet
2017-03-05 16:29:53 +01:00
Rémi Verschelde
a1cbe8e22b Merge pull request #7878 from RebelliousX/else
Bunch of missing `else` statements and general logic
2017-02-28 23:03:10 +01:00
Saracen
5e938f0001 Inf and NaN support added to GDScript. 2017-02-28 21:52:33 +00:00
Thaer Razeq
f50488a361 Various fixes detected using PVS-Studio static analyzer.
- Add FIXME tags comments to some unfixed potential bugs
- Remove some checks (always false: unsigned never < 0)
- Fix some if statements based on reviews.
- Bunch of missing `else` statements
2017-02-28 07:52:02 -06:00
Rémi Verschelde
f13e87e257 Merge pull request #7802 from tagcup/physics_64bit
Use real_t as floating point type in physics code.
2017-02-26 20:10:54 +01:00
Juan Linietsky
de0045cf1b -renamed globals.h to global_config.cpp (this seems to have caused a few modified files)
-.pck and .zip exporting redone, seems to be working..
2017-02-21 00:06:30 -03:00
Ferenc Arn
eae94ba1c8 Use real_t as floating point type in physics code.
This is a continuation of an on-going work for 64-bit floating point builds, started in PR #7528. Covers physics, physics/joints and physics_2d code.

Also removed matrixToEulerXYZ function in favor of Basis::get_euler.
2017-02-13 17:42:02 -06:00
m4nu3lf
0d9b53ce5e Fixed property setter in G6DOF joint 2017-02-03 21:23:23 +00:00
Rémi Verschelde
f44ee891be Style: Fix statements ending with ';;' 2017-01-16 08:49:52 +01:00
Rémi Verschelde
3890256fc5 Style: Cleanups, added headers, renamed files
Made sure files in core/ and tools/ have a proper Godot license header
when written by us. Also renamed aabb.{cpp,h} and object_type_db.{cpp,h}
to rect3.{cpp,h} and class_db.{cpp,h} respectively.

Also added a proper header to core/io/base64.{c,h} after clarifying
the licensing with the original author (public domain).
2017-01-16 08:04:23 +01:00
Rémi Verschelde
e0faf8a51b Style: Cosmetic fixes to play nice with clang-format 2017-01-15 16:42:17 +01:00
Juan Linietsky
52e2a1e98d fixed to 2D physics, makes it work again 2017-01-15 09:50:27 -03:00
Rémi Verschelde
93ab45b6b5 Style: Fix whole-line commented code
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.
2017-01-14 14:52:23 +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
710692278d Merge pull request #7426 from m4nu3lf/bugfix/physics
Fixed inertia tensor computation and center of mass
2017-01-10 22:27:32 -03:00
m4nu3lf
2e38b32e0f Fixed inertia tensor computation and center of mass 2017-01-09 00:13:54 +00:00
Juan Linietsky
2ab83e1abb Memory pool vectors (DVector) have been enormously simplified in code, and renamed to PoolVector 2017-01-07 18:26:38 -03:00
Juan Linietsky
0f7af4ea51 -Changed most project settings in the engine, so they have major and minor categories.
-Changed SectionedPropertyEditor to support this
-Renamed Globals singleton to GlobalConfig, makes more sense.
-Changed the logic behind persisten global settings, instead of the persist checkbox, a revert button is now available
2017-01-05 09:16:00 -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
3f3f5a5359 Merge remote-tracking branch 'origin/gles3' into gles3-on-master
Various merge conflicts have been fixed manually and some mistakes
might have been made - time will tell :)
2017-01-02 21:52:26 +01: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
Rémi Verschelde
d4c17700aa style: Fix PEP8 whitespace issues in Python files
Done with `autopep8 --select=E2,W2`, fixes:

- E201 - Remove extraneous whitespace.
- E202 - Remove extraneous whitespace.
- E203 - Remove extraneous whitespace.
- E211 - Remove extraneous whitespace.
- E221 - Fix extraneous whitespace around keywords.
- E222 - Fix extraneous whitespace around keywords.
- E223 - Fix extraneous whitespace around keywords.
- E224 - Remove extraneous whitespace around operator.
- E225 - Fix missing whitespace around operator.
- E226 - Fix missing whitespace around operator.
- E227 - Fix missing whitespace around operator.
- E228 - Fix missing whitespace around operator.
- E231 - Add missing whitespace.
- E231 - Fix various deprecated code (via lib2to3).
- E241 - Fix extraneous whitespace around keywords.
- E242 - Remove extraneous whitespace around operator.
- E251 - Remove whitespace around parameter '=' sign.
- E261 - Fix spacing after comment hash.
- E262 - Fix spacing after comment hash.
- E265 - Format block comments.
- E271 - Fix extraneous whitespace around keywords.
- E272 - Fix extraneous whitespace around keywords.
- E273 - Fix extraneous whitespace around keywords.
- E274 - Fix extraneous whitespace around keywords.
- W291 - Remove trailing whitespace.
- W293 - Remove trailing whitespace.
2016-11-01 00:35:16 +01:00
Rémi Verschelde
fc8ccd5b8c SCsub: Add python shebang as a hint for syntax highlighting
Also switch existing shebangs to "better" /usr/bin/env python.
2016-10-17 20:10:46 +02:00
Juan Linietsky
22d83bc9f6 Begining of GLES3 renderer:
-Most 2D drawing is implemented
-Missing shaders
-Missing all 3D
-Editor needs to be set on update always to be used, otherwise it does not refresh
-Large parts of editor not working
2016-10-03 21:35:16 +02:00
Fabio Alessandrelli
1d09c27ba4 Expose more 2D/3D physics options in project settings 2016-10-03 14:40:47 +02:00
Alex Piola
ffdd9f16dd Fix for incorrect velocity report due to a typo.
Closes #5854
2016-07-24 12:53:07 +02:00
Rémi Verschelde
f40f360a2c Remove unused variables (fourth pass) + dead code
Also fix a potential regression from 3fcb9b1ec1.
2016-07-08 16:47:55 +02:00
Rémi Verschelde
c3bf11d4d4 Drop fully commented-out files
Part of #5272
2016-06-18 20:23:49 +02:00
Rémi Verschelde
80727b6896 Drop empty .cpp files for header-only classes
Part of #5272
2016-06-18 20:00:08 +02:00
Rémi Verschelde
a7fc04626a Add missing license headers in our source files (#5255)
Also removes a couple wrong Godot headers from third-party source files.
2016-06-18 14:46:12 +02:00
Carter Anderson
7df5249779 Remove noisy print 2016-05-23 22:56:32 -07: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
Bojidar Marinov
f7c3d6329c Port collision and layer masks to 3D, fixes #1759
Raycasts now have type_mask and layer_mask. Areas - collision_mask and layer_mask. PhysicsBodies needed only collision_mask.
2016-04-09 22:11:12 +03:00
Hubert Jarosz
4a4f247914
remove trailing whitespace 2016-03-09 00:00:52 +01:00
Juan Linietsky
d01f55a78e Merge pull request #2698 from Faless/add_area_fix
Fix bug in Body(2D)SW::add_area
2016-01-23 23:07:23 -03:00
Juan Linietsky
cb9dfd5d28 avoid crash with empty concavepolygonshape, fixes #3169 2016-01-10 17:25:20 -03:00
Juan Linietsky
1aaf507ffb change intersect_ray function to discriminate pickable objects, fixes #3203 2016-01-10 15:54:57 -03:00
Juan Linietsky
27c47e09a1 skip the first integration in physics bodies, fixes #2213 2016-01-02 13:28:18 -03:00
George Marques
5be9ff7b67 Update copyright to 2016 in headers 2016-01-01 11:50:53 -02:00
Rémi Verschelde
d1caf2f037 Remove bogus argument in body_get_node 2015-12-28 01:32:12 +01:00
Ovnuniarchos
89efebbf56 New and corrected are override modes. 2015-12-14 02:56:49 +01:00
Juan Linietsky
ff936c6b2e Merge pull request #2868 from akien-mga/pr-fix-can-move-to
Fix can_move_to and rename it for more clarity
2015-12-08 17:09:47 -03:00
Ovnuniarchos
43b2c9c7a4 Areas now calculate their dampenings the same way as their gravity. 2015-12-08 18:45:14 +01:00
Rémi Verschelde
9457211f8f Fix wrong index being used to populate r_results
Regression from f33d9da.
2015-12-04 09:31:01 +01:00
Fabio Alessandrelli
1231c795de Fix Body (and Body2D) add_area / remove_area when area have multiple shapes 2015-12-02 11:30:48 +01:00
Rémi Verschelde
f33d9dab5b Fix can_move_to and rename it for more clarity
Fixes #2416.
The KinematicBody::can_move_to function was likely designed for two behaviours:
 - discrete: check if the body can "teleport" to the destination
 - continuous: check if the direct path to the destination is valid
The continuous behaviour was however not implemented, and the discrete behaviour was broken too due to a wrong call to intersect_shape.

The discrete behaviour has thus been fixed and the function renamed to can_teleport_to for more clarity.
2015-11-22 14:14:07 +01:00
Rémi Verschelde
399b1b0474 Cosmetic fixes to SCons buildsystem
- Removed trailing spaces
- Made sure all indentation is done using tabs (fixes #39)
- Potentially fixed an identation issue for openssl check
2015-11-01 20:53:26 +01:00
Juan Linietsky
b217e1417a Merge pull request #2479 from firefly2442/cppcheck-unusedvars
ran cppcheck, found unused variables
2015-10-17 10:25:36 -03:00
eska
375a7a727f Fix 3D Area mask matching 2015-10-10 02:33:26 +02:00
reduz
aad2bbdb6f newline fixes 2015-10-08 15:00:40 -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
firefly2442
afbb6c064c ran cppcheck, found unused variables 2015-09-16 15:35:30 -05:00
Juan Linietsky
b0aa49accb merged some stuff for okam 2015-09-03 23:24:55 -03:00
Juan Linietsky
2d8866574d Added gravity scale, and linear/angular damp override to 3D physics. 2015-08-30 18:57:17 -03:00
Juan Linietsky
89300b70e7 added ability for Area (3D) to detect other areas 2015-06-12 15:52:21 -03:00
Fabio Alessandrelli
473c7222f5 Calculate gravity based on distance from body to gravity point 2015-05-18 01:30:43 +00:00
Juan Linietsky
bbe9a37f1d sleeping property now should work properly, fixes #1892 2015-05-16 17:54:36 -03:00
ehriche
897a1aade5 optional formal changes 2015-05-06 01:22:31 +02:00
ehriche
670d77813f PhysicsServerSW::body_is_shape_set_as_trigger - missing return statement 2015-05-06 00:41:41 +02:00
Juan Linietsky
4804462ee0 -Fixes from source code analyzizer, closes #1768 2015-05-01 10:44:08 -03:00
Juan Linietsky
3bcb930e8a properly wake up bodies when a parameter changes, fixes #1740 2015-04-26 16:20:00 -03:00
Juan Linietsky
81f36b768d fixes crash related to empty concavecollisionshape, fixes #1709 2015-04-26 13:03:01 -03:00
Juan Linietsky
f92a1fd646 Merge pull request #1691 from Faless/area_combine_2d
Implement Area2D space_override_mode = COMBINE
2015-04-18 14:44:59 -03:00
Juan Linietsky
fdaa2920eb Updated copyright year in all headers 2015-04-18 14:38:54 -03:00
Fabio Alessandrelli
e1bfbcfd42 Fix operator definition for AreaCMP 2015-04-14 16:46:52 +00:00
Fabio Alessandrelli
600bae34bd Re-sort Area array during integration step 2015-03-24 18:46:26 +00:00
Fabio Alessandrelli
18a1403fcf Implement combine mode for area 2015-03-24 18:46:26 +00:00
Fabio Alessandrelli
4b3b5eba86 Use Vector for storing areas 2015-03-24 18:46:26 +00:00
Juan Linietsky
e9f94ce8d2 fix area center of gravity 2015-03-22 15:11:36 -03:00
Juan Linietsky
c2d975582c Merge pull request #1446 from UsernameIsAReservedWord/fixes_kinematicbody_move_crash
should fixes #1284 (KinematicBody .move() crash)
2015-03-22 14:56:30 -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
UsernameIsAReservedWord
69cf996ce6 should fixes #1284
I could reproduce the crash described in #1284 only with 32bits versions of godot.

The test scene contains a Plane collision shape, and a kinematicsbody with a Sphere collision shape.
 
The crash occurs into `CollisionSolverSW::solve_distance_plane()` on line 299 when `p_shape_A` is a `PlaneShapeSW` object and when `p_shape_B` is a `MotionShapeSW` object, because `int support_count;` is not initialized by default, and because `MotionShapeSW::get_supports()` does not change `support_count` once passed as referenced parameter, and if the default value of `support_count` is greater than the length of `supports[16]`.

I don't know if it is the good way to fix it because i'm not skilled ennough with the physics server inner working, but this fix prevents the crash and the test-scene seems to work correctly.
2015-02-26 19:27:32 +01:00
Juan Linietsky
f75ae815d5 -CCD in 3D physics was not working (code was not even there!) re-added, fixes 1067 2015-01-05 23:00:35 -03:00
Juan Linietsky
8c4dd8de39 -WIP to add proper key swapping according to keyboard layout
-fix with non working removal of collision exception in 3D physics
2015-01-04 21:16:40 -03:00
Juan Linietsky
c79be979d4 Batch of Bugfixes
-=-=-=-=-=-=-=-=-

-Fixed Export UV XForm (should work now). #923
-Fixed enforcement of limits in property editor. #919
-Fixed long-standing bug of export editings in script inheritance. #914, #859, #756
-Fixed horrible error reporting in shader language. #912
-Added kinematic collision with plane (please test well). #911
-Fixed double animation track insert when using 2D rigs. #904
-VKey updates offset parameter in sprite edition. #901
-Do not allow anymore a script to preload itself. (does not fix #899, but narrows it down)
-Avoid connection editor from overriding selected text. #897
-Fixed timer autostart. #876
-Fixed collision layers in 3D physics. #872
-Improved operators in shader #857
-Fixed ambient lighting bug #834
-Avoid editor from processing gamepad input #813
-Added not keyword #752

Please test!
2014-12-07 02:04:20 -03:00
Juan Linietsky
a84ba9c853 Collada
-=-=-=-

-Fixed some DAE import & export bugs
-Changed Collada exporter to use the mesh loops API
-Added tangent export to Collada exporter
-Added triangulation option to Collada exporter
-Changed a little how normalmaps are handled in shader. Not sure if it's working properly, be careful.
-Fixed some strange bug with kinematic bodies #776
-Fix release compilaiton issues #782
2014-10-14 01:01:25 -03:00
Juan Linietsky
af4a97bef9 missing fils from yesterday comit.
must have made some mistake with git,
not sure why they were not sent..
2014-10-03 08:58:41 -03:00
Juan Linietsky
b24fe3dd20 Huge Amount of BugFix
-=-=-=-=-=-=-=-=-=-=-

-Fixes to Collada Exporter (avoid crash situtions)
-Fixed to Collada Importer (Fixed Animation Optimizer Bugs)
-Fixes to RigidBody/RigidBody2D body_enter/body_exit, was buggy
-Fixed ability for RigidBody/RigidBody2D to get contacts reported and bodyin/out in Kinematic mode.
-Added proper trigger support for 3D Physics shapes
-Changed proper value for Z-Offset in OmniLight
-Fixed spot attenuation bug in SpotLight
-Fixed some 3D and 2D spatial soudn bugs related to distance attenuation.
-Fixed bugs in EventPlayer (channels were muted by default)
-Fix in ButtonGroup (get nodes in group are now returned in order)
-Fixed Linear->SRGB Conversion, previous algo sucked, new algo works OK
-Changed SRGB->Linear conversion to use hardware if supported, improves texture quality a lot
-Fixed options for Y-Fov and X-Fov in camera, should be more intuitive.
-Fixed bugs related to viewports and transparency

Huge Amount of New Stuff:
-=-=-=-=-=-=-=-==-=-=-=-

-Ability to manually advance an AnimationPlayer that is inactive (with advance() function)
-More work in WinRT platform
-Added XY normalmap support, imports on this format by default. Reduces normlmap size and enables much nice compression using LATC
-Added Anisotropic filter support to textures, can be specified on import
-Added support for Non-Square, Isometric and Hexagonal tilemaps in TileMap.
-Added Isometric Dungeon demo.
-Added simple hexagonal map demo.
-Added Truck-Town demo. Shows how most types of joints and vehicles are used. Please somebody make a nicer town, this one is too hardcore.
-Added an Object-Picking API to both RigidBody and Area! (and relevant demo)
2014-10-03 00:10:51 -03:00
Juan Linietsky
549d344f0f Fixing Issues...
- #672 (default user:// in $HOME/.godot/app_userdata (linux/osx) and $APPDATA/Godot/app_userdata (Windows)
- #676 (draw both tiles and octants in order from top to bottom, left to right )
- #686 (unicode escape sequences work now)
- #702 (was not a bug, but a test was added to see if bodies went too far away)
2014-09-19 18:39:50 -03:00
Juan Linietsky
e0ce701c8c More Bugfix...
-=-=-=-=-=-==

-Fix bug in camera follow script
-Fix negate operator not working in shader language
-Fix uninitialized pointer in raycast query API
2014-09-17 23:23:42 -03:00
Juan Linietsky
8cab401d08 3D Physics Rework, Other Stuff
-=-=-=-=-=-=-=-=-=-=-=-=-=-

3D Physics:
-Fixed "Bounce" parameter in 3D
-Fixed bug affecting Area (sometims it would not detect properly)
-Vehicle Body has seen heavy work
-Added Query API for doing space queries in 3D. Needs some docs though.
-Added JOINTS! Adapted Bullet Joints: and created easy gizmos for setting them up:
   -PinJoint
   -HingeJoint (with motor)
   -SliderJoint
   -ConeTwistJoint
   -Generic6DOFJoint
-Added OBJECT PICKING! based on the new query API. Any physics object now (Area or Body) has the following signals and virtual functions:
    -input_event (mouse or multitouch input over the body)
    -mouse_enter (mouse entered the body area)
    -mouse_exit (mouse exited body area)
   For Area it needs to be activated manually, as it isn't by default (ray goes thru).

Other:

-Begun working on Windows 8 (RT) port. Compiles but does not work yet.
-Added TheoraPlayer library for improved to-texture and portable video support.
-Fixed a few bugs in the renderer, collada importer, collada exporter, etc.
2014-09-15 11:33:30 -03:00
Juan Linietsky
1a2cb755e2 3D Physics and Other Stuff
-=-=-=-=-=-=-=-=-=-=-=-=-=

-New Vehicle (Based on Bullet's RaycastVehicle) - Vehiclebody/VehicleWheel. Demo will come soon, old vehicle (CarBody) will go away soon too.
-A lot of fixes to the 3D physics engine
-Added KinematicBody with demo
-Fixed the space query API for 2D (demo will come soon). 3D is WIP.
-Fixed long-standing bug with body_enter/body_exit for Area and Area2D
-Performance variables now includes physics (active bodies, collision pairs and islands)
-Ability to see what's inside of instanced scenes!
-Fixed Blend Shapes (no bs+skeleton yet)
-Added an Android JavaClassWrapper singleton for using Android native classes directly from GDScript. This is very Alpha!
2014-09-02 23:13:40 -03:00
Juan Linietsky
2ee4ac183b Little Bits
-=-=-=-=-=-

-Fixed small bugs all around
-Added ability to show/hide entire sections of the spatial (3D) tree
-WIP new vehicle (not ready yet) based on Bullet
2014-08-14 10:31:38 -03:00
Juan Linietsky
b324ff7ea5 A bit of everything:
-IMA-ADPCM support for samples, this means that sound effects can be compressed and use 4 timess less RAM.
-New 3D import workflow based on Wavefront OBJ. Import single objects as mesh resources instead of full scenes. Many people prefers to work this way. Just like the rest of the imported resources, these are updated in realtime if modified externally.
-Mesh resources now support naming surfaces. This helps reimporting to identify which user-created materials must be kept.
-Several fixes and improvements to SurfaceTool.
-Anti Aliasing added to WorldEnvironment effects (using FXAA)
-2D Physics bodies (RigidBody, KinematicBody, etc), Raycasts, Tilemap, etc support collision layers. This makes easy to group which objects collide against which.
-2D Trigger shapes can now also trigger collision reporting in other 2D bodies (it used to be in Area2D before)
-Viewport render target textures can now be filtered.
-Few fixes in GDscript make it easier to work with static functions and class members.
-Several and many bugfixes.
2014-05-14 01:22:15 -03:00
marynate
9593e9ddae Export linear/angular velocity sleep threshold;Change default linear velocity sleep threshold to 0.1;Fixed type treshold 2014-02-27 17:28:40 +08:00
Juan Linietsky
d7d65fa2f2 -improved physics ccd
-html5 exporter works again
-disable repeat on image loader by default
-can change shape offset en tileset, texture offset was broken
2014-02-19 11:57:14 -03:00
Juan Linietsky
0b806ee0fc GODOT IS OPEN SOURCE 2014-02-09 22:10:30 -03:00