space-game/bjsEditorPlugin
Michael Mainguy 96bc3df51e
All checks were successful
Build / build (push) Successful in 2m0s
Fix position export and add target physics improvements
- Use getAbsolutePosition() in all config builders for correct world coords
- Add TargetComponent case to meshCollector for target export
- Add shared target body cache in RockFactory (asteroids can share targets)
- Add debug logging throughout export and physics pipelines
- Pass targetId to RockFactory for proper target body sharing

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-09 12:33:31 -06:00
..
editorScripts Add BabylonJS Editor plugin for level editing 2025-12-09 07:11:49 -06:00
src Fix position export and add target physics improvements 2025-12-09 12:33:31 -06:00
.gitignore Add BabylonJS Editor plugin for level editing 2025-12-09 07:11:49 -06:00
package-lock.json Add BabylonJS Editor plugin for level editing 2025-12-09 07:11:49 -06:00
package.json Add BabylonJS Editor plugin for level editing 2025-12-09 07:11:49 -06:00
README.md Add BabylonJS Editor plugin for level editing 2025-12-09 07:11:49 -06:00
tsconfig.json Add BabylonJS Editor plugin for level editing 2025-12-09 07:11:49 -06:00

Space Game BabylonJS Editor Plugin

Export BabylonJS Editor scenes to Space Game LevelConfig format.

Installation

  1. Build the plugin:

    cd bjsEditorPlugin
    npm install
    npm run build
    
  2. Install in BabylonJS Editor:

    • Open BabylonJS Editor
    • Edit → Preferences → Plugins
    • Click "Add" and select this folder
    • Apply and restart Editor

Usage

  1. Create a workspace in BabylonJS Editor
  2. Copy the script components from editorScripts/ to your workspace's src/scenes/ folder
  3. Place meshes in your scene and attach the appropriate scripts:
    • AsteroidComponent - for asteroids
    • ShipComponent - for player spawn point
    • SunComponent - for the sun
    • PlanetComponent - for planets
    • TargetComponent - for orbit/movement targets
  4. Configure properties in the Inspector panel
  5. Space Game → Export Level Config...

Script Components

The editorScripts/ folder contains TypeScript components to use in your Editor workspace. These expose game-specific properties (velocities, targets, etc.) in the Inspector.

Plugin Menu

  • Export Level Config... - Downloads level.json file
  • Export to Clipboard - Copies JSON to clipboard

Development

npm run watch  # Watch mode for development
npm run build  # Production build

Debug in Editor: CTRL+ALT+i to open DevTools, F5 to reload plugin.