@vis-three/module-scene
v0.7.0
Published
vis-three scene module
Downloads
8
Readme
@vis-three/module-scene
最新版本
license
模块信息
module.type
- 值:
scene
module.object
- 值:
true
module.lifeOrder
- 值:
SUPPORT_LIFE_CYCLE.THREE + 1
- 301
module.extend
- setSceneBySymbol: 通过 相机 vid 设置 engine 的当前场景
import { generateConfig } from "@vis-three/middleware";
const scene = generateConfig(CONFIGTYPE.SCENE);
engine.applyConfig(scene).setSceneBySymbol(scene.vid);
提供配置
场景-Scene
- 类型:
Scene
- 配置类型:
export interface SceneFogConfig {
type: string; //"Fog" | "FogExp2" | "";
color: string;
near: number;
far: number;
density: number;
}
export interface SceneConfig extends ObjectConfig {
background: string | null; // color or vid
environment: string | null;
fog: SceneFogConfig;
}
- 默认配置:
{
vid: uniqueSymbol("Scene"),
background: "",
environment: "",
fog: {
type: "",
color: "rgb(150, 150, 150)",
near: 1,
far: 200,
density: 0.003,
},
}
:::tip
如果场景在generateConfig
中不传入vid
属性将生产默认vid
场景。
:::