Constructors

  • Parameters

    • Optionalscene: Scene

    Returns CSS3DRender

Properties

hooks: Subscribe<CSS3DRenderEventMap> = ...
state: CSS3DRenderState = ...
setBehindModeContainer: ((container: HTMLElement) => void) = setBehindModeContainer
setFrontModeContainer: ((container: HTMLElement) => void) = setFrontModeContainer

Accessors

  • get behindModeCSS3DRenderer(): ICSS3DRenderer
  • Returns ICSS3DRenderer

  • get frontModeCSS3DRenderer(): ICSS3DRenderer
  • Returns ICSS3DRenderer

  • get scene(): Scene
  • Returns Scene

  • get behindModeCSS3DRenderer(): ICSS3DRenderer
  • Returns ICSS3DRenderer

  • get frontModeCSS3DRenderer(): ICSS3DRenderer
  • Returns ICSS3DRenderer

Methods

  • Parameters

    • camera: Camera
    • points: AnyPosition[]

      矩形四个点坐标

    • Optionalparams: {
          autoRender?: boolean;
          container?: HTMLElement;
          devicePixelRatio?: number;
          pointerEvents?: "none" | "auto";
          ratio?: number;
          scene?: Scene;
          wrapperStyle?: Partial<CSSStyleDeclaration>;
      } & ({
          mode?: "front";
      } | {
          mode: "behind";
          scene: Scene;
      })

      均为可选值 @config_document params 均为可选值

      key type defaultValue comment
      ratio number 0.00216 1px对应多少米,默认为 0.00216,即1px对应2.16mm
      devicePixelRatio number 1 设备的物理像素分辨率与CSS像素分辨率的比值
      container HTMLElement undefined 自定义 return 中的 container
      pointerEvents 'none'|'auto' 'none' container 的 css属性:pointer-events 的值
      autoRender boolean true 是否自动渲染,通常为true
      mode 'front'|'behind' front 两种模式:
      front 模式:DOM 处于 five Canvas 上方,所以无法模拟遮挡效果,需要手动检测是否可见去设置显隐
      behind 模式:DOM 处于 five Canvas 下方,可以模拟真实的遮挡效果,但是 DOM 必须是非透明的
      scene THREE.Scene undefined 如果 mode 为 behind,需要传入

    Returns void | {
        appendToElement: ((element: Element) => ICSS3DRenderer);
        container: HTMLElement;
        css3DObject: CSS3DObjectPlus<HTMLElement>;
        disable: (() => void);
        dispose: (() => boolean);
        enable: (() => void);
        hide: (() => void);
        id: string;
        render: (() => void);
        setEnabled: ((enabled: boolean) => void);
        setVisible: ((visible: boolean) => void);
        show: (() => void);
    }

       {
    id: string, // id
    container: HTMLDIVElement // dom容器
    dispose: () => void // 销毁
    css3DObject: CSS3DObject // THREE.CSS3DObject 实例
    render?: () => void // 渲染函数,当 config.autoRender = true || undefined 时为 undefined
    setVisible: (visible: boolean) => void // 设置显隐, 同 setVisibleById(id, visible)
    show: () => void // 同 setVisible(true)
    hide: () => void // 同 setVisible(false)
    setEnabled: (enabled: boolean) => void // 添加/移除 container, 同 setEnabledById(id, enabled)
    enable: () => void // 同 setEnabled(true)
    disable: () => void // 同 setEnabled(false)
    } | void

    根据传入的四个点位创建一个 3d dom容器,可以通过ReactDom.render()的方式将react组件放到容器中

  • Parameters

    • __namedParameters: {
          userAction: boolean;
      } = ...
      • userAction: boolean

    Returns void

  • Returns void

  • Parameters

    • __namedParameters: {
          userAction: boolean;
      } = ...
      • userAction: boolean

    Returns void

  • Parameters

    • __namedParameters: {
          addGroupIfNotExists: boolean;
      } = {}
      • addGroupIfNotExists: boolean

    Returns CSS3DBehindGroup

  • Parameters

    • __namedParameters: {
          createSceneIfNotExists: boolean;
      } = {}
      • createSceneIfNotExists: boolean

    Returns CSS3DBehindScene

  • Returns CSS3DRenderState

  • Parameters

    • __namedParameters: {
          addGroupIfNotExists: boolean;
      } = {}
      • addGroupIfNotExists: boolean

    Returns CSS3DFrontGroup

  • Parameters

    • __namedParameters: {
          createSceneIfNotExists: boolean;
      } = {}
      • createSceneIfNotExists: boolean

    Returns CSS3DFrontScene

  • Parameters

    • __namedParameters: {
          userAction: boolean;
      } = ...
      • userAction: boolean

    Returns Promise<void>

  • Parameters

    • camera: Camera

    Returns void

  • Parameters

    • id: number
    • enabled: boolean

    Returns void

  • Parameters

    • scene: Scene

    Returns void

  • Parameters

    • state: Partial<CSS3DRenderState>
    • options: {
          userAction: boolean;
      } = ...
      • userAction: boolean

    Returns void

  • Parameters

    • id: number
    • visible: boolean

    Returns void

  • Parameters

    • __namedParameters: {
          userAction: boolean;
      } = ...
      • userAction: boolean

    Returns Promise<void>