Files
cocos4/cocos/renderer/core/input-assembler.js
T
Yun Hsiao Wu 243d645760 ES6 scene-graph (#3234)
* ES6 base-node

* ES6 node

* ES6 node activator

* ES6 component scheduler

* ES6 find

* ES6 scene

* ES6 private node

* fix linter globals
2018-09-13 01:29:59 +08:00

31 lines
662 B
JavaScript

// Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.
import gfx from '../gfx';
export default class InputAssembler {
constructor(vb, ib, pt = gfx.PT_TRIANGLES) {
this._vertexBuffer = vb;
this._indexBuffer = ib;
this._primitiveType = pt;
this._start = 0;
this._count = -1;
// TODO: instancing data
// this._stream = 0;
}
/**
* @property {Number} count The number of indices or vertices to dispatch in the draw call.
*/
get count() {
if (this._count !== -1) {
return this._count;
}
if (this._indexBuffer) {
return this._indexBuffer.count;
}
return this._vertexBuffer.count;
}
}