API ReferenceGE ExtensionseditorcrawlEditor
Crawl Editor Input
Mouse input handling for the Crawl Editor. Provides raycasting from the camera through the mouse cursor, tracking click/hold/release states with world-space hit positions.
Mouse input handling for the Crawl Editor. Provides raycasting from the camera through the mouse cursor, tracking click/hold/release states with world-space hit positions.
Public API
| Function | Returns | Description |
|---|---|---|
M.getMouseInfo() | table/nil | Returns the current mouse info table (pos, normals, click state) |
M.updateMouseInfo() | void | Updates mouse raycast and click states for the current frame |
Mouse Info Table Fields
| Field | Type | Description |
|---|---|---|
camPos | vec3 | Camera position at time of raycast |
ray | ray | Raw camera-mouse ray |
rayDir | vec3 | Normalized ray direction |
rayCast | table/nil | Raycast hit result (pos, normal) |
valid | boolean | Whether the raycast hit anything |
down | boolean | Mouse just clicked this frame (not over ImGui) |
hold | boolean | Mouse held down (not over ImGui) |
up | boolean | Mouse just released (not over ImGui) |
_downPos | vec3 | World position where mouse was pressed |
_downNormal | vec3 | Surface normal where mouse was pressed |
_holdPos | vec3 | World position during hold |
_upPos | vec3 | World position where mouse was released |
Usage Example
local input = require('editor/crawlEditor/input')
-- Call each frame
input.updateMouseInfo()
local mi = input.getMouseInfo()
if mi and mi.valid and mi.down then
log('I', '', 'Clicked at: ' .. tostring(mi._downPos))
endNotes
- Temporarily disables forest collision during raycast to avoid hitting trees
- Uses
im.IsMouseClicked(0)andim.GetIO().WantCaptureMouseto avoid conflicts with ImGui downandholdare mutually exclusive: on the click frame, onlydownis true
See Also
- Crawl Editor - Boundaries - Related reference
- Crawl Editor Mission Port Tool - Related reference
- Crawl Editor Paths - Related reference
- World Editor Guide - Guide
Crawl Editor - Boundaries
Sub-module of the Crawl Data Editor handling boundary polygon creation and editing. Provides vertex manipulation with gizmo support, terrain snapping, and undo/redo history.
Crawl Editor Mission Port Tool
Converts old crawl mission data (bounds.sites.json + race.race.json) into the new modular crawl system (boundary, path, starting position, trail files).