"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;

exports.__esModule = true;
exports.ObjModel = void 0;

var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));

var _react = _interopRequireDefault(require("react"));

var _core = require("../core");

var _EventListener = _interopRequireDefault(require("../event/EventListener"));

/**
 * > We recommend glTF for distributing assets in production over the web.
 * > Check out using the [glTF model primitive](https://aframe.io/docs/1.3.0/primitives/a-gltf-model.html).
 * > You can either instead export to COLLADA and
 * > use [the converter](https://cesiumjs.org/convertmodel.html) or try out the [OBJ converter](https://github.com/AnalyticalGraphicsInc/OBJ2GLTF).
 *
 * The .OBJ model primitive displays a 3D Wavefront model.
 *
 * @see https://aframe.io/docs/1.3.0/primitives/a-obj-model.html
 *
 * @example
 * ```tsx
 * <Scene>
 *   <Assets>
 *     <AssetItem id="crate-obj" src="crate.obj" />
 *     <AssetItem id="crate-mtl" src="crate.mtl" />
 *   </Assets>
 *
 *   // Using the asset management system.
 *   <ObjModel src="#crate-obj" mtl="#crate-mtl" />
 *
 *   // Defining the URL inline. Not recommended but may be more comfortable.
 *   <ObjModel src="crate.obj" mtl="crate.mtl" />
 * </Scene>
 * ```
 */
var ObjModel = function ObjModel(props) {
  var mtl = props.mtl,
      obj = props.obj,
      children = props.children;
  return /*#__PURE__*/_react.default.createElement(_EventListener.default, (0, _extends2.default)({
    primitive: "a-obj-model"
  }, (0, _core.toProps)(props, ['mtl', 'obj']), {
    mtl: mtl,
    src: obj
  }), children);
};

exports.ObjModel = ObjModel;