15832144755
2022-01-06 7b4c8991dca9cf2a809a95e239d144697d3afb56
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
import Matrix4 from "../Core/Matrix4.js";
 
/**
 * @private
 */
function ModelInstance(collection, modelMatrix, instanceId) {
  this.primitive = collection;
  this._modelMatrix = Matrix4.clone(modelMatrix);
  this._instanceId = instanceId;
}
 
Object.defineProperties(ModelInstance.prototype, {
  instanceId: {
    get: function () {
      return this._instanceId;
    },
  },
  model: {
    get: function () {
      return this.primitive._model;
    },
  },
  modelMatrix: {
    get: function () {
      return Matrix4.clone(this._modelMatrix);
    },
    set: function (value) {
      Matrix4.clone(value, this._modelMatrix);
      this.primitive.expandBoundingSphere(this._modelMatrix);
      this.primitive._dirty = true;
    },
  },
});
export default ModelInstance;