-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathRenderProxy.h
More file actions
37 lines (33 loc) · 1.55 KB
/
Copy pathRenderProxy.h
File metadata and controls
37 lines (33 loc) · 1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#pragma once
#include "Core.Minimal.h"
#include "TypeTrait.h"
#include <mathematics/matrix4x4.hpp>
#include <mathematics/vector3.hpp>
#include <type_traits>
// 보유층(RenderScene)에 등록되는 모든 프록시의 공통 조각.
//
// 게임 스레드가 값 스냅샷으로 만들고 create delta에 실으면, 렌더 스레드가
// 프레임 경계에서 자기 저장소에 등록해 읽는다. 파괴도 GUID delta이며
// 프록시 자신은 RenderScene이나 회수 큐를 알지 않는다.
//
// ★ 여기 있는 것은 "무엇이든 프록시라면 갖는 것"뿐이다 — 신원과 월드 변환.
// 그리는 것에만 있는 재질·메시나 라이트에만 있는 감쇠는 파생이 든다.
// 기준은 하나다: 라이트와 메시가 함께 답할 수 있는 질문인가.
class RenderProxy
{
public:
RenderProxy() = default;
virtual ~RenderProxy() = default;
// 복사·이동은 컴파일러에게 맡긴다. 손으로 나열하던 시절 여섯 필드가
// 빠져 있었고, 그 부류는 필드를 더할 때마다 다시 생긴다.
RenderProxy(const RenderProxy&) = default;
RenderProxy(RenderProxy&&) = default;
RenderProxy& operator=(const RenderProxy&) = default;
RenderProxy& operator=(RenderProxy&&) = default;
public:
HashedGuid m_instancedID{};
math::vector3 m_worldPosition{};
math::matrix4x4 m_worldMatrix{ math::matrix4x4::identity() };
};
static_assert(std::is_same_v<decltype(RenderProxy::m_worldPosition), math::vector3>);
static_assert(std::is_same_v<decltype(RenderProxy::m_worldMatrix), math::matrix4x4>);