ezEngine Release 26.3
Loading...
Searching...
No Matches
ezSpatialSystem Class Referenceabstract

Abstract base class for spatial systems that organize objects for efficient spatial queries. More...

#include <SpatialSystem.h>

Inheritance diagram for ezSpatialSystem:

Classes

struct  QueryParams
 Parameters for spatial queries to filter and track results. More...
 

Public Member Functions

virtual void StartNewFrame ()
 
Spatial Data Functions
virtual ezSpatialDataHandle CreateSpatialData (const ezSimdBBoxSphere &bounds, ezGameObject *pObject, ezUInt32 uiCategoryBitmask, const ezTagSet &tags)=0
 
virtual ezSpatialDataHandle CreateSpatialDataAlwaysVisible (ezGameObject *pObject, ezUInt32 uiCategoryBitmask, const ezTagSet &tags)=0
 
virtual void DeleteSpatialData (const ezSpatialDataHandle &hData)=0
 
virtual void UpdateSpatialDataBounds (const ezSpatialDataHandle &hData, const ezSimdBBoxSphere &bounds)=0
 
virtual void UpdateSpatialDataObject (const ezSpatialDataHandle &hData, ezGameObject *pObject)=0
 
- Public Member Functions inherited from ezReflectedClass
virtual const ezRTTIGetDynamicRTTI () const
 
bool IsInstanceOf (const ezRTTI *pType) const
 Returns whether the type of this instance is of the given type or derived from it.
 
template<typename T >
EZ_ALWAYS_INLINE bool IsInstanceOf () const
 Returns whether the type of this instance is of the given type or derived from it.
 

Protected Attributes

ezProxyAllocator m_Allocator
 
ezUInt64 m_uiFrameCounter = 0
 

Simple Queries

using QueryCallback = ezDelegate< ezVisitorExecution::Enum(ezGameObject *)>
 
virtual void FindObjectsInSphere (const ezBoundingSphere &sphere, const QueryParams &queryParams, ezDynamicArray< ezGameObject * > &out_objects) const
 
virtual void FindObjectsInSphere (const ezBoundingSphere &sphere, const QueryParams &queryParams, QueryCallback callback) const =0
 
virtual void FindObjectsInBox (const ezBoundingBox &box, const QueryParams &queryParams, ezDynamicArray< ezGameObject * > &out_objects) const
 
virtual void FindObjectsInBox (const ezBoundingBox &box, const QueryParams &queryParams, QueryCallback callback) const =0
 

Visibility Queries

using IsOccludedFunc = ezDelegate< bool(const ezSimdBBox &)>
 
virtual void FindVisibleObjects (const ezFrustum &frustum, const QueryParams &queryParams, ezDynamicArray< const ezGameObject * > &out_objects, IsOccludedFunc isOccluded, ezVisibilityState::Enum visType) const =0
 
virtual ezVisibilityState::Enum GetVisibilityState (const ezSpatialDataHandle &hData, ezUInt32 uiNumFramesBeforeInvisible) const =0
 Retrieves a state describing how visible the object is.
 

Additional Inherited Members

- Static Public Member Functions inherited from ezNoBase
static const ezRTTIGetStaticRTTI ()
 

Detailed Description

Abstract base class for spatial systems that organize objects for efficient spatial queries.

Spatial systems manage spatial data for objects in a world, enabling efficient queries like finding objects in a sphere or box, frustum culling, and visibility testing. Concrete implementations use different spatial data structures (octrees, grids, etc.) for optimization.

Member Function Documentation

◆ GetVisibilityState()

virtual ezVisibilityState::Enum ezSpatialSystem::GetVisibilityState ( const ezSpatialDataHandle hData,
ezUInt32  uiNumFramesBeforeInvisible 
) const
pure virtual

Retrieves a state describing how visible the object is.

An object may be invisible, fully visible, or indirectly visible (through shadows or reflections).

Parameters
uiNumFramesBeforeInvisibleUsed to treat an object that was visible and just became invisible as visible for a few more frames.

Implemented in ezSpatialSystem_RegularGrid.


The documentation for this class was generated from the following files: