getNextRenderItem method

RenderItem getNextRenderItem(
  1. Object3D object,
  2. BufferGeometry? geometry,
  3. Material? material,
  4. int groupOrder,
  5. double z,
  6. Map<String, dynamic>? group,
)

Implementation

RenderItem getNextRenderItem(
    Object3D object,
    BufferGeometry? geometry,
    Material? material,
    int groupOrder,
    double z,
    Map<String, dynamic>? group) {
  var renderItem = renderItems[renderItemsIndex];

  if (renderItem == null) {
    renderItem = RenderItem({
      "id": object.id,
      "object": object,
      "geometry": geometry,
      "material": material,
      "groupOrder": groupOrder,
      "renderOrder": object.renderOrder,
      "z": z,
      "group": group
    });

    renderItems[renderItemsIndex] = renderItem;
  } else {
    renderItem.id = object.id;
    renderItem.object = object;
    renderItem.geometry = geometry;
    renderItem.material = material;
    renderItem.groupOrder = groupOrder;
    renderItem.renderOrder = object.renderOrder;
    renderItem.z = z;
    renderItem.group = group;
  }

  renderItemsIndex++;

  return renderItem;
}