summaryrefslogtreecommitdiff
path: root/doc/classes
diff options
context:
space:
mode:
authorPouleyKetchoupp <pouleyketchoup@gmail.com>2021-08-09 18:16:45 -0700
committerPouleyKetchoupp <pouleyketchoup@gmail.com>2021-08-09 20:21:04 -0700
commitec9fed69f4676e42e677c551423cd5f5c8f13100 (patch)
treea1835870914ec82443c149f9bad7a5ebebc80b34 /doc/classes
parentf3ddc14d3829ed09d6eab81811bcfb1314626ddf (diff)
Fix 3D moving platform logic
Same thing that was already done in 2D, applies moving platform motion by using a call to move_and_collide that excludes the platform itself, instead of making it part of the body motion. Helps with handling walls and slopes correctly when the character walks on the moving platform. Also made some minor adjustments to the 2D version and documentation. Co-authored-by: fabriceci <fabricecipolla@gmail.com>
Diffstat (limited to 'doc/classes')
-rw-r--r--doc/classes/CharacterBody2D.xml1
-rw-r--r--doc/classes/CharacterBody3D.xml1
-rw-r--r--doc/classes/PhysicsServer3D.xml2
3 files changed, 4 insertions, 0 deletions
diff --git a/doc/classes/CharacterBody2D.xml b/doc/classes/CharacterBody2D.xml
index 1ace7ee6bf..b73aba50fd 100644
--- a/doc/classes/CharacterBody2D.xml
+++ b/doc/classes/CharacterBody2D.xml
@@ -79,6 +79,7 @@
Moves the body based on [member linear_velocity]. If the body collides with another, it will slide along the other body rather than stop immediately. If the other body is a [CharacterBody2D] or [RigidBody2D], it will also be affected by the motion of the other body. You can use this to make moving and rotating platforms, or to make nodes push other nodes.
This method should be used in [method Node._physics_process] (or in a method called by [method Node._physics_process]), as it uses the physics step's [code]delta[/code] value automatically in calculations. Otherwise, the simulation will run at an incorrect speed.
Modifies [member linear_velocity] if a slide collision occurred. To get detailed information about collisions that occurred, use [method get_slide_collision].
+ When the body touches a moving platform, the platform's velocity is automatically added to the body motion. If a collision occurs due to the platform's motion, it will always be first in the slide collisions.
</description>
</method>
</methods>
diff --git a/doc/classes/CharacterBody3D.xml b/doc/classes/CharacterBody3D.xml
index 577ab5e84c..4cb4f9a850 100644
--- a/doc/classes/CharacterBody3D.xml
+++ b/doc/classes/CharacterBody3D.xml
@@ -65,6 +65,7 @@
Moves the body based on [member linear_velocity]. If the body collides with another, it will slide along the other body rather than stop immediately. If the other body is a [CharacterBody3D] or [RigidBody3D], it will also be affected by the motion of the other body. You can use this to make moving and rotating platforms, or to make nodes push other nodes.
This method should be used in [method Node._physics_process] (or in a method called by [method Node._physics_process]), as it uses the physics step's [code]delta[/code] value automatically in calculations. Otherwise, the simulation will run at an incorrect speed.
Modifies [member linear_velocity] if a slide collision occurred. To get detailed information about collisions that occurred, use [method get_slide_collision].
+ When the body touches a moving platform, the platform's velocity is automatically added to the body motion. If a collision occurs due to the platform's motion, it will always be first in the slide collisions.
</description>
</method>
</methods>
diff --git a/doc/classes/PhysicsServer3D.xml b/doc/classes/PhysicsServer3D.xml
index 7bca8afdda..d6b7318a06 100644
--- a/doc/classes/PhysicsServer3D.xml
+++ b/doc/classes/PhysicsServer3D.xml
@@ -572,6 +572,8 @@
<argument index="3" name="infinite_inertia" type="bool" />
<argument index="4" name="margin" type="float" default="0.001" />
<argument index="5" name="result" type="PhysicsTestMotionResult3D" default="null" />
+ <argument index="6" name="exclude_raycast_shapes" type="bool" default="true" />
+ <argument index="7" name="exclude" type="Array" default="[]" />
<description>
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.
</description>