From 45c7af98625a1751f2a97aaf2a4a17d808b61092 Mon Sep 17 00:00:00 2001 From: PouleyKetchoupp Date: Tue, 17 Aug 2021 10:15:11 -0700 Subject: Restore RayShape as a regular shape type Partial revert from previously removing ray shapes completely, added back as a shape type but without the specific character controller code. --- doc/classes/PhysicsServer2D.xml | 21 ++++++++++++++------- doc/classes/PhysicsServer3D.xml | 26 +++++++++++++++++--------- doc/classes/RayShape2D.xml | 23 +++++++++++++++++++++++ doc/classes/RayShape3D.xml | 23 +++++++++++++++++++++++ 4 files changed, 77 insertions(+), 16 deletions(-) create mode 100644 doc/classes/RayShape2D.xml create mode 100644 doc/classes/RayShape3D.xml (limited to 'doc') diff --git a/doc/classes/PhysicsServer2D.xml b/doc/classes/PhysicsServer2D.xml index 1df2fd0158..ae6b5fda51 100644 --- a/doc/classes/PhysicsServer2D.xml +++ b/doc/classes/PhysicsServer2D.xml @@ -716,6 +716,11 @@ Sets a joint parameter. See [enum JointParam] for a list of available parameters. + + + + + @@ -840,25 +845,27 @@ This is the constant for creating world margin shapes. A world margin shape is an [i]infinite[/i] line with an origin point, and a normal. Thus, it can be used for front/behind checks. - + + + This is the constant for creating segment shapes. A segment shape is a [i]finite[/i] line from a point A to a point B. It can be checked for intersections. - + This is the constant for creating circle shapes. A circle shape only has a radius. It can be used for intersections and inside/outside checks. - + This is the constant for creating rectangle shapes. A rectangle shape is defined by a width and a height. It can be used for intersections and inside/outside checks. - + This is the constant for creating capsule shapes. A capsule shape is defined by a radius and a length. It can be used for intersections and inside/outside checks. - + This is the constant for creating convex polygon shapes. A polygon is defined by a list of points. It can be used for intersections and inside/outside checks. Unlike the [member CollisionPolygon2D.polygon] property, polygons modified with [method shape_set_data] do not verify that the points supplied form is a convex polygon. - + This is the constant for creating concave polygon shapes. A polygon is defined by a list of points. It can be used for intersections checks, but not for inside/outside checks. - + This constant is used internally by the engine. Any attempt to create this kind of shape results in an error. diff --git a/doc/classes/PhysicsServer3D.xml b/doc/classes/PhysicsServer3D.xml index 33eb0de698..a5234e90e7 100644 --- a/doc/classes/PhysicsServer3D.xml +++ b/doc/classes/PhysicsServer3D.xml @@ -849,6 +849,11 @@ + + + + + @@ -1171,31 +1176,34 @@ The [Shape3D] is a [WorldMarginShape3D]. - + + The [Shape3D] is a [RayShape3D]. + + The [Shape3D] is a [SphereShape3D]. - + The [Shape3D] is a [BoxShape3D]. - + The [Shape3D] is a [CapsuleShape3D]. - + The [Shape3D] is a [CylinderShape3D]. - + The [Shape3D] is a [ConvexPolygonShape3D]. - + The [Shape3D] is a [ConcavePolygonShape3D]. - + The [Shape3D] is a [HeightMapShape3D]. - + The [Shape3D] is a [SoftBody3D]. - + This constant is used internally by the engine. Any attempt to create this kind of shape results in an error. diff --git a/doc/classes/RayShape2D.xml b/doc/classes/RayShape2D.xml new file mode 100644 index 0000000000..432c650074 --- /dev/null +++ b/doc/classes/RayShape2D.xml @@ -0,0 +1,23 @@ + + + + Ray shape for 2D collisions. + + + Ray shape for 2D collisions. A ray is not really a collision body; instead, it tries to separate itself from whatever is touching its far endpoint. It's often useful for characters. + + + + + + + + The ray's length. + + + If [code]true[/code], allow the shape to return the correct normal. + + + + + diff --git a/doc/classes/RayShape3D.xml b/doc/classes/RayShape3D.xml new file mode 100644 index 0000000000..9839044c30 --- /dev/null +++ b/doc/classes/RayShape3D.xml @@ -0,0 +1,23 @@ + + + + Ray shape for 3D collisions. + + + Ray shape for 3D collisions, which can be set into a [PhysicsBody3D] or [Area3D]. A ray is not really a collision body; instead, it tries to separate itself from whatever is touching its far endpoint. It's often useful for characters. + + + + + + + + The ray's length. + + + If [code]true[/code], allow the shape to return the correct normal. + + + + + -- cgit v1.2.3 From d9720d439545792bd742645f3c6e3f7c29327aa8 Mon Sep 17 00:00:00 2001 From: PouleyKetchoupp Date: Thu, 19 Aug 2021 08:28:04 -0700 Subject: Fix CharacterBody motion with RayShape Make separation ray shapes work properly in move_and_slide, wihtout the specific code in CharacterBody like before. Now most of the logic is handled inside the physics server. The only thing that's needed is to use ray shapes only for recovery and ignore them when performing the motion itself (unless we're snapping or slips on slope is on). --- doc/classes/PhysicsServer2D.xml | 3 ++- doc/classes/PhysicsServer3D.xml | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'doc') diff --git a/doc/classes/PhysicsServer2D.xml b/doc/classes/PhysicsServer2D.xml index ae6b5fda51..758ffb9b14 100644 --- a/doc/classes/PhysicsServer2D.xml +++ b/doc/classes/PhysicsServer2D.xml @@ -595,7 +595,8 @@ - + + Returns [code]true[/code] if a collision would result from moving in the given direction from a given point in space. Margin increases the size of the shapes involved in the collision detection. [PhysicsTestMotionResult2D] can be passed to return additional information in. diff --git a/doc/classes/PhysicsServer3D.xml b/doc/classes/PhysicsServer3D.xml index a5234e90e7..cf353e1073 100644 --- a/doc/classes/PhysicsServer3D.xml +++ b/doc/classes/PhysicsServer3D.xml @@ -571,7 +571,8 @@ - + + Returns [code]true[/code] if a collision would result from moving in the given direction from a given point in space. Margin increases the size of the shapes involved in the collision detection. [PhysicsTestMotionResult3D] can be passed to return additional information in. -- cgit v1.2.3 From aa4791735d2fe92d747a39529aebb410f96cf38f Mon Sep 17 00:00:00 2001 From: PouleyKetchoupp Date: Thu, 19 Aug 2021 11:02:40 -0700 Subject: Rename slips_on_slope to slide_on_slope Also added some precision to the documentation. --- doc/classes/RayShape2D.xml | 5 +++-- doc/classes/RayShape3D.xml | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'doc') diff --git a/doc/classes/RayShape2D.xml b/doc/classes/RayShape2D.xml index 432c650074..50b89a0922 100644 --- a/doc/classes/RayShape2D.xml +++ b/doc/classes/RayShape2D.xml @@ -14,8 +14,9 @@ The ray's length. - - If [code]true[/code], allow the shape to return the correct normal. + + If [code]false[/code] (default), the shape always separates and returns a normal along its own direction. + If [code]true[/code], the shape can return the correct normal and separate in any direction, allowing sliding motion on slopes. diff --git a/doc/classes/RayShape3D.xml b/doc/classes/RayShape3D.xml index 9839044c30..e0b19e1a44 100644 --- a/doc/classes/RayShape3D.xml +++ b/doc/classes/RayShape3D.xml @@ -14,8 +14,9 @@ The ray's length. - - If [code]true[/code], allow the shape to return the correct normal. + + If [code]false[/code] (default), the shape always separates and returns a normal along its own direction. + If [code]true[/code], the shape can return the correct normal and separate in any direction, allowing sliding motion on slopes. -- cgit v1.2.3 From 3d5dc80348b9b377f6d8a33c7101d54b337396a5 Mon Sep 17 00:00:00 2001 From: PouleyKetchoupp Date: Thu, 19 Aug 2021 11:21:56 -0700 Subject: Rename RayShape to SeparationRayShape Makes it clearer that it's used for special cases when picking a collision shape. --- doc/classes/PhysicsServer2D.xml | 9 +++++---- doc/classes/PhysicsServer3D.xml | 6 +++--- doc/classes/RayShape2D.xml | 24 ------------------------ doc/classes/RayShape3D.xml | 24 ------------------------ doc/classes/SeparationRayShape2D.xml | 24 ++++++++++++++++++++++++ doc/classes/SeparationRayShape3D.xml | 24 ++++++++++++++++++++++++ 6 files changed, 56 insertions(+), 55 deletions(-) delete mode 100644 doc/classes/RayShape2D.xml delete mode 100644 doc/classes/RayShape3D.xml create mode 100644 doc/classes/SeparationRayShape2D.xml create mode 100644 doc/classes/SeparationRayShape3D.xml (limited to 'doc') diff --git a/doc/classes/PhysicsServer2D.xml b/doc/classes/PhysicsServer2D.xml index 758ffb9b14..d0ae665139 100644 --- a/doc/classes/PhysicsServer2D.xml +++ b/doc/classes/PhysicsServer2D.xml @@ -717,17 +717,17 @@ Sets a joint parameter. See [enum JointParam] for a list of available parameters. - + - + - + @@ -846,7 +846,8 @@ This is the constant for creating world margin shapes. A world margin shape is an [i]infinite[/i] line with an origin point, and a normal. Thus, it can be used for front/behind checks. - + + This is the constant for creating separation ray shapes. A separation ray is defined by a length and separates itself from what is touching its far endpoint. Useful for character controllers. This is the constant for creating segment shapes. A segment shape is a [i]finite[/i] line from a point A to a point B. It can be checked for intersections. diff --git a/doc/classes/PhysicsServer3D.xml b/doc/classes/PhysicsServer3D.xml index cf353e1073..c47a311161 100644 --- a/doc/classes/PhysicsServer3D.xml +++ b/doc/classes/PhysicsServer3D.xml @@ -850,7 +850,7 @@ - + @@ -1177,8 +1177,8 @@ The [Shape3D] is a [WorldMarginShape3D]. - - The [Shape3D] is a [RayShape3D]. + + The [Shape3D] is a [SeparationRayShape3D]. The [Shape3D] is a [SphereShape3D]. diff --git a/doc/classes/RayShape2D.xml b/doc/classes/RayShape2D.xml deleted file mode 100644 index 50b89a0922..0000000000 --- a/doc/classes/RayShape2D.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - Ray shape for 2D collisions. - - - Ray shape for 2D collisions. A ray is not really a collision body; instead, it tries to separate itself from whatever is touching its far endpoint. It's often useful for characters. - - - - - - - - The ray's length. - - - If [code]false[/code] (default), the shape always separates and returns a normal along its own direction. - If [code]true[/code], the shape can return the correct normal and separate in any direction, allowing sliding motion on slopes. - - - - - diff --git a/doc/classes/RayShape3D.xml b/doc/classes/RayShape3D.xml deleted file mode 100644 index e0b19e1a44..0000000000 --- a/doc/classes/RayShape3D.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - Ray shape for 3D collisions. - - - Ray shape for 3D collisions, which can be set into a [PhysicsBody3D] or [Area3D]. A ray is not really a collision body; instead, it tries to separate itself from whatever is touching its far endpoint. It's often useful for characters. - - - - - - - - The ray's length. - - - If [code]false[/code] (default), the shape always separates and returns a normal along its own direction. - If [code]true[/code], the shape can return the correct normal and separate in any direction, allowing sliding motion on slopes. - - - - - diff --git a/doc/classes/SeparationRayShape2D.xml b/doc/classes/SeparationRayShape2D.xml new file mode 100644 index 0000000000..fb90606577 --- /dev/null +++ b/doc/classes/SeparationRayShape2D.xml @@ -0,0 +1,24 @@ + + + + Separation ray shape for 2D collisions. + + + Separation ray shape for 2D collisions. A ray is not really a collision body; instead, it tries to separate itself from whatever is touching its far endpoint. It's often useful for characters. + + + + + + + + The ray's length. + + + If [code]false[/code] (default), the shape always separates and returns a normal along its own direction. + If [code]true[/code], the shape can return the correct normal and separate in any direction, allowing sliding motion on slopes. + + + + + diff --git a/doc/classes/SeparationRayShape3D.xml b/doc/classes/SeparationRayShape3D.xml new file mode 100644 index 0000000000..ea57e4eb59 --- /dev/null +++ b/doc/classes/SeparationRayShape3D.xml @@ -0,0 +1,24 @@ + + + + Separation ray shape for 3D collisions. + + + Separation ray shape for 3D collisions, which can be set into a [PhysicsBody3D] or [Area3D]. A ray is not really a collision body; instead, it tries to separate itself from whatever is touching its far endpoint. It's often useful for characters. + + + + + + + + The ray's length. + + + If [code]false[/code] (default), the shape always separates and returns a normal along its own direction. + If [code]true[/code], the shape can return the correct normal and separate in any direction, allowing sliding motion on slopes. + + + + + -- cgit v1.2.3