forked from playcanvas/engine
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbatch-group.js
More file actions
48 lines (42 loc) · 1.96 KB
/
Copy pathbatch-group.js
File metadata and controls
48 lines (42 loc) · 1.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import { LAYERID_WORLD } from '../constants.js';
/**
* @class
* @name BatchGroup
* @classdesc Holds mesh batching settings and a unique id. Created via {@link BatchManager#addGroup}.
* @param {number} id - Unique id. Can be assigned to model and element components.
* @param {string} name - The name of the group.
* @param {boolean} dynamic - Whether objects within this batch group should support transforming at runtime.
* @param {number} maxAabbSize - Maximum size of any dimension of a bounding box around batched objects.
* {@link BatchManager#prepare} will split objects into local groups based on this size.
* @param {number[]} [layers] - Layer ID array. Default is [{@link LAYERID_WORLD}]. The whole batch group will belong
* to these layers. Layers of source models will be ignored.
* @property {boolean} dynamic Whether objects within this batch group should support transforming at runtime.
* @property {number} maxAabbSize Maximum size of any dimension of a bounding box around batched objects.
* {@link BatchManager#prepare} will split objects into local groups based on this size.
* @property {number} id Unique id. Can be assigned to model and element components.
* @property {string} name Name of the group.
* @property {number[]} [layers] Layer ID array. Default is [{@link LAYERID_WORLD}]. The whole batch group will belong
* to these layers. Layers of source models will be ignored.
*/
class BatchGroup {
constructor(id, name, dynamic, maxAabbSize, layers = [LAYERID_WORLD]) {
this.dynamic = dynamic;
this.maxAabbSize = maxAabbSize;
this.id = id;
this.name = name;
this.layers = layers;
this._ui = false;
this._sprite = false;
this._obj = {
model: [],
element: [],
sprite: [],
render: []
};
}
static MODEL = 'model';
static ELEMENT = 'element';
static SPRITE = 'sprite';
static RENDER = 'render';
}
export { BatchGroup };