Box selection for entities #33

Open
opened 2026-03-19 06:08:50 +00:00 by kit · 0 comments
Owner

Summary

Add drag-to-select (box/marquee selection) for selecting multiple entities on screen at once.

Requirements

  • Click and drag draws a selection rectangle overlay on screen
  • On release, all entities whose screen-space bounding boxes intersect the rectangle are selected
  • Integrates with existing selection model: replaces selection by default, shift+drag adds to selection
  • Works when pointer is unlocked (cursor visible)
  • Visual: semi-transparent rectangle with border during drag

Implementation notes

  • Project entity positions (or bounding box corners) to screen space using camera.matrixWorldInverse + camera.projectionMatrix
  • Skip skybox entities and hidden entities (same filtering as single-click picking)
  • Need to handle the interaction between box select (unlocked) and the existing click-to-pick behavior — box select activates on drag, click-to-pick on click without drag
  • Consider performance for large entity counts — screen-space projection is cheap but doing it for hundreds of entities per frame during drag needs to stay smooth
## Summary Add drag-to-select (box/marquee selection) for selecting multiple entities on screen at once. ## Requirements - Click and drag draws a selection rectangle overlay on screen - On release, all entities whose screen-space bounding boxes intersect the rectangle are selected - Integrates with existing selection model: replaces selection by default, shift+drag adds to selection - Works when pointer is unlocked (cursor visible) - Visual: semi-transparent rectangle with border during drag ## Implementation notes - Project entity positions (or bounding box corners) to screen space using `camera.matrixWorldInverse` + `camera.projectionMatrix` - Skip skybox entities and hidden entities (same filtering as single-click picking) - Need to handle the interaction between box select (unlocked) and the existing click-to-pick behavior — box select activates on drag, click-to-pick on click without drag - Consider performance for large entity counts — screen-space projection is cheap but doing it for hundreds of entities per frame during drag needs to stay smooth
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
kit/gmod-web-stream#33
No description provided.