20 float px =
x * 0.1031f;
21 float py =
y * 0.1030f;
22 float pz =
x * 0.0973f;
26 float d =
px * (
py + 33.33f) +
py * (
pz + 33.33f) +
pz * (
px + 33.33f);
39 if (
p.strength < 1e-4f) {
44 const float scale =
p.cellScale < 1e-3f ? 1e-3f :
p.cellScale;
45 const float cx = std::floor(
u *
scale);
46 const float cy = std::floor(
v *
scale);
47 float rndx = 0.f, rndy = 0.f;
50 float rndBx = 0.f, rndBy = 0.f;
53 const float ox = (rndx * 2.f - 1.f) * (
p.strength /
scale);
54 const float oy = (rndy * 2.f - 1.f) * (
p.strength /
scale);
55 float rot =
p.rotAmount;
56 if (rot < 0.f) rot = 0.f;
57 if (rot > 1.f) rot = 1.f;
58 const float ang = (rndBx * 2.f - 1.f) * 3.14159265f * rot *
p.strength;
59 const float s = std::sin(
ang);
60 const float c = std::cos(
ang);
61 const float cellCenterU = (
cx + 0.5f) /
scale;
62 const float cellCenterV = (
cy + 0.5f) /
scale;
63 const float lu =
u - cellCenterU;
64 const float lv =
v - cellCenterV;
65 ou = cellCenterU + (
c * lu -
s * lv) +
ox;
66 ov = cellCenterV + (
s * lu +
c * lv) +
oy;
std::array< float, 3 > scale
卡牌游戏 UI 工具模块:工厂 + 脚本绑定入口。 功能参考 ycarowr/UiCard:扇形手牌布局、抽牌/洗牌、悬浮放大、拖拽到落牌区、 敌方手牌(背面/偷看)、费用不足置灰,以及可实时调节的布局...
void texBombHash22(float x, float y, float &ox, float &oy)
Tex bomb hash 22.
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...