#ifndef _SCENEQUERY_H__ #define _SCENEQUERY_H__ #include "common.h" #include "AxisAlignedBox3.h" namespace CHCDemoEngine { class RenderTraverser; class RenderState; /** A simple class that computes the first intersection of a horizontal ray with the scene. Can be used to "drop" objects in the scene. */ class SceneQuery { public: SceneQuery(const AxisAlignedBox3 &sceneBox, RenderTraverser *traverser, RenderState *state); ~SceneQuery() { DEL_ARRAY_PTR(mDepth); } /** Calculates intersection of vertical ray at position pt.x, pt.y and stores the intersection point if valid. returns true if the intersection is valid. */ bool CalcIntersection(Vector3 &pt); protected: void Prepare(RenderTraverser *traverser); /////////// AxisAlignedBox3 mSceneBox; //unsigned char *mDepth; float *mDepth; RenderState *mRenderState; }; } #endif