aboutsummaryrefslogtreecommitdiff
path: root/core/math/math_2d.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Vector3::round, Vector2::round & Vector2::ceil methods were added.Alexander Alekseev2018-05-041-0/+10
| | | | | Now both structs (Vector2 & Vector3) have round, floor & ceil methods. (see #18603)
* Bring back Vector2.cross()Bernhard Liebl2018-03-071-5/+0
|
* 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.
* Update copyright statements to 2018Rémi Verschelde2018-01-011-2/+2
| | | | Happy new year to the wonderful Godot community!
* Inline some very common Vector2 operationsBernhard Liebl2017-12-251-63/+0
|
* Rect2: add function returning same rect with positive w and hPoommetee Ketson2017-11-281-29/+0
|
* Dead code tells no talesRémi Verschelde2017-08-271-27/+0
|
* Use HTTPS URL for Godot's website in the headersRémi Verschelde2017-08-271-1/+1
|
* Synchronize parameter names in definition and declarationTwistedTwigleg2017-08-161-8/+8
| | | | Fixes #10244.
* renamed all Rect2.pos to Rect2.positionalexholly2017-06-041-1/+1
|
* Merge pull request #8277 from tagcup/math_checksRémi Verschelde2017-04-241-3/+6
|\ | | | | Added various functions basic math classes. Also enabled math checks …
| * Added various functions basic math classes. Also enabled math checks only ↵Ferenc Arn2017-04-061-3/+6
| | | | | | | | | | | | | | | | 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.
* | Add "Godot Engine contributors" copyright lineRémi Verschelde2017-04-081-0/+1
|/
* Made slide and reflect active verbs acting on itself in Vector2 and Vector3.Ferenc Arn2017-04-031-4/+18
| | | | | | | This is in alignment with other functions in vector classes. Also added checks for normalization, fixed the sign of reflect (which now corresponds to reflection along a plane mathematically), added bounce method and updated docs. Fixes #8201.
* Fix polar decomposition in 2D.Ferenc Arn2017-03-291-2/+2
| | | | | | | When performing polar decomposition in 2D as B = R.S, where R is rotation (with determinant +1) and S is scaling, use the convention that reflections are absorbed into S through a reflection around y axis. In 3D, this is done by using a reflection along all three axes, but since the dimensionality is even in 2D, one axis needs to be chosen. Fixes Matrix32::get_rotation and Matrix32::get_scale (which weren't properly fixed in #7445).
* A Whole New World (clang-format edition)Rémi Verschelde2017-03-051-188/+176
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Revert "Make nan==nan true for GDScript"Juan Linietsky2017-02-141-7/+0
|
* Make nan==nan true for GDScriptHein-Pieter van Braam2017-02-141-0/+7
| | | | | | | | | | | | | 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
* Overloaded basic math funcs (double and float variants). Use real_t rather ↵Ferenc Arn2017-01-161-3/+3
| | | | | | than float or double in generic functions (core/math) whenever possible. Also inlined some more math functions.
* Type renames:Juan Linietsky2017-01-111-40/+40
| | | | | | | | | | | | Matrix32 -> Transform2D Matrix3 -> Basis AABB -> Rect3 RawArray -> PoolByteArray IntArray -> PoolIntArray FloatArray -> PoolFloatArray Vector2Array -> PoolVector2Array Vector3Array -> PoolVector3Array ColorArray -> PoolColorArray
* Various corrections in 2D math.Ferenc Arn2017-01-101-51/+54
| | | | | | | | 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.
* 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!
* Added simple check to viewport, if matrix32 is invesile ↵Mateusz Adamczyk2016-10-081-1/+1
| | | | (https://github.com/godotengine/godot/issues/6296).
* Fix for #6158. Converting Vector2 to Size2 for scaling functions.anneomcl2016-09-191-14/+8
|
* remove trailing whitespaceHubert Jarosz2016-03-091-27/+27
|
* Update copyright to 2016 in headersGeorge Marques2016-01-011-1/+1
|
* removed wron return types, fixes #2483reduz2015-12-291-1/+0
| | | | removed console, which was obsolete and unused sine long long ago
* -remove Vector2.atan2() replaced by Vector2.angle(), fixes #2260Juan Linietsky2015-11-191-2/+2
|
* Changed floats to 'real_t'.James McLean2015-06-111-11/+9
|
* Changed 'scale' to 'scale_basis' in 'interpolate_with'.James McLean2015-06-111-1/+1
|
* Implemented interpolation for affine transformations ↵James McLean2015-06-111-2/+34
| | | | (Matrix32::interpolate_with)
* Updated copyright year in all headersJuan Linietsky2015-04-181-1/+1
|
* -Changed the cubic interpolator, improves situation with PathFollow in #1659Juan Linietsky2015-04-131-1/+18
|
* Small Issues & MaintenanceJuan Linietsky2014-08-011-0/+5
| | | | | | | | | -=-=-=-=-=-=-=-=-=-=-=-=-= -Begin work on Navigation Meshes (simple pathfinding for now, will improve soon) -More doc on theme overriding -Upgraded OpenSSL to version without bugs -Misc bugfixes
* 2D Animation ImprovementsJuan Linietsky2014-07-061-1/+5
| | | | | | | | | -=-=-=-=-=-=-=-=-=--=-=-= -Ability to set 2D nodes as bones -Abity to set 2D nodes as IK chains -2D IK Solver -Improvements in the UI for adding keyframes (separate loc,rot,scale buttons)
* -improved physics ccdJuan Linietsky2014-02-191-0/+10
| | | | | | -html5 exporter works again -disable repeat on image loader by default -can change shape offset en tileset, texture offset was broken
* GODOT IS OPEN SOURCEJuan Linietsky2014-02-091-0/+597