CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
CeresEngine::ScenePartition Class Referenceabstract

Partitions the scene into a highly-efficient representation that allows to quickly perform geometric queries on the scene. More...

#include <CeresEngine/Scene/Partition/ScenePartition.hpp>

Inheritance diagram for CeresEngine::ScenePartition:
CeresEngine::BSPScenePartition CeresEngine::BVHScenePartition CeresEngine::FlatScenePartition CeresEngine::OctreeScenePartition

Public Member Functions

 ScenePartition (World &world)
 
virtual ~ScenePartition ()
 
virtual SceneObject rayCast (const Ray &ray)=0
 Casts a ray on the scene to find the first SceneObject that gets hit by the ray.
 
SceneObject rayCast (const Vector3 &origin, const Vector3 &direction)
 Casts a ray on the scene to find the first SceneObject that gets hit by the ray.
 

Protected Member Functions

virtual void rebuild ()=0
 Rebuilds the scene partition after changes were done.
 
virtual void addSceneObject (const SceneObject &sceneObject)=0
 Adds a new scene object to the scene partition structure.
 
virtual void updateSceneObject (const SceneObject &sceneObject)=0
 Updates an existing scene object on the scene partition structure.
 
virtual void removeSceneObject (const SceneObject &sceneObject)=0
 Removes an existing scene object from the scene partition structure.
 

Protected Attributes

WorldmWorld
 The scene World being partitioned by the partition.
 

Friends

class ScenePartitionSystem
 

Detailed Description

Partitions the scene into a highly-efficient representation that allows to quickly perform geometric queries on the scene.

Examples of queries that can be performed are casting a ray on the scene for picking an object on the viewport.

Constructor & Destructor Documentation

◆ ScenePartition()

CeresEngine::ScenePartition::ScenePartition ( World world)

◆ ~ScenePartition()

virtual CeresEngine::ScenePartition::~ScenePartition ( )
virtual

Member Function Documentation

◆ addSceneObject()

virtual void CeresEngine::ScenePartition::addSceneObject ( const SceneObject sceneObject)
protectedpure virtual

Adds a new scene object to the scene partition structure.

Implemented in CeresEngine::FlatScenePartition.

◆ rayCast() [1/2]

virtual SceneObject CeresEngine::ScenePartition::rayCast ( const Ray &  ray)
pure virtual

Casts a ray on the scene to find the first SceneObject that gets hit by the ray.

Parameters
rayThe ray to be cast on the scene.
Returns
The hit scene object, if any. Can be nullptr if no object was hit by the ray.

Implemented in CeresEngine::FlatScenePartition.

◆ rayCast() [2/2]

SceneObject CeresEngine::ScenePartition::rayCast ( const Vector3 origin,
const Vector3 direction 
)
inline

Casts a ray on the scene to find the first SceneObject that gets hit by the ray.

Parameters
rayThe ray to be cast on the scene.
Returns
The hit scene object, if any. Can be nullptr if no object was hit by the ray.

◆ rebuild()

virtual void CeresEngine::ScenePartition::rebuild ( )
protectedpure virtual

Rebuilds the scene partition after changes were done.

Implemented in CeresEngine::FlatScenePartition.

◆ removeSceneObject()

virtual void CeresEngine::ScenePartition::removeSceneObject ( const SceneObject sceneObject)
protectedpure virtual

Removes an existing scene object from the scene partition structure.

Implemented in CeresEngine::FlatScenePartition.

◆ updateSceneObject()

virtual void CeresEngine::ScenePartition::updateSceneObject ( const SceneObject sceneObject)
protectedpure virtual

Updates an existing scene object on the scene partition structure.

Implemented in CeresEngine::FlatScenePartition.

Friends And Related Symbol Documentation

◆ ScenePartitionSystem

Member Data Documentation

◆ mWorld

World& CeresEngine::ScenePartition::mWorld
protected

The scene World being partitioned by the partition.


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