UNPKG

@bezlepkin/nativescript-ar

Version:

NativeScript Augmented Reality plugin. ARKit on iOS and (with the help of Sceneform) ARCore on Android.

20 lines (19 loc) 919 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ARSphere = void 0; const arcommon_1 = require("./arcommon"); const arcommongeometry_1 = require("./arcommongeometry"); class ARSphere extends arcommongeometry_1.ARCommonGeometryNode { static create(options, fragment) { return new Promise(async (resolve, reject) => { const node = arcommon_1.ARCommonNode.createNode(options, fragment); const defaultMaterial = await arcommon_1.ARCommonNode.getDefaultMaterial(); const radius = options.radius; const center = new com.google.ar.sceneform.math.Vector3(0, 0, 0); const renderable = com.google.ar.sceneform.rendering.ShapeFactory.makeSphere(radius, center, defaultMaterial); node.setRenderable(renderable); resolve(new ARSphere(options, node)); }); } } exports.ARSphere = ARSphere;