From be5d18163dfd84cec113f7a5685f66d95da102af Mon Sep 17 00:00:00 2001 From: Ricardo Buring Date: Tue, 20 Sep 2022 11:58:27 +0200 Subject: [PATCH] Document behavior of areas with concave shapes --- doc/classes/Area.xml | 4 +++- doc/classes/Area2D.xml | 2 ++ doc/classes/CollisionShape.xml | 3 ++- doc/classes/CollisionShape2D.xml | 3 ++- doc/classes/ConcavePolygonShape.xml | 1 + doc/classes/ConcavePolygonShape2D.xml | 1 + 6 files changed, 11 insertions(+), 3 deletions(-) diff --git a/doc/classes/Area.xml b/doc/classes/Area.xml index c7931a1338b..79af620bc9f 100644 --- a/doc/classes/Area.xml +++ b/doc/classes/Area.xml @@ -4,7 +4,9 @@ 3D area for detection and physics and audio influence. - 3D area that detects [CollisionObject] nodes overlapping, entering, or exiting. Can also alter or override local physics parameters (gravity, damping) and route audio to custom audio buses. + 3D area that detects [CollisionObject] nodes overlapping, entering, or exiting. Can also alter or override local physics parameters (gravity, damping) and route audio to a custom audio bus. + To give the area its shape, add a [CollisionShape] or a [CollisionPolygon] node as a [i]direct[/i] child (or add multiple such nodes as direct children) of the area. + [b]Warning:[/b] See [ConcavePolygonShape] (also called "trimesh") for a warning about possibly unexpected behavior when using that shape for an area. https://godotengine.org/asset-library/asset/125 diff --git a/doc/classes/Area2D.xml b/doc/classes/Area2D.xml index 3c4aa9998a0..e1cb50dfb92 100644 --- a/doc/classes/Area2D.xml +++ b/doc/classes/Area2D.xml @@ -5,6 +5,8 @@ 2D area that detects [CollisionObject2D] nodes overlapping, entering, or exiting. Can also alter or override local physics parameters (gravity, damping) and route audio to a custom audio bus. + To give the area its shape, add a [CollisionShape2D] or a [CollisionPolygon2D] node as a [i]direct[/i] child (or add multiple such nodes as direct children) of the area. + [b]Warning:[/b] See [ConcavePolygonShape2D] for a warning about possibly unexpected behavior when using that shape for an area. $DOCS_URL/tutorials/physics/using_area_2d.html diff --git a/doc/classes/CollisionShape.xml b/doc/classes/CollisionShape.xml index a8d48041ef5..58be3ddd95f 100644 --- a/doc/classes/CollisionShape.xml +++ b/doc/classes/CollisionShape.xml @@ -4,7 +4,8 @@ Node that represents collision shape data in 3D space. - Editor facility for creating and editing collision shapes in 3D space. You can use this node to represent all sorts of collision shapes, for example, add this to an [Area] to give it a detection shape, or add it to a [PhysicsBody] to create a solid object. [b]IMPORTANT[/b]: this is an Editor-only helper to create shapes, use [method CollisionObject.shape_owner_get_shape] to get the actual shape. + Editor facility for creating and editing collision shapes in 3D space. Set the [member shape] property to configure the shape. [b]IMPORTANT[/b]: this is an Editor-only helper to create shapes, use [method CollisionObject.shape_owner_get_shape] to get the actual shape. + You can use this node to represent all sorts of collision shapes, for example, add this to an [Area] to give it a detection shape, or add it to a [PhysicsBody] to create a solid object. $DOCS_URL/tutorials/physics/physics_introduction.html diff --git a/doc/classes/CollisionShape2D.xml b/doc/classes/CollisionShape2D.xml index bd4b8148809..0cf4aedaef5 100644 --- a/doc/classes/CollisionShape2D.xml +++ b/doc/classes/CollisionShape2D.xml @@ -4,7 +4,8 @@ Node that represents collision shape data in 2D space. - Editor facility for creating and editing collision shapes in 2D space. You can use this node to represent all sorts of collision shapes, for example, add this to an [Area2D] to give it a detection shape, or add it to a [PhysicsBody2D] to create a solid object. [b]IMPORTANT[/b]: this is an Editor-only helper to create shapes, use [method CollisionObject2D.shape_owner_get_shape] to get the actual shape. + Editor facility for creating and editing collision shapes in 2D space. Set the [member shape] property to configure the shape. [b]IMPORTANT[/b]: this is an Editor-only helper to create shapes, use [method CollisionObject2D.shape_owner_get_shape] to get the actual shape. + You can use this node to represent all sorts of collision shapes, for example, add this to an [Area2D] to give it a detection shape, or add it to a [PhysicsBody2D] to create a solid object. $DOCS_URL/tutorials/physics/physics_introduction.html diff --git a/doc/classes/ConcavePolygonShape.xml b/doc/classes/ConcavePolygonShape.xml index 4fe2750171b..e79511e79a8 100644 --- a/doc/classes/ConcavePolygonShape.xml +++ b/doc/classes/ConcavePolygonShape.xml @@ -6,6 +6,7 @@ Concave polygon shape resource, which can be set into a [PhysicsBody] or area. This shape is created by feeding a list of triangles. [b]Note:[/b] When used for collision, [ConcavePolygonShape] is intended to work with static [PhysicsBody] nodes like [StaticBody] and will not work with [KinematicBody] or [RigidBody] with a mode other than Static. + [b]Warning:[/b] Using this shape for an [Area] (via a [CollisionShape] node, created e.g. by using the [i]Create Trimesh Collision Sibling[/i] option in the [i]Mesh[/i] menu that appears when selecting a [MeshInstance] node) may give unexpected results: when using Godot Physics, the area will only detect collisions with the triangle faces in the [ConcavePolygonShape] (and not with any "inside" of the shape, for example), and when using Bullet Physics the area will not detect any collisions with the concave shape at all (this is a known bug). https://godotengine.org/asset-library/asset/675 diff --git a/doc/classes/ConcavePolygonShape2D.xml b/doc/classes/ConcavePolygonShape2D.xml index a46ea830976..cc6b83021c8 100644 --- a/doc/classes/ConcavePolygonShape2D.xml +++ b/doc/classes/ConcavePolygonShape2D.xml @@ -6,6 +6,7 @@ Concave polygon 2D shape resource for physics. It is made out of segments and is optimal for complex polygonal concave collisions. However, it is not advised to use for [RigidBody2D] nodes. A CollisionPolygon2D in convex decomposition mode (solids) or several convex objects are advised for that instead. Otherwise, a concave polygon 2D shape is better for static collisions. The main difference between a [ConvexPolygonShape2D] and a [ConcavePolygonShape2D] is that a concave polygon assumes it is concave and uses a more complex method of collision detection, and a convex one forces itself to be convex in order to speed up collision detection. + [b]Warning:[/b] Using this shape for an [Area2D] (via a [CollisionShape2D] node) may give unexpected results: the area will only detect collisions with the segments in the [ConcavePolygonShape2D] (and not with any "inside" of the shape, for example).