slot 0.0.1
A real time UI render framework
载入中...
搜索中...
未找到
GameObject.h
浏览该文件的文档.
1//
2// Created by zhou_zhengming on 2026/5/17.
3//
4
5#pragma once
6
7#include "Object/Object.h"
9
10#include <string>
11
12namespace z8
13{
14class BaseMaterial;
15class BaseMesh;
16class BaseCollider;
17
25 DirectX::XMFLOAT4X4 World;
26 DirectX::XMFLOAT4X4 WorldInvTranspose;
27
29 void Update(const DirectX::XMFLOAT4X4& world);
30};
31static_assert(sizeof(ObjectTransformConst) == 128,
32 "ObjectTransformConst must match the first two b0 matrices.");
33
44
54class GameObject : public Object{
55public:
57 std::string Name;
60
61 GameObject();
62 ~GameObject() override;
63
64 virtual void* ConstBuf() = 0;
65 virtual unsigned ConstBufSize() = 0;
66
67};
68
73template <typename T>
75protected:
77public:
78 void* ConstBuf() override { return &Const; }
79 unsigned ConstBufSize() override { return sizeof(T); }
80};
81}
82
83
84
85
86
87
有形状的渲染物体,一般包括:
Definition GameObject.h:54
std::string Name
Definition GameObject.h:57
BaseCollider * Collider
Definition GameObject.h:59
~GameObject() override
virtual void * ConstBuf()=0
RenderableComponent Renderable
Definition GameObject.h:58
virtual unsigned ConstBufSize()=0
GameObject()
Definition GameObject.cpp:12
包含常量缓冲区的物体
Definition GameObject.h:74
T Const
Definition GameObject.h:76
unsigned ConstBufSize() override
Definition GameObject.h:79
void * ConstBuf() override
Definition GameObject.h:78
Definition Object.h:14
资源的强类型引用,同时覆盖持久化 ID 与运行时索引两种边界。
Definition ResourceRef.h:36
世界矩阵 描述坐标系,左手坐标系 使用 DirectX12 坐标系的描述
Definition Application.h:15
Definition BaseCollider.h:12
普通和 UI 顶点着色器共享的对象变换 ABI。
Definition GameObject.h:24
DirectX::XMFLOAT4X4 WorldInvTranspose
Definition GameObject.h:26
DirectX::XMFLOAT4X4 World
Definition GameObject.h:25
void Update(const DirectX::XMFLOAT4X4 &world)
Definition GameObject.cpp:21
场景对象可渲染部分的持久化资源绑定。
Definition GameObject.h:40
ResourceRef< BaseMaterial > Material
Definition GameObject.h:42
ResourceRef< BaseMesh > Mesh
Definition GameObject.h:41