summaryrefslogtreecommitdiff
path: root/doc/classes
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-09-21 21:30:30 +0200
committerGitHub <noreply@github.com>2021-09-21 21:30:30 +0200
commitba57252bd8d7928c29e818b1ccf557e279c33ca0 (patch)
tree6b037a4a0b8b6907d571b1b847ed6ab3bc7507c3 /doc/classes
parent726b826b310900ff475122ed65934d2499b8db4d (diff)
parent90908cd67d3f44ba70cc4b7b32f024ce508cc0ee (diff)
Merge pull request #52878 from AnilBK/add-get-center
Diffstat (limited to 'doc/classes')
-rw-r--r--doc/classes/AABB.xml6
-rw-r--r--doc/classes/Rect2.xml6
-rw-r--r--doc/classes/Rect2i.xml7
3 files changed, 19 insertions, 0 deletions
diff --git a/doc/classes/AABB.xml b/doc/classes/AABB.xml
index d64e014117..5d18f69409 100644
--- a/doc/classes/AABB.xml
+++ b/doc/classes/AABB.xml
@@ -61,6 +61,12 @@
Returns the volume of the [AABB].
</description>
</method>
+ <method name="get_center" qualifiers="const">
+ <return type="Vector3" />
+ <description>
+ Returns the center of the [AABB], which is equal to [member position] + ([member size] / 2).
+ </description>
+ </method>
<method name="get_endpoint" qualifiers="const">
<return type="Vector3" />
<argument index="0" name="idx" type="int" />
diff --git a/doc/classes/Rect2.xml b/doc/classes/Rect2.xml
index b7577ca5d9..e585224818 100644
--- a/doc/classes/Rect2.xml
+++ b/doc/classes/Rect2.xml
@@ -78,6 +78,12 @@
Returns the area of the [Rect2].
</description>
</method>
+ <method name="get_center" qualifiers="const">
+ <return type="Vector2" />
+ <description>
+ Returns the center of the [Rect2], which is equal to [member position] + ([member size] / 2).
+ </description>
+ </method>
<method name="grow" qualifiers="const">
<return type="Rect2" />
<argument index="0" name="amount" type="float" />
diff --git a/doc/classes/Rect2i.xml b/doc/classes/Rect2i.xml
index c578b8cbb4..2f6f4de66d 100644
--- a/doc/classes/Rect2i.xml
+++ b/doc/classes/Rect2i.xml
@@ -76,6 +76,13 @@
Returns the area of the [Rect2i].
</description>
</method>
+ <method name="get_center" qualifiers="const">
+ <return type="Vector2i" />
+ <description>
+ Returns the center of the [Rect2i], which is equal to [member position] + ([member size] / 2).
+ If [member size] is an odd number, the returned center value will be rounded towards [member position].
+ </description>
+ </method>
<method name="grow" qualifiers="const">
<return type="Rect2i" />
<argument index="0" name="amount" type="int" />