QuaternionAngleDiff
0x00275430 · 228 bytes · __cdecl
_Z19QuaternionAngleDiffRK10QuaternionS1_
Decompiled
undefined (2 params)
/* QuaternionAngleDiff(Quaternion const&, Quaternion const&) */
longdouble QuaternionAngleDiff(Quaternion *param_1,Quaternion *param_2)
{
longdouble lVar1;
float fVar2;
uint local_2c;
uint local_28;
uint local_24;
undefined4 local_20;
float local_1c;
float local_18;
float local_14;
local_2c = *(uint *)param_2 ^ 0x80000000;
local_28 = *(uint *)(param_2 + 4) ^ 0x80000000;
local_24 = *(uint *)(param_2 + 8) ^ 0x80000000;
local_20 = *(undefined4 *)(param_2 + 0xc);
QuaternionMult(param_1,(Quaternion *)&local_2c,(Quaternion *)&local_1c);
fVar2 = local_18 * local_18 + local_1c * local_1c + local_14 * local_14;
if (1.0 < fVar2) {
return (longdouble)180.0;
}
lVar1 = (longdouble)__asin_finite((double)SQRT(fVar2));
return (longdouble)((float)((double)lVar1 + (double)lVar1) * 57.295776);
}
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.