module
Diorite::GeometryBuilder
Overview
High-performance algorithmic generator for 2D and 3D debug geometry.
Emits line-list vertices (Vector3 or Vector2) and vertex color arrays suitable for direct
ingestion by Godot's ImmediateMesh surface buffers (surface_add_vertex and surface_set_color).
Designed for zero heap reallocation during frame loops when passed pre-sized arrays.
Included Modules
Defined in:
diorite/core/geometry_builder.crClass Method Summary
-
.build_actor_card_3d(position : Godot::Vector3, size : Godot::Vector2, color : Godot::Color, verts : Array(Godot::Vector3), cols : Array(Godot::Color)) : Void
Generates a 3D actor card frame with ground anchor line.
-
.build_arc_2d(center : Godot::Vector2, radius : Float32, start_angle : Float32, end_angle : Float32, segments : Int32, color : Godot::Color, verts : Array(Godot::Vector2), cols : Array(Godot::Color)) : Void
Generates a 2D circular arc segment.
-
.build_arrow(from : Godot::Vector3, to : Godot::Vector3, color : Godot::Color, head_size : Float32, verts : Array(Godot::Vector3), cols : Array(Godot::Color)) : Void
Generates a 3D directional arrow with a 4-fin conical arrowhead.
-
.build_arrow_2d(from : Godot::Vector2, to : Godot::Vector2, head_size : Float32, color : Godot::Color, verts : Array(Godot::Vector2), cols : Array(Godot::Color)) : Void
Generates a 2D directional arrow with a triangular head on the canvas overlay.
-
.build_bezier_cubic(p0 : Godot::Vector3, p1 : Godot::Vector3, p2 : Godot::Vector3, p3 : Godot::Vector3, segments : Int32, color : Godot::Color, verts : Array(Godot::Vector3), cols : Array(Godot::Color), show_hull : Bool = true) : Void
Generates a 3D cubic Bézier spline curve.
-
.build_billboard_square(position : Godot::Vector3, size : Float32, camera_pos : Godot::Vector3, color : Godot::Color, verts : Array(Godot::Vector3), cols : Array(Godot::Color)) : Void
Generates a camera-facing billboard square marker in 3D world space.
-
.build_box(center : Godot::Vector3, size : Godot::Vector3, color : Godot::Color, verts : Array(Godot::Vector3), cols : Array(Godot::Color)) : Void
Generates an axis-aligned 3D bounding box (AABB) wireframe with 12 edges.
-
.build_box_cast(from : Godot::Vector3, to : Godot::Vector3, size : Godot::Vector3, hit : Bool, color : Godot::Color, verts : Array(Godot::Vector3), cols : Array(Godot::Color)) : Void
Generates a 3D swept oriented or axis-aligned box cast between from and to.
-
.build_camera_frustum(origin : Godot::Vector3, basis : Godot::Basis, fov_deg : Float32, near : Float32, far : Float32, aspect : Float32, color : Godot::Color, verts : Array(Godot::Vector3), cols : Array(Godot::Color)) : Void
Generates a 3D camera view frustum pyramid with near and far clipping rectangles.
-
.build_capsule(center : Godot::Vector3, radius : Float32, height : Float32, segments : Int32, color : Godot::Color, verts : Array(Godot::Vector3), cols : Array(Godot::Color)) : Void
Generates a 3D wireframe capsule with hemispherical domes and side struts.
-
.build_capsule_2d(p0 : Godot::Vector2, p1 : Godot::Vector2, radius : Float32, color : Godot::Color, verts : Array(Godot::Vector2), cols : Array(Godot::Color), segments : Int32 = 12) : Void
Generates a 2D wireframe stadium capsule connecting two center points with semicircular caps.
-
.build_capsule_cast(from : Godot::Vector3, to : Godot::Vector3, radius : Float32, height : Float32, hit : Bool, color : Godot::Color, verts : Array(Godot::Vector3), cols : Array(Godot::Color)) : Void
Generates a 3D swept capsule cast between from and to.
-
.build_catmull_rom(points : Array(Godot::Vector3), segments_per_curve : Int32, color : Godot::Color, verts : Array(Godot::Vector3), cols : Array(Godot::Color), loop : Bool = false) : Void
Generates a 3D Catmull-Rom spline through a sequence of waypoints.
-
.build_circle_2d(center : Godot::Vector2, radius : Float32, segments : Int32, color : Godot::Color, verts : Array(Godot::Vector2), cols : Array(Godot::Color)) : Void
Generates a 2D wireframe circle on the canvas overlay.
-
.build_circle_3d(center : Godot::Vector3, normal : Godot::Vector3, radius : Float32, segments : Int32, color : Godot::Color, verts : Array(Godot::Vector3), cols : Array(Godot::Color)) : Void
Generates an arbitrary 3D planar circle ring.
-
.build_cone_3d(tip : Godot::Vector3, dir : Godot::Vector3, length : Float32, angle_rad : Float32, segments : Int32, color : Godot::Color, verts : Array(Godot::Vector3), cols : Array(Godot::Color)) : Void
Generates a 3D vision cone or spotlight frustum.
-
.build_cylinder(center : Godot::Vector3, radius : Float32, height : Float32, segments : Int32, color : Godot::Color, verts : Array(Godot::Vector3), cols : Array(Godot::Color)) : Void
Generates a 3D wireframe cylinder with circular caps and longitudinal ribs.
-
.build_gizmo(origin : Godot::Vector3, basis : Godot::Basis, size : Float32, verts : Array(Godot::Vector3), cols : Array(Godot::Color)) : Void
Generates a 3D coordinate transform gizmo with Red=X, Green=Y, Blue=Z axis vectors.
-
.build_grid(center : Godot::Vector3, size : Godot::Vector2, subdivisions : Int32, color : Godot::Color, verts : Array(Godot::Vector3), cols : Array(Godot::Color)) : Void
Generates a 3D ground reference grid plane.
-
.build_line(from : Godot::Vector3, to : Godot::Vector3, color : Godot::Color, verts : Array(Godot::Vector3), cols : Array(Godot::Color)) : Void
Generates a single 3D line segment between from and to.
-
.build_line_2d(from : Godot::Vector2, to : Godot::Vector2, color : Godot::Color, verts : Array(Godot::Vector2), cols : Array(Godot::Color)) : Void
Generates a 2D line segment between two canvas pixel coordinates.
-
.build_line_path(points : Array(Godot::Vector3), color : Godot::Color, verts : Array(Godot::Vector3), cols : Array(Godot::Color)) : Void
Generates a continuous 3D polyline connecting an ordered list of points.
-
.build_obb(center : Godot::Vector3, size : Godot::Vector3, basis : Godot::Basis, color : Godot::Color, verts : Array(Godot::Vector3), cols : Array(Godot::Color)) : Void
Generates an arbitrarily oriented bounding box (OBB) defined by a 3x3 rotation
Basis. -
.build_path_2d(points : Array(Godot::Vector2), color : Godot::Color, verts : Array(Godot::Vector2), cols : Array(Godot::Color)) : Void
Generates a continuous 2D polyline connecting an ordered list of canvas points.
-
.build_plane(center : Godot::Vector3, normal : Godot::Vector3, size : Godot::Vector2, color : Godot::Color, verts : Array(Godot::Vector3), cols : Array(Godot::Color)) : Void
Generates an oriented 3D plane quad with a center normal pointer.
-
.build_points(points : Array(Godot::Vector3), size : Float32, color : Godot::Color, verts : Array(Godot::Vector3), cols : Array(Godot::Color)) : Void
Generates small 3D crosshair markers for an array of world points.
-
.build_points_2d(points : Array(Godot::Vector2), size : Float32, color : Godot::Color, verts : Array(Godot::Vector2), cols : Array(Godot::Color)) : Void
Generates crosshair markers for a collection of 2D points on the canvas.
-
.build_position_3d(origin : Godot::Vector3, size : Float32, color : Godot::Color, verts : Array(Godot::Vector3), cols : Array(Godot::Color)) : Void
Generates a 3-axis crossing crosshair indicating position and scale.
-
.build_ray_hit(origin : Godot::Vector3, hit_point : Godot::Vector3, normal : Godot::Vector3, color : Godot::Color, verts : Array(Godot::Vector3), cols : Array(Godot::Color)) : Void
Generates a raycast hit visualization: incident ray, surface impact disc, and surface normal reflection vector.
-
.build_rect_2d(rect : Godot::Rect2, color : Godot::Color, verts : Array(Godot::Vector2), cols : Array(Godot::Color)) : Void
Generates a 2D wireframe rectangle on the canvas overlay.
-
.build_reticle(position : Godot::Vector3, normal : Godot::Vector3, size : Float32, color : Godot::Color, verts : Array(Godot::Vector3), cols : Array(Godot::Color)) : Void
Generates an aim reticle with a center circle and 4 corner target brackets.
-
.build_ruler(from : Godot::Vector3, to : Godot::Vector3, tick_size : Float32, color : Godot::Color, verts : Array(Godot::Vector3), cols : Array(Godot::Color)) : Void
Generates a calibrated distance measurement ruler bar with tick marks between two points.
-
.build_ruler_2d(from : Godot::Vector2, to : Godot::Vector2, color : Godot::Color, verts : Array(Godot::Vector2), cols : Array(Godot::Color), tick_step : Float32 = 20.0_f32, tick_size : Float32 = 8.0_f32) : Void
Generates a 2D calibrated measuring ruler with distance tick marks.
-
.build_sector_2d(center : Godot::Vector2, radius : Float32, start_angle : Float32, end_angle : Float32, segments : Int32, color : Godot::Color, verts : Array(Godot::Vector2), cols : Array(Godot::Color)) : Void
Generates a 2D pie-slice sector with bounding radial rays.
-
.build_sphere(center : Godot::Vector3, radius : Float32, rings : Int32, color : Godot::Color, verts : Array(Godot::Vector3), cols : Array(Godot::Color)) : Void
Generates a 3D wireframe sphere composed of 3 orthogonal intersecting rings.
-
.build_sphere_cast(from : Godot::Vector3, to : Godot::Vector3, radius : Float32, hit : Bool, color : Godot::Color, verts : Array(Godot::Vector3), cols : Array(Godot::Color)) : Void
Generates a 3D swept sphere cast visualizing collision trajectory between from and to.
-
.build_spring(from : Godot::Vector3, to : Godot::Vector3, radius : Float32, coils : Int32, segments : Int32, color : Godot::Color, verts : Array(Godot::Vector3), cols : Array(Godot::Color)) : Void
Generates a 3D helical wire spring between two world endpoints.
-
.build_surface_disk(position : Godot::Vector3, normal : Godot::Vector3, radius : Float32, segments : Int32, color : Godot::Color, verts : Array(Godot::Vector3), cols : Array(Godot::Color)) : Void
Generates a normal-aligned circular surface disc indicating a collision or ground contact patch.
-
.build_trajectory_arc(origin : Godot::Vector3, velocity : Godot::Vector3, gravity : Godot::Vector3, max_time : Float32, steps : Int32, color : Godot::Color, verts : Array(Godot::Vector3), cols : Array(Godot::Color)) : Void
Generates a ballistic parabolic trajectory arc computed under gravity.
-
.build_vision_cone(origin : Godot::Vector3, direction : Godot::Vector3, angle_deg : Float32, range : Float32, segments : Int32, color : Godot::Color, verts : Array(Godot::Vector3), cols : Array(Godot::Color)) : Void
Generates a spherical sector vision/detection cone for AI sensory perception.
-
.build_vision_cone_2d(origin : Godot::Vector2, dir : Godot::Vector2, distance : Float32, angle_rad : Float32, segments : Int32, color : Godot::Color, verts : Array(Godot::Vector2), cols : Array(Godot::Color)) : Void
Generates a 2D vision cone or field-of-view wedge.
Class methods inherited from module Diorite::MathHelpers
deg_to_rad(degrees : Number) : Float32
deg_to_rad,
find_perpendicular(normal : Godot::Vector3) : Godot::Vector3
find_perpendicular,
orthonormal_plane(normal : Godot::Vector3) : Tuple(Godot::Vector3, Godot::Vector3)
orthonormal_plane,
rad_to_deg(radians : Number) : Float32
rad_to_deg,
rotate_around_axis(point : Godot::Vector3, axis : Godot::Vector3, theta : Float32) : Godot::Vector3
rotate_around_axis
Class Method Detail
Generates a 3D actor card frame with ground anchor line.
Generates a 2D circular arc segment.
Generates a 3D directional arrow with a 4-fin conical arrowhead.
Generates a 2D directional arrow with a triangular head on the canvas overlay.
Generates a 3D cubic Bézier spline curve.
Generates a camera-facing billboard square marker in 3D world space.
Generates an axis-aligned 3D bounding box (AABB) wireframe with 12 edges.
Generates a 3D swept oriented or axis-aligned box cast between from and to.
Generates a 3D camera view frustum pyramid with near and far clipping rectangles.
Generates a 3D wireframe capsule with hemispherical domes and side struts.
Generates a 2D wireframe stadium capsule connecting two center points with semicircular caps.
Generates a 3D swept capsule cast between from and to.
Generates a 3D Catmull-Rom spline through a sequence of waypoints.
Generates a 2D wireframe circle on the canvas overlay.
Generates an arbitrary 3D planar circle ring.
Generates a 3D vision cone or spotlight frustum.
Generates a 3D wireframe cylinder with circular caps and longitudinal ribs.
Generates a 3D coordinate transform gizmo with Red=X, Green=Y, Blue=Z axis vectors.
Generates a 3D ground reference grid plane.
Generates a single 3D line segment between from and to.
Generates a 2D line segment between two canvas pixel coordinates.
Generates a continuous 3D polyline connecting an ordered list of points.
Generates an arbitrarily oriented bounding box (OBB) defined by a 3x3 rotation Basis.
Generates a continuous 2D polyline connecting an ordered list of canvas points.
Generates an oriented 3D plane quad with a center normal pointer.
Generates small 3D crosshair markers for an array of world points.
Generates crosshair markers for a collection of 2D points on the canvas.
Generates a 3-axis crossing crosshair indicating position and scale.
Generates a raycast hit visualization: incident ray, surface impact disc, and surface normal reflection vector.
Generates a 2D wireframe rectangle on the canvas overlay.
Generates an aim reticle with a center circle and 4 corner target brackets.
Generates a calibrated distance measurement ruler bar with tick marks between two points.
Generates a 2D calibrated measuring ruler with distance tick marks.
Generates a 2D pie-slice sector with bounding radial rays.
Generates a 3D wireframe sphere composed of 3 orthogonal intersecting rings.
Generates a 3D swept sphere cast visualizing collision trajectory between from and to.
Generates a 3D helical wire spring between two world endpoints.
Generates a normal-aligned circular surface disc indicating a collision or ground contact patch.
Generates a ballistic parabolic trajectory arc computed under gravity.
Generates a spherical sector vision/detection cone for AI sensory perception.
Generates a 2D vision cone or field-of-view wedge.