class_pathfollow3d.rst 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  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.0/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/4.0/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:`float<class_float>` | :ref:`v_offset<class_PathFollow3D_property_v_offset>` | ``0.0`` |
  37. +-----------------------------------------------------+-------------------------------------------------------------------+----------+
  38. .. rst-class:: classref-reftable-group
  39. Methods
  40. -------
  41. .. table::
  42. :widths: auto
  43. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  44. | :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| |
  45. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  46. .. rst-class:: classref-section-separator
  47. ----
  48. .. rst-class:: classref-descriptions-group
  49. Enumerations
  50. ------------
  51. .. _enum_PathFollow3D_RotationMode:
  52. .. rst-class:: classref-enumeration
  53. enum **RotationMode**:
  54. .. _class_PathFollow3D_constant_ROTATION_NONE:
  55. .. rst-class:: classref-enumeration-constant
  56. :ref:`RotationMode<enum_PathFollow3D_RotationMode>` **ROTATION_NONE** = ``0``
  57. Forbids the PathFollow3D to rotate.
  58. .. _class_PathFollow3D_constant_ROTATION_Y:
  59. .. rst-class:: classref-enumeration-constant
  60. :ref:`RotationMode<enum_PathFollow3D_RotationMode>` **ROTATION_Y** = ``1``
  61. Allows the PathFollow3D to rotate in the Y axis only.
  62. .. _class_PathFollow3D_constant_ROTATION_XY:
  63. .. rst-class:: classref-enumeration-constant
  64. :ref:`RotationMode<enum_PathFollow3D_RotationMode>` **ROTATION_XY** = ``2``
  65. Allows the PathFollow3D to rotate in both the X, and Y axes.
  66. .. _class_PathFollow3D_constant_ROTATION_XYZ:
  67. .. rst-class:: classref-enumeration-constant
  68. :ref:`RotationMode<enum_PathFollow3D_RotationMode>` **ROTATION_XYZ** = ``3``
  69. Allows the PathFollow3D to rotate in any axis.
  70. .. _class_PathFollow3D_constant_ROTATION_ORIENTED:
  71. .. rst-class:: classref-enumeration-constant
  72. :ref:`RotationMode<enum_PathFollow3D_RotationMode>` **ROTATION_ORIENTED** = ``4``
  73. 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``.
  74. .. rst-class:: classref-section-separator
  75. ----
  76. .. rst-class:: classref-descriptions-group
  77. Property Descriptions
  78. ---------------------
  79. .. _class_PathFollow3D_property_cubic_interp:
  80. .. rst-class:: classref-property
  81. :ref:`bool<class_bool>` **cubic_interp** = ``true``
  82. .. rst-class:: classref-property-setget
  83. - void **set_cubic_interpolation** **(** :ref:`bool<class_bool>` value **)**
  84. - :ref:`bool<class_bool>` **get_cubic_interpolation** **(** **)**
  85. If ``true``, the position between two cached points is interpolated cubically, and linearly otherwise.
  86. 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.
  87. 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.
  88. .. rst-class:: classref-item-separator
  89. ----
  90. .. _class_PathFollow3D_property_h_offset:
  91. .. rst-class:: classref-property
  92. :ref:`float<class_float>` **h_offset** = ``0.0``
  93. .. rst-class:: classref-property-setget
  94. - void **set_h_offset** **(** :ref:`float<class_float>` value **)**
  95. - :ref:`float<class_float>` **get_h_offset** **(** **)**
  96. The node's offset along the curve.
  97. .. rst-class:: classref-item-separator
  98. ----
  99. .. _class_PathFollow3D_property_loop:
  100. .. rst-class:: classref-property
  101. :ref:`bool<class_bool>` **loop** = ``true``
  102. .. rst-class:: classref-property-setget
  103. - void **set_loop** **(** :ref:`bool<class_bool>` value **)**
  104. - :ref:`bool<class_bool>` **has_loop** **(** **)**
  105. If ``true``, any offset outside the path's length will wrap around, instead of stopping at the ends. Use it for cyclic paths.
  106. .. rst-class:: classref-item-separator
  107. ----
  108. .. _class_PathFollow3D_property_progress:
  109. .. rst-class:: classref-property
  110. :ref:`float<class_float>` **progress** = ``0.0``
  111. .. rst-class:: classref-property-setget
  112. - void **set_progress** **(** :ref:`float<class_float>` value **)**
  113. - :ref:`float<class_float>` **get_progress** **(** **)**
  114. 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.
  115. .. rst-class:: classref-item-separator
  116. ----
  117. .. _class_PathFollow3D_property_progress_ratio:
  118. .. rst-class:: classref-property
  119. :ref:`float<class_float>` **progress_ratio** = ``0.0``
  120. .. rst-class:: classref-property-setget
  121. - void **set_progress_ratio** **(** :ref:`float<class_float>` value **)**
  122. - :ref:`float<class_float>` **get_progress_ratio** **(** **)**
  123. 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.
  124. .. rst-class:: classref-item-separator
  125. ----
  126. .. _class_PathFollow3D_property_rotation_mode:
  127. .. rst-class:: classref-property
  128. :ref:`RotationMode<enum_PathFollow3D_RotationMode>` **rotation_mode** = ``3``
  129. .. rst-class:: classref-property-setget
  130. - void **set_rotation_mode** **(** :ref:`RotationMode<enum_PathFollow3D_RotationMode>` value **)**
  131. - :ref:`RotationMode<enum_PathFollow3D_RotationMode>` **get_rotation_mode** **(** **)**
  132. Allows or forbids rotation on one or more axes, depending on the :ref:`RotationMode<enum_PathFollow3D_RotationMode>` constants being used.
  133. .. rst-class:: classref-item-separator
  134. ----
  135. .. _class_PathFollow3D_property_tilt_enabled:
  136. .. rst-class:: classref-property
  137. :ref:`bool<class_bool>` **tilt_enabled** = ``true``
  138. .. rst-class:: classref-property-setget
  139. - void **set_tilt_enabled** **(** :ref:`bool<class_bool>` value **)**
  140. - :ref:`bool<class_bool>` **is_tilt_enabled** **(** **)**
  141. If ``true``, the tilt property of :ref:`Curve3D<class_Curve3D>` takes effect.
  142. .. rst-class:: classref-item-separator
  143. ----
  144. .. _class_PathFollow3D_property_v_offset:
  145. .. rst-class:: classref-property
  146. :ref:`float<class_float>` **v_offset** = ``0.0``
  147. .. rst-class:: classref-property-setget
  148. - void **set_v_offset** **(** :ref:`float<class_float>` value **)**
  149. - :ref:`float<class_float>` **get_v_offset** **(** **)**
  150. The node's offset perpendicular to the curve.
  151. .. rst-class:: classref-section-separator
  152. ----
  153. .. rst-class:: classref-descriptions-group
  154. Method Descriptions
  155. -------------------
  156. .. _class_PathFollow3D_method_correct_posture:
  157. .. rst-class:: classref-method
  158. :ref:`Transform3D<class_Transform3D>` **correct_posture** **(** :ref:`Transform3D<class_Transform3D>` transform, :ref:`RotationMode<enum_PathFollow3D_RotationMode>` rotation_mode **)** |static|
  159. Correct the ``transform``. ``rotation_mode`` implicitly specifies how posture (forward, up and sideway direction) is calculated.
  160. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  161. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  162. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  163. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  164. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  165. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`