Răsfoiți Sursa

Document Vector3 and Vector3Array. Fix documentation of Vector2 and Vector2Array.

Bojidar Marinov 9 ani în urmă
părinte
comite
4359a90cca
1 a modificat fișierele cu 33 adăugiri și 13 ștergeri
  1. 33 13
      doc/base/classes.xml

+ 33 - 13
doc/base/classes.xml

@@ -37623,7 +37623,7 @@ This method controls whether the position between two cached points is interpola
 			<argument index="0" name="vec" type="Vector2">
 			<argument index="0" name="vec" type="Vector2">
 			</argument>
 			</argument>
 			<description>
 			<description>
-			Reflects/mirrors the vector around another vector.
+			Like "slide", but reflects the Vector instead of continuing along the wall.
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="rotated">
 		<method name="rotated">
@@ -37687,10 +37687,10 @@ This method controls whether the position between two cached points is interpola
 </class>
 </class>
 <class name="Vector2Array" category="Built-In Types">
 <class name="Vector2Array" category="Built-In Types">
 	<brief_description>
 	<brief_description>
-	An Array of Vector2's.
+	An Array of Vector2.
 	</brief_description>
 	</brief_description>
 	<description>
 	<description>
-	An Array specifically designed to hold Vector2's.
+	An Array specifically designed to hold Vector2.
 	</description>
 	</description>
 	<methods>
 	<methods>
 		<method name="get">
 		<method name="get">
@@ -37699,21 +37699,21 @@ This method controls whether the position between two cached points is interpola
 			<argument index="0" name="idx" type="int">
 			<argument index="0" name="idx" type="int">
 			</argument>
 			</argument>
 			<description>
 			<description>
-			Get the Vector2 at the given index.
+			Returns the Vector2 at the given index.
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="push_back">
 		<method name="push_back">
 			<argument index="0" name="vector2" type="Vector2">
 			<argument index="0" name="vector2" type="Vector2">
 			</argument>
 			</argument>
 			<description>
 			<description>
-			Insert a new Vector2.
+			Inserts a Vector2 at the end.
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="resize">
 		<method name="resize">
 			<argument index="0" name="idx" type="int">
 			<argument index="0" name="idx" type="int">
 			</argument>
 			</argument>
 			<description>
 			<description>
-			Set the size of the Vector2Array. If larger than the current size it will reserve some space beforehand, and if it is smaller it will cut off the array.
+			Sets the size of the Vector2Array. If larger than the current size it will reserve some space beforehand, and if it is smaller it will cut off the array.
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="set">
 		<method name="set">
@@ -37722,7 +37722,7 @@ This method controls whether the position between two cached points is interpola
 			<argument index="1" name="vector2" type="Vector2">
 			<argument index="1" name="vector2" type="Vector2">
 			</argument>
 			</argument>
 			<description>
 			<description>
-			Set the Vector2 at the given index.
+			Changes the Vector2 at the given index.
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="size">
 		<method name="size">
@@ -37757,12 +37757,14 @@ This method controls whether the position between two cached points is interpola
 			<return type="Vector3">
 			<return type="Vector3">
 			</return>
 			</return>
 			<description>
 			<description>
+			Returns a new vector with all components in absolute values (e.g. positive).
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="ceil">
 		<method name="ceil">
 			<return type="Vector3">
 			<return type="Vector3">
 			</return>
 			</return>
 			<description>
 			<description>
+			Returns a new vector with all components rounded up.
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="cross">
 		<method name="cross">
@@ -37786,7 +37788,7 @@ This method controls whether the position between two cached points is interpola
 			<argument index="3" name="t" type="float">
 			<argument index="3" name="t" type="float">
 			</argument>
 			</argument>
 			<description>
 			<description>
-			Perform a cubic interpolation between vectors a,b,c,d (b is current), by the given amount (i).
+			Perform a cubic interpolation between vectors pre_a, a, b, post_b (a is current), by the given amount (t).
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="distance_squared_to">
 		<method name="distance_squared_to">
@@ -37795,7 +37797,7 @@ This method controls whether the position between two cached points is interpola
 			<argument index="0" name="b" type="Vector3">
 			<argument index="0" name="b" type="Vector3">
 			</argument>
 			</argument>
 			<description>
 			<description>
-			Return the squared distance (distance minus the last square root) to b.
+			Return the squared distance (distance minus the last square root) to b. Prefer this function over distance_to if you need to sort vectors or need the squared distance for some formula.
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="distance_to">
 		<method name="distance_to">
@@ -37820,13 +37822,14 @@ This method controls whether the position between two cached points is interpola
 			<return type="Vector3">
 			<return type="Vector3">
 			</return>
 			</return>
 			<description>
 			<description>
+			Returns a new vector with all components rounded down.
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="inverse">
 		<method name="inverse">
 			<return type="Vector3">
 			<return type="Vector3">
 			</return>
 			</return>
 			<description>
 			<description>
-			Returns the inverse of the vector. this is the same as Vector3( 1.0 / v.x, 1.0 / v.y, 1.0 / v.z )
+			Returns the inverse of the vector. This is the same as Vector3( 1.0 / v.x, 1.0 / v.y, 1.0 / v.z )
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="length">
 		<method name="length">
@@ -37840,7 +37843,7 @@ This method controls whether the position between two cached points is interpola
 			<return type="float">
 			<return type="float">
 			</return>
 			</return>
 			<description>
 			<description>
-			Return the length of the vector, squared.
+			Return the length of the vector, squared. Prefer this function over "length" if you need to sort vectors or need the squared length for some formula.
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="linear_interpolate">
 		<method name="linear_interpolate">
@@ -37851,26 +37854,28 @@ This method controls whether the position between two cached points is interpola
 			<argument index="1" name="t" type="float">
 			<argument index="1" name="t" type="float">
 			</argument>
 			</argument>
 			<description>
 			<description>
-			Linearly interpolates the vector to a given one (b), by the given amount (i).
+			Linearly interpolates the vector to a given one (b), by the given amount (t).
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="max_axis">
 		<method name="max_axis">
 			<return type="int">
 			<return type="int">
 			</return>
 			</return>
 			<description>
 			<description>
+			Returns AXIS_X, AXIS_Y or AXIS_Z depending on which axis is the largest.
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="min_axis">
 		<method name="min_axis">
 			<return type="int">
 			<return type="int">
 			</return>
 			</return>
 			<description>
 			<description>
+			Returns AXIS_X, AXIS_Y or AXIS_Z depending on which axis is the smallest.
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="normalized">
 		<method name="normalized">
 			<return type="Vector3">
 			<return type="Vector3">
 			</return>
 			</return>
 			<description>
 			<description>
-			Return a copy of the normalized vector to unit length. This is the same as v / v.length()
+			Return a copy of the normalized vector to unit length. This is the same as v / v.length().
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="reflect">
 		<method name="reflect">
@@ -37879,6 +37884,7 @@ This method controls whether the position between two cached points is interpola
 			<argument index="0" name="by" type="Vector3">
 			<argument index="0" name="by" type="Vector3">
 			</argument>
 			</argument>
 			<description>
 			<description>
+			Like "slide", but reflects the Vector instead of continuing along the wall.
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="rotated">
 		<method name="rotated">
@@ -37889,6 +37895,7 @@ This method controls whether the position between two cached points is interpola
 			<argument index="1" name="phi" type="float">
 			<argument index="1" name="phi" type="float">
 			</argument>
 			</argument>
 			<description>
 			<description>
+			Rotates the vector around some axis by phi radians.
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="slide">
 		<method name="slide">
@@ -37897,6 +37904,7 @@ This method controls whether the position between two cached points is interpola
 			<argument index="0" name="by" type="Vector3">
 			<argument index="0" name="by" type="Vector3">
 			</argument>
 			</argument>
 			<description>
 			<description>
+			Slides the vector along a wall.
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="snapped">
 		<method name="snapped">
@@ -37918,6 +37926,7 @@ This method controls whether the position between two cached points is interpola
 			<argument index="2" name="z" type="float">
 			<argument index="2" name="z" type="float">
 			</argument>
 			</argument>
 			<description>
 			<description>
+			Returns a Vector3 with the given components.
 			</description>
 			</description>
 		</method>
 		</method>
 	</methods>
 	</methods>
@@ -37931,17 +37940,22 @@ This method controls whether the position between two cached points is interpola
 	</members>
 	</members>
 	<constants>
 	<constants>
 		<constant name="AXIS_X" value="0">
 		<constant name="AXIS_X" value="0">
+			Enumerated value for the X axis. Returned by functions like max_axis or min_axis.
 		</constant>
 		</constant>
 		<constant name="AXIS_Y" value="1">
 		<constant name="AXIS_Y" value="1">
+			Enumerated value for the Y axis.
 		</constant>
 		</constant>
 		<constant name="AXIS_Z" value="2">
 		<constant name="AXIS_Z" value="2">
+			Enumerated value for the Z axis.
 		</constant>
 		</constant>
 	</constants>
 	</constants>
 </class>
 </class>
 <class name="Vector3Array" category="Built-In Types">
 <class name="Vector3Array" category="Built-In Types">
 	<brief_description>
 	<brief_description>
+	An Array of Vector3.
 	</brief_description>
 	</brief_description>
 	<description>
 	<description>
+	An Array specifically designed to hold Vector3.
 	</description>
 	</description>
 	<methods>
 	<methods>
 		<method name="get">
 		<method name="get">
@@ -37950,18 +37964,21 @@ This method controls whether the position between two cached points is interpola
 			<argument index="0" name="idx" type="int">
 			<argument index="0" name="idx" type="int">
 			</argument>
 			</argument>
 			<description>
 			<description>
+			Returns the Vector3 at the given index.
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="push_back">
 		<method name="push_back">
 			<argument index="0" name="vector3" type="Vector3">
 			<argument index="0" name="vector3" type="Vector3">
 			</argument>
 			</argument>
 			<description>
 			<description>
+			Inserts a Vector3 at the end.
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="resize">
 		<method name="resize">
 			<argument index="0" name="idx" type="int">
 			<argument index="0" name="idx" type="int">
 			</argument>
 			</argument>
 			<description>
 			<description>
+			Sets the size of the Vector3Array. If larger than the current size it will reserve some space beforehand, and if it is smaller it will cut off the array.
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="set">
 		<method name="set">
@@ -37970,12 +37987,14 @@ This method controls whether the position between two cached points is interpola
 			<argument index="1" name="vector3" type="Vector3">
 			<argument index="1" name="vector3" type="Vector3">
 			</argument>
 			</argument>
 			<description>
 			<description>
+			Changes the Vector3 at the given index.
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="size">
 		<method name="size">
 			<return type="int">
 			<return type="int">
 			</return>
 			</return>
 			<description>
 			<description>
+			Returns the size of the array.
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="Vector3Array">
 		<method name="Vector3Array">
@@ -37984,6 +38003,7 @@ This method controls whether the position between two cached points is interpola
 			<argument index="0" name="from" type="Array">
 			<argument index="0" name="from" type="Array">
 			</argument>
 			</argument>
 			<description>
 			<description>
+			Constructs a new Vector3Array. Optionally, you can pass in an Array that will be converted.
 			</description>
 			</description>
 		</method>
 		</method>
 	</methods>
 	</methods>