update method

dynamic update([
  1. dynamic frame
])
override

Implementation

update([frame]) {
  var object = this.object3d != null ? this.object3d : frame.object;
  var inputNode = this._inputNode;
  var camera = frame.camera;
  var scope = this.scope;

  if (scope == Object3DNode.VIEW_MATRIX) {
    inputNode.value = object.modelViewMatrix;
  } else if (scope == Object3DNode.NORMAL_MATRIX) {
    inputNode.value = object.normalMatrix;
  } else if (scope == Object3DNode.WORLD_MATRIX) {
    inputNode.value = object.matrixWorld;
  } else if (scope == Object3DNode.POSITION) {
    inputNode.value.setFromMatrixPosition(object.matrixWorld);
  } else if (scope == Object3DNode.VIEW_POSITION) {
    inputNode.value.setFromMatrixPosition(object.matrixWorld);

    inputNode.value.applyMatrix4(camera.matrixWorldInverse);
  }
}