The Scene object
A 3D scene is a collection of models and primitives. The scene can have some optional acceleration structure, similar to how our mesh implementation contains an optional BVH. This acceleration structure is commonly implemented as an Octree
, the same way the BVH we implemented for the mesh is an Octree
.
One common misconception is that the same scene graph should be used for rendering as the one used for physics. In practice, the two systems need to track different data for different purposes. It makes sense to have a Render Scene and a Physics Scene, both of which contain the same objects, but track the objects in different ways. In this chapter, we will implement a Scene
object that is limited to containing Model
objects, and not primitives.
Getting ready
We are about to implement a basic scene with an optional Octree
acceleration structure. The acceleration structure will be added to the scene later in this chapter. The scene will need functions to add and remove models...