Class: PointerData
PathBuilding.PointerData(point)
Contains the pointer input data associated with a pointer event
Constructor
new PointerData(point)
Parameters:
Name | Type | Description |
---|---|---|
point | InkInput.SensorPoint | Pointer data |
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
x | int | Pointer x coordinate | |
y | int | Pointer y coordinate | |
z | int | <optional> | Pointer z coordinate |
timestamp | long | Time when is gathered event | |
pressure | float | <optional> | The normalized pressure of the pointer input in the range of 0 to 1, where 0 and 1 represent the minimum and maximum pressure the hardware is capable of detecting, respectively |
force | float | <optional> | Pressure alias |
radiusX | float | <optional> | Touch radius - x radius of the ellipse that most closely circumscribes the area of contact with the screen. The value is in pixels of the same scale as screenX. |
radiusY | float | <optional> | Touch radius - y radius of the ellipse that most closely circumscribes the area of contact with the screen. The value is in pixels of the same scale as screenY. |
altitude | float | <optional> | Rhe angular elevation of a celestial object above the horizon |
azimuth | float | <optional> | Horizontal direction expressed as the angular distance between the direction of a fixed point (such as the observer's heading) and the direction of the object |
rotation | float | <optional> | Value representing the amount of twist, in radians, applied to the transducer (pointer). The value is in the range 0 to 2 * Pi, inclusive.For devices that do not report twist, the value is 0. |
phase | PathBuilding.Pipeline.Phase | Event phase representation | |
pointer | InkInput.Pointer | <optional> | Describes where this pointer data comes from |
Since:
- version 3.0
Methods
computeNearestAzimuthAngle(previous) → {float}
Computes an azimuth angle that is at the smallest absolute distance from the previous point's azimuth angle
Parameters:
Name | Type | Description |
---|---|---|
previous | PathBuilding.PointerData | The previous pointer data |
Returns:
The computed azimuth angle
Type
float
computeSpeed(previous, next) → {float}
Calculates the speed of the pointer movement based on positions and timestamps of the current pointer data and its neighbours
Parameters:
Name | Type | Description |
---|---|---|
previous | PathBuilding.PointerData | Previous pointer data |
next | PathBuilding.PointerData | Next pointer data |
Returns:
The speed
Type
float
getDelta(previous, next) → PathBuilding.PointerDataDelta
Calculates delta distance and time between 2 points
Parameters:
Name | Type | Description |
---|---|---|
previous | PathBuilding.PointerData | Previous pointer data |
next | PathBuilding.PointerData | Next pointer data |
Returns:
Delta distance and time between 2 points
Type
(static) computeSpeed(delta) → {float}
Calculates the speed of the pointer movement based on delta vector
Parameters:
Name | Type | Description |
---|---|---|
delta | PathBuilding.PointerDataDelta |
Returns:
The speed
Type
float
(static) normalizeSpeed(speed, minNormSpeed, maxNormSpeed, minSpeedopt, maxSpeedopt) → {float}
Normalize speed
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
speed | float | Pointer speed | ||
minNormSpeed | float | Min normalized speed value | ||
maxNormSpeed | float | Max normalized speed value | ||
minSpeed | float | <optional> | 0 | Min speed value |
maxSpeed | float | <optional> | 4000 | Max speed value |
Returns:
Normalized speed
Type
float
Type Definitions
Property
Pointer data properties
Properties:
Name | Type | Description |
---|---|---|
X | object | Pointer X coordinate |
Y | object | Pointer Y coordinate |
Z | object | Pointer Z coordinate |
PHASE | object | Stroke phase |
TIMESTAMP | object | Timestamp of the pointer event |
PRESSURE | object | Pointer Pressure / Force |
RADIUS_X | object | Touch radius - X radius of the ellipse that most closely circumscribes the area of contact with the screen |
RADIUS_Y | object | Touch radius - Y radius of the ellipse that most closely circumscribes the area of contact with the screen |
ALTITUDE | object | Pen altitude angle |
AZIMUTH | object | Pen azimuth angle |
ROTATION | object | Pen rotation angle |