Lens.Coordinate(system, x, y, z) ARCore/coordinate.js, line 94
Creates a new Coordinate
Argument | Type | Attributes | Description |
---|---|---|---|
system |
System | The coordinate system, such as |
|
x |
Number | X coordinate |
|
y |
Number | Y coordinate |
|
z |
Number |
<optional> |
Z coordinate |
Static Properties
-
Lens.Coordinate.DEPTH ARCore/coordinate.js, line 258
-
Coordinate frame of the depth camera. Units are pixels.
-
Lens.Coordinate.getWindowOffset ARCore/coordinate.js, line 246
-
Returns the offset between window coordinates and projector coordinates.
-
Lens.Coordinate.HD ARCore/coordinate.js, line 252
-
Coordinate frame of the HD camera. Units are pixels.
-
Lens.Coordinate.PROJECTOR ARCore/coordinate.js, line 264
-
Coordinate frame of the projector/page. Units are pixels.
-
Lens.Coordinate.WINDOW ARCore/coordinate.js, line 274
-
Coordinate frame of the DOM window. For top-level apps, this is the same as the projector coordinate frame. For embedded Lens apps, this can be used to translate coordinates in the frame of the parent app (projector coordinates) to the frame of the child app (window coordinates).
-
Lens.Coordinate.WORLD ARCore/coordinate.js, line 280
-
Coordinate frame of the depth camera. Units are millimeters.
Static Methods
-
Lens.Coordinate.forElement(el) → {Array} ARCore/coordinate.js, line 216
-
Returns the coordinates for the bounding box of an element. Does not take into account CSS transforms. Throws an error if given a CSS selector that does not match any elements, or a jQuery object with no elements.
Argument Type Description el
Element | String | jQuery A DOM element, CSS selector, or jQuery object. This element must be rendered to the screen; it can't have been hidden with
display: none
in CSS or with jQuery's.hide()
.A 2-element array whose first element is the top left corner of the element and whose second element is the bottom right corner.
Instance Properties
-
system: System
-
The coordinate system, such as
Lens.Coordinate.PROJECTOR
. -
x: Number
-
X coordinate.
-
y: Number
-
Y coordinate.
-
z: Number
-
Z coordinate, or
undefined
.
Instance Methods
-
transform(system, callback) → {Promise} ARCore/coordinate.js, line 123
-
Transforms this Coordinate to a Coordinate in a different system.
Argument Type Attributes Description system
String The system to transform to, such as
Lens.Coordinate.WORLD
callback
function <optional>
A function to call with the transformed coordinate.
A jQuery promise. You can attach callbacks using this promise or use jQuery's tools to do parallel transformations. If you passed a callback, that callback will automatically be registered as a completion handler for this promise.