CSheetSimulator::SatisfyCollisionConstraints
0x004b0760 · 285 bytes · __thiscall
_ZN15CSheetSimulator27SatisfyCollisionConstraintsEv
Decompiled
undefined (1 param)
/* CSheetSimulator::SatisfyCollisionConstraints() */
void __thiscall CSheetSimulator::SatisfyCollisionConstraints(CSheetSimulator *this)
{
float *pfVar1;
float fVar2;
float fVar3;
int iVar4;
int iVar5;
int iVar6;
int iVar7;
float fVar8;
iVar6 = 0;
iVar5 = *(int *)this;
if (0 < *(int *)(this + 4) * iVar5) {
iVar7 = 0;
do {
iVar4 = *(int *)(this + 8) + iVar6;
if (-1 < *(int *)(iVar4 + 0x2c)) {
fVar2 = *(float *)(iVar4 + 0x30);
fVar3 = *(float *)(this + 0x68);
fVar8 = *(float *)(this + 0x60);
pfVar1 = (float *)(*(int *)(this + 0x90) + *(int *)(iVar4 + 0x2c) * 0x14);
*(float *)(iVar4 + 8) =
(*(float *)(iVar4 + 8) - *(float *)(this + 100)) * fVar2 + *(float *)(this + 100);
*(float *)(iVar4 + 0xc) = (*(float *)(iVar4 + 0xc) - fVar3) * fVar2 + fVar3;
*(float *)(iVar4 + 4) = (*(float *)(iVar4 + 4) - fVar8) * fVar2 + fVar8;
fVar2 = pfVar1[1];
fVar3 = pfVar1[2];
iVar5 = *(int *)(this + 8) + iVar6;
fVar8 = fVar2 * *(float *)(iVar5 + 0x14) + *pfVar1 * *(float *)(iVar5 + 0x10) +
fVar3 * *(float *)(iVar5 + 0x18);
if (fVar8 < 0.0) {
*(float *)(iVar5 + 0x10) = *(float *)(iVar5 + 0x10) - *pfVar1 * fVar8;
*(float *)(iVar5 + 0x14) = *(float *)(iVar5 + 0x14) - fVar2 * fVar8;
*(float *)(iVar5 + 0x18) = *(float *)(iVar5 + 0x18) - fVar8 * fVar3;
}
iVar5 = *(int *)this;
}
iVar7 = iVar7 + 1;
iVar6 = iVar6 + 0x34;
} while (iVar7 < *(int *)(this + 4) * iVar5);
}
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.