载入中...
搜索中...
未找到
HairCards.h
浏览该文件的文档.
1#pragma once
2#include "common/Export.h"
3
4
5#include <cstdint>
6#include <vector>
7
8namespace eve::graphics {
9
10class Graphics;
11class Material;
12class Mesh;
13class Renderable3D;
14class Shader;
15class Texture;
16
24namespace hair {
25
28 std::vector<float> positions;
29 std::vector<float> normals;
30 std::vector<float> uvs;
31 std::vector<uint32_t> indices;
32};
33
35struct CardRoot {
36 float x = 0.f, y = 0.f, z = 0.f;
37 float dirX = 0.f, dirY = 1.f, dirZ = 0.f;
38 float width = 0.08f;
39 float length = 0.35f;
40};
41
47EVENGINE_API_BACKENDS CardMeshData buildCard(float width = 0.12f, float height = 0.45f);
48
55EVENGINE_API_BACKENDS CardMeshData buildCardsAlongPolyline(const float *pointsXYZ, int pointCount, float width = 0.08f);
56
61
63void appendCardMesh(CardMeshData &dst, const CardMeshData &src);
64
72Mesh *uploadCardMesh(Graphics *gfx, const CardMeshData &data);
73
80Mesh *newCardMesh(Graphics *gfx, float width = 0.12f, float height = 0.45f);
81
87
96Material *makeCardMaterial(Graphics *gfx, Texture *albedo = nullptr, Shader *hairShader = nullptr);
97
102EVENGINE_API_BACKENDS void configureCardLod(Renderable3D *renderable, Mesh *nearCards, Mesh *farProxy,
103 float switchDistance);
104
105} // namespace hair
106
107} // namespace eve::graphics
graphics::Texture * albedo
#define EVENGINE_API_BACKENDS
Definition Export.h:108
std::uint32_t height
std::uint32_t width
bool hair
Packages shading method + surface parameters into one attachable asset.
Definition Material.h:35
GPU mesh handle (+ optional CPU morph targets).
Definition Mesh.h:25
EVENGINE_API_BACKENDS public API.
Custom GPU program.
Definition Shader.h:39
GPU texture created via Graphics::newTexture. Owns GPU resources through an opaque backend handle.
Definition Texture.h:18
CardMeshData buildCardsAlongPolyline(const float *pointsXYZ, int pointCount, float width)
Build one card per polyline segment, facing a camera-facing side approximated by world up.
Definition HairCards.cpp:75
CardMeshData buildCard(float width, float height)
Build a single upright card in local space (origin at root, height along +Y, face +Z).
Definition HairCards.cpp:66
CardMeshData buildCardsFromRoots(const CardRoot *roots, int rootCount)
Expand root samples into independent cards.
Mesh * newCardMesh(Graphics *gfx, float width, float height)
Convenience: single card mesh.
void applyCardDefaults(Material &mat)
Apply transparent hair-card surface defaults (double-sided, no depth write/shadows)....
Material * makeCardMaterial(Graphics *gfx, Texture *albedo, Shader *hairShader)
Create a Material configured for hair cards and optionally bind the hair shader + albedo.
Mesh * uploadCardMesh(Graphics *gfx, const CardMeshData &data)
Upload card arrays as a Graphics-owned Mesh.
void configureCardLod(Renderable3D *renderable, Mesh *nearCards, Mesh *farProxy, float switchDistance)
Wire near/far geometric LOD on a renderable (index 0 = cards, index 1 = proxy).
void appendCardMesh(CardMeshData &dst, const CardMeshData &src)
Append src into dst (vertex/index rebase).
卡牌游戏 UI 工具模块:工厂 + 脚本绑定入口。 功能参考 ycarowr/UiCard:扇形手牌布局、抽牌/洗牌、悬浮放大、拖拽到落牌区、 敌方手牌(背面/偷看)、费用不足置灰,以及可实时调节的布局...
Definition Animation.h:25
CPU-side interleaved mesh arrays for upload via Graphics::newMeshFromArrays.
Definition HairCards.h:27
std::vector< uint32_t > indices
Definition HairCards.h:31
std::vector< float > normals
xyz per vertex
Definition HairCards.h:29
std::vector< float > positions
xyz per vertex
Definition HairCards.h:28
std::vector< float > uvs
uv per vertex
Definition HairCards.h:30
One root sample expanded into a card.
Definition HairCards.h:35