4#include "scene/Object.hpp"
15 using List = std::vector<long>;
20 Culler(
const std::vector<Object> & objects);
28 const List &
cull(
const glm::mat4 & view,
const glm::mat4 & proj);
37 const List &
cullAndSort(
const glm::mat4 & view,
const glm::mat4 & proj,
const glm::vec3 & pos);
72 double distance = std::numeric_limits<double>::max();
Select and sort objects based on visibility and distance criteria.
Definition: Culler.hpp:11
std::vector< long > List
Indices of selected objects.
Definition: Culler.hpp:15
unsigned long _maxCount
Maximum number of objects to select.
Definition: Culler.hpp:78
Ordering
Define ordering of sorted objects.
Definition: Culler.hpp:61
@ FRONT_TO_BACK
Closest first.
@ BACK_TO_FRONT
Furthest first.
void interface()
Definition: Culler.cpp:128
Culler & operator=(Culler &&)=delete
Culler & operator=(const Culler &)=delete
bool _freezeFrustum
Should the frustum not be updated.
Definition: Culler.hpp:79
const List & cullAndSort(const glm::mat4 &view, const glm::mat4 &proj, const glm::vec3 &pos)
Definition: Culler.cpp:41
const List & cull(const glm::mat4 &view, const glm::mat4 &proj)
Definition: Culler.cpp:11
std::vector< DistPair > _distances
Intermediate storage for sorting.
Definition: Culler.hpp:75
List _order
Will contain the indices of the objects selected.
Definition: Culler.hpp:67
Culler(const Culler &)=delete
const std::vector< Object > & _objects
Reference to the objects to process.
Definition: Culler.hpp:66
Frustum _frustum
Current view frustum.
Definition: Culler.hpp:77
Represent a 3D frustum, volume defined by the intersection of six planes.
Definition: Bounds.hpp:106
Definition: Culler.hpp:70
double distance
Distance.
Definition: Culler.hpp:72
long material
Material set (lower is closer).
Definition: Culler.hpp:73