3 #include <boost/archive/text_iarchive.hpp> 4 #include <boost/archive/text_oarchive.hpp> 5 #include <boost/serialization/base_object.hpp> 16 #include "DetailedVoxel.h" 18 #include "KDTreeNodeRoot.h" 20 #include "RaySceneIntersection.h" 30 friend class boost::serialization::access;
31 template<
class Archive>
32 void serialize(Archive &ar,
const unsigned int version)
35 ar.template register_type<AABB>();
36 ar.template register_type<Triangle>();
37 ar.template register_type<Vertex>();
38 ar.template register_type<Voxel>();
39 ar.template register_type<DetailedVoxel>();
41 ar & boost::serialization::base_object<Asset>(*this);
52 std::shared_ptr<KDTreeNodeRoot>
kdtree;
56 std::shared_ptr<AABB>
bbox;
93 std::shared_ptr<AABB>
getAABB();
113 glm::dvec3 & rayOrigin,
130 glm::dvec3 & rayOrigin,
std::shared_ptr< AABB > bbox
Axis aligned bounding box defining scene boundaries.
Definition: Scene.h:56
Base class for all assets.
Definition: Asset.h:10
glm::dvec3 getGroundPointAt(glm::dvec3 point)
Obtain the ground point at specified XY coordinates.
Definition: Scene.cpp:148
std::map< double, Primitive * > getIntersections(glm::dvec3 &rayOrigin, glm::dvec3 &rayDir, bool groundOnly)
Obtain all intersections between the ray and the scene, if any.
Definition: Scene.cpp:205
void writeObject(std::string path)
Serialize the scene and write it to given output file.
Definition: Scene.cpp:231
std::shared_ptr< AABB > getAABB()
Obtain the axis aligned bounding box defining scene boundaries.
Definition: Scene.cpp:144
std::shared_ptr< KDTreeNodeRoot > kdtree
KDTree splitting scene points/vertices to speed-up intersection computations.
Definition: Scene.h:52
std::vector< Primitive * > primitives
Vector of primitives composing the scene.
Definition: Scene.h:66
bool finalizeLoading()
Handle scene loading finish process.
Definition: Scene.cpp:59
static Scene * readObject(std::string path)
Read serialized scene from given file.
Definition: Scene.cpp:238
Scene()=default
Scene default constructor.
glm::dvec3 getShift()
Obtain the minimum boundaries of the original axis aligned bounding box containing the scene...
Definition: Scene.cpp:227
Class representing a scene asset.
Definition: Scene.h:25
Abstract class defining the common behavior for all primitives.
Definition: Primitive.h:20
std::shared_ptr< RaySceneIntersection > getIntersection(glm::dvec3 &rayOrigin, glm::dvec3 &rayDir, bool groundOnly)
Obtain the intersection between the ray and the scene, if any.
Definition: Scene.cpp:174
std::shared_ptr< AABB > bbox_crs
Original axis aligned bounding box defining scene boundaries before centering it. ...
Definition: Scene.h:61