123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307 |
- :github_url: hide
- .. DO NOT EDIT THIS FILE!!!
- .. Generated automatically from Godot engine sources.
- .. Generator: https://github.com/godotengine/godot/tree/4.2/doc/tools/make_rst.py.
- .. XML source: https://github.com/godotengine/godot/tree/4.2/doc/classes/PathFollow3D.xml.
- .. _class_PathFollow3D:
- PathFollow3D
- ============
- **Inherits:** :ref:`Node3D<class_Node3D>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
- Point sampler for a :ref:`Path3D<class_Path3D>`.
- .. rst-class:: classref-introduction-group
- Description
- -----------
- 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.
- 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.
- .. rst-class:: classref-reftable-group
- Properties
- ----------
- .. table::
- :widths: auto
- +-----------------------------------------------------+---------------------------------------------------------------------+-----------+
- | :ref:`bool<class_bool>` | :ref:`cubic_interp<class_PathFollow3D_property_cubic_interp>` | ``true`` |
- +-----------------------------------------------------+---------------------------------------------------------------------+-----------+
- | :ref:`float<class_float>` | :ref:`h_offset<class_PathFollow3D_property_h_offset>` | ``0.0`` |
- +-----------------------------------------------------+---------------------------------------------------------------------+-----------+
- | :ref:`bool<class_bool>` | :ref:`loop<class_PathFollow3D_property_loop>` | ``true`` |
- +-----------------------------------------------------+---------------------------------------------------------------------+-----------+
- | :ref:`float<class_float>` | :ref:`progress<class_PathFollow3D_property_progress>` | ``0.0`` |
- +-----------------------------------------------------+---------------------------------------------------------------------+-----------+
- | :ref:`float<class_float>` | :ref:`progress_ratio<class_PathFollow3D_property_progress_ratio>` | ``0.0`` |
- +-----------------------------------------------------+---------------------------------------------------------------------+-----------+
- | :ref:`RotationMode<enum_PathFollow3D_RotationMode>` | :ref:`rotation_mode<class_PathFollow3D_property_rotation_mode>` | ``3`` |
- +-----------------------------------------------------+---------------------------------------------------------------------+-----------+
- | :ref:`bool<class_bool>` | :ref:`tilt_enabled<class_PathFollow3D_property_tilt_enabled>` | ``true`` |
- +-----------------------------------------------------+---------------------------------------------------------------------+-----------+
- | :ref:`bool<class_bool>` | :ref:`use_model_front<class_PathFollow3D_property_use_model_front>` | ``false`` |
- +-----------------------------------------------------+---------------------------------------------------------------------+-----------+
- | :ref:`float<class_float>` | :ref:`v_offset<class_PathFollow3D_property_v_offset>` | ``0.0`` |
- +-----------------------------------------------------+---------------------------------------------------------------------+-----------+
- .. rst-class:: classref-reftable-group
- Methods
- -------
- .. table::
- :widths: auto
- +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :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| |
- +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- .. rst-class:: classref-section-separator
- ----
- .. rst-class:: classref-descriptions-group
- Enumerations
- ------------
- .. _enum_PathFollow3D_RotationMode:
- .. rst-class:: classref-enumeration
- enum **RotationMode**:
- .. _class_PathFollow3D_constant_ROTATION_NONE:
- .. rst-class:: classref-enumeration-constant
- :ref:`RotationMode<enum_PathFollow3D_RotationMode>` **ROTATION_NONE** = ``0``
- Forbids the PathFollow3D to rotate.
- .. _class_PathFollow3D_constant_ROTATION_Y:
- .. rst-class:: classref-enumeration-constant
- :ref:`RotationMode<enum_PathFollow3D_RotationMode>` **ROTATION_Y** = ``1``
- Allows the PathFollow3D to rotate in the Y axis only.
- .. _class_PathFollow3D_constant_ROTATION_XY:
- .. rst-class:: classref-enumeration-constant
- :ref:`RotationMode<enum_PathFollow3D_RotationMode>` **ROTATION_XY** = ``2``
- Allows the PathFollow3D to rotate in both the X, and Y axes.
- .. _class_PathFollow3D_constant_ROTATION_XYZ:
- .. rst-class:: classref-enumeration-constant
- :ref:`RotationMode<enum_PathFollow3D_RotationMode>` **ROTATION_XYZ** = ``3``
- Allows the PathFollow3D to rotate in any axis.
- .. _class_PathFollow3D_constant_ROTATION_ORIENTED:
- .. rst-class:: classref-enumeration-constant
- :ref:`RotationMode<enum_PathFollow3D_RotationMode>` **ROTATION_ORIENTED** = ``4``
- 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``.
- .. rst-class:: classref-section-separator
- ----
- .. rst-class:: classref-descriptions-group
- Property Descriptions
- ---------------------
- .. _class_PathFollow3D_property_cubic_interp:
- .. rst-class:: classref-property
- :ref:`bool<class_bool>` **cubic_interp** = ``true``
- .. rst-class:: classref-property-setget
- - void **set_cubic_interpolation** **(** :ref:`bool<class_bool>` value **)**
- - :ref:`bool<class_bool>` **get_cubic_interpolation** **(** **)**
- If ``true``, the position between two cached points is interpolated cubically, and linearly otherwise.
- 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.
- 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.
- .. rst-class:: classref-item-separator
- ----
- .. _class_PathFollow3D_property_h_offset:
- .. rst-class:: classref-property
- :ref:`float<class_float>` **h_offset** = ``0.0``
- .. rst-class:: classref-property-setget
- - void **set_h_offset** **(** :ref:`float<class_float>` value **)**
- - :ref:`float<class_float>` **get_h_offset** **(** **)**
- The node's offset along the curve.
- .. rst-class:: classref-item-separator
- ----
- .. _class_PathFollow3D_property_loop:
- .. rst-class:: classref-property
- :ref:`bool<class_bool>` **loop** = ``true``
- .. rst-class:: classref-property-setget
- - void **set_loop** **(** :ref:`bool<class_bool>` value **)**
- - :ref:`bool<class_bool>` **has_loop** **(** **)**
- If ``true``, any offset outside the path's length will wrap around, instead of stopping at the ends. Use it for cyclic paths.
- .. rst-class:: classref-item-separator
- ----
- .. _class_PathFollow3D_property_progress:
- .. rst-class:: classref-property
- :ref:`float<class_float>` **progress** = ``0.0``
- .. rst-class:: classref-property-setget
- - void **set_progress** **(** :ref:`float<class_float>` value **)**
- - :ref:`float<class_float>` **get_progress** **(** **)**
- 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.
- .. rst-class:: classref-item-separator
- ----
- .. _class_PathFollow3D_property_progress_ratio:
- .. rst-class:: classref-property
- :ref:`float<class_float>` **progress_ratio** = ``0.0``
- .. rst-class:: classref-property-setget
- - void **set_progress_ratio** **(** :ref:`float<class_float>` value **)**
- - :ref:`float<class_float>` **get_progress_ratio** **(** **)**
- 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.
- .. rst-class:: classref-item-separator
- ----
- .. _class_PathFollow3D_property_rotation_mode:
- .. rst-class:: classref-property
- :ref:`RotationMode<enum_PathFollow3D_RotationMode>` **rotation_mode** = ``3``
- .. rst-class:: classref-property-setget
- - void **set_rotation_mode** **(** :ref:`RotationMode<enum_PathFollow3D_RotationMode>` value **)**
- - :ref:`RotationMode<enum_PathFollow3D_RotationMode>` **get_rotation_mode** **(** **)**
- Allows or forbids rotation on one or more axes, depending on the :ref:`RotationMode<enum_PathFollow3D_RotationMode>` constants being used.
- .. rst-class:: classref-item-separator
- ----
- .. _class_PathFollow3D_property_tilt_enabled:
- .. rst-class:: classref-property
- :ref:`bool<class_bool>` **tilt_enabled** = ``true``
- .. rst-class:: classref-property-setget
- - void **set_tilt_enabled** **(** :ref:`bool<class_bool>` value **)**
- - :ref:`bool<class_bool>` **is_tilt_enabled** **(** **)**
- If ``true``, the tilt property of :ref:`Curve3D<class_Curve3D>` takes effect.
- .. rst-class:: classref-item-separator
- ----
- .. _class_PathFollow3D_property_use_model_front:
- .. rst-class:: classref-property
- :ref:`bool<class_bool>` **use_model_front** = ``false``
- .. rst-class:: classref-property-setget
- - void **set_use_model_front** **(** :ref:`bool<class_bool>` value **)**
- - :ref:`bool<class_bool>` **is_using_model_front** **(** **)**
- 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>`.
- .. rst-class:: classref-item-separator
- ----
- .. _class_PathFollow3D_property_v_offset:
- .. rst-class:: classref-property
- :ref:`float<class_float>` **v_offset** = ``0.0``
- .. rst-class:: classref-property-setget
- - void **set_v_offset** **(** :ref:`float<class_float>` value **)**
- - :ref:`float<class_float>` **get_v_offset** **(** **)**
- The node's offset perpendicular to the curve.
- .. rst-class:: classref-section-separator
- ----
- .. rst-class:: classref-descriptions-group
- Method Descriptions
- -------------------
- .. _class_PathFollow3D_method_correct_posture:
- .. rst-class:: classref-method
- :ref:`Transform3D<class_Transform3D>` **correct_posture** **(** :ref:`Transform3D<class_Transform3D>` transform, :ref:`RotationMode<enum_PathFollow3D_RotationMode>` rotation_mode **)** |static|
- Correct the ``transform``. ``rotation_mode`` implicitly specifies how posture (forward, up and sideway direction) is calculated.
- .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
- .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
- .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
- .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
- .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
- .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
- .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
|