Skip to content
本页内容

Class: ZSorterUtil

Sort a data with world coordinates based on the camera's camera by z

Constructors

Methods

Constructors

constructor

new ZSorterUtil()

Methods

sort

sort(camera3D, userDataList, getObject3D, result?): any[]

Sort userDataList by z based on the view coordinates of camera3D

Parameters

NameTypeDescription
camera3DCamera3Dcamera3D
userDataListany[]List of objects that users need to sort
getObject3D(userData: any) => Object3DObtain the function of the Object 3D reference based on userData
result?any[]Returns a list of userData, and if passed in as null, instantiates one

Returns

any[]

Defined in

src/util/ZSorterUtil.ts:39


worldToCameraDepth

worldToCameraDepth(obj3d, camera?): number

Parameters

NameType
obj3dObject3D
camera?Camera3D

Returns

number

Defined in

src/util/ZSorterUtil.ts:61