aboutsummaryrefslogtreecommitdiff
path: root/core/math (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Add a bunch of missing Godot headers in own filesRémi Verschelde2017-03-052-0/+56
|
* Fix RANDOM_MAX, which is 2^32-1 with PCG32.Leandro Motta Barros2017-03-011-1/+1
|
* Inf and NaN support added to GDScript.Saracen2017-02-281-0/+1
|
* Correct hash behavior for floating point numbersHein-Pieter van Braam2017-02-161-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes HashMap where a key or part of a key is a floating point number. To fix this the following has been done: * HashMap now takes an extra template argument Comparator. This class gets used to compare keys. The default Comperator now works correctly for common types and floating point numbets. * Variant implements ::hash_compare() now. This function implements nan-safe comparison for all types with components that contain floating point numbers. * Variant now has a VariantComparator which uses Variant::hash_compare() safely compare floating point components of variant's types. * The hash functions for floating point numbers will now normalize NaN values so that all floating point numbers that are NaN hash to the same value. C++ module writers that want to use HashMap internally in their modules can now also safeguard against this crash by defining their on Comperator class that safely compares their types. GDScript users, or writers of modules that don't use HashMap internally in their modules don't need to do anything. This fixes #7354 and fixes #6947.
* Many fixes to make exported scenes work better, still buggy.Juan Linietsky2017-02-151-0/+28
|
* Revert "Make nan==nan true for GDScript"Juan Linietsky2017-02-148-48/+1
|
* Make nan==nan true for GDScriptHein-Pieter van Braam2017-02-148-1/+48
| | | | | | | | | | | | | After discussing this with Reduz this seemed like the best way to fix #7354. This will make composite values that contain NaN in the same places as well as the same other values compare as the same. Additionally non-composite values now also compare equal if they are both NaN. This breaks IEEE specifications but this is probably what most users expect. There is a GDScript function check for NaN if the user needs this information. This fixes #7354 and probably also fixes #6947
* Rename the _MD macro to D_METHODHein-Pieter van Braam2017-02-131-13/+13
| | | | | | This new name also makes its purpose a little clearer This is a step towards fixing #56
* WIP new AudioServer, with buses, effects, etc.Juan Linietsky2017-01-211-0/+33
|
* Merge pull request #7528 from tagcup/real_t_float_fixesJuan Linietsky2017-01-2026-474/+402
|\ | | | | Use real_t rather than float or double in generic functions (core/mat…
| * Overloaded basic math funcs (double and float variants). Use real_t rather ↵Ferenc Arn2017-01-1626-474/+402
| | | | | | | | | | | | than float or double in generic functions (core/math) whenever possible. Also inlined some more math functions.
* | Some changes in the header so Godot3 compiles again on Windows.BastiaanOlij2017-01-182-7/+2
|/
* Merge pull request #7532 from tagcup/pcg_prngRémi Verschelde2017-01-164-16/+45
|\ | | | | Replace the existing PRNG (Xorshift31) with (minimal) PCG-32.
| * Replace the existing PRNG (Xorshift31) with (minimal) PCG (XSH-RR variant ↵Ferenc Arn2017-01-154-16/+45
| | | | | | | | | | | | with 32-bit output, 64-bit state). PCG is better than many alternatives by many metrics (see www.pcg-random.org) including statistical quality with good speed.
* | Fix compile errors related to audio on OSXBastiaanOlij2017-01-161-8/+8
| |
* | Style: Various fixes to play nice with clang-formatRémi Verschelde2017-01-162-34/+56
| |
* | Style: Fix statements ending with ';;'Rémi Verschelde2017-01-161-1/+1
| |
* | Style: Cleanups, added headers, renamed filesRémi Verschelde2017-01-168-9/+9
| | | | | | | | | | | | | | | | | | 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).
* | Oops! Audio engine has vanished :DJuan Linietsky2017-01-152-0/+30
|/
* Style: Fix whole-line commented codeRémi Verschelde2017-01-146-14/+20
| | | | | 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.
* Vector2.get_aspect() renamed to Vector2.aspect() to keep consistent method ↵Juan Linietsky2017-01-131-1/+1
| | | | naming
* made math functions inlnieJuan Linietsky2017-01-122-131/+119
|
* Type renames:Juan Linietsky2017-01-1122-297/+296
| | | | | | | | | | | | Matrix32 -> Transform2D Matrix3 -> Basis AABB -> Rect3 RawArray -> PoolByteArray IntArray -> PoolIntArray FloatArray -> PoolFloatArray Vector2Array -> PoolVector2Array Vector3Array -> PoolVector3Array ColorArray -> PoolColorArray
* Merge pull request #7426 from m4nu3lf/bugfix/physicsJuan Linietsky2017-01-104-2/+163
|\ | | | | Fixed inertia tensor computation and center of mass
| * Fixed inertia tensor computation and center of massm4nu3lf2017-01-094-2/+163
| |
* | Merge pull request #7445 from tagcup/2d_math_fixesJuan Linietsky2017-01-102-94/+107
|\ \ | | | | | | Various corrections in 2D math.
| * | Various corrections in 2D math.Ferenc Arn2017-01-102-94/+107
| | | | | | | | | | | | | | | | | | | | | | | | This is the follow up for the 2D changes mentioned in PR #6865. It fixes various mistakes regarding the order of matrix indices, order of transformation operations, usage of atan2 function and ensures that the sense of rotation is compatible with a left-handed coordinate system with Y-axis pointing down (which flips the sense of rotations along the z-axis). Also replaced float with real_t, and tried to make use of Matrix32 methods rather than accessing its elements directly. Affected code in the Godot code base is also fixed in this commit. The user code using functions involving angles such as atan2, angle_to, get_rotation, set_rotation will need to be updated to conform with the new behavior. Furthermore, the sign of the rotation angles in existing 2D scene files need to be flipped as well.
* | | Merge pull request #7438 from tagcup/matrix3_rotate_fixJuan Linietsky2017-01-104-27/+58
|\ \ \ | | | | | | | | Fix the order in which additional transformations are applied
| * | | Fix the order in which additional transformations are applied in Matrix3 and ↵Ferenc Arn2017-01-084-27/+58
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Transform. This is a part of the breaking changes proposed in PR #6865, solving the issue regarding the order of affine transformations described in #2565. This PR also fixes the affected code within Godot codebase. Includes improvements to documentation too. Another change is, Matrix3::get_scale() will now return negative scaling when the determinant of the matrix is negative. The rationale behind this is simple: when performing a polar decomposition on a basis matrix M = R.S, we have to ensure that the determinant of R is +1, such that it is a proper rotation matrix (with no reflections) which can be represented by Euler angles or a quaternion. Also replaced the few instances of float with real_t in Matrix3 and Transform. Furthermore, this PR fixes an issue introduced due to the API breakage in #6865. Namely Matrix3::get_euler() now only works with proper rotation matrices. As a result, the code that wants to get the rotation portion of a transform needs to use Matrix3::get_rotation() introduced in this commit, which complements Matrix3::get_scaled(), providing both parts of the polar decomposition. Finally, it is now possible to construct a rotation matrix from Euler angles using the new constructor Matrix3::Matrix3(const Vector3 &p_euler).
* / / Memory pool vectors (DVector) have been enormously simplified in code, and ↵Juan Linietsky2017-01-078-82/+82
|/ / | | | | | | renamed to PoolVector
* / Use right handed coordinate system for rotation matrices and quaternions. ↵Ferenc Arn2017-01-036-82/+159
|/ | | | | | | | Also fixes Euler angles (XYZ convention, which is used as default by Blender). Furthermore, functions which expect a rotation matrix will now give an error simply, rather than trying to orthonormalize such matrices. The documentation for such functions has be updated accordingly. This commit breaks code using 3D rotations, and is a part of the breaking changes in 2.1 -> 3.0 transition. The code affected within Godot code base is fixed in this commit.
* ObjectTypeDB was renamed to ClassDB. Types are meant to be more generic to ↵Juan Linietsky2017-01-023-15/+15
| | | | | | | | 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()
* Merge remote-tracking branch 'origin/gles3' into gles3-on-masterRémi Verschelde2017-01-023-2/+138
|\ | | | | | | | | Various merge conflicts have been fixed manually and some mistakes might have been made - time will tell :)
| * DOF blur, near and far fields..Juan Linietsky2016-12-102-2/+2
| |
| * Support for SSAOJuan Linietsky2016-12-042-0/+10
| |
| * all light types and shadows are working, pending a lot of clean-upJuan Linietsky2016-11-093-1/+25
| |
| * Everything returning to normal in 3D, still a long way to goJuan Linietsky2016-10-191-0/+102
| | | | | | | | -implemented the scene part of visual server and rasterizer, objects without lighting and material are rendererd only
* | Welcome in 2017, dear changelog reader!Rémi Verschelde2017-01-0134-34/+34
| | | | | | | | | | | | | | | | 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!
* | Merge pull request #7039 from RandomShaper/fix-triangulationRémi Verschelde2016-11-092-13/+5
|\ \ | | | | | | Clean/fix triangulation internals
| * | Clean/fix triangulation internalsPedro J. Estébanez2016-11-052-13/+5
| | | | | | | | | | | | | | | | | | Drop unused variable Remove commented-out code Fix leak by using Vector instead of raw memory
* | | Some missing License notice has been addedSPTelur2016-11-072-0/+59
|/ /
* | style: Fix PEP8 whitespace issues in Python filesRémi Verschelde2016-11-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Merge pull request #6751 from SuperUserNameMan/new_PRNG_for_rand_from_seedRémi Verschelde2016-10-301-29/+8
|\ \ | | | | | | xorshift32 PRNG for Math::rand_from_seed()
| * | xorshift32 PRNG for Math::rand_from_seed()yg2f2016-10-101-29/+8
| |/ | | | | | | | | | | should fixes #1043 PRNG adapted from : http://excamera.com/sphinx/article-xorshift.html
* | SCsub: Add python shebang as a hint for syntax highlightingRémi Verschelde2016-10-171-0/+2
| | | | | | | | Also switch existing shebangs to "better" /usr/bin/env python.
* | Added simple check to viewport, if matrix32 is invesile ↵Mateusz Adamczyk2016-10-081-1/+1
|/ | | | (https://github.com/godotengine/godot/issues/6296).
* Vector3: added angle_to(Vector3 other)J08nY2016-10-031-5/+7
|
* Vector3: format properly, fix indentsJ08nY2016-10-032-97/+100
|
* Fix for #6158. Converting Vector2 to Size2 for scaling functions.anneomcl2016-09-192-24/+13
|
* Added a generic AStar implementation to Godot.Juan Linietsky2016-09-132-0/+504
| | | | It's pretty fast, use it for games where Navigation does not cut it.