summaryrefslogtreecommitdiffstats
path: root/scene/3d/spatial.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #15083 from tagcup/spatial_rot_fixJuan Linietsky2018-01-021-28/+64
|\ | | | | Restore the behavior of Spatial rotations recently changed in c1153f5.
| * Restore the behavior of Spatial rotations recently changed in c1153f5.tagcup2017-12-271-28/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | That change was borne out of a confusion regarding the meaning of "local" in #14569. Affine transformations in Spatial simply correspond to affine operations of its Transform. Such operations take place in a coordinate system that is defined by the parent Spatial. When there is no parent, they correspond to operations in the global coordinate system. This coordinate system, which is relative to the parent, has been referred to as the local coordinate system in the docs so far, but this sloppy language has apparently confused some users, making them think that the local coordinate system refers to the one whose axes are "painted" on the Spatial node itself. To avoid such conceptual conflations and misunderstandings in the future, the parent-relative local system is now referred to as "parent-local", and the object-relative local system is called "object-local" in the docs. This commit adds the functionality "requested" in #14569, not by changing how rotate/scale/translate works, but by adding new rotate_object_local, scale_object_local and translate_object_local functions. Also, for completeness, there is now global_scale. This commit also updates another part of the docs regarding the rotation property of Spatial, which also leads to confusion among some users.
* | Update copyright statements to 2018Rémi Verschelde2018-01-011-2/+2
|/ | | | Happy new year to the wonderful Godot community!
* Change the rotate function of Spatial to be local, makes more sense. Closes ↵Juan Linietsky2017-12-261-4/+4
| | | | #14569
* Style: Apply new clang-format 5.0 style to all filesRémi Verschelde2017-12-071-2/+2
|
* Unify degree members and propertiesletheed2017-11-101-7/+7
|
* Remove deprecated rotation methodsletheed2017-11-101-18/+0
|
* Rename pos to position in user facing methods and variablesletheed2017-09-201-2/+2
| | | | | | | | | | | Rename user facing methods and variables as well as the corresponding C++ methods according to the folloming changes: * pos -> position * rot -> rotation * loc -> location C++ variables are left as is.
* Fix unused variable warningsHein-Pieter van Braam2017-09-081-2/+0
| | | | The forth in my quest to make Godot 3.x compile with -Werror on GCC7
* Dead code tells no talesRémi Verschelde2017-08-271-31/+0
|
* Use HTTPS URL for Godot's website in the headersRémi Verschelde2017-08-271-1/+1
|
* -Massive clean up to gizmosJuan Linietsky2017-08-261-6/+17
| | | | | | | -Make sure handles are always visible (on top) -Fixed instanced scene selection (should work properly now) -Added interpolated camera -Customizable gizmo colors in editor settings
* Convert Object::cast_to() to the static versionHein-Pieter van Braam2017-08-241-4/+4
| | | | | | | | | | | | Currently we rely on some undefined behavior when Object->cast_to() gets called with a Null pointer. This used to work fine with GCC < 6 but newer versions of GCC remove all codepaths in which the this pointer is Null. However, the non-static cast_to() was supposed to be null safe. This patch makes cast_to() Null safe and removes the now redundant Null checks where they existed. It is explained in this article: https://www.viva64.com/en/b/0226/
* Removes editor_hint from SceneTreeIgnacio Etcheverry2017-08-191-3/+4
|
* Merge pull request #10202 from neikeq/how-do-you-turn-this-onRémi Verschelde2017-08-111-4/+4
|\ | | | | Improves method bind's detecting of signarute types
| * Removes type information from method bindsIgnacio Etcheverry2017-08-101-4/+4
| |
* | Gizmos properly follow the edited object, closes #7837Juan Linietsky2017-08-091-2/+8
|/
* Merge pull request #9791 from bojidar-bg/6087-add-global-local-convRémi Verschelde2017-07-241-0/+13
|\ | | | | Add .to_local/.to_global methods on Node2D and Spatial
| * Add .to_local/.to_global methods on Node2D and SpatialBojidar Marinov2017-07-231-0/+13
| | | | | | | | | | Those are just helpers around get_global_transform().affine_inverse().xform() and get_global_transform().xform(). Closes #6087
* | Add object type hint for docsPoommetee Ketson2017-07-231-2/+2
|/
* Update visibility icon properlyvolzhs2017-07-031-8/+5
|
* Add "Godot Engine contributors" copyright lineRémi Verschelde2017-04-081-0/+1
|
* New particle system, mostly working, some small features missing.Juan Linietsky2017-04-061-14/+0
|
* Fix more property names in _change_notify calls.Andreas Haas2017-04-031-4/+5
|
* A Whole New World (clang-format edition)Rémi Verschelde2017-03-051-226/+181
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Rename the _MD macro to D_METHODHein-Pieter van Braam2017-02-131-46/+46
| | | | | | This new name also makes its purpose a little clearer This is a step towards fixing #56
* Remove use of _SCS from ADD_METHODHein-Pieter van Braam2017-02-131-10/+10
| | | | This saves typing and is a step towards fixing #56
* Fix editor method calls to is_visible for Spatial and CanvasItem and ↵Ray Koopa2017-01-181-1/+1
| | | | is_visible itself for Spatial
* removed duplicated functions in class hierarchy that were bound more than onceJuan Linietsky2017-01-141-1/+1
| | | | added a check to detect this case in the future
* Style: Fix whole-line commented codeRémi Verschelde2017-01-141-3/+5
| | | | | 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.
* Renamed call_group to call_group_flags, made call_group without flags the ↵Juan Linietsky2017-01-141-1/+1
| | | | default
* New API for visibility in both CanvasItem and SpatialJuan Linietsky2017-01-131-27/+10
| | | | | | visible (property) - access set_visible(bool) is_visible() is_visible_in_tree() - true when visible and parents visible show() hide() - for convenience
* Must now register with set_transform_notify() to get ↵Juan Linietsky2017-01-121-2/+15
| | | | NOTIFICATION_TRANSFORM_CHANGED
* Type renames:Juan Linietsky2017-01-111-2/+2
| | | | | | | | | | | | Matrix32 -> Transform2D Matrix3 -> Basis AABB -> Rect3 RawArray -> PoolByteArray IntArray -> PoolIntArray FloatArray -> PoolFloatArray Vector2Array -> PoolVector2Array Vector3Array -> PoolVector3Array ColorArray -> PoolColorArray
* Fix the order in which additional transformations are applied in Matrix3 and ↵Ferenc Arn2017-01-081-5/+7
| | | | | | | | | | | | | | 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).
* -Conversion of most properties to a simpler syntax, easier to use by scriptJuan Linietsky2017-01-041-12/+15
| | | | | | -Modified help to display properties GDScript can still not make use of them, though.
* ObjectTypeDB was renamed to ClassDB. Types are meant to be more generic to ↵Juan Linietsky2017-01-021-46/+46
| | | | | | | | 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()
* 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!
* better rewordingJuan Linietsky2016-06-111-1/+1
|
* Show descriptive errors when look_at is improperly used, closes #5131Juan Linietsky2016-06-111-0/+9
|
* Rotation APIs: Better exposure for degrees methodsRémi Verschelde2016-05-061-15/+36
| | | | | | | | Made public the various set/getters for rotations in degrees. For consistency, renamed the exposed method names to remove the leading underscore, and kept the old names with a deprecation warning. Fixes #4511.
* remove trailing whitespaceHubert Jarosz2016-03-091-17/+17
|
* Update copyright to 2016 in headersGeorge Marques2016-01-011-1/+1
|
* Added set_hidden method to Spatial and CanvasItemromulox_x2015-11-261-0/+10
|
* Ability to keep collisionshapes and collisionpolygons when running the game.reduz2015-09-151-0/+25
| | | | | | | | | | Works for 2D and 3D These are still just helpers in case you want to animate them or access them directly. Modifying the real shapes is still done via CollisionObject and CollisionObject2D APIs But an API was added so you can query which shapes from CollisionObject correspond to which CollisionShape. Have Fun!
* Several performance improvements, mainly in loading and instancing scenes ↵Juan Linietsky2015-06-291-1/+1
| | | | | | | | and resources. A general speedup should be apparent, with even more peformance increase when compiling optimized. WARNING: Tested and it seems to work, but if something breaks, please report.
* new file dialog!Juan Linietsky2015-06-061-1/+2
| | | | | | | | | -ItemList control for easier lists/thumbnails -New file dialog, with support for thumbnails, favorites, recent places, etc -Moved .fscache out of the project, no more bugs due to committed/pulled .fscache! -Dir dialog now sorts directories
* Updated copyright year in all headersJuan Linietsky2015-04-181-1/+1
|
* gui in 3D demo now uses area for inputJuan Linietsky2015-03-221-0/+7
|
* added spatial and node2d helper methodsJuan Linietsky2015-03-221-0/+106
| | | | | to perform operations such as translaiton, rotation, etc directly on nodes.