@tracing-the-sky/engine
v0.1.5
Published
High-performance WebGL planetarium engine
Maintainers
Readme
@planetarium/engine
High-performance WebGL planetarium engine built with TypeScript and Babylon.js.
Features
- Real-time astronomical calculations
- 8,921+ star catalog with accurate positions
- 89 constellation definitions
- Solar system bodies (Sun, Moon, Planets)
- Custom marker support
- Interactive camera controls
- Time simulation and manipulation
Installation
pnpm add @planetarium/engine @babylonjs/core @babylonjs/loadersUsage
import { PlanetariumEngine } from '@planetarium/engine';
// Initialize the engine
const engine = new PlanetariumEngine({
canvas: document.getElementById('canvas'),
observer: {
latitude: 40.7128,
longitude: -74.0060,
elevation: 10
}
});
// Load astronomy data
await engine.loadData({
starsUrl: '/resources/stars.json',
constellationsUrl: '/resources/constellations.json'
});
// Start rendering
engine.start();API Documentation
Core Modules
- core/ - Engine state, lifecycle, and event system
- time/ - Time model and UTC handling
- astro/ - Coordinate transformations (equatorial, horizontal, ecliptic)
- render/ - Babylon.js rendering wrapper
- input/ - Pointer and touch event handling
- features/ - Stars, sun, moon, planets, constellations, markers
- data/ - Data loaders, schemas, and types
- types/ - Shared TypeScript interfaces
- utils/ - Logging and performance utilities
Development
This package is part of a monorepo. See the root README for development instructions.
License
MIT
