Octree.pkg 1.3 KB

123456789101112131415161718192021222324252627282930313233
  1. $#include "Octree.h"
  2. /// %Octree component. Should be added only to the root scene node
  3. class Octree : public Component
  4. {
  5. public:
  6. /// Resize octree. If octree is not empty, drawable objects will be temporarily moved to the root.
  7. void Resize(const BoundingBox& box, unsigned numLevels);
  8. /// Update and reinsert drawable objects.
  9. void Update(const FrameInfo& frame);
  10. /// Add a drawable manually.
  11. void AddManualDrawable(Drawable* drawable);
  12. /// Remove a manually added drawable.
  13. void RemoveManualDrawable(Drawable* drawable);
  14. /// Return drawable objects by a query.
  15. void GetDrawables(OctreeQuery& query) const;
  16. /// Return drawable objects by a ray query.
  17. void Raycast(RayOctreeQuery& query) const;
  18. /// Return the closest drawable object by a ray query.
  19. void RaycastSingle(RayOctreeQuery& query) const;
  20. /// Return subdivision levels.
  21. unsigned GetNumLevels() const;
  22. /// Mark drawable object as requiring an update.
  23. void QueueUpdate(Drawable* drawable);
  24. /// Mark drawable object as requiring a reinsertion. Is thread-safe.
  25. void QueueReinsertion(Drawable* drawable);
  26. /// Visualize the component as debug geometry.
  27. void DrawDebugGeometry(bool depthTest);
  28. };
  29. Octree* GetOctree();