• Stars
    star
    4,111
  • Rank 10,551 (Top 0.3 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created almost 4 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A typescript interactive engine, support 2D, 3D, animation, physics, built on WebGL and glTF.

Galacean Engine

npm-size npm-download codecov

Galacean is a web-first and mobile-first high-performance real-time interactive engine. Use component system design and pursue ease of use and light weight. Developers can independently use and write Typescript scripts to develop projects using pure code.

Features

  • ๐Ÿ–ฅ ย Platform - Support HTML5 and Alipay miniprogram
  • ๐Ÿ”ฎ ย Graphics - Advanced 2D + 3D graphics engine
  • ๐Ÿƒ ย Animation - Powerful animation system
  • ๐Ÿงฑ ย Physics - Powerful and easy-to-use physical features
  • ๐Ÿ‘† ย Input - Easy-to-use interactive capabilities
  • ๐Ÿ“‘ ย Scripts - Use TypeScript to write logic efficiently

npm

The engine is published on npm with full typing support. To install, use:

npm install @galacean/engine

This will allow you to import engine entirely using:

import * as GALACEAN from "@galacean/engine";

or individual classes using:

import { Engine, Scene, Entity } from "@galacean/engine";

Usage

// 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

Everyone is welcome to join us! Whether you find a bug, have a great feature request or you fancy owning a task from the road map feel free to get in touch.

Make sure to read the Contributing Guide / ่ดก็ŒฎๆŒ‡ๅ— before submitting changes.

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.

More Repositories

1

effects-runtime

It can load and render cool animation effects
TypeScript
297
star
2

engine-toolkit

Some out-of-the-box utility features based on the Galacean engine.
TypeScript
75
star
3

galacean.github.io

Source code of website, documentation and examples included.
TypeScript
73
star
4

create-galacean-app

A tool for creating your oasis application. Currently supported template presets include Vanillaใ€React and Vue.
TypeScript
50
star
5

physX.js

Javascript bindings for Nvidia PhysX based on Embind
C++
25
star
6

playground

The playground is a place that can be used to show your wonderful cases, and can also be used to visually debug the code.
JavaScript
18
star
7

effects-native

The mobile runtime of Galacean Effects
C++
15
star
8

effects-native-examples

Galacean Effects's native examples
C
14
star
9

miniprogram-adapter

TypeScript
12
star
10

engine-lottie

A WebGL runtime of lottie based on Galacean Engine
TypeScript
12
star
11

effects-miniprogram-demo

Galacean Effects ๅฐ็จ‹ๅบ Demo
JavaScript
11
star
12

awesome

Awesome work from our community
9
star
13

engine-spine

TypeScript
9
star
14

effects-specification

Galacean Effects JSON definition
TypeScript
7
star
15

asset-tools

JavaScript
5
star
16

effects-math

Galacean Effects general math library
TypeScript
4
star
17

nvcloth.js

Javascript bindings for Nvidia NvCloth based on Embind
C++
3
star
18

appx-adapter

Help adapt the Galacean Effects to WeChat/Alipay Mini Programs/Mini Games, etc.
TypeScript
2
star
19

tools

Some galacean engine related asset processing or auxiliary tools
TypeScript
2
star
20

benchmark

Benchmark of Galacean
TypeScript
2
star
21

engine-effects

Load and render Galacean Effects products in the Galacean Engine.
1
star
22

vscode-extension

Extension for bridging Galacean and VSCode.
1
star
23

platform-wechat-miniprogram

Adaptation layer of WeChat miniprogram platform.
1
star
24

tool-atlas-lottie

Transform lottie JSON file to atlas format in oasis engine.
JavaScript
1
star
25

platform-adapter

Adaptation for various game platforms
1
star
26

devtools

JavaScript
1
star
27

effects-components

Galacean Effects components
TypeScript
1
star