Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
GeometrySoup.h
Go to the documentation of this file.
1#pragma once
2
4#include "SDL/sdl_interface.h"
5
6#include <vector>
7#include <memory>
8
9namespace ph
10{
11
12class GeometrySoup : public Geometry
13{
14public:
16
17 void storeCooked(
18 CookedGeometry& out_geometry,
19 const CookingContext& ctx) const override;
20
21 void genPrimitive(
22 const PrimitiveBuildingMaterial& data,
23 std::vector<std::unique_ptr<Primitive>>& out_primitives) const override;
24
25 std::shared_ptr<Geometry> genTransformed(
26 const math::StaticAffineTransform& transform) const override;
27
28 void add(const std::shared_ptr<Geometry>& geometry);
29
30 bool addTransformed(
31 const std::shared_ptr<Geometry>& geometry,
32 const math::StaticAffineTransform& transform);
33
34private:
35 std::vector<std::shared_ptr<Geometry>> m_geometries;
36
37public:
39 {
40 ClassType clazz("geometry-soup");
41 clazz.docName("Geometry Soup");
42 clazz.description("A collection of random geometries.");
43 clazz.baseOn<Geometry>();
44
45 TSdlReferenceArray<Geometry, GeometrySoup> geometries("geometries", &OwnerType::m_geometries);
46 geometries.description("Array of references to the geometries in the soup.");
47 clazz.addField(geometries);
48
49 return clazz;
50 }
51};
52
53}// end namespace ph
Definition CookedGeometry.h:13
Information about the world being cooked.
Definition CookingContext.h:24
Definition Geometry.h:21
Definition GeometrySoup.h:13
bool addTransformed(const std::shared_ptr< Geometry > &geometry, const math::StaticAffineTransform &transform)
Definition GeometrySoup.cpp:59
void genPrimitive(const PrimitiveBuildingMaterial &data, std::vector< std::unique_ptr< Primitive > > &out_primitives) const override
Definition GeometrySoup.cpp:24
PH_DEFINE_SDL_CLASS(TSdlOwnerClass< GeometrySoup >)
Definition GeometrySoup.h:38
std::shared_ptr< Geometry > genTransformed(const math::StaticAffineTransform &transform) const override
Definition GeometrySoup.cpp:34
void storeCooked(CookedGeometry &out_geometry, const CookingContext &ctx) const override
Store data suitable for rendering into out_geometry.
Definition GeometrySoup.cpp:14
void add(const std::shared_ptr< Geometry > &geometry)
Definition GeometrySoup.cpp:54
GeometrySoup()
Definition GeometrySoup.cpp:9
Definition PrimitiveBuildingMaterial.h:11
SDL binding type for a canonical SDL resource class.
Definition TSdlOwnerClass.h:23
A value that points to an array of SDL resources.
Definition TSdlReferenceArray.h:23
Definition StaticAffineTransform.h:14
The root for all renderer implementations.
Definition EEngineProject.h:6