:github_url: hide .. DO NOT EDIT THIS FILE!!! .. Generated automatically from Godot engine sources. .. Generator: https://github.com/godotengine/godot/tree/3.6/doc/tools/make_rst.py. .. XML source: https://github.com/godotengine/godot/tree/3.6/doc/classes/PoolVector3Array.xml. .. _class_PoolVector3Array: PoolVector3Array ================ A pooled array of :ref:`Vector3`. .. rst-class:: classref-introduction-group Description ----------- An array specifically designed to hold :ref:`Vector3`. Optimized for memory usage, does not fragment the memory. \ **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` or :ref:`Dictionary`, changes will be lost: :: var array = [PoolVector3Array()] array[0].push_back(Vector3(12, 34, 56)) print(array) # [[]] (empty PoolVector3Array within an 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) .. rst-class:: classref-reftable-group Methods ------- .. table:: :widths: auto +-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | :ref:`PoolVector3Array` | :ref:`PoolVector3Array` **(** :ref:`Array` from **)** | +-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`append` **(** :ref:`Vector3` vector3 **)** | +-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`append_array` **(** :ref:`PoolVector3Array` array **)** | +-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`clear` **(** **)** | +-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`count` **(** :ref:`Vector3` value **)** | +-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`empty` **(** **)** | +-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`fill` **(** :ref:`Vector3` vector3 **)** | +-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`find` **(** :ref:`Vector3` value, :ref:`int` from=0 **)** | +-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`has` **(** :ref:`Vector3` value **)** | +-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`insert` **(** :ref:`int` idx, :ref:`Vector3` vector3 **)** | +-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`invert` **(** **)** | +-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`push_back` **(** :ref:`Vector3` vector3 **)** | +-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`remove` **(** :ref:`int` idx **)** | +-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`resize` **(** :ref:`int` idx **)** | +-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`rfind` **(** :ref:`Vector3` value, :ref:`int` from=-1 **)** | +-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set` **(** :ref:`int` idx, :ref:`Vector3` vector3 **)** | +-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`size` **(** **)** | +-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`sort` **(** **)** | +-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Method Descriptions ------------------- .. _class_PoolVector3Array_method_PoolVector3Array: .. rst-class:: classref-method :ref:`PoolVector3Array` **PoolVector3Array** **(** :ref:`Array` from **)** Constructs a new **PoolVector3Array**. Optionally, you can pass in a generic :ref:`Array` that will be converted. .. rst-class:: classref-item-separator ---- .. _class_PoolVector3Array_method_append: .. rst-class:: classref-method void **append** **(** :ref:`Vector3` vector3 **)** Appends an element at the end of the array (alias of :ref:`push_back`). .. rst-class:: classref-item-separator ---- .. _class_PoolVector3Array_method_append_array: .. rst-class:: classref-method void **append_array** **(** :ref:`PoolVector3Array` array **)** Appends a **PoolVector3Array** at the end of this array. .. rst-class:: classref-item-separator ---- .. _class_PoolVector3Array_method_clear: .. rst-class:: classref-method void **clear** **(** **)** Clears the array. This is equivalent to using :ref:`resize` with a size of ``0``. .. rst-class:: classref-item-separator ---- .. _class_PoolVector3Array_method_count: .. rst-class:: classref-method :ref:`int` **count** **(** :ref:`Vector3` value **)** Returns the number of times an element is in the array. .. rst-class:: classref-item-separator ---- .. _class_PoolVector3Array_method_empty: .. rst-class:: classref-method :ref:`bool` **empty** **(** **)** Returns ``true`` if the array is empty. .. rst-class:: classref-item-separator ---- .. _class_PoolVector3Array_method_fill: .. rst-class:: classref-method void **fill** **(** :ref:`Vector3` vector3 **)** Assigns the given value to all elements in the array. This can typically be used together with :ref:`resize` to create an array with a given size and initialized elements. .. rst-class:: classref-item-separator ---- .. _class_PoolVector3Array_method_find: .. rst-class:: classref-method :ref:`int` **find** **(** :ref:`Vector3` value, :ref:`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. .. rst-class:: classref-item-separator ---- .. _class_PoolVector3Array_method_has: .. rst-class:: classref-method :ref:`bool` **has** **(** :ref:`Vector3` value **)** Returns ``true`` if the array contains the given value. \ **Note:** This is equivalent to using the ``in`` operator. .. rst-class:: classref-item-separator ---- .. _class_PoolVector3Array_method_insert: .. rst-class:: classref-method :ref:`int` **insert** **(** :ref:`int` idx, :ref:`Vector3` vector3 **)** Inserts a new element at a given position in the array. The position must be valid, or at the end of the array (``idx == size()``). .. rst-class:: classref-item-separator ---- .. _class_PoolVector3Array_method_invert: .. rst-class:: classref-method void **invert** **(** **)** Reverses the order of the elements in the array. .. rst-class:: classref-item-separator ---- .. _class_PoolVector3Array_method_push_back: .. rst-class:: classref-method void **push_back** **(** :ref:`Vector3` vector3 **)** Inserts a :ref:`Vector3` at the end. .. rst-class:: classref-item-separator ---- .. _class_PoolVector3Array_method_remove: .. rst-class:: classref-method void **remove** **(** :ref:`int` idx **)** Removes an element from the array by index. .. rst-class:: classref-item-separator ---- .. _class_PoolVector3Array_method_resize: .. rst-class:: classref-method void **resize** **(** :ref:`int` idx **)** Sets the size of the array. If the array is grown, reserves elements at the end of the array. If the array is shrunk, truncates the array to the new size. .. rst-class:: classref-item-separator ---- .. _class_PoolVector3Array_method_rfind: .. rst-class:: classref-method :ref:`int` **rfind** **(** :ref:`Vector3` value, :ref:`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. .. rst-class:: classref-item-separator ---- .. _class_PoolVector3Array_method_set: .. rst-class:: classref-method void **set** **(** :ref:`int` idx, :ref:`Vector3` vector3 **)** Changes the :ref:`Vector3` at the given index. .. rst-class:: classref-item-separator ---- .. _class_PoolVector3Array_method_size: .. rst-class:: classref-method :ref:`int` **size** **(** **)** Returns the number of elements in the array. .. rst-class:: classref-item-separator ---- .. _class_PoolVector3Array_method_sort: .. rst-class:: classref-method void **sort** **(** **)** Sorts the elements of the array in ascending order. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`