Class InstancedMeshModule

实例化mesh模块

Hierarchy (view full)

Implements

Constructors

Properties

_app?: App
_destroyed: boolean = false
appRenderIndex: number = 0
data: ShallowReactive<{
    [key: string]: any;
}> = ...

Type declaration

  • [key: string]: any
entity: Entity
extData: {
    [key: string]: any;
} = {}

Type declaration

  • [key: string]: any
idIndexMap: BidirectionalMap = ...
instConfig: Record<string, {
    color?: Color;
    isBloom?: boolean;
    isHighlight?: boolean;
    isOutline?: boolean;
    isSelected?: boolean;
    position?: Vector3;
    rotation?: Vector3;
    scale?: number | Vector3;
}> = {}

Type declaration

  • Optional color?: Color
  • Optional isBloom?: boolean
  • Optional isHighlight?: boolean
  • Optional isOutline?: boolean
  • Optional isSelected?: boolean
  • Optional position?: Vector3
  • Optional rotation?: Vector3
  • Optional scale?: number | Vector3
instanceId: number = ++AppObject._instanceIdCounter
instancedMeshList: DynamicInstancedMesh[] = []
matrixWorldList: Matrix4[] = []
meshList: Mesh<BufferGeometry<NormalBufferAttributes>, Material | Material[], Object3DEventMap>[] = []
onInstanceTransformChangedSignal: Signal = ...
onSetApp: Signal = ...
uuidList: string[] = []
moduleName: string = "InstancedMeshModule"

Accessors

  • get app(): App
  • Returns App

  • set app(value): void
  • Parameters

    Returns void

  • get destroyed(): boolean
  • Whether it has been destroyed.

    Returns boolean

  • get enabled(): boolean
  • Indicates whether the component is enabled.

    Returns boolean

  • set enabled(value): void
  • Parameters

    • value: boolean

    Returns void

Methods

  • 增加实例化对象,如果id为空,则自动增加,如存在,则修改

    Parameters

    • opts: {
          color?: Color;
          computeBoundingSphere?: boolean;
          id: string;
          position?: Vector3;
          rotation?: Vector3;
          scale?: number | Vector3;
      }
      • Optional color?: Color
      • Optional computeBoundingSphere?: boolean
      • id: string
      • Optional position?: Vector3
      • Optional rotation?: Vector3
      • Optional scale?: number | Vector3

    Returns any

  • Parameters

    • toClassInst: any
    • Optional methodNames: string[]
    • Optional addMethods: string[]
    • Optional filterName: string[]

    Returns void

  • 清除所有实例辉光

    Returns void

  • 清除所有实例高亮

    Returns void

  • 清除所有实例描边

    Returns void

  • 清除所有实例选择

    Returns void

  • 触发指定事件名称.

    Parameters

    • event: string

      Event name

    • Rest ...data: any

      Data

    Returns boolean

    • Whether the dispatching is successful
  • 获取实体化的组对象

    Returns Group<Object3DEventMap>

  • 通过id获取索引

    Parameters

    • index: number

    Returns string

  • 通过索引获取id

    Parameters

    • id: string

    Returns number

  • 获取实例属性

    Parameters

    • id: string

      id

    • key: string

    Returns any

  • 获取实例的外包盒

    Parameters

    • id: string

      id

    Returns Box3

  • 确定是否存在事件侦听

    Parameters

    • event: string

      事件名

    Returns boolean

    返回是否存在相应的事件

  • 实例是否辉光

    Parameters

    • id: string

      id

    Returns any

  • 实例是否高亮

    Parameters

    • id: string

      id

    Returns any

  • 实例是否描边

    Parameters

    • id: string

      id

    Returns any

  • 实例是否选中

    Parameters

    • id: string

      id

    Returns any

  • 返回具有指定事件名称的侦听总数.

    Parameters

    • event: string

      Event name

    Returns number

    The count of listeners

  • 通过事件名移除所有监听.

    Parameters

    • Optional event: string

      Event name, delete all events if not passed

    Returns void

  • 根据一个id删除实例化对象

    Parameters

    • id: string
    • Optional computeBoundingSphere: boolean

    Returns void

  • 根据id设置实例化对象属性,如不存在,则新增,如果id为空,则自动增加

    Parameters

    • opts: {
          color?: Color;
          computeBoundingSphere?: boolean;
          id: string;
          position?: Vector3;
          rotation?: Vector3;
          scale?: number | Vector3;
      }
      • Optional color?: Color
      • Optional computeBoundingSphere?: boolean
      • id: string
      • Optional position?: Vector3
      • Optional rotation?: Vector3
      • Optional scale?: number | Vector3

    Returns any

  • 设置实例属性

    Parameters

    • id: string

      id

    • key: string
    • value: any

    Returns void

  • 设置实例辉光与否

    Parameters

    • id: string

      id

    • Optional isBloom: boolean

    Returns void

  • 设置实例高亮与否

    Parameters

    • id: string

      id

    • Optional highlightColor: ColorRepresentation

      高亮颜色,如果为null,则表示取消高亮

    Returns void

  • 设置实例描边与否

    Parameters

    • id: string

      id

    • Optional isOutline: boolean

    Returns void

  • 设置实例选择与否

    Parameters

    • id: string

      id

    • Optional isSelected: boolean

    Returns void