6.0.0-3D-Surface (Wave A.2 spike): GridPositioner3D camera ray-cast helper. This is a spike, not a production positioner. It validates the highest-risk piece of the 3D surface (Camera3D ray → GridMap cell) end-to-end before committing to the full Wave B/C/D plan. What it does: given a Camera3D, a GridMap, and a screen-space cursor position, returns the GridMap cell the camera is looking at (or null if the ray misses the grid). What it does NOT do: full 2D-style positioner lifecycle, mode gating, multi-camera, recenter, keyboard nav, rotation, etc. Those are Wave B/C/D work; the spike is the math, not the surface. Math: Camera3D.project_ray_origin(screen_pos) + project_ray_normal(screen_pos) gives the world-space ray. We intersect it with the y=0 (or the configured ground plane) and use GridMap.local_to_map(world_hit) to resolve the cell. GridMap is a static body in Godot 4.6; we can also use PhysicsServer3D.space_get_direct_state().intersect_ray() for a more accurate hit (catches diagonal/blocked grids). 6.0.0 host + session pattern: this spike does NOT extend PlacementNode2D / PlacementNode3D. It is a stand-alone Node3D helper; the eventual GridPositioner3D (Wave B) will wire it into the host's _input dispatch via the same pattern as GridPositioner2D (which is also a stand-alone Node2D, not a PlacementNode2D).
Source: addons/grid_placement/systems/grid_targeting/grid_positioner/3d/grid_positioner_3d_spike.gd
Syntax
class GridPositioner3DSpike extends Node3DMembers
| Name | Kind | Summary |
|---|---|---|
camera | Property | The camera that the spike ray-casts through. Set this at _ready() in your test/scene; the spike does not auto-discover. |
grid | Property | The grid the spike resolves cells on. Same pattern as `camera`. |
ground_plane_y | Property | The y-coordinate (in grid-local space) of the ground plane the ray intersects. Default 0.0 = top face of the cell layer at y=0. |
SPIKE_MISS | Field | Sentinel returned when the ray misses the grid. The test asserts on `== SPIKE_MISS` rather than `== null` to make the contract explicit and to avoid Godot's null-Variant ambiguity. |
ray_from_screen_to_cell | Method | |
ray_origin | Property | |
ray_normal | Property | |
world_to_grid | Property | |
grid_origin | Property | |
grid_normal | Property | |
t | Property | |
hit_point_local | Property | |
cell | Property | |
ray_from_screen_to_cell_or_null | Method | |
cell | Property |
Source
addons/grid_placement/systems/grid_targeting/grid_positioner/3d/grid_positioner_3d_spike.gd
Plugin docs root:gdscript/plugins/grid_placement_dev/docs