PlaneGeometry.js 777 字节
Newer Older
1
import { Geometry } from '../core/Geometry';
R
Rich Harris 已提交
2 3
import { PlaneBufferGeometry } from './PlaneBufferGeometry';

4
/**
M
Mr.doob 已提交
5
 * @author mrdoob / http://mrdoob.com/
M
Mr.doob 已提交
6
 * based on http://papervision3d.googlecode.com/svn/trunk/as3/trunk/src/org/papervision3d/objects/primitives/Plane.as
7 8
 */

M
Mr.doob 已提交
9
function PlaneGeometry( width, height, widthSegments, heightSegments ) {
10

R
Rich Harris 已提交
11
	Geometry.call( this );
12

13
	this.type = 'PlaneGeometry';
M
Mr.doob 已提交
14

M
Mr.doob 已提交
15 16 17 18 19 20 21
	this.parameters = {
		width: width,
		height: height,
		widthSegments: widthSegments,
		heightSegments: heightSegments
	};

R
Rich Harris 已提交
22
	this.fromBufferGeometry( new PlaneBufferGeometry( width, height, widthSegments, heightSegments ) );
M
Mr.doob 已提交
23

M
Mr.doob 已提交
24
}
M
Mr.doob 已提交
25

R
Rich Harris 已提交
26 27 28 29
PlaneGeometry.prototype = Object.create( Geometry.prototype );
PlaneGeometry.prototype.constructor = PlaneGeometry;


30
export { PlaneGeometry };