QuaternionExp
0x00275520 · 365 bytes · __cdecl
_Z13QuaternionExpRK10QuaternionRS_
Decompiled
undefined (2 params)
/* QuaternionExp(Quaternion const&, Quaternion&) */
void QuaternionExp(Quaternion *param_1,Quaternion *param_2)
{
longdouble lVar1;
float fVar2;
float fVar3;
float fVar4;
float fVar5;
float fVar6;
double dVar7;
double local_14;
fVar4 = *(float *)param_1;
fVar5 = *(float *)(param_1 + 4);
fVar6 = *(float *)(param_1 + 8);
fVar2 = SQRT(fVar5 * fVar5 + fVar4 * fVar4 + fVar6 * fVar6);
lVar1 = (longdouble)__expf_finite(*(undefined4 *)(param_1 + 0xc));
if (fVar2 < 1e-05) {
fVar4 = 0.0;
local_14 = (double)(float)lVar1;
fVar5 = fVar4;
fVar6 = fVar4;
}
else {
local_14 = (double)(float)lVar1;
dVar7 = sin((double)fVar2);
fVar3 = (float)((dVar7 * local_14) / (double)fVar2);
fVar4 = fVar4 * fVar3;
fVar5 = fVar5 * fVar3;
fVar6 = fVar6 * fVar3;
}
dVar7 = cos((double)fVar2);
*(float *)param_2 = fVar4;
*(float *)(param_2 + 4) = fVar5;
*(float *)(param_2 + 8) = fVar6;
*(float *)(param_2 + 0xc) = (float)(dVar7 * local_14);
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.