@bezlepkin/nativescript-ar
Version:
NativeScript Augmented Reality plugin. ARKit on iOS and (with the help of Sceneform) ARCore on Android.
61 lines (60 loc) • 2.94 kB
TypeScript
import { ImageSource } from "@nativescript/core";
import { AR as ARBase, ARAddBoxOptions, ARAddImageOptions, ARAddModelOptions, ARAddOptions, ARAddPlaneOptions, ARAddSphereOptions, ARAddTextOptions, ARAddTubeOptions, ARAddVideoOptions, ARCommonNode, ARDebugLevel, ARImageTrackingOptions, ARPlaneDetectionOrientation, ARPosition, ARRotation, ARTrackingMode, ARUIViewOptions, ARVideoNode } from "./ar-common";
import { ARUIView } from "./nodes/ios/aruiview";
export { ARDebugLevel, ARTrackingMode };
export declare class AR extends ARBase {
sceneView: ARSCNView;
private configuration;
private delegate;
private physicsWorldContactDelegate;
private sceneTapHandler;
private sceneLongPressHandler;
private scenePanHandler;
private sceneRotationHandler;
private scenePinchHandler;
private recorder;
renderer: SCNSceneRenderer;
static isSupported(): boolean;
static isImageTrackingSupported(): boolean;
static isFaceTrackingSupported(): boolean;
setDebugLevel(to: ARDebugLevel): void;
grabScreenshot(): Promise<ImageSource>;
startRecordingVideo(): Promise<boolean>;
stopRecordingVideo(): Promise<string>;
toggleStatistics(on: boolean): void;
setPlaneDetection(to: ARPlaneDetectionOrientation): void;
togglePlaneVisibility(on: boolean): void;
getCameraPosition(): ARPosition;
private getCameraRotationRad;
getCameraRotation(): ARRotation;
private initAR;
private resolveParentNode;
private addBottomPlane;
createNativeView(): Object;
onLayout(left: number, top: number, right: number, bottom: number): void;
sceneLongPressed(recognizer: UITapGestureRecognizer): void;
private getHitTargetWithProperty;
private getTargetARNodeFromSCNNode;
lastPositionForPanning: CGPoint;
targetNodeForPanning: ARCommonNode;
targetNodeForRotating: SCNNode;
targetNodeForScaling: SCNNode;
targetNodeInitialScale: SCNVector3;
targetNodeInitialPan: SCNVector3;
scenePanned(recognizer: UIPanGestureRecognizer): void;
sceneRotated(recognizer: UIRotationGestureRecognizer): void;
scenePinched(recognizer: UIPinchGestureRecognizer): void;
sceneTapped(recognizer: UITapGestureRecognizer): void;
addUIView(options: ARUIViewOptions): Promise<ARUIView>;
addNode(options: ARAddOptions): Promise<ARCommonNode>;
addVideo(options: ARAddVideoOptions): Promise<ARVideoNode>;
addImage(options: ARAddImageOptions): Promise<ARCommonNode>;
addModel(options: ARAddModelOptions): Promise<ARCommonNode>;
addPlane(options: ARAddPlaneOptions): Promise<ARCommonNode>;
addBox(options: ARAddBoxOptions): Promise<ARCommonNode>;
addSphere(options: ARAddSphereOptions): Promise<ARCommonNode>;
addText(options: ARAddTextOptions): Promise<ARCommonNode>;
addTube(options: ARAddTubeOptions): Promise<ARCommonNode>;
trackImage(options: ARImageTrackingOptions): void;
reset(): void;
}