Skip to content

editorGlobalsAbstractInteractionMapping

Class: AbstractInteractionMapping ‹Mapping

Defines the interface for InteractionMappings

Type parameters

Mapping: IMapping

Hierarchy

  • AbstractInteractionMapping

Index

Constructors

Properties

Methods

Constructors

constructor

+ new AbstractInteractionMapping(context?: Record‹string, any›): AbstractInteractionMapping

Defined in src/tools/utils/mappings/AbstractInteractionMapping.ts:17

Parameters:

Name Type Description
context? Record‹string, any› Allows tools to store mapping specific contextual information. The context object is passed to the tool during each interaction step as part of the mapping result.

Returns: AbstractInteractionMapping

Properties

Protected Readonly context

context: Record‹string, any›

Defined in src/tools/utils/mappings/AbstractInteractionMapping.ts:15


Protected defaultQuality

defaultQuality: number = 0

Defined in src/tools/utils/mappings/AbstractInteractionMapping.ts:16


Protected lastMapping

lastMapping: Mapping | null = null

Defined in src/tools/utils/mappings/AbstractInteractionMapping.ts:17

Methods

getContext

getContext(): Record‹string, any›

Defined in src/tools/utils/mappings/AbstractInteractionMapping.ts:77

Returns: Record‹string, any›

The context of this mapping.


getDefaultQuality

getDefaultQuality(): number

Defined in src/tools/utils/mappings/AbstractInteractionMapping.ts:100

Returns: number

the default quality that this mapping has


getLastMapping

getLastMapping(): Mapping

Defined in src/tools/utils/mappings/AbstractInteractionMapping.ts:85

Returns: Mapping

the last result of the map operation, or null, if map hasn't been called. Look into the subclass definition to see the detailed values.


map

map(inputEvent: IInputEvent): Mapping

Defined in src/tools/utils/mappings/AbstractInteractionMapping.ts:33

Map 3D interaction

Parameters:

Name Type Description
inputEvent IInputEvent contains various event parameters like position, rotation…

Returns: Mapping

object containing meaningful mapping results to be used by the tools. This has to contain at least a Vector3, 'intersectionPoint', in world coordinates, which represents the point of interaction


mapPoint

mapPoint(point: Vector3, direction: Vector3): Mapping

Defined in src/tools/utils/mappings/AbstractInteractionMapping.ts:70

Map 3D interaction (point in scene)

Parameters:

Name Type
point Vector3
direction Vector3

Returns: Mapping

object containing meaningful mapping results to be used by the tools. This has to contain at least a Vector3, 'intersectionPoint', in world coordinates, which represents the point of interaction. The return value should be null if no mapping has been performed yet.


mapRay

mapRay(rayOrigin: Vector3, rayDirection: Vector3): Mapping

Defined in src/tools/utils/mappings/AbstractInteractionMapping.ts:56

Map 3D interaction (as a ray from the camera through the scene) onto the internally defined coordinate system.

Parameters:

Name Type
rayOrigin Vector3
rayDirection Vector3

Returns: Mapping

object containing meaningful mapping results to be used by the tools. This has to contain at least a Vector3, 'intersectionPoint', in world coordinates, which represents the point of interaction


setDefaultQuality

setDefaultQuality(defaultQuality: number): void

Defined in src/tools/utils/mappings/AbstractInteractionMapping.ts:93

Parameters:

Name Type
defaultQuality number

Returns: void