1 Star 0 Fork 24

wuyouw / Oasis-Engine

forked from oasis-engine / engine 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

Oasis Engine (Ant Graphics Engine)

Oasis logo

npm-version npm-size npm-download

Oasis is a web-first and mobile-first high-performance real-time development platform. Use component system design and pursue ease of use and light weight. This repository is the core engine of Oasis. Developers can independently use and write Typescript scripts to develop projects using pure code.

Features

  • 🖥  Platform - Suppport HTML5 and Alipay miniprogram
  • 🔮  Graphics - Advanced 2D + 3D graphics engine
  • 🏃  Animation - Powerful animation system
  • 📑  Scripts - Use TypeScript to write logic efficiently

Usage

// Create engine by passing in the HTMLCanvasElement name and get root entity.
const engine = new WebGLEngine("canvas");
const canvas = engine.canvas;
const rootEntity = engine.sceneManager.activeScene.createRootEntity("Root");
canvas.width = window.innerWidth * SystemInfo.devicePixelRatio;
canvas.height = window.innerHeight * SystemInfo.devicePixelRatio;

// Create light.
const lightEntity = rootEntity.createChild("Light");
const ambient = lightEntity.addComponent(AmbientLight);
const directLight = lightEntity.addComponent(DirectLight);
ambient.color = new Color(0.5, 0.5, 0.5);
directLight.color = new Color(0.3, 0.4, 0.4);

// Create camera.
const cameraEntity = rootEntity.createChild("Camera");
cameraEntity.transform.setPosition(0, 6, 10);
cameraEntity.transform.lookAt(new Vector3(0, 0, 0));
cameraEntity.addComponent(Camera);

// Create cube.
const cubeEntity = rootEntity.createChild("Cube");
const cubeRenderer = cubeEntity.addComponent(GeometryRenderer);
const material = new BlinnPhongMaterial(engine);
cubeEntity.transform.rotate(0, 60, 0);
material.ambientColor = new Color(0.6, 0.6, 0.6, 1);
cubeRenderer.geometry = new CuboidGeometry(engine, 1, 1, 1);
cubeRenderer.material = material;

// Run engine.
engine.run();

npm

Oasis Engine are published on npm with full typing support. To install, use:

npm install oasis-engine

This will allow you to import Oasis Engine entirely using:

import * as OASIS from "oasis-engine";

or individual classes using:

import { Engine, Scene, Entity } from "oasis-engine";

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

If you don't already have Node.js and NPM, go install them. Then, in the folder where you have cloned the repository, install the build dependencies using npm:

npm run bootstrap

Then, to build the source, using npm:

npm run build

The docs can be generated using npm:

npm run doc

Links

License

The Oasis Engine is released under the MIT license. See LICENSE file.

The MIT License Copyright © 2020-2021 Oasis authors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

Oasis Engine 引擎是一款以 Web 为先,移动为先的互动/创作平台,使用组件系统架构、逻辑编写采用脚本系统、引擎源码使用 TypeScript 编写,并且追求易用和轻量 展开 收起
TypeScript
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
TypeScript
1
https://gitee.com/wuyouw/Oasis-Engine.git
git@gitee.com:wuyouw/Oasis-Engine.git
wuyouw
Oasis-Engine
Oasis-Engine
main

搜索帮助