class_geometry.rst 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the doc/base/classes.xml source instead.
  3. .. _class_Geometry:
  4. Geometry
  5. ========
  6. **Inherits:** :ref:`Object<class_object>`
  7. **Category:** Core
  8. Brief Description
  9. -----------------
  10. Member Functions
  11. ----------------
  12. +------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  13. | :ref:`Array<class_array>` | :ref:`build_box_planes<class_Geometry_build_box_planes>` **(** :ref:`Vector3<class_vector3>` extents **)** |
  14. +------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  15. | :ref:`Array<class_array>` | :ref:`build_capsule_planes<class_Geometry_build_capsule_planes>` **(** :ref:`float<class_float>` radius, :ref:`float<class_float>` height, :ref:`int<class_int>` sides, :ref:`int<class_int>` lats, :ref:`int<class_int>` axis=2 **)** |
  16. +------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  17. | :ref:`Array<class_array>` | :ref:`build_cylinder_planes<class_Geometry_build_cylinder_planes>` **(** :ref:`float<class_float>` radius, :ref:`float<class_float>` height, :ref:`int<class_int>` sides, :ref:`int<class_int>` axis=2 **)** |
  18. +------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  19. | :ref:`Vector3<class_vector3>` | :ref:`get_closest_point_to_segment<class_Geometry_get_closest_point_to_segment>` **(** :ref:`Vector3<class_vector3>` point, :ref:`Vector3<class_vector3>` s1, :ref:`Vector3<class_vector3>` s2 **)** |
  20. +------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  21. | :ref:`Vector2<class_vector2>` | :ref:`get_closest_point_to_segment_2d<class_Geometry_get_closest_point_to_segment_2d>` **(** :ref:`Vector2<class_vector2>` point, :ref:`Vector2<class_vector2>` s1, :ref:`Vector2<class_vector2>` s2 **)** |
  22. +------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  23. | :ref:`Vector3<class_vector3>` | :ref:`get_closest_point_to_segment_uncapped<class_Geometry_get_closest_point_to_segment_uncapped>` **(** :ref:`Vector3<class_vector3>` point, :ref:`Vector3<class_vector3>` s1, :ref:`Vector3<class_vector3>` s2 **)** |
  24. +------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  25. | :ref:`Vector2<class_vector2>` | :ref:`get_closest_point_to_segment_uncapped_2d<class_Geometry_get_closest_point_to_segment_uncapped_2d>` **(** :ref:`Vector2<class_vector2>` point, :ref:`Vector2<class_vector2>` s1, :ref:`Vector2<class_vector2>` s2 **)** |
  26. +------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  27. | :ref:`Vector3Array<class_vector3array>` | :ref:`get_closest_points_between_segments<class_Geometry_get_closest_points_between_segments>` **(** :ref:`Vector3<class_vector3>` p1, :ref:`Vector3<class_vector3>` p2, :ref:`Vector3<class_vector3>` q1, :ref:`Vector3<class_vector3>` q2 **)** |
  28. +------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  29. | :ref:`Vector2Array<class_vector2array>` | :ref:`get_closest_points_between_segments_2d<class_Geometry_get_closest_points_between_segments_2d>` **(** :ref:`Vector2<class_vector2>` p1, :ref:`Vector2<class_vector2>` q1, :ref:`Vector2<class_vector2>` p2, :ref:`Vector2<class_vector2>` q2 **)** |
  30. +------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  31. | :ref:`int<class_int>` | :ref:`get_uv84_normal_bit<class_Geometry_get_uv84_normal_bit>` **(** :ref:`Vector3<class_vector3>` normal **)** |
  32. +------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  33. | :ref:`Dictionary<class_dictionary>` | :ref:`make_atlas<class_Geometry_make_atlas>` **(** :ref:`Vector2Array<class_vector2array>` sizes **)** |
  34. +------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  35. | :ref:`bool<class_bool>` | :ref:`point_is_inside_triangle<class_Geometry_point_is_inside_triangle>` **(** :ref:`Vector2<class_vector2>` point, :ref:`Vector2<class_vector2>` a, :ref:`Vector2<class_vector2>` b, :ref:`Vector2<class_vector2>` c **)** const |
  36. +------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  37. | void | :ref:`ray_intersects_triangle<class_Geometry_ray_intersects_triangle>` **(** :ref:`Vector3<class_vector3>` from, :ref:`Vector3<class_vector3>` dir, :ref:`Vector3<class_vector3>` a, :ref:`Vector3<class_vector3>` b, :ref:`Vector3<class_vector3>` c **)** |
  38. +------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  39. | :ref:`float<class_float>` | :ref:`segment_intersects_circle<class_Geometry_segment_intersects_circle>` **(** :ref:`Vector2<class_vector2>` segment_from, :ref:`Vector2<class_vector2>` segment_to, :ref:`Vector2<class_vector2>` circle_pos, :ref:`float<class_float>` circle_radius **)** |
  40. +------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  41. | :ref:`Vector3Array<class_vector3array>` | :ref:`segment_intersects_convex<class_Geometry_segment_intersects_convex>` **(** :ref:`Vector3<class_vector3>` from, :ref:`Vector3<class_vector3>` to, :ref:`Array<class_array>` planes **)** |
  42. +------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  43. | :ref:`Vector3Array<class_vector3array>` | :ref:`segment_intersects_cylinder<class_Geometry_segment_intersects_cylinder>` **(** :ref:`Vector3<class_vector3>` from, :ref:`Vector3<class_vector3>` to, :ref:`float<class_float>` height, :ref:`float<class_float>` radius **)** |
  44. +------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  45. | void | :ref:`segment_intersects_segment_2d<class_Geometry_segment_intersects_segment_2d>` **(** :ref:`Vector2<class_vector2>` from_a, :ref:`Vector2<class_vector2>` to_a, :ref:`Vector2<class_vector2>` from_b, :ref:`Vector2<class_vector2>` to_b **)** |
  46. +------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  47. | :ref:`Vector3Array<class_vector3array>` | :ref:`segment_intersects_sphere<class_Geometry_segment_intersects_sphere>` **(** :ref:`Vector3<class_vector3>` from, :ref:`Vector3<class_vector3>` to, :ref:`Vector3<class_vector3>` spos, :ref:`float<class_float>` sradius **)** |
  48. +------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  49. | void | :ref:`segment_intersects_triangle<class_Geometry_segment_intersects_triangle>` **(** :ref:`Vector3<class_vector3>` from, :ref:`Vector3<class_vector3>` to, :ref:`Vector3<class_vector3>` a, :ref:`Vector3<class_vector3>` b, :ref:`Vector3<class_vector3>` c **)** |
  50. +------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  51. | :ref:`IntArray<class_intarray>` | :ref:`triangulate_polygon<class_Geometry_triangulate_polygon>` **(** :ref:`Vector2Array<class_vector2array>` polygon **)** |
  52. +------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  53. Member Function Description
  54. ---------------------------
  55. .. _class_Geometry_build_box_planes:
  56. - :ref:`Array<class_array>` **build_box_planes** **(** :ref:`Vector3<class_vector3>` extents **)**
  57. .. _class_Geometry_build_capsule_planes:
  58. - :ref:`Array<class_array>` **build_capsule_planes** **(** :ref:`float<class_float>` radius, :ref:`float<class_float>` height, :ref:`int<class_int>` sides, :ref:`int<class_int>` lats, :ref:`int<class_int>` axis=2 **)**
  59. .. _class_Geometry_build_cylinder_planes:
  60. - :ref:`Array<class_array>` **build_cylinder_planes** **(** :ref:`float<class_float>` radius, :ref:`float<class_float>` height, :ref:`int<class_int>` sides, :ref:`int<class_int>` axis=2 **)**
  61. .. _class_Geometry_get_closest_point_to_segment:
  62. - :ref:`Vector3<class_vector3>` **get_closest_point_to_segment** **(** :ref:`Vector3<class_vector3>` point, :ref:`Vector3<class_vector3>` s1, :ref:`Vector3<class_vector3>` s2 **)**
  63. .. _class_Geometry_get_closest_point_to_segment_2d:
  64. - :ref:`Vector2<class_vector2>` **get_closest_point_to_segment_2d** **(** :ref:`Vector2<class_vector2>` point, :ref:`Vector2<class_vector2>` s1, :ref:`Vector2<class_vector2>` s2 **)**
  65. .. _class_Geometry_get_closest_point_to_segment_uncapped:
  66. - :ref:`Vector3<class_vector3>` **get_closest_point_to_segment_uncapped** **(** :ref:`Vector3<class_vector3>` point, :ref:`Vector3<class_vector3>` s1, :ref:`Vector3<class_vector3>` s2 **)**
  67. .. _class_Geometry_get_closest_point_to_segment_uncapped_2d:
  68. - :ref:`Vector2<class_vector2>` **get_closest_point_to_segment_uncapped_2d** **(** :ref:`Vector2<class_vector2>` point, :ref:`Vector2<class_vector2>` s1, :ref:`Vector2<class_vector2>` s2 **)**
  69. .. _class_Geometry_get_closest_points_between_segments:
  70. - :ref:`Vector3Array<class_vector3array>` **get_closest_points_between_segments** **(** :ref:`Vector3<class_vector3>` p1, :ref:`Vector3<class_vector3>` p2, :ref:`Vector3<class_vector3>` q1, :ref:`Vector3<class_vector3>` q2 **)**
  71. .. _class_Geometry_get_closest_points_between_segments_2d:
  72. - :ref:`Vector2Array<class_vector2array>` **get_closest_points_between_segments_2d** **(** :ref:`Vector2<class_vector2>` p1, :ref:`Vector2<class_vector2>` q1, :ref:`Vector2<class_vector2>` p2, :ref:`Vector2<class_vector2>` q2 **)**
  73. .. _class_Geometry_get_uv84_normal_bit:
  74. - :ref:`int<class_int>` **get_uv84_normal_bit** **(** :ref:`Vector3<class_vector3>` normal **)**
  75. .. _class_Geometry_make_atlas:
  76. - :ref:`Dictionary<class_dictionary>` **make_atlas** **(** :ref:`Vector2Array<class_vector2array>` sizes **)**
  77. .. _class_Geometry_point_is_inside_triangle:
  78. - :ref:`bool<class_bool>` **point_is_inside_triangle** **(** :ref:`Vector2<class_vector2>` point, :ref:`Vector2<class_vector2>` a, :ref:`Vector2<class_vector2>` b, :ref:`Vector2<class_vector2>` c **)** const
  79. .. _class_Geometry_ray_intersects_triangle:
  80. - void **ray_intersects_triangle** **(** :ref:`Vector3<class_vector3>` from, :ref:`Vector3<class_vector3>` dir, :ref:`Vector3<class_vector3>` a, :ref:`Vector3<class_vector3>` b, :ref:`Vector3<class_vector3>` c **)**
  81. .. _class_Geometry_segment_intersects_circle:
  82. - :ref:`float<class_float>` **segment_intersects_circle** **(** :ref:`Vector2<class_vector2>` segment_from, :ref:`Vector2<class_vector2>` segment_to, :ref:`Vector2<class_vector2>` circle_pos, :ref:`float<class_float>` circle_radius **)**
  83. .. _class_Geometry_segment_intersects_convex:
  84. - :ref:`Vector3Array<class_vector3array>` **segment_intersects_convex** **(** :ref:`Vector3<class_vector3>` from, :ref:`Vector3<class_vector3>` to, :ref:`Array<class_array>` planes **)**
  85. .. _class_Geometry_segment_intersects_cylinder:
  86. - :ref:`Vector3Array<class_vector3array>` **segment_intersects_cylinder** **(** :ref:`Vector3<class_vector3>` from, :ref:`Vector3<class_vector3>` to, :ref:`float<class_float>` height, :ref:`float<class_float>` radius **)**
  87. .. _class_Geometry_segment_intersects_segment_2d:
  88. - void **segment_intersects_segment_2d** **(** :ref:`Vector2<class_vector2>` from_a, :ref:`Vector2<class_vector2>` to_a, :ref:`Vector2<class_vector2>` from_b, :ref:`Vector2<class_vector2>` to_b **)**
  89. .. _class_Geometry_segment_intersects_sphere:
  90. - :ref:`Vector3Array<class_vector3array>` **segment_intersects_sphere** **(** :ref:`Vector3<class_vector3>` from, :ref:`Vector3<class_vector3>` to, :ref:`Vector3<class_vector3>` spos, :ref:`float<class_float>` sradius **)**
  91. .. _class_Geometry_segment_intersects_triangle:
  92. - void **segment_intersects_triangle** **(** :ref:`Vector3<class_vector3>` from, :ref:`Vector3<class_vector3>` to, :ref:`Vector3<class_vector3>` a, :ref:`Vector3<class_vector3>` b, :ref:`Vector3<class_vector3>` c **)**
  93. .. _class_Geometry_triangulate_polygon:
  94. - :ref:`IntArray<class_intarray>` **triangulate_polygon** **(** :ref:`Vector2Array<class_vector2array>` polygon **)**