#pragma once #include "v8World/SpatialHashMultiRes.h" #include namespace RBX { class FrameRateManager; } namespace RBX { namespace Graphics { class VisualEngine; class CullableSceneNode; class RenderCamera; class RenderQueue; class GfxSpatialHash; class SpatialHashedScene { public: SpatialHashedScene(); ~SpatialHashedScene(); bool isAdmissible(CullableSceneNode* child); void internalUpdateChild(CullableSceneNode* child); void internalRemoveChild(CullableSceneNode* child); GfxSpatialHash* getSpatialHash() const { return spatialHash.get(); } void queryFrustumOrdered(std::vector& nodes, const RenderCamera& camera, const Vector3& pointOfInterest, FrameRateManager* frm); void querySphere(std::vector& nodes, const Vector3& center, float radius, unsigned int flags); void queryExtents(std::vector& nodes, const Extents& extents, unsigned int flags); std::vector getAllNodes() const; private: typedef boost::unordered_set UnhashedNodes; static const float maxAdmissibleVolume; static const float maxAdmissibleLength; static int globalFrameNumber; scoped_ptr spatialHash; UnhashedNodes unhashedNodes; static int getNextFrame(); }; } }