Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
Actor.h
Go to the documentation of this file.
1#pragma once
2
5#include "SDL/sdl_interface.h"
6
7#include <Common/logging.h>
8
9#include <string>
10
11namespace ph { class PreCookReport; }
12namespace ph { class CookingContext; }
13namespace ph { class CookOrder; }
14
15namespace ph
16{
17
18// General group for actor cooking process
20
21class Actor : public TSdlResourceBase<ESdlTypeCategory::Ref_Actor>
22{
23public:
28 virtual PreCookReport preCook(const CookingContext& ctx) const;
29
30 virtual TransientVisualElement cook(const CookingContext& ctx, const PreCookReport& report) const = 0;
31
37 virtual void postCook(const CookingContext& ctx, TransientVisualElement& element) const;
38
39 virtual CookOrder getCookOrder() const;
40
44
45 // TODO: may need a new method for cache generation (request this stage from precook?)
46
47public:
49 {
50 ClassType clazz(std::string(sdl::category_to_string(CATEGORY)));
51 clazz.docName("Actor");
52 clazz.description(
53 "Represents an entity in the scene. "
54 "Every entity that participates in a scene is an actor.");
55 return clazz;
56 }
57};
58
59}// end namespace ph
Definition Actor.h:22
PH_DEFINE_SDL_CLASS(TSdlOwnerClass< Actor >)
Definition Actor.h:48
virtual void postCook(const CookingContext &ctx, TransientVisualElement &element) const
Cooking additional data after cook(). This method provides an opportunity for user to decorate the co...
Definition Actor.cpp:17
virtual TransientVisualElement cook(const CookingContext &ctx, const PreCookReport &report) const =0
virtual PreCookReport preCook(const CookingContext &ctx) const
Cooking supplemental data before cook(). This method allows user to specify additional configurations...
Definition Actor.cpp:12
TransientVisualElement stagelessCook(const CookingContext &ctx) const
Helper to execute the full cooking procedure in one go.
Definition Actor.cpp:25
virtual CookOrder getCookOrder() const
Definition Actor.cpp:20
Controls the order actors are cooked.
Definition CookOrder.h:31
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 convenient ISdlResource with core requirements implemented. This class is similar to SdlResourceBas...
Definition TSdlResourceBase.h:16
static constexpr ESdlTypeCategory CATEGORY
Definition TSdlResourceBase.h:22
A group of cooked data that represent the visible part of the scene at a specific time....
Definition TransientVisualElement.h:19
std::string_view category_to_string(const ESdlTypeCategory category)
Definition ESdlTypeCategory.h:59
The root for all renderer implementations.
Definition EEngineProject.h:6
PH_DECLARE_LOG_GROUP(ActorCooking)