Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
AModel.h
Go to the documentation of this file.
1#pragma once
2
7#include "SDL/sdl_interface.h"
8
9#include <memory>
10#include <vector>
11
12namespace ph
13{
14
15class AModel : public PhysicalActor
16{
17public:
18 PreCookReport preCook(const CookingContext& ctx) const override;
19 TransientVisualElement cook(const CookingContext& ctx, const PreCookReport& report) const override;
20
21 const Geometry* getGeometry() const;
22 const Material* getMaterial() const;
23 void setGeometry(const std::shared_ptr<Geometry>& geometry);
24 void setMaterial(const std::shared_ptr<Material>& material);
25 void setMotionSource(const std::shared_ptr<MotionSource>& motion);
26
27private:
28 std::shared_ptr<Geometry> m_geometry;
29 std::shared_ptr<Material> m_material;
30 std::shared_ptr<MotionSource> m_motionSource;
31
32public:
34 {
35 ClassType clazz("model");
36 clazz.docName("Model Actor");
37 clazz.description("An actor that has a certain 3-D shape in the scene.");
38 clazz.baseOn<PhysicalActor>();
39
40 TSdlReference<Geometry, OwnerType> geometry("geometry", &OwnerType::m_geometry);
41 geometry.description("A geometry that represent this actor's shape.");
42 geometry.required();
43 clazz.addField(geometry);
44
45 TSdlReference<Material, OwnerType> material("material", &OwnerType::m_material);
46 material.description("A material that describes this actor's surface appearance.");
47 material.required();
48 clazz.addField(material);
49
50 TSdlReference<MotionSource, OwnerType> motion("motion", &OwnerType::m_motionSource);
51 motion.description("Movement of this actor.");
52 motion.optional();
53 clazz.addField(motion);
54
55 return clazz;
56 }
57};
58
59}// end namespace ph
Definition AModel.h:16
PH_DEFINE_SDL_CLASS(TSdlOwnerClass< AModel >)
Definition AModel.h:33
const Geometry * getGeometry() const
Definition AModel.cpp:126
TransientVisualElement cook(const CookingContext &ctx, const PreCookReport &report) const override
Definition AModel.cpp:44
PreCookReport preCook(const CookingContext &ctx) const override
Cooking supplemental data before cook(). This method allows user to specify additional configurations...
Definition AModel.cpp:27
void setMaterial(const std::shared_ptr< Material > &material)
Definition AModel.cpp:116
void setGeometry(const std::shared_ptr< Geometry > &geometry)
Definition AModel.cpp:111
void setMotionSource(const std::shared_ptr< MotionSource > &motion)
Definition AModel.cpp:121
const Material * getMaterial() const
Definition AModel.cpp:131
Information about the world being cooked.
Definition CookingContext.h:24
Definition Geometry.h:21
Definition Material.h:17
Definition PhysicalActor.h:18
Definition PreCookReport.h:13
SDL binding type for a canonical SDL resource class.
Definition TSdlOwnerClass.h:23
A value that points to a SDL resource.
Definition TSdlReference.h:21
TSdlReference & optional()
Definition TSdlReference.ipp:214
TSdlReference & required()
Definition TSdlReference.ipp:228
TSdlReference & description(std::string descriptionStr)
Definition TSdlReference.ipp:206
A group of cooked data that represent the visible part of the scene at a specific time....
Definition TransientVisualElement.h:19
The root for all renderer implementations.
Definition EEngineProject.h:6