From 33da7b49137fad76693d9a1cc80745953075daee Mon Sep 17 00:00:00 2001 From: Chris Bradfield Date: Thu, 14 Sep 2017 16:04:36 -0700 Subject: [PATCH] Document new KinematicCollision2D class --- doc/classes/KinematicBody2D.xml | 3 ++- doc/classes/KinematicCollision2D.xml | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/doc/classes/KinematicBody2D.xml b/doc/classes/KinematicBody2D.xml index 26c7c6125dd..dddae2c0fc8 100644 --- a/doc/classes/KinematicBody2D.xml +++ b/doc/classes/KinematicBody2D.xml @@ -63,6 +63,7 @@ + Moves the body along the given vector. The body will stop if it collides. Returns a [KinematicCollision2D], which contains information about the colliding body. @@ -97,7 +98,7 @@ - Return true if there would be a collision if the body moved from the given point in the given direction. + Returns true if there would be a collision if the body moved from the given point in the given direction. diff --git a/doc/classes/KinematicCollision2D.xml b/doc/classes/KinematicCollision2D.xml index 4ef35066d06..7a40a392923 100644 --- a/doc/classes/KinematicCollision2D.xml +++ b/doc/classes/KinematicCollision2D.xml @@ -1,8 +1,11 @@ + Collision data for KinematicBody2D collisions. + Contains collision data for KinematicBody2D collisions. When a [KinematicBody2D] is moved using [method KinematicBody2D.move_and_collide], it stops if it detects a collision with another body. If a collision is detected, a KinematicCollision2D object is returned. + This object contains information about the collision, including the colliding object, the remaining motion, and the collision position. This information can be used to calculate a collision response. @@ -78,26 +81,37 @@ + The colliding body. + The colliding body's unique [RID]. + The colliding body's metadata. See [Object]. + The colliding body's shape. + The colliding shape's index. See [CollisionObject2D]. + The colliding object's velocity. + The moving object's colliding shape. + The colliding body's shape's normal at the point of collision. + The point of collision. + The moving object's remaining movement vector. + The distance the moving object traveled before collision.