QuaternionAlign
0x000a37c0 · 132 bytes · __cdecl
_Z15QuaternionAlignRK10QuaternionS1_RS_
Decompiled
undefined (3 params)
/* QuaternionAlign(Quaternion const&, Quaternion const&, Quaternion&) */
void QuaternionAlign(Quaternion *param_1,Quaternion *param_2,Quaternion *param_3)
{
int iVar1;
int iVar2;
int iVar3;
float fVar4;
float fVar5;
float fVar6;
float fVar7;
fVar6 = 0.0;
iVar3 = 0;
fVar7 = 0.0;
do {
iVar1 = iVar3 * 4;
iVar2 = iVar3 * 4;
iVar3 = iVar3 + 1;
fVar5 = *(float *)(param_1 + iVar1) - *(float *)(param_2 + iVar2);
fVar4 = *(float *)(param_1 + iVar1) + *(float *)(param_2 + iVar2);
fVar7 = fVar7 + fVar5 * fVar5;
fVar6 = fVar6 + fVar4 * fVar4;
} while (iVar3 != 4);
if (fVar7 <= fVar6) {
if (param_3 != param_2) {
iVar3 = 0;
do {
*(undefined4 *)(param_3 + iVar3 * 4) = *(undefined4 *)(param_2 + iVar3 * 4);
iVar3 = iVar3 + 1;
} while (iVar3 != 4);
return;
}
}
else {
iVar3 = 0;
do {
*(uint *)(param_3 + iVar3 * 4) = *(uint *)(param_2 + iVar3 * 4) ^ 0x80000000;
iVar3 = iVar3 + 1;
} while (iVar3 != 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.