CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
CeresEngine::FlatScenePartition Class Referencefinal

A flat scene partitioning system. More...

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

Inheritance diagram for CeresEngine::FlatScenePartition:
CeresEngine::ScenePartition

Classes

struct  ObjectInformation
 Represents information about an object in a scene. More...
 

Public Member Functions

SceneObject rayCast (const Ray &ray) final
 Casts a ray on the scene to find the first SceneObject that gets hit by the ray.
 
void rebuild () final
 Rebuilds the scene partition after changes were done.
 
void addSceneObject (const SceneObject &sceneObject) final
 Adds a new scene object to the scene partition structure.
 
void updateSceneObject (const SceneObject &sceneObject) final
 Updates an existing scene object on the scene partition structure.
 
void removeSceneObject (const SceneObject &sceneObject) final
 Removes an existing scene object from the scene partition structure.
 
- Public Member Functions inherited from CeresEngine::ScenePartition
 ScenePartition (World &world)
 
virtual ~ScenePartition ()
 
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.
 

Private Attributes

Vector< ObjectInformationmObjects
 

Additional Inherited Members

- Protected Attributes inherited from CeresEngine::ScenePartition
WorldmWorld
 The scene World being partitioned by the partition.
 

Detailed Description

A flat scene partitioning system.

Performs no partitioning on the scene and iterates over all objects in the scene to execute queries.

The implementation of this partition system is very trivial and only operates on the bounding boxes of the object. It won't perform a more fine-grained ray casting by looking at the actual geometry of the object.

Usage of this implementation is discouraged and a more optimized one such as BVHScenePartitionSystem or OctreeScenePartitionSystem should be used instead.

Member Function Documentation

◆ addSceneObject()

void CeresEngine::FlatScenePartition::addSceneObject ( const SceneObject sceneObject)
finalvirtual

Adds a new scene object to the scene partition structure.

Implements CeresEngine::ScenePartition.

◆ rayCast()

SceneObject CeresEngine::FlatScenePartition::rayCast ( const Ray &  ray)
finalvirtual

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.

Implements CeresEngine::ScenePartition.

◆ rebuild()

void CeresEngine::FlatScenePartition::rebuild ( )
finalvirtual

Rebuilds the scene partition after changes were done.

Implements CeresEngine::ScenePartition.

◆ removeSceneObject()

void CeresEngine::FlatScenePartition::removeSceneObject ( const SceneObject sceneObject)
finalvirtual

Removes an existing scene object from the scene partition structure.

Implements CeresEngine::ScenePartition.

◆ updateSceneObject()

void CeresEngine::FlatScenePartition::updateSceneObject ( const SceneObject sceneObject)
finalvirtual

Updates an existing scene object on the scene partition structure.

Implements CeresEngine::ScenePartition.

Member Data Documentation

◆ mObjects

Vector<ObjectInformation> CeresEngine::FlatScenePartition::mObjects
private

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