#ifndef __KDINTERSECTABLE_H #define __KDINTERSECTABLE_H #include "AxisAlignedBox3.h" #include "Intersectable.h" namespace GtpVisibilityPreprocessor { struct VssRayContainer; class KdNode; /** Wrapper for Kd nodes for use in a PVS. */ class KdIntersectable: public Intersectable { public: KdIntersectable(KdNode *node); /** Returns 'mesh' associated with this instance. */ KdNode *GetNode() const; /** See get. */ void SetNode(KdNode *node); //-- inherited functions from Intersectable AxisAlignedBox3 GetBox() const; int CastRay(Ray &ray); bool IsConvex() const; bool IsWatertight() const; float IntersectionComplexity(); int NumberOfFaces() const; int Type() const; int GetRandomSurfacePoint(GtpVisibilityPreprocessor::Vector3 &point, GtpVisibilityPreprocessor::Vector3 &normal); int GetRandomVisibleSurfacePoint(GtpVisibilityPreprocessor::Vector3 &point, GtpVisibilityPreprocessor::Vector3 &normal, const GtpVisibilityPreprocessor::Vector3 &viewpoint, const int maxTries); ostream &Describe(ostream &s); /** Pointer to kd leaf object that was hit during ray casting. */ Intersectable *mHitObject; protected: KdNode *mNode; }; } #endif