Class: ZSorterUtil
Sort a data with world coordinates based on the camera's camera by z
Constructors
Methods
Constructors
constructor
• new ZSorterUtil(): ZSorterUtil
Returns
Methods
sort
▸ sort(camera3D
, userDataList
, getObject3D
, result?
): any
[]
Sort userDataList by z based on the view coordinates of camera3D
Parameters
Name | Type | Description |
---|---|---|
camera3D | Camera3D | camera3D |
userDataList | any [] | List of objects that users need to sort |
getObject3D | (userData : any ) => Object3D | Obtain 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
worldToCameraDepth
▸ worldToCameraDepth(obj3d
, camera?
): number
Parameters
Name | Type |
---|---|
obj3d | Object3D |
camera? | Camera3D |
Returns
number