19 float px =
x * 0.1031f;
20 float py =
y * 0.1030f;
21 float pz =
x * 0.0973f;
25 float d =
px * (py + 33.33f) + py * (pz + 33.33f) + pz * (
px + 33.33f);
38 if (
p.strength < 1e-4f) {
43 const float scale =
p.cellScale < 1e-3f ? 1e-3f :
p.cellScale;
44 const float cx = std::floor(
u *
scale);
45 const float cy = std::floor(
v *
scale);
46 float rndx = 0.f, rndy = 0.f;
48 float rndBx = 0.f, rndBy = 0.f;
50 const float ox = (rndx * 2.f - 1.f) * (
p.strength /
scale);
51 const float oy = (rndy * 2.f - 1.f) * (
p.strength /
scale);
52 float rot =
p.rotAmount;
53 if (rot < 0.f) rot = 0.f;
54 if (rot > 1.f) rot = 1.f;
55 const float ang = (rndBx * 2.f - 1.f) * 3.14159265f * rot *
p.strength;
56 const float s = std::sin(ang);
57 const float c = std::cos(ang);
58 const float cellCenterU = (
cx + 0.5f) /
scale;
59 const float cellCenterV = (
cy + 0.5f) /
scale;
60 const float lu =
u - cellCenterU;
61 const float lv =
v - cellCenterV;
62 ou = cellCenterU + (
c * lu -
s * lv) + ox;
63 ov = cellCenterV + (
s * lu +
c * lv) + oy;
卡牌游戏 UI 工具模块:工厂 + 脚本绑定入口。 功能参考 ycarowr/UiCard:扇形手牌布局、抽牌/洗牌、悬浮放大、拖拽到落牌区、 敌方手牌(背面/偷看)、费用不足置灰,以及可实时调节的布局...
void texBombHash22(float x, float y, float &ox, float &oy)
void texCellBombSampleUV(float u, float v, const TexCellBombParams &p, float &ou, float &ov)
Map UV → bombed sample UV for the dominant (floor) cell; strength≤0 → identity.
CPU reference for texture cell-bombing math (matches tex_cell_bomb.glsl). Used by unit tests; the GPU...