Skip to main content

Class: ObjectPicker

Interaction.ObjectPicker

Hierarchy

Accessors

scene

get scene(): IScene<any, ICamera<ICameraOptions, any, any>>

Returns

IScene<any, ICamera<ICameraOptions, any, any>>

Defined in

webgi/src/extras/interaction/ObjectPicker.ts:8

set scene(value): void

Parameters

NameType
valueIScene<any, ICamera<ICameraOptions, any, any>>

Returns

void

Defined in

webgi/src/extras/interaction/ObjectPicker.ts:12


camera

get camera(): undefined | ICamera<ICameraOptions, any, any>

Returns

undefined | ICamera<ICameraOptions, any, any>

Defined in

webgi/src/extras/interaction/ObjectPicker.ts:74

set camera(value): void

Parameters

NameType
valueundefined | ICamera<ICameraOptions, any, any>

Returns

void

Defined in

webgi/src/extras/interaction/ObjectPicker.ts:78


selectedObject

get selectedObject(): null | Object3D<Event>

Returns

null | Object3D<Event>

Defined in

webgi/src/extras/interaction/ObjectPicker.ts:83

set selectedObject(object): void

Parameters

NameType
objectnull | Object3D<Event>

Returns

void

Defined in

webgi/src/extras/interaction/ObjectPicker.ts:90


hoverObject

get hoverObject(): null | Object3D<Event>

Returns

null | Object3D<Event>

Defined in

webgi/src/extras/interaction/ObjectPicker.ts:97

set hoverObject(object): void

Parameters

NameType
objectnull | Object3D<Event>

Returns

void

Defined in

webgi/src/extras/interaction/ObjectPicker.ts:104


time

get time(): number

Returns

number

Defined in

webgi/src/extras/interaction/ObjectPicker.ts:110


isMouseDown

get isMouseDown(): boolean

Returns

boolean

Defined in

webgi/src/extras/interaction/ObjectPicker.ts:115


mouseDownDeltaTime

get mouseDownDeltaTime(): number

Returns

number

Defined in

webgi/src/extras/interaction/ObjectPicker.ts:119

Properties

selectionCondition

selectionCondition: (o: Object3D<Event>) => boolean

Type declaration

▸ (o): boolean

Parameters
NameType
oObject3D<Event>
Returns

boolean

Defined in

webgi/src/extras/interaction/ObjectPicker.ts:22


raycaster

raycaster: Raycaster

Defined in

webgi/src/extras/interaction/ObjectPicker.ts:23


mouse

mouse: Vector2

Defined in

webgi/src/extras/interaction/ObjectPicker.ts:24


cursorStyles

cursorStyles: Object

Type declaration

NameType
defaultstring
downstring

Defined in

webgi/src/extras/interaction/ObjectPicker.ts:27


domElement

domElement: HTMLElement

Defined in

webgi/src/extras/interaction/ObjectPicker.ts:28

Constructors

constructor

new ObjectPicker(scene, domElement, camera?, selectionCondition?)

Parameters

NameType
sceneIScene<any, ICamera<ICameraOptions, any, any>>
domElementHTMLElement
camera?ICamera<ICameraOptions, any, any>
selectionCondition?(o: Object3D<Event>) => boolean

Overrides

SimpleEventDispatcher.constructor

Defined in

webgi/src/extras/interaction/ObjectPicker.ts:29

Methods

onPointerMove

onPointerMove(event): void

Parameters

NameType
eventPointerEvent

Returns

void

Defined in

webgi/src/extras/interaction/ObjectPicker.ts:123


onPointerLeave

onPointerLeave(event): void

Parameters

NameType
eventPointerEvent

Returns

void

Defined in

webgi/src/extras/interaction/ObjectPicker.ts:132


onPointerEnter

onPointerEnter(event): void

Parameters

NameType
eventPointerEvent

Returns

void

Defined in

webgi/src/extras/interaction/ObjectPicker.ts:142


onPointerCancel

onPointerCancel(event): void

Parameters

NameType
eventPointerEvent

Returns

void

Defined in

webgi/src/extras/interaction/ObjectPicker.ts:145


updateMouseFromEvent

updateMouseFromEvent(event): void

Parameters

NameType
eventPointerEvent

Returns

void

Defined in

webgi/src/extras/interaction/ObjectPicker.ts:149


onPointerDown

onPointerDown(event): undefined

Parameters

NameType
eventPointerEvent

Returns

undefined

Defined in

webgi/src/extras/interaction/ObjectPicker.ts:155


onPointerUp

onPointerUp(event): undefined

Parameters

NameType
eventPointerEvent

Returns

undefined

Defined in

webgi/src/extras/interaction/ObjectPicker.ts:164


onPointerClick

onPointerClick(event): void

Parameters

NameType
eventPointerEvent

Returns

void

Defined in

webgi/src/extras/interaction/ObjectPicker.ts:178


addPasses

addPasses(): void

Returns

void

Defined in

webgi/src/extras/interaction/ObjectPicker.ts:189


checkIntersection

checkIntersection(): null | { selectedObject: Object3D<Event> ; intersect: Intersection<Object3D<Event>> ; intersects: Intersection<Object3D<Event>>[] ; mouse: Vector2Tuple }

Returns

null | { selectedObject: Object3D<Event> ; intersect: Intersection<Object3D<Event>> ; intersects: Intersection<Object3D<Event>>[] ; mouse: Vector2Tuple }

Defined in

webgi/src/extras/interaction/ObjectPicker.ts:217


refreshOutlinePass

refreshOutlinePass(): void

Returns

void

Defined in

webgi/src/extras/interaction/ObjectPicker.ts:285


isHovering

isHovering(): boolean

Returns

boolean

Defined in

webgi/src/extras/interaction/ObjectPicker.ts:294


isSelected

isSelected(): boolean

Returns

boolean

Defined in

webgi/src/extras/interaction/ObjectPicker.ts:298


addEventListener

addEventListener(type, listener): void

Adds a listener to an event type.

Parameters

NameType
type"selectedObjectChanged" | "hoverObjectChanged" | "hitObject"
listener(event: IEvent<"selectedObjectChanged" | "hoverObjectChanged" | "hitObject">) => void

Returns

void

Inherited from

SimpleEventDispatcher.addEventListener

Defined in

webgi/src/helpers/EventDispatcher.ts:48


hasEventListener

hasEventListener(type, listener): boolean

Checks if listener is added to an event type.

Parameters

NameType
type"selectedObjectChanged" | "hoverObjectChanged" | "hitObject"
listener(event: IEvent<"selectedObjectChanged" | "hoverObjectChanged" | "hitObject">) => void

Returns

boolean

Inherited from

SimpleEventDispatcher.hasEventListener

Defined in

webgi/src/helpers/EventDispatcher.ts:56


removeEventListener

removeEventListener(type, listener): void

Removes a listener from an event type.

Parameters

NameType
type"selectedObjectChanged" | "hoverObjectChanged" | "hitObject"
listener(event: IEvent<"selectedObjectChanged" | "hoverObjectChanged" | "hitObject">) => void

Returns

void

Inherited from

SimpleEventDispatcher.removeEventListener

Defined in

webgi/src/helpers/EventDispatcher.ts:63


dispatchEvent

dispatchEvent(event): void

Fire an event type.

Parameters

NameType
eventIEvent<"selectedObjectChanged" | "hoverObjectChanged" | "hitObject">

Returns

void

Inherited from

SimpleEventDispatcher.dispatchEvent

Defined in

webgi/src/helpers/EventDispatcher.ts:74