Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Utility

工具类

Hierarchy

  • Utility

Index

Constructors

constructor

  • new Utility(bim365: BIMModel): Utility
  • Parameters

    • bim365: BIMModel

    Returns Utility

Methods

detectIntersects

  • detectIntersects(v2: MouseEvent, useOctree?: boolean): Promise<Intersection[]>
  • 射线碰撞

    Parameters

    • v2: MouseEvent

      屏幕坐标

    • Default value useOctree: boolean = false

      是否开启八叉树需在场景初始化时创建八叉树。默认为false。

       let meshes = detectIntersects({x:0,y:0})

    Returns Promise<Intersection[]>

getBoundingBox

  • getBoundingBox(elementids: string | string[]): Box3
  • 获得指定构件的boundingbox.

    Parameters

    • elementids: string | string[]

    Returns Box3

getElementsCenterPoint

  • getElementsCenterPoint(elementids: string | string[]): Vector3
  • 获取多构件中心点

    Parameters

    • elementids: string | string[]

    Returns Vector3

getScreenCoords

  • getScreenCoords(position: Vector3, camera?: PerspectiveCamera): Vector2
  • 通过三维矢量位置获得屏幕二维位置

    Parameters

    • position: Vector3
    • Default value camera: PerspectiveCamera = this.bim365.resource.activeCamera as any

      默认值为activecamera

    Returns Vector2