Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
GPlyPolygonMesh.h
Go to the documentation of this file.
1#pragma once
2
5#include "SDL/sdl_interface.h"
7
8namespace ph
9{
10
14{
15public:
16 void storeCooked(
17 CookedGeometry& out_geometry,
18 const CookingContext& ctx) const override;
19
20 void genPrimitive(
21 const PrimitiveBuildingMaterial& data,
22 std::vector<std::unique_ptr<Primitive>>& out_primitives) const override;
23
24 std::shared_ptr<Geometry> genTransformed(
25 const math::StaticAffineTransform& transform) const override;
26
27private:
28 ResourceIdentifier m_plyFile;
29
30 IndexedTriangleBuffer loadTriangleBuffer() const;
31
32public:
34 {
35 ClassType clazz("ply");
36 clazz.docName("PLY Polygon Mesh");
37 clazz.description("Polygon mesh stored as a .ply file.");
38 clazz.baseOn<Geometry>();
39
40 TSdlResourceIdentifier<OwnerType> plyFile("ply-file", &OwnerType::m_plyFile);
41 plyFile.description(
42 "The .ply file that stores the polygon mesh.");
43 plyFile.required();
44 clazz.addField(plyFile);
45
46 return clazz;
47 }
48};
49
50}// end namespace ph
Definition CookedGeometry.h:13
Information about the world being cooked.
Definition CookingContext.h:24
Mesh stored as a .ply file.
Definition GPlyPolygonMesh.h:14
std::shared_ptr< Geometry > genTransformed(const math::StaticAffineTransform &transform) const override
Definition GPlyPolygonMesh.cpp:73
PH_DEFINE_SDL_CLASS(TSdlOwnerClass< GPlyPolygonMesh >)
Definition GPlyPolygonMesh.h:33
void storeCooked(CookedGeometry &out_geometry, const CookingContext &ctx) const override
Store data suitable for rendering into out_geometry.
Definition GPlyPolygonMesh.cpp:21
void genPrimitive(const PrimitiveBuildingMaterial &data, std::vector< std::unique_ptr< Primitive > > &out_primitives) const override
Definition GPlyPolygonMesh.cpp:66
Definition Geometry.h:21
Definition PrimitiveBuildingMaterial.h:11
An general identifier that points to some resource. This is the most general form of a resource ident...
Definition ResourceIdentifier.h:20
Definition TIndexedPolygonBuffer.h:23
SDL binding type for a canonical SDL resource class.
Definition TSdlOwnerClass.h:23
A field class that binds a resource identifier member. Though the member type that is binded by defau...
Definition TSdlResourceIdentifier.h:28
Definition StaticAffineTransform.h:14
The root for all renderer implementations.
Definition EEngineProject.h:6