UNPKG

nativescript-ar

Version:

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

25 lines (24 loc) 1.16 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var arcommon_1 = require("./arcommon"); var armaterialfactory_1 = require("./armaterialfactory"); var ARCommonGeometryNode = (function (_super) { __extends(ARCommonGeometryNode, _super); function ARCommonGeometryNode(options, node, renderer) { var _this = _super.call(this, options, node, renderer) || this; if (options.materials) { ARCommonGeometryNode.applyMaterial(node, options.materials); } return _this; } ARCommonGeometryNode.applyMaterial = function (node, materials) { var materialArray = NSMutableArray.alloc().initWithCapacity(materials.length); materials.map(function (material) { return materialArray.addObject(armaterialfactory_1.ARMaterialFactory.getMaterial(material)); }); node.geometry.materials = materialArray; }; ARCommonGeometryNode.prototype.setMaterials = function (materials) { ARCommonGeometryNode.applyMaterial(this.ios, materials); }; return ARCommonGeometryNode; }(arcommon_1.ARCommonNode)); exports.ARCommonGeometryNode = ARCommonGeometryNode;