2017-09-12 20:42:36 +00:00
<?xml version="1.0" encoding="UTF-8" ?>
2022-03-16 22:01:02 +00:00
<class name= "PoolVector3Array" version= "3.5" xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation= "../class.xsd" >
2017-09-12 20:42:36 +00:00
<brief_description >
2022-04-23 03:07:55 +00:00
A pooled array of [Vector3].
2017-09-12 20:42:36 +00:00
</brief_description>
<description >
2022-04-23 03:07:55 +00:00
An array specifically designed to hold [Vector3]. Optimized for memory usage, does not fragment the memory.
2022-03-28 14:16:41 +00:00
[b]Note:[/b] This type is passed by value and not by reference. This means that when [i]mutating[/i] a class property of type [PoolVector3Array] or mutating a [PoolVector3Array] within an [Array] or [Dictionary], changes will be lost:
[codeblock]
var array = [PoolVector3Array()]
array[0].push_back(Vector3(12, 34, 56))
2022-06-01 07:57:51 +00:00
print(array) # [[]] (empty PoolVector3Array within an Array)
2022-03-28 14:16:41 +00:00
[/codeblock]
Instead, the entire [PoolVector3Array] property must be [i]reassigned[/i] with [code]=[/code] for it to be changed:
[codeblock]
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)
[/codeblock]
2017-09-12 20:42:36 +00:00
</description>
<tutorials >
</tutorials>
<methods >
<method name= "PoolVector3Array" >
2021-07-30 13:28:05 +00:00
<return type= "PoolVector3Array" />
<argument index= "0" name= "from" type= "Array" />
2017-09-12 20:42:36 +00:00
<description >
2019-06-21 23:04:47 +00:00
Constructs a new [PoolVector3Array]. Optionally, you can pass in a generic [Array] that will be converted.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "append" >
2021-07-30 13:28:05 +00:00
<argument index= "0" name= "vector3" type= "Vector3" />
2017-09-12 20:42:36 +00:00
<description >
2019-06-21 23:04:47 +00:00
Appends an element at the end of the array (alias of [method push_back]).
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "append_array" >
2021-07-30 13:28:05 +00:00
<argument index= "0" name= "array" type= "PoolVector3Array" />
2017-09-12 20:42:36 +00:00
<description >
2019-06-21 23:04:47 +00:00
Appends a [PoolVector3Array] at the end of this array.
2017-09-12 20:42:36 +00:00
</description>
</method>
2022-05-07 11:47:49 +00:00
<method name= "count" >
<return type= "int" />
<argument index= "0" name= "value" type= "Vector3" />
<description >
Returns the number of times an element is in the array.
</description>
</method>
2019-10-31 15:27:32 +00:00
<method name= "empty" >
2021-07-30 13:28:05 +00:00
<return type= "bool" />
2019-10-31 15:27:32 +00:00
<description >
Returns [code]true[/code] if the array is empty.
</description>
</method>
2022-04-22 10:45:34 +00:00
<method name= "fill" >
<argument index= "0" name= "vector3" type= "Vector3" />
<description >
Assigns the given value to all elements in the array. This can typically be used together with [method resize] to create an array with a given size and initialized elements.
</description>
</method>
2022-05-07 11:47:49 +00:00
<method name= "find" >
<return type= "int" />
<argument index= "0" name= "value" type= "Vector3" />
<argument index= "1" name= "from" type= "int" default= "0" />
<description >
Searches the array for a value and returns its index or [code]-1[/code] if not found. Optionally, the initial search index can be passed. Returns [code]-1[/code] if [code]from[/code] is out of bounds.
</description>
</method>
<method name= "has" >
<return type= "bool" />
<argument index= "0" name= "value" type= "Vector3" />
<description >
Returns [code]true[/code] if the array contains the given value.
[b]Note:[/b] This is equivalent to using the [code]in[/code] operator.
</description>
</method>
2017-09-12 20:42:36 +00:00
<method name= "insert" >
2021-07-30 13:28:05 +00:00
<return type= "int" />
<argument index= "0" name= "idx" type= "int" />
<argument index= "1" name= "vector3" type= "Vector3" />
2017-09-12 20:42:36 +00:00
<description >
2019-06-21 23:04:47 +00:00
Inserts a new element at a given position in the array. The position must be valid, or at the end of the array ([code]idx == size()[/code]).
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "invert" >
<description >
2019-06-21 23:04:47 +00:00
Reverses the order of the elements in the array.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "push_back" >
2021-07-30 13:28:05 +00:00
<argument index= "0" name= "vector3" type= "Vector3" />
2017-09-12 20:42:36 +00:00
<description >
2019-06-21 23:04:47 +00:00
Inserts a [Vector3] at the end.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "remove" >
2021-07-30 13:28:05 +00:00
<argument index= "0" name= "idx" type= "int" />
2017-09-12 20:42:36 +00:00
<description >
2019-06-21 23:04:47 +00:00
Removes an element from the array by index.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "resize" >
2021-07-30 13:28:05 +00:00
<argument index= "0" name= "idx" type= "int" />
2017-09-12 20:42:36 +00:00
<description >
2019-06-21 23:04:47 +00:00
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.
2017-09-12 20:42:36 +00:00
</description>
</method>
2022-05-07 11:47:49 +00:00
<method name= "rfind" >
<return type= "int" />
<argument index= "0" name= "value" type= "Vector3" />
<argument index= "1" name= "from" type= "int" default= "-1" />
<description >
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.
</description>
</method>
2017-09-12 20:42:36 +00:00
<method name= "set" >
2021-07-30 13:28:05 +00:00
<argument index= "0" name= "idx" type= "int" />
<argument index= "1" name= "vector3" type= "Vector3" />
2017-09-12 20:42:36 +00:00
<description >
2019-06-21 23:04:47 +00:00
Changes the [Vector3] at the given index.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "size" >
2021-07-30 13:28:05 +00:00
<return type= "int" />
2017-09-12 20:42:36 +00:00
<description >
2022-01-06 10:46:25 +00:00
Returns the number of elements in the array.
2017-09-12 20:42:36 +00:00
</description>
</method>
2021-11-04 13:30:12 +00:00
<method name= "sort" >
<description >
Sorts the elements of the array in ascending order.
</description>
</method>
2017-09-12 20:42:36 +00:00
</methods>
<constants >
</constants>
</class>