mirror of
https://github.com/godotengine/godot-docs.git
synced 2026-01-05 22:09:56 +03:00
classref: Sync with current 3.5 branch (af8a02dd)
This commit is contained in:
@@ -16,7 +16,23 @@ Description
|
||||
|
||||
An array specifically designed to hold :ref:`Vector3<class_Vector3>`. Optimized for memory usage, does not fragment the memory.
|
||||
|
||||
\ **Note:** This type is passed by value and not by reference.
|
||||
\ **Note:** This type is passed by value and not by reference. This means that when *mutating* a class property of type ``PoolVector3Array`` or mutating a ``PoolVector3Array`` within an :ref:`Array<class_Array>` or :ref:`Dictionary<class_Dictionary>`, changes will be lost:
|
||||
|
||||
::
|
||||
|
||||
var array = [PoolVector3Array()]
|
||||
array[0].push_back(Vector3(12, 34, 56))
|
||||
print(array) # [[]] (empty PoolVector3Array within an empty Array)
|
||||
|
||||
Instead, the entire ``PoolVector3Array`` property must be *reassigned* with ``=`` for it to be changed:
|
||||
|
||||
::
|
||||
|
||||
var array = [PoolVector3Array()]
|
||||
var pool_array = array[0]
|
||||
pool_array.push_back(Vector3(12, 34, 56))
|
||||
array[0] = pool_array
|
||||
print(array) # [[(12, 34, 56)]] (PoolVector3Array with 1 element inside an Array)
|
||||
|
||||
Methods
|
||||
-------
|
||||
@@ -28,10 +44,16 @@ Methods
|
||||
+-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`append_array<class_PoolVector3Array_method_append_array>` **(** :ref:`PoolVector3Array<class_PoolVector3Array>` array **)** |
|
||||
+-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`int<class_int>` | :ref:`count<class_PoolVector3Array_method_count>` **(** :ref:`Vector3<class_Vector3>` value **)** |
|
||||
+-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`empty<class_PoolVector3Array_method_empty>` **(** **)** |
|
||||
+-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`fill<class_PoolVector3Array_method_fill>` **(** :ref:`Vector3<class_Vector3>` vector3 **)** |
|
||||
+-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`int<class_int>` | :ref:`find<class_PoolVector3Array_method_find>` **(** :ref:`Vector3<class_Vector3>` value, :ref:`int<class_int>` from=0 **)** |
|
||||
+-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`has<class_PoolVector3Array_method_has>` **(** :ref:`Vector3<class_Vector3>` value **)** |
|
||||
+-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`int<class_int>` | :ref:`insert<class_PoolVector3Array_method_insert>` **(** :ref:`int<class_int>` idx, :ref:`Vector3<class_Vector3>` vector3 **)** |
|
||||
+-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`invert<class_PoolVector3Array_method_invert>` **(** **)** |
|
||||
@@ -42,6 +64,8 @@ Methods
|
||||
+-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`resize<class_PoolVector3Array_method_resize>` **(** :ref:`int<class_int>` idx **)** |
|
||||
+-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`int<class_int>` | :ref:`rfind<class_PoolVector3Array_method_rfind>` **(** :ref:`Vector3<class_Vector3>` value, :ref:`int<class_int>` from=-1 **)** |
|
||||
+-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`set<class_PoolVector3Array_method_set>` **(** :ref:`int<class_int>` idx, :ref:`Vector3<class_Vector3>` vector3 **)** |
|
||||
+-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`int<class_int>` | :ref:`size<class_PoolVector3Array_method_size>` **(** **)** |
|
||||
@@ -74,6 +98,14 @@ Appends a ``PoolVector3Array`` at the end of this array.
|
||||
|
||||
----
|
||||
|
||||
.. _class_PoolVector3Array_method_count:
|
||||
|
||||
- :ref:`int<class_int>` **count** **(** :ref:`Vector3<class_Vector3>` value **)**
|
||||
|
||||
Returns the number of times an element is in the array.
|
||||
|
||||
----
|
||||
|
||||
.. _class_PoolVector3Array_method_empty:
|
||||
|
||||
- :ref:`bool<class_bool>` **empty** **(** **)**
|
||||
@@ -90,6 +122,24 @@ Assigns the given value to all elements in the array. This can typically be used
|
||||
|
||||
----
|
||||
|
||||
.. _class_PoolVector3Array_method_find:
|
||||
|
||||
- :ref:`int<class_int>` **find** **(** :ref:`Vector3<class_Vector3>` value, :ref:`int<class_int>` from=0 **)**
|
||||
|
||||
Searches the array for a value and returns its index or ``-1`` if not found. Optionally, the initial search index can be passed. Returns ``-1`` if ``from`` is out of bounds.
|
||||
|
||||
----
|
||||
|
||||
.. _class_PoolVector3Array_method_has:
|
||||
|
||||
- :ref:`bool<class_bool>` **has** **(** :ref:`Vector3<class_Vector3>` value **)**
|
||||
|
||||
Returns ``true`` if the array contains the given value.
|
||||
|
||||
\ **Note:** This is equivalent to using the ``in`` operator.
|
||||
|
||||
----
|
||||
|
||||
.. _class_PoolVector3Array_method_insert:
|
||||
|
||||
- :ref:`int<class_int>` **insert** **(** :ref:`int<class_int>` idx, :ref:`Vector3<class_Vector3>` vector3 **)**
|
||||
@@ -130,6 +180,14 @@ Sets the size of the array. If the array is grown, reserves elements at the end
|
||||
|
||||
----
|
||||
|
||||
.. _class_PoolVector3Array_method_rfind:
|
||||
|
||||
- :ref:`int<class_int>` **rfind** **(** :ref:`Vector3<class_Vector3>` value, :ref:`int<class_int>` from=-1 **)**
|
||||
|
||||
Searches the array in reverse order. Optionally, a start search index can be passed. If negative, the start index is considered relative to the end of the array. If the adjusted start index is out of bounds, this method searches from the end of the array.
|
||||
|
||||
----
|
||||
|
||||
.. _class_PoolVector3Array_method_set:
|
||||
|
||||
- void **set** **(** :ref:`int<class_int>` idx, :ref:`Vector3<class_Vector3>` vector3 **)**
|
||||
|
||||
Reference in New Issue
Block a user