@galacean/engine 0.0.0-experimental-animator-additive.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License
2
+
3
+ Copyright © 2020-2023 Galacean authors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,82 @@
1
+ # Galacean Engine
2
+
3
+ <a href="https://www.npmjs.com/package/@galacean/engine"><img src="https://img.shields.io/npm/v/@galacean/engine"/></a>
4
+ ![npm-size](https://img.shields.io/bundlephobia/minzip/@galacean/engine)
5
+ ![npm-download](https://img.shields.io/npm/dm/@galacean/engine)
6
+ [![codecov](https://codecov.io/gh/galacean/engine/branch/main/graph/badge.svg?token=KR2UBKE3OX)](https://codecov.io/gh/galacean/engine)
7
+
8
+ 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.
9
+
10
+ ## Features
11
+
12
+ - 🖥 &nbsp;**Platform** - Suppport HTML5 and Alipay miniprogram
13
+ - 🔮 &nbsp;**Graphics** - Advanced 2D + 3D graphics engine
14
+ - 🏃 &nbsp;**Animation** - Powerful animation system
15
+ - 🧱 &nbsp;**Physics** - Powerful and easy-to-use physical features
16
+ - 👆 &nbsp;**Input** - Easy-to-use interactive capabilities
17
+ - 📑 &nbsp;**Scripts** - Use TypeScript to write logic efficiently
18
+
19
+ ## Installation
20
+
21
+ To install, use:
22
+
23
+ ```sh
24
+ npm install @galacean/engine
25
+ ```
26
+
27
+ This will allow you to import engine entirely using:
28
+
29
+ ```javascript
30
+ import * as GALACEAN from "@galacean/engine";
31
+ ```
32
+
33
+ or individual classes using:
34
+
35
+ ```javascript
36
+ import { Engine, Scene, Entity } from "@galacean/engine";
37
+ ```
38
+
39
+ ## Usage
40
+
41
+ ```typescript
42
+ // Create engine by passing in the HTMLCanvasElement id and adjust canvas size.
43
+ const engine = new WebGLEngine("canvas-id");
44
+ engine.canvas.resizeByClientSize();
45
+
46
+ // Get scene and create root entity.
47
+ const scene = engine.sceneManager.activeScene;
48
+ const rootEntity = scene.createRootEntity("Root");
49
+
50
+ // Create light.
51
+ const lightEntity = rootEntity.createChild("Light");
52
+ const directLight = lightEntity.addComponent(DirectLight);
53
+ lightEntity.transform.setRotation(-45, -45, 0);
54
+ directLight.intensity = 0.4;
55
+
56
+ // Create camera.
57
+ const cameraEntity = rootEntity.createChild("Camera");
58
+ cameraEntity.addComponent(Camera);
59
+ cameraEntity.transform.setPosition(0, 0, 12);
60
+
61
+ // Create sphere.
62
+ const meshEntity = rootEntity.createChild("Sphere");
63
+ const meshRenderer = meshEntity.addComponent(MeshRenderer);
64
+ const material = new BlinnPhongMaterial(engine);
65
+ meshRenderer.setMaterial(material);
66
+ meshRenderer.mesh = PrimitiveMesh.createSphere(engine, 1);
67
+
68
+ // Run engine.
69
+ engine.run();
70
+ ```
71
+
72
+ ## Links
73
+
74
+ - [Official Site](https://oasisengine.cn)
75
+ - [Examples](https://oasisengine.cn/#/examples/latest)
76
+ - [Documentation](https://oasisengine.cn/#/docs/latest/cn/install)
77
+ - [API References](https://oasisengine.cn/#/api/latest/core)
78
+
79
+
80
+ ## License
81
+
82
+ The engine is released under the [MIT](https://opensource.org/licenses/MIT) license. See LICENSE file.