Skip to content

Custom controls API, Minimap and RaycasterProvider - #58

Merged
tmarcon-dev merged 4 commits into
mainfrom
feature/controlled-player
Oct 23, 2026
Merged

tmarcon-dev merged 4 commits into
mainfrom
feature/controlled-player

Conversation

@tmarcon-dev

Copy link
Copy Markdown
Owner

Closes #49

Added

  • controls={false} to disable the built-in keyboard and mouse controls
  • move, turn, look, interact and getPlayer in the game context (joystickMove / joystickCamera deprecated)
  • onPlayerChange, with reported positions ignored when they come back through player
  • RaycasterProvider + useRaycaster() to use the game outside of the Raycaster children
  • Minimap component with clickable cells
  • lockPointer(element) and isFormKey(event) helpers for custom controls
  • Custom controls demo (replaces the render only demo)

Fixed

  • Mouse camera jumps since 0.2.0 (raw pointer lock, first movement after locking ignored)
  • Keyboard controls no longer move the player while typing in form fields, nor take Space/Enter from focused buttons, links and checkboxes
  • Initial player positions with decimals no longer crash
  • The CommonJS build still exports the component itself, with the named exports attached

See the CHANGELOG for details.

🤖 Generated with Claude Code

tmarcon-dev and others added 4 commits October 9, 2026 20:59
- `player` value changes move and rotate the player without resetting
  the game, positions in walls or open areas are ignored with a warning
- `controls={false}` disables the built-in keyboard and mouse controls,
  to use the component as a renderer only
- Document the renderer-only usage and `openDoor`

Closes #49

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Second example page where the parent component handles movements,
  collisions and inputs, with a clickable minimap to teleport
- Share the tiles between both demo pages, link them together
- Build both pages for GitHub Pages

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- move, turn, look, interact and getPlayer in the game context, the
  joystick methods are deprecated
- onPlayerChange, with reported positions ignored when they come back
  through the player prop
- RaycasterProvider and useRaycaster to use the game outside of the
  Raycaster children
- Minimap component with clickable cells
- lockPointer with raw mouse input, fixes camera jumps
- isFormKey: keyboard controls ignore keys typed in form fields and
  Space/Enter on focused buttons, links and checkboxes
- Render only demo becomes the custom controls demo

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The named exports made require("react-raycaster") return the module
object instead of the component. The named exports and default are now
properties of the component in the CommonJS build.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tmarcon-dev
tmarcon-dev merged commit e0d9961 into main Oct 23, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Using this library as a renderer only?

1 participant