Ocular Engine
Ocular::Core::ISceneTree Class Referenceabstract
Inheritance diagram for Ocular::Core::ISceneTree:
Ocular::Core::BVHSceneTree

Public Member Functions

virtual void restructure ()=0
 
virtual void destroy ()=0
 
virtual void addObject (SceneObject *object)=0
 
virtual void addObjects (std::vector< SceneObject * > const &objects)=0
 
virtual bool removeObject (SceneObject *object)=0
 
virtual void removeObjects (std::vector< SceneObject * > const &objects)=0
 
virtual void getAllObjects (std::vector< SceneObject * > &objects) const =0
 
virtual void getAllVisibleObjects (Math::Frustum const &frustum, std::vector< SceneObject * > &objects) const =0
 
virtual void getIntersections (Math::Ray const &ray, std::vector< SceneObject * > &objects) const =0
 
virtual void getIntersections (Math::BoundsSphere const &bounds, std::vector< SceneObject * > &objects) const =0
 
virtual void getIntersections (Math::BoundsAABB const &bounds, std::vector< SceneObject * > &objects) const =0
 
virtual void getIntersections (Math::BoundsOBB const &bounds, std::vector< SceneObject * > &objects) const =0
 
virtual SceneTreeType getType () const =0
 
virtual void setDirty (UUID const &uuid)=0
 

Protected Attributes

std::vector< SceneObject * > m_NewObjects
 Newly added objects that are waiting to be added to the tree.
 

Member Function Documentation

virtual void Ocular::Core::ISceneTree::addObject ( SceneObject object)
pure virtual

Adds the object to the scene tree.

Note
The object will not be instantly added to the tree proper. Instead, they will be added next time the restructure method is invoked. The restructure method is automatically called by the engine periodically. If one needs the object to be immediately available in the tree, then they must manually call the restructure method themselves.
Parameters
[in]object

Implemented in Ocular::Core::BVHSceneTree.

virtual void Ocular::Core::ISceneTree::addObjects ( std::vector< SceneObject * > const &  objects)
pure virtual

Adds a collection of objects to the scene tree.

Note
The objects will not be instantly added to the tree proper. Instead, they will be added next time the restructure method is invoked. The restructure method is automatically called by the engine periodically. If one needs the object to be immediately available in the tree, then they must manually call the restructure method themselves.
Parameters
[in]objects

Implemented in Ocular::Core::BVHSceneTree.

virtual void Ocular::Core::ISceneTree::destroy ( )
pure virtual

Destroys the SceneTree and all nodes contained within. Does not destroy any SceneObjects.

Implemented in Ocular::Core::BVHSceneTree.

virtual void Ocular::Core::ISceneTree::getAllObjects ( std::vector< SceneObject * > &  objects) const
pure virtual

Returns a flat list of all objects in the scene tree. No order is guaranteed for the returned objects.

Parameters
[out]objectsList of all objects in the scene tree.

Implemented in Ocular::Core::BVHSceneTree.

virtual void Ocular::Core::ISceneTree::getAllVisibleObjects ( Math::Frustum const &  frustum,
std::vector< SceneObject * > &  objects 
) const
pure virtual

Returns a flat list of all visbile objects in the scene tree. No order is guaranteed for the returned objects.

Parameters
[in]frustumViewing frustum to check visibility against.
[out]objectsList of all visible objects in the scene tree.

Implemented in Ocular::Core::BVHSceneTree.

virtual void Ocular::Core::ISceneTree::getIntersections ( Math::Ray const &  ray,
std::vector< SceneObject * > &  objects 
) const
pure virtual

Returns a list of all scene objects that intersect with the specified ray. The objects are given in the order they are encountered along the ray.

For example, if a ray is created with the origin at the camera and extends along the view direction, then objects[0] will be the object closest to the camera and objects[size-1] will be the object farthest away from the camera.

Parameters
[in]ray
[out]objectsList of objects intersected by the specified ray.

Implemented in Ocular::Core::BVHSceneTree.

virtual void Ocular::Core::ISceneTree::getIntersections ( Math::BoundsSphere const &  bounds,
std::vector< SceneObject * > &  objects 
) const
pure virtual

Returns a list of all scene objects that intersect with the sphere. An intersection occurs if a SceneObject either partially intersects or is entirely contained within the bounds.

Parameters
[in]bounds
[out]objectsList of objects intersected by the specified bounds.

Implemented in Ocular::Core::BVHSceneTree.

virtual void Ocular::Core::ISceneTree::getIntersections ( Math::BoundsAABB const &  bounds,
std::vector< SceneObject * > &  objects 
) const
pure virtual

Returns a list of all scene objects that intersect with the specified AABB. An intersection occurs if a SceneObject either partially intersects or is entirely contained within the bounds.

Parameters
[in]bounds
[out]objectsList of objects intersected by the specified bounds.

Implemented in Ocular::Core::BVHSceneTree.

virtual void Ocular::Core::ISceneTree::getIntersections ( Math::BoundsOBB const &  bounds,
std::vector< SceneObject * > &  objects 
) const
pure virtual

Returns a list of all scene objects that intersect with the specified OBB. An intersection occurs if a SceneObject either partially intersects or is entirely contained within the bounds.

Parameters
[in]bounds
[out]objectsList of objects intersected by the specified bounds.

Implemented in Ocular::Core::BVHSceneTree.

virtual SceneTreeType Ocular::Core::ISceneTree::getType ( ) const
pure virtual

Returns the type of SceneTree this implementation is.

Implemented in Ocular::Core::BVHSceneTree.

virtual bool Ocular::Core::ISceneTree::removeObject ( SceneObject object)
pure virtual

Removes the object from the scene tree.

Note that this simply removes the reference to the object and does not actually delete/deallocate the object as that should be handled by the scene manager.

Parameters
[in]object

Implemented in Ocular::Core::BVHSceneTree.

virtual void Ocular::Core::ISceneTree::removeObjects ( std::vector< SceneObject * > const &  objects)
pure virtual

Removes all objects from the scene tree.

Note that this simply removes the reference to the object and does not actually delete/deallocate the object as that should be handled by the scene manager.

Parameters
[in]object

Implemented in Ocular::Core::BVHSceneTree.

virtual void Ocular::Core::ISceneTree::restructure ( )
pure virtual

Periodically called (typically once per frame), this method behaves differently based on the SceneTree implementation. Generally though, it will update interal nodes based on any movement and/or rotation that has happened since the last call.

Implemented in Ocular::Core::BVHSceneTree.

virtual void Ocular::Core::ISceneTree::setDirty ( UUID const &  uuid)
pure virtual

Indicates that the tree is dirty, and that the object with the given UUID was explicitly changed.

Implemented in Ocular::Core::BVHSceneTree.


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