NGL@1.0.0-beta.7 Home Manual Reference Source Gallery
import {Picker} from 'ngl/src/utils/picker.js'
public interface | source

Picker

Picker class

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public

Method Summary

Public Methods
public

Get the index for the given picking id

public abstract

Get object data

public

getPosition(pid: Integer, instance: Object, component: Component): Vector3

Get position for the given picking id

Private Methods
private
private abstract

Get object position

Public Constructors

public constructor(array: Array | TypedArray) source

Params:

NameTypeAttributeDescription
array Array | TypedArray
  • optional

mapping

Public Members

public array source

Public Methods

public getIndex(pid: Integer): Integer source

Get the index for the given picking id

Params:

NameTypeAttributeDescription
pid Integer

the picking id

Return:

Integer

the index

public abstract getObject(pid: Integer): Object source

Get object data

Params:

NameTypeAttributeDescription
pid Integer

the picking id

Return:

Object

the object data

public getPosition(pid: Integer, instance: Object, component: Component): Vector3 source

Get position for the given picking id

Params:

NameTypeAttributeDescription
pid Integer

the picking id

instance Object

the instance that should be applied

component Component

the component of the picked object

Return:

Vector3

the position

Private Methods

private _applyTransformations() source

private abstract _getPosition(pid: Integer): Vector3 source

Get object position

Params:

NameTypeAttributeDescription
pid Integer

the picking id

Return:

Vector3

the object position