update method

BufferGeometry update(
  1. Object3D object
)

Implementation

BufferGeometry update(Object3D object) {
  num frame = info.render["frame"]!;

  final geometry = object.geometry;

  final buffergeometry = geometries.get(geometry!);

  // Update once per frame

  if (updateMap.get(buffergeometry) != frame) {
    geometries.update(buffergeometry);
    updateMap.add(key: buffergeometry, value: frame);
  }

  // print(" WebGLObjects update object: ${object} ${object.type} ");

  if (object is InstancedMesh) {
    if (object.hasEventListener('dispose', onInstancedMeshDispose) == false) {
      object.addEventListener('dispose', onInstancedMeshDispose);
    }

    // print(" WebGLObjects update 2 object: ${object} ${object.instanceMatrix} ");
    attributes.update(object.instanceMatrix, WebGL.ARRAY_BUFFER);

    if (object.instanceColor != null) {
      attributes.update(object.instanceColor, WebGL.ARRAY_BUFFER);
    }
  }

  return buffergeometry;
}