浏览代码

Added general notes on RayCast[2D] updating behaviour and force_raycast_update()

(cherry picked from commit 8d57640d3745084d5c4abc4e6926298c2f4a3fb4)
Karol Walasek 9 年之前
父节点
当前提交
9f9d1eed7b
共有 1 个文件被更改,包括 14 次插入0 次删除
  1. 14 0
      doc/base/classes.xml

+ 14 - 0
doc/base/classes.xml

@@ -30921,6 +30921,8 @@
 		RayCast can ignore some objects by adding them to the exception list via [code]add_exception[/code], setting proper filtering with layers, or by filtering object types with type masks.
 		RayCast can ignore some objects by adding them to the exception list via [code]add_exception[/code], setting proper filtering with layers, or by filtering object types with type masks.
 
 
 		Only enabled raycasts will be able to query the space and report collisions!
 		Only enabled raycasts will be able to query the space and report collisions!
+
+		RayCast calculates intersection every fixed frame (see [Node]), and the result is cached so it can be used later until the next frame. If multiple queries are required between fixed frames (or during the same frame) use [method force_raycast_update] after adjusting the raycast.
 	</description>
 	</description>
 	<methods>
 	<methods>
 		<method name="add_exception">
 		<method name="add_exception">
@@ -30941,6 +30943,11 @@
 				Removes all collision exception for this ray.
 				Removes all collision exception for this ray.
 			</description>
 			</description>
 		</method>
 		</method>
+		<method name="force_raycast_update">
+			<description>
+				Updates the collision information in case if this object's properties changed during the current frame (for example position, rotation or the cast_point). Note, [code]set_enabled[/code] is not required for this to work.
+			</description>
+		</method>
 		<method name="get_cast_to" qualifiers="const">
 		<method name="get_cast_to" qualifiers="const">
 			<return type="Vector3">
 			<return type="Vector3">
 			</return>
 			</return>
@@ -31059,6 +31066,8 @@
 		RayCast2D can ignore some objects by adding them to the exception list via [code]add_exception[/code], setting proper filtering with layers, or by filtering object types with type masks.
 		RayCast2D can ignore some objects by adding them to the exception list via [code]add_exception[/code], setting proper filtering with layers, or by filtering object types with type masks.
 
 
 		Only enabled raycasts will be able to query the space and report collisions!
 		Only enabled raycasts will be able to query the space and report collisions!
+
+		RayCast2D calculates intersection every fixed frame (see [Node]), and the result is cached so it can be used later until the next frame. If multiple queries are required between fixed frames (or during the same frame) use [method force_raycast_update] after adjusting the raycast.
 	</description>
 	</description>
 	<methods>
 	<methods>
 		<method name="add_exception">
 		<method name="add_exception">
@@ -31079,6 +31088,11 @@
 				Removes all collision exception for this ray.
 				Removes all collision exception for this ray.
 			</description>
 			</description>
 		</method>
 		</method>
+		<method name="force_raycast_update">
+			<description>
+				Updates the collision information in case if this object's properties changed during the current frame (for example position, rotation or the cast_point). Note, [code]set_enabled[/code] is not required for this to work.
+			</description>
+		</method>
 		<method name="get_cast_to" qualifiers="const">
 		<method name="get_cast_to" qualifiers="const">
 			<return type="Vector2">
 			<return type="Vector2">
 			</return>
 			</return>