Limited availability
The XRHand
interface is pair iterator (an ordered map) with the key being the hand joints and the value being an XRJointSpace
.
XRHand
is returned by XRInputSource.hand
.
size
Read only Experimental
Returns 25
, the size of the pair iterator.
The XRHand
object is a pair iterator. It can directly be used in a for...of
structure. for (const joint of myHand)
is equivalent to for (const joint of myHand.entries())
. However, it's not a map-like object, so you don't have the clear()
, delete()
, has()
, and set()
methods.
entries()
Experimental
Returns an iterator with the hand joints/XRJointSpace
pairs for each element. See Map.prototype.entries()
for more details.
forEach()
Experimental
Runs a provided function once per each hand joint/XRJointSpace
pair. See Map.prototype.forEach()
for more details.
get()
Experimental
Returns a XRJointSpace
for a given hand joint or undefined
if no such hand joint key is in the map. See Map.prototype.get()
for more details.
keys()
Experimental
Returns an iterator with all the hand joint keys. See Map.prototype.keys()
for more details.
values()
Experimental
Returns an iterator with all the XRJointSpace
values. See Map.prototype.values()
for more details.
The XRHand
object contains the following hand joints:
XRHand
objects
const wristJoint = inputSource.hand.get("wrist");
const indexFingerTipJoint = inputSource.hand.get("index-finger-tip");
for (const [joint, jointSpace] of inputSource.hand) {
console.log(joint);
console.log(jointSpace);
}
Specifications Browser compatibility See also
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4