Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
AMaskedModel.h
Go to the documentation of this file.
1#pragma once
2
3#include "Actor/Actor.h"
4#include "Actor/AModel.h"
5#include "Actor/Image/Image.h"
6#include "SDL/sdl_interface.h"
7
8#include <memory>
9#include <vector>
10
11namespace ph
12{
13
14class AMaskedModel : public Actor
15{
16public:
17 PreCookReport preCook(const CookingContext& ctx) const override;
18 TransientVisualElement cook(const CookingContext& ctx, const PreCookReport& report) const override;
19
20 void setMask(const std::shared_ptr<Image>& mask);
21
22private:
23 std::shared_ptr<AModel> m_base;
24 std::shared_ptr<Image> m_mask;
25
26public:
28 {
29 ClassType clazz("masked-model");
30 clazz.docName("Masked Model Actor");
31 clazz.description("Masks another model actor.");
32 clazz.baseOn<Actor>();
33
34 TSdlReference<AModel, OwnerType> base("base", &OwnerType::m_base);
35 base.description(
36 "The base model that the mask will apply on.");
37 base.required();
38 clazz.addField(base);
39
40 TSdlReference<Image, OwnerType> mask("mask", &OwnerType::m_mask);
41 mask.description(
42 "The mask to apply. This will remove some part of the base model acoording to the "
43 "pattern recorded on the image.");
44 mask.required();
45 clazz.addField(mask);
46
47 return clazz;
48 }
49};
50
51}// end namespace ph
Definition AMaskedModel.h:15
PH_DEFINE_SDL_CLASS(TSdlOwnerClass< AMaskedModel >)
Definition AMaskedModel.h:27
PreCookReport preCook(const CookingContext &ctx) const override
Cooking supplemental data before cook(). This method allows user to specify additional configurations...
Definition AMaskedModel.cpp:15
void setMask(const std::shared_ptr< Image > &mask)
Definition AMaskedModel.cpp:77
TransientVisualElement cook(const CookingContext &ctx, const PreCookReport &report) const override
Definition AMaskedModel.cpp:40
Definition Actor.h:22
Information about the world being cooked.
Definition CookingContext.h:24
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 & 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