CDispCollTri::CalcPlane
0x000cb030 · 368 bytes · __thiscall
_ZN12CDispCollTri9CalcPlaneER11CDispVectorI6VectorE
Decompiled
undefined (2 params)
/* CDispCollTri::CalcPlane(CDispVector<Vector>&) */
void __thiscall CDispCollTri::CalcPlane(CDispCollTri *this,CDispVector *param_1)
{
Vector *pVVar1;
float *pfVar2;
float *pfVar3;
int iVar4;
uint uVar5;
float fVar6;
float fVar7;
float fVar8;
float fVar9;
float fVar10;
float fVar11;
pVVar1 = (Vector *)(this + 8);
iVar4 = *(int *)param_1;
pfVar2 = (float *)(iVar4 + (*(ushort *)this & 0x1ff) * 0xc);
pfVar3 = (float *)(iVar4 + (*(ushort *)(this + 2) & 0x1ff) * 0xc);
fVar6 = *pfVar3 - *pfVar2;
fVar8 = pfVar3[1] - pfVar2[1];
fVar10 = pfVar3[2] - pfVar2[2];
pfVar3 = (float *)(iVar4 + (*(ushort *)(this + 4) & 0x1ff) * 0xc);
fVar9 = *pfVar3 - *pfVar2;
fVar7 = pfVar3[1] - pfVar2[1];
fVar11 = pfVar3[2] - pfVar2[2];
*(float *)(this + 8) = fVar7 * fVar10 - fVar11 * fVar8;
*(float *)(this + 0xc) = fVar11 * fVar6 - fVar10 * fVar9;
*(float *)(this + 0x10) = fVar8 * fVar9 - fVar6 * fVar7;
VectorNormalize(pVVar1);
uVar5 = 0;
pfVar2 = (float *)(*(int *)param_1 + (*(ushort *)this & 0x1ff) * 0xc);
fVar6 = pfVar2[1];
fVar7 = *pfVar2;
fVar8 = pfVar2[2];
this[6] = (CDispCollTri)((byte)this[6] & 0xc0 | 0x28);
*(float *)(this + 0x14) =
fVar6 * *(float *)(this + 0xc) + fVar7 * *(float *)(this + 8) +
fVar8 * *(float *)(this + 0x10);
do {
fVar6 = *(float *)(pVVar1 + uVar5 * 4);
if (fVar6 < 0.0) {
this[6] = (CDispCollTri)
((byte)this[6] & 0xf8 | ((byte)(1 << ((byte)uVar5 & 0x1f)) | (byte)this[6]) & 7);
fVar6 = *(float *)(pVVar1 + uVar5 * 4);
}
if (fVar6 == 1.0) {
this[6] = (CDispCollTri)((byte)this[6] & 199 | (byte)((uVar5 & 7) << 3));
}
uVar5 = uVar5 + 1;
} while (uVar5 != 3);
return;
}
SourceMod gamedata
paste intoaddons/sourcemod/gamedata/<your_plugin>.txt
used as the SourceMod key — change to fit your plugin's convention
SourceMod library name (server / engine / matchmaking)
Just a Signatures{} block, ready to drop into a gamedata
file. Wire it up in your plugin however you like - SDKCall, DHooks,
raw memory ops, or anything else.
Signatures + Functions block. The plugin uses
DHookCreateFromConf - DHooks reads return type, this-type,
calling convention, and argument types straight from the gamedata. Less
boilerplate in the plugin, types travel with the gamedata.
Gamedata KeyValues
DHooks plugin example
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.