载入中...
搜索中...
未找到
EvpackStaticPrefab.h
浏览该文件的文档.
1#pragma once
2#include "common/Export.h"
3
4
5#include <array>
6#include <cstdint>
7#include <memory>
8#include <vector>
10#include "common/ResourceRef.h"
11
12namespace eve::asset {
13class EvpackResourceReader;
14struct EvpackCapabilities;
15} // namespace eve::asset
16namespace eve::graphics {
17class Graphics;
18class IMeshResourceFactory;
19class IImageResourceFactory;
20class Mesh;
21class Material;
22} // namespace eve::graphics
23
24namespace eve::asset_graphics {
25class EvpackStaticPrefab;
32public:
41
42private:
43 friend class EvpackStaticPrefab;
44 explicit StaticPrefabResourcePin(std::shared_ptr<EvpackStaticPrefab> owner);
45 std::shared_ptr<EvpackStaticPrefab> owner_;
46};
49 std::array<float, 16> localTransform{};
50 graphics::Mesh* mesh = nullptr;
52 bool castShadows = true, receiveShadows = true;
53};
59public:
67 [[nodiscard]] const std::vector<StaticPrefabScenePart>& parts() const noexcept;
71 [[nodiscard]] Result<void> release();
72
73private:
74 friend class EvpackStaticPrefab;
75 struct Impl;
76 explicit PreparedStaticPrefabScene(std::unique_ptr<Impl> impl);
77 std::unique_ptr<Impl> impl_;
78};
81 std::array<float, 16> localTransform{};
82 std::uint32_t meshId = 0xffffffffu, materialId = 0xffffffffu, flags = 0x7u, lodGroupId = 0xffffffffu;
83};
92public:
103 [[nodiscard]] static Result<std::unique_ptr<EvpackStaticPrefab>> load(
105 graphics::IImageResourceFactory& images, const AssetRef& asset, const asset::EvpackCapabilities& capabilities);
107 [[nodiscard]] std::size_t drawCount() const noexcept;
115 [[nodiscard]] Result<std::array<float, 6>> localBounds(PrefabRootPose rootPose = PrefabRootPose::Authored) const;
119 [[nodiscard]] AssetRef sourceAsset() const;
123 [[nodiscard]] PersistentId sourceBuildId() const noexcept;
130 [[nodiscard]] static Result<std::unique_ptr<StaticPrefabResourcePin>> pinResources(
131 const std::shared_ptr<EvpackStaticPrefab>& owner);
140 [[nodiscard]] static Result<std::unique_ptr<PreparedStaticPrefabScene>> prepareScene(
141 const std::shared_ptr<EvpackStaticPrefab>& owner, graphics::Graphics& graphics,
142 PrefabRootPose rootPose = PrefabRootPose::Authored);
148 [[nodiscard]] Result<std::vector<StaticPrefabGpuPart>> prepareGpuDriven(graphics::Graphics& graphics);
158 [[nodiscard]] Result<void> draw(graphics::Graphics& graphics, const std::array<float, 16>& transform,
159 const std::array<float, 16>& cameraView) const;
168 [[nodiscard]] Result<void> drawShadow(graphics::Graphics& graphics,
169 const std::array<float, 16>& transform,
170 const std::array<float, 16>& lightViewProjection) const;
174 [[nodiscard]] Result<void> release();
175
176private:
179 struct Impl;
180 explicit EvpackStaticPrefab(std::unique_ptr<Impl> impl);
181 std::unique_ptr<Impl> impl_;
182};
183} // namespace eve::asset_graphics
std::vector< eve::artifact::PartView > parts
void * impl
#define EVENGINE_API_WORLD
Definition Export.h:109
MeshVfxBatchedDraw draw
std::shared_ptr< OceanGpuSpectrum > owner
Strong asset, definition, object and generic resource references.
Graphics * graphics
uint32_t flags
Stable asset identity backed by PersistentId.
Definition ResourceRef.h:53
Move-only operation result carrying either a value or Status.
Definition Result.h:176
Immutable reader retaining an admitted pack by shared ownership.
Owning static-prefab GPU leases and immutable draw transforms; no ECS or Scene mutation....
EvpackStaticPrefab & operator=(const EvpackStaticPrefab &)=delete
EvpackStaticPrefab(const EvpackStaticPrefab &)=delete
Owning preparation lease pinning prefab GPU resources and complete scene materials....
PreparedStaticPrefabScene(const PreparedStaticPrefabScene &)=delete
PreparedStaticPrefabScene & operator=(PreparedStaticPrefabScene &&)=delete
PreparedStaticPrefabScene(PreparedStaticPrefabScene &&)=delete
PreparedStaticPrefabScene & operator=(const PreparedStaticPrefabScene &)=delete
Owning resource pin for an admitted immutable prefab version; does not allocate scene materials....
StaticPrefabResourcePin & operator=(StaticPrefabResourcePin &&)=delete
StaticPrefabResourcePin & operator=(const StaticPrefabResourcePin &)=delete
StaticPrefabResourcePin(StaticPrefabResourcePin &&)=delete
StaticPrefabResourcePin(const StaticPrefabResourcePin &)=delete
Id128 public API.
Definition Identity.h:111
Backend-owned RGBA8 texture upload and release operations.
Backend-owned mesh upload and release operations.
Packages shading method + surface parameters into one attachable asset.
Definition Material.h:38
GPU mesh handle (+ optional CPU morph targets).
Definition Mesh.h:26
卡牌游戏 UI 工具模块:工厂 + 脚本绑定入口。 功能参考 ycarowr/UiCard:扇形手牌布局、抽牌/洗牌、悬浮放大、拖拽到落牌区、 敌方手牌(背面/偷看)、费用不足置灰,以及可实时调节的布局...
Definition Animation.h:25
PrefabRootPose
Immutable prefab placement convention shared by geometry bounds and renderer preparation....
Actual runtime device capabilities used for variant selection.
Definition Evpack.h:92
One prefab renderer registered in backend GPU-driven tables.
Renderer inputs borrowed from PreparedStaticPrefabScene until its release/destruction.