galacean / runtime-toolkit Goto Github PK
View Code? Open in Web Editor NEWSome out-of-the-box utility features based on the Galacean engine.
Home Page: https://oasisengine.cn
License: MIT License
Some out-of-the-box utility features based on the Galacean engine.
Home Page: https://oasisengine.cn
License: MIT License
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Describe the solution you'd like
A clear and concise description of what you want to happen.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
The local bounding box is not initialized when the Mesh
is initialized, so the auxiliary line cannot be seen when the camera does not contain the origin(0,0,0)
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Describe the solution you'd like
A clear and concise description of what you want to happen.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
in Editor, the wireframe drawer should move into different editor components, which will call in onSceneGUI, it will be more easy to control the data modification and customization.
Is your feature request related to a problem? Please describe.
regardless of camera distance, the wireframe for light should always be the same on the screen
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Describe the solution you'd like
A clear and concise description of what you want to happen.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
有些时候不需要 stats 面板,只是获取性能数据,只需要 Core。
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Create README in monorepo sub-package which will sync into npm package
Auxiliary rendering for colliders.
For example StaticCollider
, DynamicCollider
Describe the bug
Expected behavior
Optimize algorithm to enhance experience
now, Gizmo can control size, translation and rotation. Actually, these three is the basic of viewport manipulation. Gizmo can be refactor to control more paremeter like Collider size, waypoint, and event in CSG modelling mode.
Gizmo should consider to split these three, and make the control target can be self-defined.
Use spherical joint to build high-level spring bone packages
复现方式:
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
拼装场景是编辑器的重要功能,除了在透视视角下进行,三视图必不可少。
对于web编辑器来说,除了使用通常的鼠标+键盘的组合控制场景相机,也应该有门槛更低、直观明了的方式控制场景相机,即直接操作可视化场景坐标轴。
参考blender, xyz三轴,轴端为球状轴点。轴点有XYZ节点标识,文字始终大小方向一致。
悬浮于区域,区域背景为圆形半透明白色。悬浮于轴点,文字变色。
点击轴点,旋转到对应三视图。
拖拽半透明白色区域,旋转场景相机,并变为透视。
import { NavigationGizmo } from "oasis-engine-toolkit"
const navigationGizmo = rootEntity.addComponent(NavigationGizmo)
// 传入场景相机
navigationGizmo.camera = sceneCamera
// 设置图层,默认为Layer01
navigationGizmo.layer = Layer.Layer10
// 设置位置,默认为右上角(0.8, 0, 0.2, 0.2)
navigationGizmo.viewport(0.8, 0, 0.2, 0.2);
"dependencies": {
"oasis-engine",
"@oasis-engine/physics-lite",
"@tweenjs/tween.js",
}
class GizmoScript extends Script {
constructor() {}
onUpdate() {
// 同步 navigationGzimoEntity 和 sceneCameraEntity 的 rotation
}
}
class SphereScript extends Script {
constructor() {}
onPointerEnter() {
// 出现半透明背景
}
onPointerExit() {
// 消失半透明背景
}
onPointerDown() {
// 变为透视相机
// 记录初始位置 this.startQuat = ...
// 获得初始点 this.startPoint = this._getHitPoint()
}
onPointerDrag() {
// 获得转动过程中的点
this.movePoint = this._getHitPoint();
// 转过的角度
const quat = this._getRadian(this.startPoint, this.movePoint);
// 同步navigationGizmoEntity 的 rotation
}
onPointerUp() {
// 停止转动
}
_getHitPoint() {
// 计算当前点位置
}
_getRadian() {
// 计算空间中两向量夹角
}
}
class EndScript extends Script {
constructor() {}
onPointerEnter() {
// 文字变色
}
onPointerExit() {
// 文字颜色恢复
}
onPointerClick() {
// 转到相应的视图
}
_cameraTween() {
// 相机转动缓动动画
}
}
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Describe the solution you'd like
A clear and concise description of what you want to happen.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Add new API to replace material's shader and rewrite FrameBufferPicker
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Describe the solution you'd like
A clear and concise description of what you want to happen.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
Infinity grid不显示。
复制官方示例,同样不显示grid。
<template>
<canvas id="canvas" style="width:500px;height:500px"></canvas>
</template>
<script setup>
import { Camera, WebGLEngine, Vector3 } from "oasis-engine";
import { OrbitControl, GridControl } from "oasis-engine-toolkit";
import {onMounted} from 'vue'
onMounted(() => {
const engine = new WebGLEngine("canvas");
engine.canvas.resizeByClientSize();
engine.sceneManager.activeScene.ambientLight.diffuseSolidColor.set(1,1,1,1);
const rootEntity = engine.sceneManager.activeScene.createRootEntity();
const cameraEntity = rootEntity.createChild("camera");
const camera = cameraEntity.addComponent(Camera);
cameraEntity.transform.setPosition(6, 6, 6);
cameraEntity.transform.lookAt(new Vector3());
cameraEntity.addComponent(OrbitControl);
//无效
const grid = rootEntity.addComponent(GridControl);
grid.camera = camera;
engine.resourceManager
.load(
"https://gw.alipayobjects.com/os/OasisHub/267000040/9994/%25E5%25BD%2592%25E6%25A1%25A3.gltf"
)
.then((gltf) => {
rootEntity.addChild(gltf.defaultSceneRoot);
});
engine.run();
});
</script>
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Describe the solution you'd like
A clear and concise description of what you want to happen.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
当前依据 x 和 y 的移动分量实现,可以考虑换个参考轴使表现更自然。
Add a snapshot
function to generate HTMLImageElement
for preview
function snapshot(asset: Asset, engine: Engine): Promise<HTMLImageElement>;
For Asset
, there are serveral types need support:
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Describe the solution you'd like
A clear and concise description of what you want to happen.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
Is your feature request related to a problem? Please describe.
Stats toolkit can't work in miniprogram because it renders data with DOM API.
Describe the solution you'd like
Maybe we can solve the problem if we use engine's build-in API such as TextRenderer
feature.
Describe the bug
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behavior:
Desktop (please complete the following information):
在react strict模式下使用useEffect的方式初始化引擎及场景,导致orbitControl在pad模式下单点点击便造成rotate
官网的例子原封不动的复制粘贴过来。鼠标左键按住拖拽都没反应。同事苹果电脑没问题。是不兼容window吗?
import { OrbitControl } from "@oasis-engine/controls";
import { Camera, GLTFResource, WebGLEngine } from "oasis-engine";
const engine = new WebGLEngine("canvas");
engine.canvas.resizeByClientSize();
const rootEntity = engine.sceneManager.activeScene.createRootEntity();
const cameraEntity = rootEntity.createChild("camera");
cameraEntity.addComponent(Camera);
cameraEntity.transform.setPosition(3, 3, 3);
cameraEntity.addComponent(OrbitControl);
engine.sceneManager.activeScene.ambientLight.diffuseSolidColor.setValue(1, 1, 1, 1);
engine.resourceManager
.load("https://gw.alipayobjects.com/os/OasisHub/267000040/9994/%25E5%25BD%2592%25E6%25A1%25A3.gltf")
.then((gltf) => {
rootEntity.addChild(gltf.defaultSceneRoot);
});
engine.run();
Auxiliary icon for invisible object.
For example DirectionalLight
, PointLight
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.