mirror of
https://github.com/godotengine/godot-docs.git
synced 2026-01-05 22:09:56 +03:00
457 lines
27 KiB
ReStructuredText
457 lines
27 KiB
ReStructuredText
:github_url: hide
|
|
|
|
.. Generated automatically by doc/tools/makerst.py in Godot's source tree.
|
|
.. DO NOT EDIT THIS FILE, but the Vector2.xml source instead.
|
|
.. The source is found in doc/classes or modules/<name>/doc_classes.
|
|
|
|
.. _class_Vector2:
|
|
|
|
Vector2
|
|
=======
|
|
|
|
Vector used for 2D math using floating point coordinates.
|
|
|
|
Description
|
|
-----------
|
|
|
|
2-element structure that can be used to represent positions in 2D space or any other pair of numeric values.
|
|
|
|
It uses floating point coordinates.
|
|
|
|
Tutorials
|
|
---------
|
|
|
|
- :doc:`../tutorials/math/index`
|
|
|
|
Properties
|
|
----------
|
|
|
|
+---------------------------+------------------------------------+---------+
|
|
| :ref:`float<class_float>` | :ref:`x<class_Vector2_property_x>` | ``0.0`` |
|
|
+---------------------------+------------------------------------+---------+
|
|
| :ref:`float<class_float>` | :ref:`y<class_Vector2_property_y>` | ``0.0`` |
|
|
+---------------------------+------------------------------------+---------+
|
|
|
|
Methods
|
|
-------
|
|
|
|
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Vector2<class_Vector2>` | :ref:`Vector2<class_Vector2_method_Vector2>` **(** :ref:`Vector2i<class_Vector2i>` from **)** |
|
|
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Vector2<class_Vector2>` | :ref:`Vector2<class_Vector2_method_Vector2>` **(** :ref:`float<class_float>` x, :ref:`float<class_float>` y **)** |
|
|
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Vector2<class_Vector2>` | :ref:`abs<class_Vector2_method_abs>` **(** **)** |
|
|
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`float<class_float>` | :ref:`angle<class_Vector2_method_angle>` **(** **)** |
|
|
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`float<class_float>` | :ref:`angle_to<class_Vector2_method_angle_to>` **(** :ref:`Vector2<class_Vector2>` to **)** |
|
|
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`float<class_float>` | :ref:`angle_to_point<class_Vector2_method_angle_to_point>` **(** :ref:`Vector2<class_Vector2>` to **)** |
|
|
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`float<class_float>` | :ref:`aspect<class_Vector2_method_aspect>` **(** **)** |
|
|
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Vector2<class_Vector2>` | :ref:`bounce<class_Vector2_method_bounce>` **(** :ref:`Vector2<class_Vector2>` n **)** |
|
|
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Vector2<class_Vector2>` | :ref:`ceil<class_Vector2_method_ceil>` **(** **)** |
|
|
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Vector2<class_Vector2>` | :ref:`clamped<class_Vector2_method_clamped>` **(** :ref:`float<class_float>` length **)** |
|
|
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`float<class_float>` | :ref:`cross<class_Vector2_method_cross>` **(** :ref:`Vector2<class_Vector2>` with **)** |
|
|
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Vector2<class_Vector2>` | :ref:`cubic_interpolate<class_Vector2_method_cubic_interpolate>` **(** :ref:`Vector2<class_Vector2>` b, :ref:`Vector2<class_Vector2>` pre_a, :ref:`Vector2<class_Vector2>` post_b, :ref:`float<class_float>` t **)** |
|
|
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Vector2<class_Vector2>` | :ref:`direction_to<class_Vector2_method_direction_to>` **(** :ref:`Vector2<class_Vector2>` b **)** |
|
|
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`float<class_float>` | :ref:`distance_squared_to<class_Vector2_method_distance_squared_to>` **(** :ref:`Vector2<class_Vector2>` to **)** |
|
|
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`float<class_float>` | :ref:`distance_to<class_Vector2_method_distance_to>` **(** :ref:`Vector2<class_Vector2>` to **)** |
|
|
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`float<class_float>` | :ref:`dot<class_Vector2_method_dot>` **(** :ref:`Vector2<class_Vector2>` with **)** |
|
|
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Vector2<class_Vector2>` | :ref:`floor<class_Vector2_method_floor>` **(** **)** |
|
|
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`is_equal_approx<class_Vector2_method_is_equal_approx>` **(** :ref:`Vector2<class_Vector2>` v **)** |
|
|
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`is_normalized<class_Vector2_method_is_normalized>` **(** **)** |
|
|
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`float<class_float>` | :ref:`length<class_Vector2_method_length>` **(** **)** |
|
|
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`float<class_float>` | :ref:`length_squared<class_Vector2_method_length_squared>` **(** **)** |
|
|
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Vector2<class_Vector2>` | :ref:`linear_interpolate<class_Vector2_method_linear_interpolate>` **(** :ref:`Vector2<class_Vector2>` b, :ref:`float<class_float>` t **)** |
|
|
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Vector2<class_Vector2>` | :ref:`move_toward<class_Vector2_method_move_toward>` **(** :ref:`Vector2<class_Vector2>` to, :ref:`float<class_float>` delta **)** |
|
|
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Vector2<class_Vector2>` | :ref:`normalized<class_Vector2_method_normalized>` **(** **)** |
|
|
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Vector2<class_Vector2>` | :ref:`posmod<class_Vector2_method_posmod>` **(** :ref:`float<class_float>` mod **)** |
|
|
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Vector2<class_Vector2>` | :ref:`posmodv<class_Vector2_method_posmodv>` **(** :ref:`Vector2<class_Vector2>` modv **)** |
|
|
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Vector2<class_Vector2>` | :ref:`project<class_Vector2_method_project>` **(** :ref:`Vector2<class_Vector2>` b **)** |
|
|
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Vector2<class_Vector2>` | :ref:`reflect<class_Vector2_method_reflect>` **(** :ref:`Vector2<class_Vector2>` n **)** |
|
|
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Vector2<class_Vector2>` | :ref:`rotated<class_Vector2_method_rotated>` **(** :ref:`float<class_float>` phi **)** |
|
|
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Vector2<class_Vector2>` | :ref:`round<class_Vector2_method_round>` **(** **)** |
|
|
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Vector2<class_Vector2>` | :ref:`sign<class_Vector2_method_sign>` **(** **)** |
|
|
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Vector2<class_Vector2>` | :ref:`slerp<class_Vector2_method_slerp>` **(** :ref:`Vector2<class_Vector2>` b, :ref:`float<class_float>` t **)** |
|
|
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Vector2<class_Vector2>` | :ref:`slide<class_Vector2_method_slide>` **(** :ref:`Vector2<class_Vector2>` n **)** |
|
|
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Vector2<class_Vector2>` | :ref:`snapped<class_Vector2_method_snapped>` **(** :ref:`Vector2<class_Vector2>` by **)** |
|
|
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Vector2<class_Vector2>` | :ref:`tangent<class_Vector2_method_tangent>` **(** **)** |
|
|
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
Constants
|
|
---------
|
|
|
|
.. _class_Vector2_constant_AXIS_X:
|
|
|
|
.. _class_Vector2_constant_AXIS_Y:
|
|
|
|
.. _class_Vector2_constant_ZERO:
|
|
|
|
.. _class_Vector2_constant_ONE:
|
|
|
|
.. _class_Vector2_constant_INF:
|
|
|
|
.. _class_Vector2_constant_LEFT:
|
|
|
|
.. _class_Vector2_constant_RIGHT:
|
|
|
|
.. _class_Vector2_constant_UP:
|
|
|
|
.. _class_Vector2_constant_DOWN:
|
|
|
|
- **AXIS_X** = **0** --- Enumerated value for the X axis.
|
|
|
|
- **AXIS_Y** = **1** --- Enumerated value for the Y axis.
|
|
|
|
- **ZERO** = **Vector2( 0, 0 )** --- Zero vector.
|
|
|
|
- **ONE** = **Vector2( 1, 1 )** --- One vector.
|
|
|
|
- **INF** = **Vector2( inf, inf )** --- Infinity vector.
|
|
|
|
- **LEFT** = **Vector2( -1, 0 )** --- Left unit vector.
|
|
|
|
- **RIGHT** = **Vector2( 1, 0 )** --- Right unit vector.
|
|
|
|
- **UP** = **Vector2( 0, -1 )** --- Up unit vector.
|
|
|
|
- **DOWN** = **Vector2( 0, 1 )** --- Down unit vector.
|
|
|
|
Property Descriptions
|
|
---------------------
|
|
|
|
.. _class_Vector2_property_x:
|
|
|
|
- :ref:`float<class_float>` **x**
|
|
|
|
+-----------+---------+
|
|
| *Default* | ``0.0`` |
|
|
+-----------+---------+
|
|
|
|
The vector's X component. Also accessible by using the index position ``[0]``.
|
|
|
|
----
|
|
|
|
.. _class_Vector2_property_y:
|
|
|
|
- :ref:`float<class_float>` **y**
|
|
|
|
+-----------+---------+
|
|
| *Default* | ``0.0`` |
|
|
+-----------+---------+
|
|
|
|
The vector's Y component. Also accessible by using the index position ``[1]``.
|
|
|
|
Method Descriptions
|
|
-------------------
|
|
|
|
.. _class_Vector2_method_Vector2:
|
|
|
|
- :ref:`Vector2<class_Vector2>` **Vector2** **(** :ref:`Vector2i<class_Vector2i>` from **)**
|
|
|
|
Constructs a new ``Vector2`` from :ref:`Vector2i<class_Vector2i>`.
|
|
|
|
----
|
|
|
|
- :ref:`Vector2<class_Vector2>` **Vector2** **(** :ref:`float<class_float>` x, :ref:`float<class_float>` y **)**
|
|
|
|
Constructs a new ``Vector2`` from the given ``x`` and ``y``.
|
|
|
|
----
|
|
|
|
.. _class_Vector2_method_abs:
|
|
|
|
- :ref:`Vector2<class_Vector2>` **abs** **(** **)**
|
|
|
|
Returns a new vector with all components in absolute values (i.e. positive).
|
|
|
|
----
|
|
|
|
.. _class_Vector2_method_angle:
|
|
|
|
- :ref:`float<class_float>` **angle** **(** **)**
|
|
|
|
Returns the vector's angle in radians with respect to the X axis, or ``(1, 0)`` vector.
|
|
|
|
Equivalent to the result of :ref:`@GDScript.atan2<class_@GDScript_method_atan2>` when called with the vector's :ref:`x<class_Vector2_property_x>` and :ref:`y<class_Vector2_property_y>` as parameters: ``atan2(x, y)``.
|
|
|
|
----
|
|
|
|
.. _class_Vector2_method_angle_to:
|
|
|
|
- :ref:`float<class_float>` **angle_to** **(** :ref:`Vector2<class_Vector2>` to **)**
|
|
|
|
Returns the angle in radians between the two vectors.
|
|
|
|
----
|
|
|
|
.. _class_Vector2_method_angle_to_point:
|
|
|
|
- :ref:`float<class_float>` **angle_to_point** **(** :ref:`Vector2<class_Vector2>` to **)**
|
|
|
|
Returns the angle in radians between the line connecting the two points and the X coordinate.
|
|
|
|
----
|
|
|
|
.. _class_Vector2_method_aspect:
|
|
|
|
- :ref:`float<class_float>` **aspect** **(** **)**
|
|
|
|
Returns the ratio of :ref:`x<class_Vector2_property_x>` to :ref:`y<class_Vector2_property_y>`.
|
|
|
|
----
|
|
|
|
.. _class_Vector2_method_bounce:
|
|
|
|
- :ref:`Vector2<class_Vector2>` **bounce** **(** :ref:`Vector2<class_Vector2>` n **)**
|
|
|
|
Returns the vector "bounced off" from a plane defined by the given normal.
|
|
|
|
----
|
|
|
|
.. _class_Vector2_method_ceil:
|
|
|
|
- :ref:`Vector2<class_Vector2>` **ceil** **(** **)**
|
|
|
|
Returns the vector with all components rounded up.
|
|
|
|
----
|
|
|
|
.. _class_Vector2_method_clamped:
|
|
|
|
- :ref:`Vector2<class_Vector2>` **clamped** **(** :ref:`float<class_float>` length **)**
|
|
|
|
Returns the vector with a maximum length.
|
|
|
|
----
|
|
|
|
.. _class_Vector2_method_cross:
|
|
|
|
- :ref:`float<class_float>` **cross** **(** :ref:`Vector2<class_Vector2>` with **)**
|
|
|
|
Returns the 2-dimensional analog of the cross product with the given vector.
|
|
|
|
----
|
|
|
|
.. _class_Vector2_method_cubic_interpolate:
|
|
|
|
- :ref:`Vector2<class_Vector2>` **cubic_interpolate** **(** :ref:`Vector2<class_Vector2>` b, :ref:`Vector2<class_Vector2>` pre_a, :ref:`Vector2<class_Vector2>` post_b, :ref:`float<class_float>` t **)**
|
|
|
|
Cubically interpolates between this vector and ``b`` using ``pre_a`` and ``post_b`` as handles, and returns the result at position ``t``. ``t`` is in the range of ``0.0 - 1.0``, representing the amount of interpolation.
|
|
|
|
----
|
|
|
|
.. _class_Vector2_method_direction_to:
|
|
|
|
- :ref:`Vector2<class_Vector2>` **direction_to** **(** :ref:`Vector2<class_Vector2>` b **)**
|
|
|
|
Returns the normalized vector pointing from this vector to ``b``.
|
|
|
|
----
|
|
|
|
.. _class_Vector2_method_distance_squared_to:
|
|
|
|
- :ref:`float<class_float>` **distance_squared_to** **(** :ref:`Vector2<class_Vector2>` to **)**
|
|
|
|
Returns the squared distance to vector ``b``. Prefer this function over :ref:`distance_to<class_Vector2_method_distance_to>` if you need to sort vectors or need the squared distance for some formula.
|
|
|
|
----
|
|
|
|
.. _class_Vector2_method_distance_to:
|
|
|
|
- :ref:`float<class_float>` **distance_to** **(** :ref:`Vector2<class_Vector2>` to **)**
|
|
|
|
Returns the distance to vector ``b``.
|
|
|
|
----
|
|
|
|
.. _class_Vector2_method_dot:
|
|
|
|
- :ref:`float<class_float>` **dot** **(** :ref:`Vector2<class_Vector2>` with **)**
|
|
|
|
Returns the dot product with vector ``b``.
|
|
|
|
----
|
|
|
|
.. _class_Vector2_method_floor:
|
|
|
|
- :ref:`Vector2<class_Vector2>` **floor** **(** **)**
|
|
|
|
Returns the vector with all components rounded down.
|
|
|
|
----
|
|
|
|
.. _class_Vector2_method_is_equal_approx:
|
|
|
|
- :ref:`bool<class_bool>` **is_equal_approx** **(** :ref:`Vector2<class_Vector2>` v **)**
|
|
|
|
Returns ``true`` if this vector and ``v`` are approximately equal, by running :ref:`@GDScript.is_equal_approx<class_@GDScript_method_is_equal_approx>` on each component.
|
|
|
|
----
|
|
|
|
.. _class_Vector2_method_is_normalized:
|
|
|
|
- :ref:`bool<class_bool>` **is_normalized** **(** **)**
|
|
|
|
Returns ``true`` if the vector is normalized.
|
|
|
|
----
|
|
|
|
.. _class_Vector2_method_length:
|
|
|
|
- :ref:`float<class_float>` **length** **(** **)**
|
|
|
|
Returns the vector's length.
|
|
|
|
----
|
|
|
|
.. _class_Vector2_method_length_squared:
|
|
|
|
- :ref:`float<class_float>` **length_squared** **(** **)**
|
|
|
|
Returns the vector's length squared. Prefer this method over :ref:`length<class_Vector2_method_length>` if you need to sort vectors or need the squared length for some formula.
|
|
|
|
----
|
|
|
|
.. _class_Vector2_method_linear_interpolate:
|
|
|
|
- :ref:`Vector2<class_Vector2>` **linear_interpolate** **(** :ref:`Vector2<class_Vector2>` b, :ref:`float<class_float>` t **)**
|
|
|
|
Returns the result of the linear interpolation between this vector and ``b`` by amount ``t``. ``t`` is in the range of ``0.0 - 1.0``, representing the amount of interpolation.
|
|
|
|
----
|
|
|
|
.. _class_Vector2_method_move_toward:
|
|
|
|
- :ref:`Vector2<class_Vector2>` **move_toward** **(** :ref:`Vector2<class_Vector2>` to, :ref:`float<class_float>` delta **)**
|
|
|
|
Moves the vector toward ``to`` by the fixed ``delta`` amount.
|
|
|
|
----
|
|
|
|
.. _class_Vector2_method_normalized:
|
|
|
|
- :ref:`Vector2<class_Vector2>` **normalized** **(** **)**
|
|
|
|
Returns the vector scaled to unit length. Equivalent to ``v / v.length()``.
|
|
|
|
----
|
|
|
|
.. _class_Vector2_method_posmod:
|
|
|
|
- :ref:`Vector2<class_Vector2>` **posmod** **(** :ref:`float<class_float>` mod **)**
|
|
|
|
Returns a vector composed of the ``fposmod`` of this vector's components and ``mod``.
|
|
|
|
----
|
|
|
|
.. _class_Vector2_method_posmodv:
|
|
|
|
- :ref:`Vector2<class_Vector2>` **posmodv** **(** :ref:`Vector2<class_Vector2>` modv **)**
|
|
|
|
Returns a vector composed of the ``fposmod`` of this vector's components and ``modv``'s components.
|
|
|
|
----
|
|
|
|
.. _class_Vector2_method_project:
|
|
|
|
- :ref:`Vector2<class_Vector2>` **project** **(** :ref:`Vector2<class_Vector2>` b **)**
|
|
|
|
Returns the vector projected onto the vector ``b``.
|
|
|
|
----
|
|
|
|
.. _class_Vector2_method_reflect:
|
|
|
|
- :ref:`Vector2<class_Vector2>` **reflect** **(** :ref:`Vector2<class_Vector2>` n **)**
|
|
|
|
Returns the vector reflected from a plane defined by the given normal.
|
|
|
|
----
|
|
|
|
.. _class_Vector2_method_rotated:
|
|
|
|
- :ref:`Vector2<class_Vector2>` **rotated** **(** :ref:`float<class_float>` phi **)**
|
|
|
|
Returns the vector rotated by ``phi`` radians. See also :ref:`@GDScript.deg2rad<class_@GDScript_method_deg2rad>`.
|
|
|
|
----
|
|
|
|
.. _class_Vector2_method_round:
|
|
|
|
- :ref:`Vector2<class_Vector2>` **round** **(** **)**
|
|
|
|
Returns the vector with all components rounded to the nearest integer, with halfway cases rounded away from zero.
|
|
|
|
----
|
|
|
|
.. _class_Vector2_method_sign:
|
|
|
|
- :ref:`Vector2<class_Vector2>` **sign** **(** **)**
|
|
|
|
Returns the vector with each component set to one or negative one, depending on the signs of the components.
|
|
|
|
----
|
|
|
|
.. _class_Vector2_method_slerp:
|
|
|
|
- :ref:`Vector2<class_Vector2>` **slerp** **(** :ref:`Vector2<class_Vector2>` b, :ref:`float<class_float>` t **)**
|
|
|
|
Returns the result of spherical linear interpolation between this vector and ``b``, by amount ``t``. ``t`` is in the range of ``0.0 - 1.0``, representing the amount of interpolation.
|
|
|
|
**Note:** Both vectors must be normalized.
|
|
|
|
----
|
|
|
|
.. _class_Vector2_method_slide:
|
|
|
|
- :ref:`Vector2<class_Vector2>` **slide** **(** :ref:`Vector2<class_Vector2>` n **)**
|
|
|
|
Returns the component of the vector along a plane defined by the given normal.
|
|
|
|
----
|
|
|
|
.. _class_Vector2_method_snapped:
|
|
|
|
- :ref:`Vector2<class_Vector2>` **snapped** **(** :ref:`Vector2<class_Vector2>` by **)**
|
|
|
|
Returns the vector snapped to a grid with the given size.
|
|
|
|
----
|
|
|
|
.. _class_Vector2_method_tangent:
|
|
|
|
- :ref:`Vector2<class_Vector2>` **tangent** **(** **)**
|
|
|
|
Returns a perpendicular vector.
|
|
|