interface BaseSceneProps {
    backgroundColor?: number;
    backgroundImage?: string;
    camera2dSize?: Vec2;
    cameraPosition?: Vec2 | Vec3;
    commandMgr?: CommandManager;
    container: string;
    coordinateType?: "top" | "front" | "left";
    disableResize?: boolean;
    draggable?: boolean;
    frustumSize?: number;
    id: string;
    initialized?: ((sceneTool) => void);
    maxFPS?: number;
    onClickNothing?: ((event) => void);
    outputEncoding?: number;
    preserveDrawingBuffer?: boolean;
    renderFlag?: boolean;
    resizeFramebuffer?: boolean;
    resizeTo?: string | Window;
    resolution?: number;
    scalable?: boolean;
    skyBoxImages?: string[];
    transparent?: boolean;
    type?: symbol;
    viewport?: ViewportInfo;
}

Properties

backgroundColor?: number

画布背景色,使用十六进制。默认:0xffffff

backgroundImage?: string

画布背景图,优先级高于背景色

camera2dSize?: Vec2

2d 相机的尺寸(x是宽度、y是高度)单位:毫米

cameraPosition?: Vec2 | Vec3

相机的初始位置

commandMgr?: CommandManager

处理本场景的 commandMgr

container: string

画布容器标识 多个不同 id 的场景可关联同一个容器/渲染器上下文

coordinateType?: "top" | "front" | "left"

坐标系类型

disableResize?: boolean

禁用 resize

draggable?: boolean

画布是否可拖拽。默认:true

frustumSize?: number

视椎体的大小(高度),只供 3d 正交相机使用

id: string

用以标示当前场景的 ID 当多个不同 id 的场景关联到同一容器中时,可用于区分场景和隔离交互控制器

initialized?: ((sceneTool) => void)

Type declaration

    • (sceneTool): void
    • 场景初始化完成的回调

      Parameters

      Returns void

maxFPS?: number

最大帧率限制

onClickNothing?: ((event) => void)

Type declaration

    • (event): void
    • 点击场景未选中任何目标的回调

      Parameters

      Returns void

outputEncoding?: number

颜色输出模式 renderer.outputEncoding

preserveDrawingBuffer?: boolean

保留绘制缓存数据,用来截图

renderFlag?: boolean

渲染标志(用来打开或关闭渲染 ticker,若为 false,则当前帧不渲染)

resizeFramebuffer?: boolean

resizeFramebuffer

resizeTo?: string | Window

resizeTo 适配的 dom id 或元素引用

resolution?: number

分辨率

scalable?: boolean

画布是否可缩放。默认:true

skyBoxImages?: string[]

天空盒背景图,只有 3d 下才有效,图片列表顺序 pos-x, neg-x, pos-y, neg-y, pos-z, neg-z

transparent?: boolean

是否画布透明。默认:false

type?: symbol

用以标示当前场景的类型

viewport?: ViewportInfo

根视图容器参数(在一个 renderer 中渲染多个子视图并互相隔离时使用)

Generated using TypeDoc