#ifndef __BVH_SAH_BUILDER_H__
#define __BVH_SAH_BUILDER_H__

#include "BVHBuilder.h"

namespace VRUT
{
	class BVHSAHBuilder : public BVHBuilder
	{
	public:
		class Comparator
		{
			private:
				unsigned char axis;
				TriangleAABB * aabbs;

			public:
				Comparator(unsigned char axis, TriangleAABB * aabbs);
				bool operator()(int left, int right);

		};

		virtual BVHBottom * Build(const smart_pointer<Geometry> & geometry, unsigned int maxTrianglesPerLeaf = 0);

		BVHSAHBuilder() : BVHBuilder() {}
	};
}

#endif /* __BVH_SAH_BUILDER_H__ */
