// Copyright 2019 Intel Corporation
// SPDX-License-Identifier: Apache-2.0

#pragma once

#include "IteratorShared.h"

struct IntervalIteratorContext;

struct GridAcceleratorIteratorIntervalState
{
  vec3i currentCellIndex;
  float nominalDeltaT;  // constant for all intervals
};

struct GridAcceleratorIteratorHitState
{
  bool activeCell;
  vec3i currentCellIndex;
  box1f currentCellTRange;
};

struct GridAcceleratorIterator
{
  uniform IntervalIteratorShared super;

  vec3f origin;
  vec3f direction;
  box1f tRange;
  float time;

  // common state
  box1f boundingBoxTRange;

  // interval iterator state
  GridAcceleratorIteratorIntervalState intervalState;

  // hit iterator state
  GridAcceleratorIteratorHitState hitState;
};
