UNPKG

meta-client

Version:
1 lines 1.09 kB
'use strict';Object.defineProperty(exports,'__esModule',{value:true});var _three=require('three');var _Graphics=require('../Graphics');var _Graphics2=_interopRequireDefault(_Graphics);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError('Cannot call a class as a function')}}var _DEFAULT={WIDTH:1,LENGTH:1};var Plane=function Plane(){var props=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var stop=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;_classCallCheck(this,Plane);if(typeof props==='boolean')stop=props;var _width=props.width||props.w||_DEFAULT.WIDTH;var _length=props.length||props.l||_DEFAULT.LENGTH;this.physics=true;if(props.p!==undefined)this.physics=props.p;if(props.physics!==undefined)this.physics=props.physics;this.geometry=new _three.PlaneGeometry(_width,_length);this.geometry.rotateX(-Math.PI/2);this.type='box';if(stop)return this.geometry;return new _Graphics2.default(this)};exports.default=Plane;