class_pathfollow3d.rst 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/4.2/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/4.2/doc/classes/PathFollow3D.xml.
  6. .. _class_PathFollow3D:
  7. PathFollow3D
  8. ============
  9. **Inherits:** :ref:`Node3D<class_Node3D>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  10. Point sampler for a :ref:`Path3D<class_Path3D>`.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. This node takes its parent :ref:`Path3D<class_Path3D>`, and returns the coordinates of a point within it, given a distance from the first vertex.
  15. It is useful for making other nodes follow a path, without coding the movement pattern. For that, the nodes must be children of this node. The descendant nodes will then move accordingly when setting the :ref:`progress<class_PathFollow3D_property_progress>` in this node.
  16. .. rst-class:: classref-reftable-group
  17. Properties
  18. ----------
  19. .. table::
  20. :widths: auto
  21. +-----------------------------------------------------+---------------------------------------------------------------------+-----------+
  22. | :ref:`bool<class_bool>` | :ref:`cubic_interp<class_PathFollow3D_property_cubic_interp>` | ``true`` |
  23. +-----------------------------------------------------+---------------------------------------------------------------------+-----------+
  24. | :ref:`float<class_float>` | :ref:`h_offset<class_PathFollow3D_property_h_offset>` | ``0.0`` |
  25. +-----------------------------------------------------+---------------------------------------------------------------------+-----------+
  26. | :ref:`bool<class_bool>` | :ref:`loop<class_PathFollow3D_property_loop>` | ``true`` |
  27. +-----------------------------------------------------+---------------------------------------------------------------------+-----------+
  28. | :ref:`float<class_float>` | :ref:`progress<class_PathFollow3D_property_progress>` | ``0.0`` |
  29. +-----------------------------------------------------+---------------------------------------------------------------------+-----------+
  30. | :ref:`float<class_float>` | :ref:`progress_ratio<class_PathFollow3D_property_progress_ratio>` | ``0.0`` |
  31. +-----------------------------------------------------+---------------------------------------------------------------------+-----------+
  32. | :ref:`RotationMode<enum_PathFollow3D_RotationMode>` | :ref:`rotation_mode<class_PathFollow3D_property_rotation_mode>` | ``3`` |
  33. +-----------------------------------------------------+---------------------------------------------------------------------+-----------+
  34. | :ref:`bool<class_bool>` | :ref:`tilt_enabled<class_PathFollow3D_property_tilt_enabled>` | ``true`` |
  35. +-----------------------------------------------------+---------------------------------------------------------------------+-----------+
  36. | :ref:`bool<class_bool>` | :ref:`use_model_front<class_PathFollow3D_property_use_model_front>` | ``false`` |
  37. +-----------------------------------------------------+---------------------------------------------------------------------+-----------+
  38. | :ref:`float<class_float>` | :ref:`v_offset<class_PathFollow3D_property_v_offset>` | ``0.0`` |
  39. +-----------------------------------------------------+---------------------------------------------------------------------+-----------+
  40. .. rst-class:: classref-reftable-group
  41. Methods
  42. -------
  43. .. table::
  44. :widths: auto
  45. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  46. | :ref:`Transform3D<class_Transform3D>` | :ref:`correct_posture<class_PathFollow3D_method_correct_posture>` **(** :ref:`Transform3D<class_Transform3D>` transform, :ref:`RotationMode<enum_PathFollow3D_RotationMode>` rotation_mode **)** |static| |
  47. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  48. .. rst-class:: classref-section-separator
  49. ----
  50. .. rst-class:: classref-descriptions-group
  51. Enumerations
  52. ------------
  53. .. _enum_PathFollow3D_RotationMode:
  54. .. rst-class:: classref-enumeration
  55. enum **RotationMode**:
  56. .. _class_PathFollow3D_constant_ROTATION_NONE:
  57. .. rst-class:: classref-enumeration-constant
  58. :ref:`RotationMode<enum_PathFollow3D_RotationMode>` **ROTATION_NONE** = ``0``
  59. Forbids the PathFollow3D to rotate.
  60. .. _class_PathFollow3D_constant_ROTATION_Y:
  61. .. rst-class:: classref-enumeration-constant
  62. :ref:`RotationMode<enum_PathFollow3D_RotationMode>` **ROTATION_Y** = ``1``
  63. Allows the PathFollow3D to rotate in the Y axis only.
  64. .. _class_PathFollow3D_constant_ROTATION_XY:
  65. .. rst-class:: classref-enumeration-constant
  66. :ref:`RotationMode<enum_PathFollow3D_RotationMode>` **ROTATION_XY** = ``2``
  67. Allows the PathFollow3D to rotate in both the X, and Y axes.
  68. .. _class_PathFollow3D_constant_ROTATION_XYZ:
  69. .. rst-class:: classref-enumeration-constant
  70. :ref:`RotationMode<enum_PathFollow3D_RotationMode>` **ROTATION_XYZ** = ``3``
  71. Allows the PathFollow3D to rotate in any axis.
  72. .. _class_PathFollow3D_constant_ROTATION_ORIENTED:
  73. .. rst-class:: classref-enumeration-constant
  74. :ref:`RotationMode<enum_PathFollow3D_RotationMode>` **ROTATION_ORIENTED** = ``4``
  75. Uses the up vector information in a :ref:`Curve3D<class_Curve3D>` to enforce orientation. This rotation mode requires the :ref:`Path3D<class_Path3D>`'s :ref:`Curve3D.up_vector_enabled<class_Curve3D_property_up_vector_enabled>` property to be set to ``true``.
  76. .. rst-class:: classref-section-separator
  77. ----
  78. .. rst-class:: classref-descriptions-group
  79. Property Descriptions
  80. ---------------------
  81. .. _class_PathFollow3D_property_cubic_interp:
  82. .. rst-class:: classref-property
  83. :ref:`bool<class_bool>` **cubic_interp** = ``true``
  84. .. rst-class:: classref-property-setget
  85. - void **set_cubic_interpolation** **(** :ref:`bool<class_bool>` value **)**
  86. - :ref:`bool<class_bool>` **get_cubic_interpolation** **(** **)**
  87. If ``true``, the position between two cached points is interpolated cubically, and linearly otherwise.
  88. The points along the :ref:`Curve3D<class_Curve3D>` of the :ref:`Path3D<class_Path3D>` are precomputed before use, for faster calculations. The point at the requested offset is then calculated interpolating between two adjacent cached points. This may present a problem if the curve makes sharp turns, as the cached points may not follow the curve closely enough.
  89. There are two answers to this problem: either increase the number of cached points and increase memory consumption, or make a cubic interpolation between two points at the cost of (slightly) slower calculations.
  90. .. rst-class:: classref-item-separator
  91. ----
  92. .. _class_PathFollow3D_property_h_offset:
  93. .. rst-class:: classref-property
  94. :ref:`float<class_float>` **h_offset** = ``0.0``
  95. .. rst-class:: classref-property-setget
  96. - void **set_h_offset** **(** :ref:`float<class_float>` value **)**
  97. - :ref:`float<class_float>` **get_h_offset** **(** **)**
  98. The node's offset along the curve.
  99. .. rst-class:: classref-item-separator
  100. ----
  101. .. _class_PathFollow3D_property_loop:
  102. .. rst-class:: classref-property
  103. :ref:`bool<class_bool>` **loop** = ``true``
  104. .. rst-class:: classref-property-setget
  105. - void **set_loop** **(** :ref:`bool<class_bool>` value **)**
  106. - :ref:`bool<class_bool>` **has_loop** **(** **)**
  107. If ``true``, any offset outside the path's length will wrap around, instead of stopping at the ends. Use it for cyclic paths.
  108. .. rst-class:: classref-item-separator
  109. ----
  110. .. _class_PathFollow3D_property_progress:
  111. .. rst-class:: classref-property
  112. :ref:`float<class_float>` **progress** = ``0.0``
  113. .. rst-class:: classref-property-setget
  114. - void **set_progress** **(** :ref:`float<class_float>` value **)**
  115. - :ref:`float<class_float>` **get_progress** **(** **)**
  116. The distance from the first vertex, measured in 3D units along the path. Changing this value sets this node's position to a point within the path.
  117. .. rst-class:: classref-item-separator
  118. ----
  119. .. _class_PathFollow3D_property_progress_ratio:
  120. .. rst-class:: classref-property
  121. :ref:`float<class_float>` **progress_ratio** = ``0.0``
  122. .. rst-class:: classref-property-setget
  123. - void **set_progress_ratio** **(** :ref:`float<class_float>` value **)**
  124. - :ref:`float<class_float>` **get_progress_ratio** **(** **)**
  125. The distance from the first vertex, considering 0.0 as the first vertex and 1.0 as the last. This is just another way of expressing the progress within the path, as the progress supplied is multiplied internally by the path's length.
  126. .. rst-class:: classref-item-separator
  127. ----
  128. .. _class_PathFollow3D_property_rotation_mode:
  129. .. rst-class:: classref-property
  130. :ref:`RotationMode<enum_PathFollow3D_RotationMode>` **rotation_mode** = ``3``
  131. .. rst-class:: classref-property-setget
  132. - void **set_rotation_mode** **(** :ref:`RotationMode<enum_PathFollow3D_RotationMode>` value **)**
  133. - :ref:`RotationMode<enum_PathFollow3D_RotationMode>` **get_rotation_mode** **(** **)**
  134. Allows or forbids rotation on one or more axes, depending on the :ref:`RotationMode<enum_PathFollow3D_RotationMode>` constants being used.
  135. .. rst-class:: classref-item-separator
  136. ----
  137. .. _class_PathFollow3D_property_tilt_enabled:
  138. .. rst-class:: classref-property
  139. :ref:`bool<class_bool>` **tilt_enabled** = ``true``
  140. .. rst-class:: classref-property-setget
  141. - void **set_tilt_enabled** **(** :ref:`bool<class_bool>` value **)**
  142. - :ref:`bool<class_bool>` **is_tilt_enabled** **(** **)**
  143. If ``true``, the tilt property of :ref:`Curve3D<class_Curve3D>` takes effect.
  144. .. rst-class:: classref-item-separator
  145. ----
  146. .. _class_PathFollow3D_property_use_model_front:
  147. .. rst-class:: classref-property
  148. :ref:`bool<class_bool>` **use_model_front** = ``false``
  149. .. rst-class:: classref-property-setget
  150. - void **set_use_model_front** **(** :ref:`bool<class_bool>` value **)**
  151. - :ref:`bool<class_bool>` **is_using_model_front** **(** **)**
  152. If ``true``, the node moves on the travel path with orienting the +Z axis as forward. See also :ref:`Vector3.FORWARD<class_Vector3_constant_FORWARD>` and :ref:`Vector3.MODEL_FRONT<class_Vector3_constant_MODEL_FRONT>`.
  153. .. rst-class:: classref-item-separator
  154. ----
  155. .. _class_PathFollow3D_property_v_offset:
  156. .. rst-class:: classref-property
  157. :ref:`float<class_float>` **v_offset** = ``0.0``
  158. .. rst-class:: classref-property-setget
  159. - void **set_v_offset** **(** :ref:`float<class_float>` value **)**
  160. - :ref:`float<class_float>` **get_v_offset** **(** **)**
  161. The node's offset perpendicular to the curve.
  162. .. rst-class:: classref-section-separator
  163. ----
  164. .. rst-class:: classref-descriptions-group
  165. Method Descriptions
  166. -------------------
  167. .. _class_PathFollow3D_method_correct_posture:
  168. .. rst-class:: classref-method
  169. :ref:`Transform3D<class_Transform3D>` **correct_posture** **(** :ref:`Transform3D<class_Transform3D>` transform, :ref:`RotationMode<enum_PathFollow3D_RotationMode>` rotation_mode **)** |static|
  170. Correct the ``transform``. ``rotation_mode`` implicitly specifies how posture (forward, up and sideway direction) is calculated.
  171. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  172. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  173. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  174. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  175. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  176. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  177. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`