MCPcopy Index your code
hub / github.com/galacean/engine

github.com/galacean/engine @v1.6.13 sqlite

repository ↗ · DeepWiki ↗ · release v1.6.13 ↗
10,099 symbols 25,651 edges 976 files 2,424 documented · 24%
README

Galacean Engine

npm-size npm-download codecov

Galacean Engine is a high-performance, real-time interactive engine designed primarily for web and mobile platforms. It employs a component system architecture and emphasizes ease of use and lightweight design. Developers can create projects using either editor or pure code.

image

Features

  • 🖥  Platform - Support HTML5 and wechat minigame
  • 🔮  Graphics - Advanced 2D + 3D graphics engine
  • 🏃  Animation - Powerful animation system
  • 🧱  Physics - Powerful and easy-to-use physical features
  • 🎨  GUI - Flexible UI system with drag-and-drop and dynamic interactions
  • 👆  Input - Easy-to-use interactive capabilities
  • 📑  Scripts - Use TypeScript to write logic efficiently

Usage

Using Editor

We recommend using Editor for a streamlined workflow that enables seamless integration between artists and developers. Its intuitive visual tools allow artists to quickly create scenes and enable developers to write custom logic, with convenient platform export. You can even create projects based on pre-built case templates.

image

Using Pure Code

If you want to build your project using pure code via runtime, install the engine from npm:

npm install @galacean/engine

Create a simple scene:

import { BlinnPhongMaterial, Camera, DirectLight, MeshRenderer, WebGLEngine, PrimitiveMesh } from "@galacean/engine";

// Create engine by passing in the HTMLCanvasElement id and adjust canvas size
const engine = await WebGLEngine.create({ canvas: "canvas-id" });
engine.canvas.resizeByClientSize();

// Get scene and create root entity
const scene = engine.sceneManager.activeScene;
const rootEntity = scene.createRootEntity("Root");

// Create light
const lightEntity = rootEntity.createChild("Light");
const directLight = lightEntity.addComponent(DirectLight);
lightEntity.transform.setRotation(-45, -45, 0);
directLight.intensity = 0.4;

// Create camera
const cameraEntity = rootEntity.createChild("Camera");
cameraEntity.addComponent(Camera);
cameraEntity.transform.setPosition(0, 0, 12);

// Create sphere
const meshEntity = rootEntity.createChild("Sphere");
const meshRenderer = meshEntity.addComponent(MeshRenderer);
const material = new BlinnPhongMaterial(engine);
meshRenderer.setMaterial(material);
meshRenderer.mesh = PrimitiveMesh.createSphere(engine, 1);

// Run engine
engine.run();

Contributing

This repository contains the runtime's source code and documentation. Everyone is welcome to contribute—whether you find a bug, have a feature request, or want to tackle a task from our roadmap, please get in touch.

Make sure to read the Contributing Guide / 贡献指南 before submitting changes.

Clone

Prerequisites:

  • git-lfs (Install by official website)

Clone this repository:

git clone git@github.com:galacean/engine.git

Build

Prerequisites:

  • Node.js v15.0.0+ and NPM (Install by official website)
  • PNPM (Install globally by npm install -g pnpm)

In the folder where you have cloned the repository, install the build dependencies using pnpm:

pnpm install

Then, to build the source, using npm:

npm run b:all

Links

License

The engine is released under the MIT license. See LICENSE file.

Extension points exported contracts — how you extend this code

ISpriteRenderer (Interface)
(no doc) [7 implementers]
packages/core/src/2d/assembler/ISpriteRenderer.ts
IGraphics (Interface)
(no doc) [6 implementers]
packages/ui/src/interface/IGraphics.ts
ISphereColliderShape (Interface)
(no doc) [5 implementers]
packages/design/src/physics/shape/ISphereColliderShape.ts
ICopy (Interface)
(no doc) [5 implementers]
packages/math/src/ICopy.ts
IBaseSymbol (Interface)
(no doc) [4 implementers]
packages/shader-lab/src/common/IBaseSymbol.ts
XRManager (Interface)
(no doc) [1 implementers]
packages/xr/src/XRManagerExtended.ts
IWebXRRequestTrackingAnchor (Interface)
(no doc)
packages/xr-webxr/src/feature/WebXRAnchorTracking.ts
WebGLExtension (Interface)
(no doc)
packages/rhi-webgl/src/type.ts

Core symbols most depended-on inside this repo

equals
called by 1137
packages/math/src/Color.ts
addComponent
called by 657
packages/core/src/Entity.ts
equal
called by 613
packages/shader-lab/src/common/IBaseSymbol.ts
set
called by 480
packages/math/src/Rect.ts
push
called by 471
packages/core/src/utils/SafeLoopArray.ts
createChild
called by 446
packages/core/src/Entity.ts
then
called by 393
packages/core/src/asset/AssetPromise.ts
abort
called by 351
packages/physics-physx/libs/physx.release.downgrade.js

Shape

Function 4,302
Method 4,045
Class 1,332
Interface 217
Enum 203

Languages

TypeScript100%

Modules by API surface

packages/physics-physx/libs/physx.release.downgrade.js3,452 symbols
packages/shader-lab/src/parser/AST.ts321 symbols
packages/physics-physx/libs/physx.release.js189 symbols
packages/loader/libs/basis_transcoder.js161 symbols
packages/core/src/animation/Animator.ts69 symbols
packages/core/src/mesh/ModelMesh.ts65 symbols
packages/core/src/Transform.ts58 symbols
packages/core/src/Camera.ts57 symbols
packages/core/src/Entity.ts53 symbols
packages/core/src/material/PBRMaterial.ts50 symbols
tests/src/core/Script.test.ts46 symbols
packages/rhi-webgl/src/WebGLGraphicDevice.ts44 symbols

Dependencies from manifests, versioned

@commitlint/cli11.0.0 · 1×
@commitlint/config-conventional11.0.0 · 1×
@galacean/engineworkspace:* · 1×
@galacean/engine-coreworkspace:* · 1×
@galacean/engine-designworkspace:* · 1×
@galacean/engine-loaderworkspace:* · 1×
@galacean/engine-mathworkspace:* · 1×
@galacean/engine-physics-liteworkspace:* · 1×
@galacean/engine-physics-physxworkspace:* · 1×
@galacean/engine-rhi-webglworkspace:* · 1×
@galacean/engine-shaderworkspace:* · 1×
@galacean/engine-shaderlabworkspace:* · 1×

For agents

$ claude mcp add engine \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact