CSimplePhysics::Simulate
0x005985b0 · 581 bytes · __thiscall
_ZN14CSimplePhysics8SimulateEPNS_5CNodeEiPNS_7IHelperEff
Decompiled
undefined (6 params)
/* CSimplePhysics::Simulate(CSimplePhysics::CNode*, int, CSimplePhysics::IHelper*, float, float) */
void __thiscall
CSimplePhysics::Simulate
(CSimplePhysics *this,CNode *param_1,int param_2,IHelper *param_3,float param_4,
float param_5)
{
float fVar1;
float fVar2;
float fVar3;
float fVar4;
float fVar5;
int iVar6;
int iVar7;
CNode *pCVar8;
CNode *pCVar9;
CNode *pCVar10;
CNode *pCVar11;
int iVar12;
int iVar13;
double dVar14;
float fVar15;
double dVar16;
int local_3c;
float local_28;
float local_24;
float local_20;
dVar16 = (double)param_4 + *(double *)this;
fVar15 = *(float *)(this + 0xc);
dVar14 = (double)fVar15;
*(double *)this = dVar16;
iVar6 = (int)(dVar16 / dVar14);
iVar7 = iVar6 + 1;
if (dVar16 / dVar14 <= (double)iVar6) {
iVar7 = iVar6;
}
iVar6 = *(int *)(this + 8);
if (0 < iVar7 - iVar6) {
local_3c = 0;
do {
if (0 < param_2) {
pCVar8 = param_1 + 0xc;
pCVar10 = param_1;
iVar12 = 0;
pCVar11 = param_1 + 0xc;
do {
iVar13 = iVar12 + 1;
(*(code *)**(undefined4 **)param_3)(param_3,param_1,iVar12,&local_28);
fVar15 = *(float *)(pCVar10 + 4);
fVar1 = *(float *)(this + 0x10);
fVar2 = *(float *)(pCVar10 + 8);
fVar3 = *(float *)pCVar10;
fVar4 = *(float *)(pCVar11 + 8);
fVar5 = *(float *)pCVar11;
*(float *)(pCVar10 + 4) =
local_24 * fVar1 + fVar15 + (fVar15 - *(float *)(pCVar11 + 4)) * param_5;
*(float *)(pCVar10 + 8) = local_20 * fVar1 + fVar2 + (fVar2 - fVar4) * param_5;
*(float *)pCVar10 = fVar1 * local_28 + fVar3 + (fVar3 - fVar5) * param_5;
*(float *)pCVar8 = fVar3;
*(float *)(pCVar8 + 4) = fVar15;
*(float *)(pCVar8 + 8) = fVar2;
pCVar8 = pCVar8 + 0x24;
pCVar10 = pCVar10 + 0x24;
iVar12 = iVar13;
pCVar11 = pCVar11 + 0x24;
} while (iVar13 != param_2);
}
(**(code **)(*(int *)param_3 + 4))(param_3,param_1,param_2);
local_3c = local_3c + 1;
} while (local_3c != iVar7 - iVar6);
fVar15 = *(float *)(this + 0xc);
dVar16 = *(double *)this;
dVar14 = (double)fVar15;
}
*(int *)(this + 8) = iVar7;
fVar15 = (float)(((dVar16 + dVar14) - (double)((float)iVar7 * fVar15)) / dVar14);
if (0 < param_2) {
pCVar8 = param_1;
pCVar10 = param_1 + 0xc;
pCVar11 = param_1 + 0x18;
do {
pCVar9 = pCVar8 + 0x24;
*(float *)pCVar11 = (*(float *)pCVar8 - *(float *)pCVar10) * fVar15 + *(float *)pCVar10;
*(float *)(pCVar11 + 4) =
(*(float *)(pCVar8 + 4) - *(float *)(pCVar10 + 4)) * fVar15 + *(float *)(pCVar10 + 4);
*(float *)(pCVar11 + 8) =
(*(float *)(pCVar8 + 8) - *(float *)(pCVar10 + 8)) * fVar15 + *(float *)(pCVar10 + 8);
pCVar8 = pCVar9;
pCVar10 = pCVar10 + 0x24;
pCVar11 = pCVar11 + 0x24;
} while (pCVar9 != param_1 + param_2 * 0x24);
}
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.