summaryrefslogtreecommitdiffstats
path: root/core/math/geometry.h
Commit message (Collapse)AuthorAgeFilesLines
* Replace 'ERR_EXPLAIN' with 'ERR_FAIL_*_MSG' in 'core/' and 'editor/'Braden Bodily2019-08-171-2/+1
| | | | | | | | | Condensed some if and ERR statements. Added dots to end of error messages Couldn't figure out EXPLAINC. These files gave me trouble: core/error_macros.h, core/io/file_access_buffered_fa.h (where is it?), core/os/memory.cpp, drivers/png/png_driver_common.cpp, drivers/xaudio2/audio_driver_xaudio2.cpp (where is it?)
* Remove redundant author doc commentsIAmActuallyCthulhu2019-08-121-4/+0
|
* Optimize get_closest_point_to_segment*.Simon Puchert2019-07-061-18/+14
| | | | | | By combining all scalar factors we can get rid of a scalar * vector multiplication and a square root operation, since the resulting formula only uses the squared length.
* Expose 2D Delaunay triangulation in Geometry singletonAndrii Doroshenko (Xrayez)2019-05-241-0/+14
| | | | | | | 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.
* Expose 2D polygon boolean operations in Geometry singletonAndrii Doroshenko (Xrayez)2019-05-221-1/+76
| | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Fix typos with codespellRémi Verschelde2019-05-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 ```
* Use approximate equallity methods in many placesAaron Franke2019-04-251-5/+5
|
* Fixes Geometry.segment_intersects_circle working only one way.Christoph Schroeder2019-03-061-2/+4
|
* TileSet/TileMap: Decompose solid non-convex polygons into convexes. Real fix ↵Mariano Suligoy2019-03-041-0/+2
| | | | for #24003
* Core: Ensure classes match their header filenameRémi Verschelde2019-02-121-1/+1
| | | | | | | | | | | | | | | Also drop some unused files. Renamed: - `core/dvector.h` -> `pool_vector.h` - `core/io/resource_import.h` -> `resource_importer.h` - `core/sort.h` -> `sort_array.h` - `core/string_db.h` -> `string_name.h` Dropped: - `core/allocators.h` - `core/os/shell.h` - `core/variant_construct_string.cpp`
* Removed splits in Polygon editor, replace by internal vertices and polygon ↵Juan Linietsky2019-01-081-1/+31
| | | | support.
* Update copyright statements to 2019Rémi Verschelde2019-01-011-2/+2
| | | | Happy new year to the wonderful Godot community!
* Ensure that array passed to physics is always counter clockwise, fixes #15361.Juan Linietsky2018-11-141-0/+15
|
* Make core/ includes absolute, remove subfolders from include pathRémi Verschelde2018-09-121-8/+9
| | | | | | 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.
* [Core] Completely kill math_2d.h, change includesAaron Franke2018-08-111-1/+1
|
* Reduce unnecessary COW on Vector by make writing explicitHein-Pieter van Braam2018-07-261-2/+2
| | | | | | | | | | | | | | | | | | | | | | | 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.
* Merge pull request #15943 from poke1024/geometry-line-lineJuan Linietsky2018-05-071-0/+15
|\ | | | | Add Geometry::line_intersects_line_2d()
| * Add Geometry::line_intersects_line_2d()Bernhard Liebl2018-01-211-0/+15
| |
* | Fix is_point_in_triangleChaosus2018-02-081-7/+6
|/
* 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.
* Merge pull request #15093 from poke1024/canvas-editor-selectRémi Verschelde2018-01-031-0/+3
|\ | | | | More exact picking for canvas editor
| * More exact picking for canvas editorBernhard Liebl2017-12-271-0/+3
| |
* | Update copyright statements to 2018Rémi Verschelde2018-01-011-2/+2
|/ | | | Happy new year to the wonderful Godot community!
* Dead code tells no talesRémi Verschelde2017-08-271-28/+1
|
* Use HTTPS URL for Godot's website in the headersRémi Verschelde2017-08-271-1/+1
|
* Particle system is complete. Rejoice!Juan Linietsky2017-04-081-10/+11
|
* Add "Godot Engine contributors" copyright lineRémi Verschelde2017-04-081-0/+1
|
* Fix typos in source code using codespellRémi Verschelde2017-03-241-1/+1
| | | | From https://github.com/lucasdemarchi/codespell
* A Whole New World (clang-format edition)Rémi Verschelde2017-03-051-398/+360
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Many fixes to make exported scenes work better, still buggy.Juan Linietsky2017-02-151-0/+28
|
* Overloaded basic math funcs (double and float variants). Use real_t rather ↵Ferenc Arn2017-01-161-60/+60
| | | | | | than float or double in generic functions (core/math) whenever possible. Also inlined some more math functions.
* Style: Fix statements ending with ';;'Rémi Verschelde2017-01-161-1/+1
|
* Style: Fix whole-line commented codeRémi Verschelde2017-01-141-2/+0
| | | | | 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.
* Memory pool vectors (DVector) have been enormously simplified in code, and ↵Juan Linietsky2017-01-071-7/+7
| | | | renamed to PoolVector
* 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!
* remove trailing whitespaceHubert Jarosz2016-03-091-53/+53
|
* Update copyright to 2016 in headersGeorge Marques2016-01-011-1/+1
|
* implement point cloud function using convex hull for ConvexPolygonShape2D, ↵Juan Linietsky2015-12-141-0/+31
| | | | fixes #2848
* Updated copyright year in all headersJuan Linietsky2015-04-181-1/+1
|
* Changed code to remove gcc -Wparentheses warnings.ElectricSolstice2015-02-161-2/+2
|
* New Navigation & Pathfinding support for 2DJuan Linietsky2015-02-141-0/+14
| | | | | | | -Added Navigation & NavigationPolygon nodes -Added corresponding visual editor -New pathfinding algorithm is modern and fast! -Similar API to 3D Pathfinding (more coherent)
* Build System ChangesJuan Linietsky2014-10-071-0/+53
| | | | | | | | | | | | | -=-=-=-=-=-=-=-=-=-= Build System: -Big clean up of SCons, changed how builds are done to a much cleaner method (check the Github Wiki for instructions). -Deactivated BlackBerry10 (sorry), if no mantainer found (or BlackBerry does not send us a Passort ;), platform will be removed as we have no longer devices to test. Engine: -Removed deprecated object and scene format (was in there just for compatibility, not in use since a long time). -Added ability to open scenes even if a node type was removed (will try to guess the closest type). -Removed deprecated node types.
* Huge Amount of BugFixJuan Linietsky2014-10-031-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -=-=-=-=-=-=-=-=-=-=- -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)
* A bit of everything:Juan Linietsky2014-05-141-0/+80
| | | | | | | | | | | | | -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.
* GODOT IS OPEN SOURCEJuan Linietsky2014-02-091-0/+755