Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
CookOrder.h
Go to the documentation of this file.
1#pragma once
2
3#include <Common/primitive_type.h>
4
5#include <cstddef>
6#include <limits>
7
8namespace ph
9{
10
11using CookPriority = uint8;
12using CookLevel = uint8;
13
15{
16 High = 1,
17 Normal = std::numeric_limits<CookPriority>::max() / 2,
18 Low
19};
20
22{
23 First = 0,
24 Normal = std::numeric_limits<CookLevel>::max() / 2,
25 Last
26};
27
46
47// In-header Implementations:
48
52
53inline CookOrder::CookOrder(const ECookPriority priority) :
54 CookOrder(priority, ECookLevel::Normal)
55{}
56
57inline CookOrder::CookOrder(const ECookPriority priority, const ECookLevel level) :
58 CookOrder(static_cast<CookPriority>(priority), static_cast<CookLevel>(level))
59{}
60
61inline CookOrder::CookOrder(const CookPriority priority, const CookLevel level) :
62 priority(priority), level(level)
63{}
64
65inline bool CookOrder::operator < (const CookOrder& rhs) const
66{
67 // Smaller level takes precedence over priority
68 return this->level != rhs.level ?
69 this->level < rhs.level :
70 this->priority < rhs.priority;
71}
72
73}// end namespace ph
Controls the order actors are cooked.
Definition CookOrder.h:31
bool operator<(const CookOrder &rhs) const
Definition CookOrder.h:65
CookLevel level
Definition CookOrder.h:34
CookOrder()
Cooks normally.
Definition CookOrder.h:49
CookPriority priority
Definition CookOrder.h:33
The root for all renderer implementations.
Definition EEngineProject.h:6
ECookPriority
Definition CookOrder.h:15
uint8 CookPriority
Definition CookOrder.h:11
ECookLevel
Definition CookOrder.h:22
uint8 CookLevel
Definition CookOrder.h:12