PathFollow.xml 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="PathFollow" inherits="Spatial" category="Core" version="3.0.alpha.custom_build">
  3. <brief_description>
  4. Point sampler for a [Path].
  5. </brief_description>
  6. <description>
  7. This node takes its parent [Path], and returns the coordinates of a point within it, given a distance from the first vertex.
  8. It is useful for making other nodes follow a path, without coding the movement pattern. For that, the nodes must be descendants of this node. Then, when setting an offset in this node, the descendant nodes will move accordingly.
  9. </description>
  10. <tutorials>
  11. </tutorials>
  12. <demos>
  13. </demos>
  14. <methods>
  15. <method name="get_cubic_interpolation" qualifiers="const">
  16. <return type="bool">
  17. </return>
  18. <description>
  19. This method returns whether the position between two cached points (see [method set_cubic_interpolation]) is interpolated linearly, or cubicly.
  20. </description>
  21. </method>
  22. <method name="get_h_offset" qualifiers="const">
  23. <return type="float">
  24. </return>
  25. <description>
  26. Returns the X displacement this node has from its parent [Path].
  27. </description>
  28. </method>
  29. <method name="get_offset" qualifiers="const">
  30. <return type="float">
  31. </return>
  32. <description>
  33. Returns the distance along the path in 3D units.
  34. </description>
  35. </method>
  36. <method name="get_rotation_mode" qualifiers="const">
  37. <return type="int" enum="PathFollow.RotationMode">
  38. </return>
  39. <description>
  40. Returns the rotation mode. The constants below list which axes are allowed to rotate for each mode.
  41. </description>
  42. </method>
  43. <method name="get_unit_offset" qualifiers="const">
  44. <return type="float">
  45. </return>
  46. <description>
  47. Returns the distance along the path as a number in the range 0.0 (for the first vertex) to 1.0 (for the last).
  48. </description>
  49. </method>
  50. <method name="get_v_offset" qualifiers="const">
  51. <return type="float">
  52. </return>
  53. <description>
  54. Returns the Y displacement this node has from its parent [Path].
  55. </description>
  56. </method>
  57. <method name="has_loop" qualifiers="const">
  58. <return type="bool">
  59. </return>
  60. <description>
  61. Returns whether this node wraps its offsets around, or truncates them to the path ends.
  62. </description>
  63. </method>
  64. <method name="set_cubic_interpolation">
  65. <return type="void">
  66. </return>
  67. <argument index="0" name="enable" type="bool">
  68. </argument>
  69. <description>
  70. The points along the [Curve3D] of the [Path] 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.
  71. 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.
  72. This method controls whether the position between two cached points is interpolated linearly, or cubicly.
  73. </description>
  74. </method>
  75. <method name="set_h_offset">
  76. <return type="void">
  77. </return>
  78. <argument index="0" name="h_offset" type="float">
  79. </argument>
  80. <description>
  81. Moves this node in the X axis. As this node's position will be set every time its offset is set, this allows many PathFollow to share the same curve (and thus the same movement pattern), yet not return the same position for a given path offset.
  82. A similar effect may be achieved moving the this node's descendants.
  83. </description>
  84. </method>
  85. <method name="set_loop">
  86. <return type="void">
  87. </return>
  88. <argument index="0" name="loop" type="bool">
  89. </argument>
  90. <description>
  91. If set, any offset outside the path's length (whether set by [method set_offset] or [method set_unit_offset] will wrap around, instead of stopping at the ends. Set it for cyclic paths.
  92. </description>
  93. </method>
  94. <method name="set_offset">
  95. <return type="void">
  96. </return>
  97. <argument index="0" name="offset" type="float">
  98. </argument>
  99. <description>
  100. Sets the distance from the first vertex, measured in 3D units along the path. This sets this node's position to a point within the path.
  101. </description>
  102. </method>
  103. <method name="set_rotation_mode">
  104. <return type="void">
  105. </return>
  106. <argument index="0" name="rotation_mode" type="int" enum="PathFollow.RotationMode">
  107. </argument>
  108. <description>
  109. Allows or forbids rotation on one or more axes, per the constants below.
  110. </description>
  111. </method>
  112. <method name="set_unit_offset">
  113. <return type="void">
  114. </return>
  115. <argument index="0" name="unit_offset" type="float">
  116. </argument>
  117. <description>
  118. Sets 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 offset within the path, as the offset supplied is multiplied internally by the path's length.
  119. </description>
  120. </method>
  121. <method name="set_v_offset">
  122. <return type="void">
  123. </return>
  124. <argument index="0" name="v_offset" type="float">
  125. </argument>
  126. <description>
  127. Moves this node in the Y axis, for the same reasons of [method set_h_offset].
  128. </description>
  129. </method>
  130. </methods>
  131. <constants>
  132. <constant name="ROTATION_NONE" value="0">
  133. Forbids the PathFollow to rotate.
  134. </constant>
  135. <constant name="ROTATION_Y" value="1">
  136. Allows the PathFollow to rotate in the Y axis only.
  137. </constant>
  138. <constant name="ROTATION_XY" value="2">
  139. Allows the PathFollow to rotate in both the X, and Y axes.
  140. </constant>
  141. <constant name="ROTATION_XYZ" value="3">
  142. Allows the PathFollow to rotate in any axis.
  143. </constant>
  144. </constants>
  145. </class>