Commit graph

381 commits

Author SHA1 Message Date
Rémi Verschelde b0d41847ed SCons: Use CPPDEFINES instead of CPPFLAGS for pre-processor defines
It's the recommended way to set those, and is more portable
(automatically prepends -D for GCC/Clang and /D for MSVC).

We still use CPPFLAGS for some pre-processor flags which are not
defines.
2019-07-03 09:59:04 +02:00
Fabio Alessandrelli 564d93ff10 CryptoCore class to access to base crypto utils.
Godot core needs MD5/SHA256/AES/Base64 which used to be provided by
separate libraries.
Since we bundle mbedtls in most cases, and we can easily only include
the needed sources if we so desire, let's use it.

To simplify library changes in the future, and better isolate header
dependencies all functions have been wrapped around inside a class in
`core/math/crypto_base.h`.

If the mbedtls module is disabled, we only bundle the needed source
files independently of the `builtin_mbedtls` option.
If the module is enabled, the `builtin_mbedtls` option works as usual.

Also remove some unused headers from StreamPeerMbedTLS which were
causing build issues.
2019-07-02 12:36:27 +02:00
Rémi Verschelde b0ce9401ff
Merge pull request #30126 from qarmin/remove_unnecessary_code
Remove unnecessary code and add some error explanations
2019-07-01 14:32:04 +02:00
qarmin 3c154eb93b Remove unnecessary code and add some error explanations 2019-07-01 12:59:42 +02:00
Rémi Verschelde 1df38f2372
Merge pull request #30112 from AgentEnder/master
AStar get_current_point enabled consideration
2019-06-29 13:45:17 +02:00
Craigory V Coppola dc9659a9bf AStar get_closest_point/get_closest_position_in_segment enabled consideration 2019-06-29 02:04:13 -05:00
qarmin 4e5310cc60 Some code changed with Clang-Tidy 2019-06-26 15:08:25 +02:00
JohnJLight 38d3bfe971 Made use of semicolons more consitent, fixed formatting 2019-06-19 15:24:31 +02:00
Rémi Verschelde 43a9b8c76c
Merge pull request #27237 from Chaosus/astar_2d
Added 2D functions to AStar
2019-06-19 15:07:59 +02:00
Chaosus cc94a95fc9 Fix AStar set/is_point_disabled crash 2019-06-18 08:02:41 +03:00
Rémi Verschelde bd937ea397
Merge pull request #29488 from Daw11/astar-remove-node
Fix the performance of remove_point of AStar
2019-06-13 20:36:25 +02:00
Rémi Verschelde b44488d823
Merge pull request #29702 from KoBeWi/fix_random_crash
Validate parameters of randi_range()
2019-06-12 23:07:39 +02:00
Tomasz Chabora d89478975f Validate parameters of randi_range() 2019-06-12 19:46:07 +02:00
Rémi Verschelde 73960e585b
Merge pull request #27193 from toasteater/fix/pcg-randf
Improved uniformity of RandomPCG::randf.
2019-06-12 15:21:58 +02:00
Toshiwo 416a7d06de Fix Vector3 slerp method normalizing cross product 2019-06-07 11:28:50 -05:00
Daw11 605c5c71f4 Save inside the Points of AStar the neighbours that aren't connected
Improve the performance of remove_point because it doesn't have to search every neighbour of every node
2019-06-04 21:39:44 +02:00
Rémi Verschelde 3c4fab295b
Merge pull request #27789 from Giacom/move_towards
Added move_toward functions for float, Vector2 and Vector3
2019-06-01 12:05:18 +02:00
Chaosus 0bc37de744 Added 2D functions to AStar 2019-05-30 07:10:07 +03:00
Giacom c00427add3 Added move_toward functions for float, Vector2 and Vector3 2019-05-28 11:39:35 +01:00
Rémi Verschelde 7487d2f852
Merge pull request #28957 from aaronfranke/basis-optimize
Optimize Basis constructor for Axis Angle
2019-05-27 17:42:43 +02:00
Andrii Doroshenko (Xrayez) 24e9a881c0 Expose 2D Delaunay triangulation in Geometry singleton
Can be used via scripting as `Geometry.triangulate_delaunay_2d(points)`

The interface is the same as in `Triangulate` library, returning indices
into triangulated points.
2019-05-24 13:10:13 +03:00
Andrii Doroshenko (Xrayez) 883ef8570a Expose 2D polygon boolean operations in Geometry singleton
Clipper 6.4.2 is used internally to perform polypaths clipping, as well
as inflating/deflating polypaths. The following methods were added:

```
Geometry.merge_polygons_2d(poly_a, poly_b) # union
Geometry.clip_polygons_2d(poly_a, poly_b) # difference
Geometry.intersect_polygons_2d(poly_a, poly_b) # intersection
Geometry.exclude_polygons_2d(poly_a, poly_b) # xor

Geometry.clip_polyline_with_polygon_2d(poly_a, poly_b)
Geometry.intersect_polyline_with_polygon_2d(poly_a, poly_b)

Geometry.offset_polygon_2d(polygon, delta) # inflate/deflate
Geometry.offset_polyline_2d(polyline, delta) # returns polygons

// This one helps to implement CSG-like behaviour:
Geometry.transform_points_2d(points, transform)
```

All the methods return an array of polygons/polylines. The resulting
polygons could possibly be holes which could be checked with
`Geometry.is_polygon_clockwise()` which was exposed to scripting as well.
2019-05-22 17:12:39 +03:00
Rémi Verschelde e0574e1d98 Fix typos with codespell
Using codespell 1.15.0.

Method:
```
$ cat > ../godot-word-whitelist.txt << EOF
ang
curvelinear
doubleclick
leapyear
lod
merchantibility
nd
numer
ois
ony
que
seeked
synching
te
uint
unselect
webp
EOF

$ codespell -w -q 3 -I ../godot-word-whitelist.txt --skip="./thirdparty,*.po"
$ git diff // undo unwanted changes
```
2019-05-19 13:10:35 +02:00
Max Hilbrunner 33897d9b58
Merge pull request #28925 from Daw11/astar-sorted-array
Improve the performance of AStar
2019-05-18 23:20:02 +02:00
Aaron Franke 9ff708f008
Optimize Basis constructor for Axis Angle 2019-05-17 05:11:12 -04:00
Daw11 cc7be6c643 Use a binary heap for the open list of Astar 2019-05-16 20:14:35 +02:00
Daw11 28bff3d1ad Implement Lanczos image filter 2019-05-05 14:03:56 +02:00
Rémi Verschelde ae41e35191
Merge pull request #27676 from qarmin/small_fixes_2
Small fixes to static analyzer bugs
2019-05-01 08:19:04 +02:00
Aaron Franke 620ec4703f
Make "decimal" functions more consistent
In GDScript, rename "decimals" to "step_decimals". In C#, add "StepDecimals", but keep the old functionality in a method called "DecimalCount".
2019-04-30 13:49:17 -04:00
Rémi Verschelde d6b20e854c
Merge pull request #27294 from lupoDharkael/rect2i
Add missing methods to Rect2i
2019-04-30 11:46:40 +02:00
Aaron Franke b659e1eb2b
Use approximate equallity methods in many places 2019-04-25 13:20:29 -04:00
Aaron Franke b2e1c9c276
[Core] Approximate equality 2019-04-25 13:20:29 -04:00
Hein-Pieter van Braam 5d33f241f0
Merge pull request #26064 from JFonS/add_frustum_camera_mode
Add FRUSTUM camera mode, allowing tilted frustums
2019-04-23 06:20:13 +03:00
Juan Linietsky 04847ef5f9 Added ability for multiple images to be imported as an atlas
This adds support for groups in the import system, which point to a single file.
Add property hint for saving files in file field
2019-04-19 15:56:34 -03:00
Juan Linietsky e33764744c Added generator audio stream, and spectrum analyzer audio effect
Made AudioFrame and Vector2 equivalent for casting.
Added ability to obtain the playback object from stream players.
Added ability to obtain effect instance from audio server.
2019-04-10 12:58:06 -03:00
Rémi Verschelde c8994b56f9 Style: Apply new changes from clang-format 8.0
It seems to stay compatible with formatting done by clang-format 6.0 and 7.0,
so contributors can keep using those versions for now (they will not undo those
changes).
2019-04-09 17:09:48 +02:00
Rémi Verschelde 3cf2bdbd84
Merge pull request #27506 from Chaosus/astar
Added functions to AStar for disable/enable points to effectivly create obstacles
2019-04-08 12:19:51 +02:00
Rémi Verschelde 7f3373d79f
Merge pull request #27452 from Chaosus/direction_to
Added method to retrieve a direction vector from one point to another
2019-04-08 12:00:54 +02:00
Rémi Verschelde d211aff777
Merge pull request #27231 from Chaosus/smoothstep
Added smoothstep built-in function
2019-04-08 10:03:42 +02:00
Chaosus cc71fb2308 Added functions to AStar for disable/enable points 2019-04-08 09:28:03 +03:00
Chaosus 514a3fb96a Added smoothstep built-in function 2019-04-07 14:11:26 +03:00
Yuri Roubinsky 134be5c728
Merge pull request #27043 from Chaosus/randfn
Added gaussian distribution function to RNG
2019-04-07 08:32:04 +03:00
Rémi Verschelde 3b697ce8d5
Merge pull request #26486 from marxin/fix-Wdeprecated-copy
Fix new GCC 9 warnings: -Wdeprecated-copy.
2019-04-06 18:21:18 +02:00
Rémi Verschelde 34ea708596
Merge pull request #26699 from Schroedi/fix-line-circle-intersect
Fixes Geometry.segment_intersects_circle working only one way.
2019-04-06 12:42:16 +02:00
Chaosus 55f3bd97a2 Added direction_to method to vectors 2019-04-05 17:09:57 +03:00
qarmin 8460d0678c Small fixes to static analyzer bugs 2019-04-04 22:00:16 +02:00
Rémi Verschelde 29a1202d39
Merge pull request #27171 from Chaosus/randfix
Properly setup seed in RNG
2019-04-01 17:17:30 +02:00
Rémi Verschelde e3bd84fa57
Merge pull request #27485 from Faless/io/encode_decode_safety_pr
Safer encode/decode variant.
2019-04-01 17:00:40 +02:00
Juan Linietsky dee98d3b6d Some improvements to is_equal_approx, restored Quat operator. 2019-04-01 11:11:02 -03:00
Fabio Alessandrelli 393e62b98a Add object encoding param to serialization methods
Network peers get_var/put_var
File get_var/store_var
GDScript/Mono/VisualScript bytes2var/var2bytes
Add MultiplayerAPI.allow_object_decoding member which deprecates PacketPeer.allow_object_decoding.

Break ABI compatibaility (API compatibility for GDNative).
2019-04-01 15:53:19 +02:00