PlaneGeometry.js 777 B

123456789101112131415161718192021222324252627282930
  1. import { Geometry } from '../core/Geometry';
  2. import { PlaneBufferGeometry } from './PlaneBufferGeometry';
  3. /**
  4. * @author mrdoob / http://mrdoob.com/
  5. * based on http://papervision3d.googlecode.com/svn/trunk/as3/trunk/src/org/papervision3d/objects/primitives/Plane.as
  6. */
  7. function PlaneGeometry( width, height, widthSegments, heightSegments ) {
  8. Geometry.call( this );
  9. this.type = 'PlaneGeometry';
  10. this.parameters = {
  11. width: width,
  12. height: height,
  13. widthSegments: widthSegments,
  14. heightSegments: heightSegments
  15. };
  16. this.fromBufferGeometry( new PlaneBufferGeometry( width, height, widthSegments, heightSegments ) );
  17. }
  18. PlaneGeometry.prototype = Object.create( Geometry.prototype );
  19. PlaneGeometry.prototype.constructor = PlaneGeometry;
  20. export { PlaneGeometry };