载入中...
搜索中...
未找到
GeometryCollectionRenderer.h
浏览该文件的文档.
1#pragma once
2#include "common/Export.h"
3
4#include "common/Result.h"
5
6#include <cstdint>
7
8namespace eve::graphics {
9class Graphics;
10class Mesh;
11} // namespace eve::graphics
12
13namespace eve::physics {
14
15class GeometryCollectionInstance;
16
30public:
37 explicit GeometryCollectionRenderer(GeometryCollectionInstance* instance) noexcept;
38
43
49 void setInstance(GeometryCollectionInstance* instance);
55 [[nodiscard]] GeometryCollectionInstance* getInstance() const noexcept { return instance_; }
56
58 void setExteriorColor(float r, float g, float b, float a);
60 void setInteriorColor(float r, float g, float b, float a);
62 void setSleepColor(float r, float g, float b, float a);
63
71 [[nodiscard("check geometry-collection draw")]] eve::Result<void> draw(graphics::Graphics* graphics);
72
74 [[nodiscard]] int lastActiveDrawCount() const noexcept { return lastActiveDrawCount_; }
76 [[nodiscard]] int lastSleepBatchCount() const noexcept { return lastSleepBatchCount_; }
77
78private:
79 void ensureUnitBox(graphics::Graphics& graphics);
80 void releaseOwnedMeshes(graphics::Graphics* graphics);
81 void invalidateSleepBatch(graphics::Graphics* graphics = nullptr);
82 [[nodiscard]] eve::Result<void> rebuildSleepBatch(graphics::Graphics& graphics);
83
84 GeometryCollectionInstance* instance_ = nullptr;
86 graphics::Graphics* meshOwner_ = nullptr;
87 graphics::Mesh* unitBox_ = nullptr;
88 graphics::Mesh* sleepBatch_ = nullptr;
89 std::uint64_t sleepBatchRevision_ = 0;
90 int sleepBatchBoneCount_ = 0;
91 int lastActiveDrawCount_ = 0;
92 int lastSleepBatchCount_ = 0;
93 float exteriorR_ = 0.62f, exteriorG_ = 0.58f, exteriorB_ = 0.52f, exteriorA_ = 1.f;
94 float interiorR_ = 0.78f, interiorG_ = 0.42f, interiorB_ = 0.28f, interiorA_ = 1.f;
95 float sleepR_ = 0.45f, sleepG_ = 0.45f, sleepB_ = 0.48f, sleepA_ = 1.f;
96};
97
98} // namespace eve::physics
#define EVENGINE_API_DOMAINS
Definition Export.h:110
tensor::Graph g
Definition GpuGraph.cpp:7
double r
MeleePoint3 b
Definition MeleeHit.cpp:41
MeleePoint3 a
Definition MeleeHit.cpp:40
MeshVfxBatchedDraw draw
Move-only, checked operation results for the common layer.
Move-only operation result carrying either a value or Status.
Definition Result.h:155
GPU mesh handle (+ optional CPU morph targets).
Definition Mesh.h:25
Runtime owner of bone state, connection strain, and PhysicsLink bindings.
Presentation bridge for a borrowed geometry-collection instance.
int lastSleepBatchCount() const noexcept
Number of bones included in the sleeping batch on the last draw.
GeometryCollectionInstance * getInstance() const noexcept
Return the currently borrowed instance. @ownership Borrowed; caller must not delete through this poin...
GeometryCollectionRenderer & operator=(const GeometryCollectionRenderer &)=delete
GeometryCollectionRenderer(const GeometryCollectionRenderer &)=delete
int lastActiveDrawCount() const noexcept
Number of bones drawn individually on the last successful draw.
卡牌游戏 UI 工具模块:工厂 + 脚本绑定入口。 功能参考 ycarowr/UiCard:扇形手牌布局、抽牌/洗牌、悬浮放大、拖拽到落牌区、 敌方手牌(背面/偷看)、费用不足置灰,以及可实时调节的布局...
Definition Animation.h:25
Optional physics backend for vehicle mobility and body attach.
Definition Climbing.h:36