CSheetSimulator::ClampPointsToCollisionPlanes
0x004b0ab0 · 251 bytes · __thiscall
_ZN15CSheetSimulator28ClampPointsToCollisionPlanesEv
Decompiled
undefined (1 param)
/* CSheetSimulator::ClampPointsToCollisionPlanes() */
void __thiscall CSheetSimulator::ClampPointsToCollisionPlanes(CSheetSimulator *this)
{
float *pfVar1;
int iVar2;
int iVar3;
int iVar4;
float fVar5;
int local_20;
DetermineBestCollisionPlane(this,false);
local_20 = *(int *)this;
iVar3 = 0;
iVar4 = 0;
if (0 < *(int *)(this + 4) * local_20) {
do {
iVar2 = *(int *)(this + 8) + iVar3;
if (-1 < *(int *)(iVar2 + 0x2c)) {
pfVar1 = (float *)(*(int *)(this + 0x90) + *(int *)(iVar2 + 0x2c) * 0x14);
fVar5 = ABS((*pfVar1 * *(float *)(iVar2 + 4) - pfVar1[3]) +
pfVar1[1] * *(float *)(iVar2 + 8) + pfVar1[2] * *(float *)(iVar2 + 0xc));
if (fVar5 < 6.0) {
fVar5 = -fVar5;
*(float *)(iVar2 + 4) = *pfVar1 * fVar5 + *(float *)(iVar2 + 4);
*(float *)(iVar2 + 8) = pfVar1[1] * fVar5 + *(float *)(iVar2 + 8);
*(float *)(iVar2 + 0xc) = fVar5 * pfVar1[2] + *(float *)(iVar2 + 0xc);
local_20 = *(int *)this;
}
}
iVar4 = iVar4 + 1;
iVar3 = iVar3 + 0x34;
} while (iVar4 < local_20 * *(int *)(this + 4));
}
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.