-
-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(WebXRManager): add missing methods, update getCamera signature (#…
…169) * chore(WebXRManager): add missing methods, update getCamera signature * chore(WebXRManager): move three types out of webxr spec types * chore: run prettier * fix(WebXRManager): leave XRProjectionLayer out of getBaseLayer for now * fix(WebXRManager): add setReferenceSpace From mrdoob/three.js#20949 * chore: update webxr types, complete webxr controller types * chore(XRHandSpace): make joints readonly * chore: lint * fix: unwrap mangled * chore: lint * chore: lint * chore: prefer record * chore: lint
- Loading branch information
1 parent
52e8c66
commit f675677
Showing
2 changed files
with
51 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,40 @@ | ||
import { Group } from '../../objects/Group'; | ||
import { Vector3 } from '../../math/Vector3'; | ||
|
||
export type XRControllerEventType = XRSessionEventType | XRInputSourceEventType | 'disconnected' | 'connected'; | ||
|
||
export type XRHandJoints = Record<XRHandJoint, number>; | ||
|
||
export interface XRHandInputState { | ||
pinching: boolean; | ||
} | ||
|
||
export class XRHandSpace extends Group { | ||
readonly joints: Partial<XRHandJoints>; | ||
readonly inputState: XRHandInputState; | ||
} | ||
|
||
export class XRTargetRaySpace extends Group { | ||
hasLinearVelocity: boolean; | ||
readonly linearVelocity: Vector3; | ||
hasAngularVelocity: boolean; | ||
readonly angularVelocity: Vector3; | ||
} | ||
|
||
export class XRGripSpace extends Group { | ||
hasLinearVelocity: boolean; | ||
readonly linearVelocity: Vector3; | ||
hasAngularVelocity: boolean; | ||
readonly angularVelocity: Vector3; | ||
} | ||
|
||
export class WebXRController { | ||
constructor(); | ||
|
||
getTargetRaySpace(): Group; | ||
getGripSpace(): Group; | ||
dispatchEvent(event: { type: XRControllerEventType; data?: XRInputSource | undefined }): this; | ||
getHandSpace(): XRHandSpace; | ||
getTargetRaySpace(): XRTargetRaySpace; | ||
getGripSpace(): XRGripSpace; | ||
dispatchEvent(event: { type: XRControllerEventType; data?: XRInputSource }): this; | ||
disconnect(inputSource: XRInputSource): this; | ||
update(inputSource: XRInputSource, frame: XRFrame, referenceSpace: XRReferenceSpace): this; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters