QuaternionAverageExponential
0x000a4610 · 391 bytes · __cdecl
_Z28QuaternionAverageExponentialR10QuaternioniPKS_PKf
Decompiled
undefined (4 params)
/* QuaternionAverageExponential(Quaternion&, int, Quaternion const*, float const*) */
void QuaternionAverageExponential
(Quaternion *param_1,int param_2,Quaternion *param_3,float *param_4)
{
int iVar1;
int iVar2;
Quaternion *pQVar3;
float fVar4;
float local_58;
float local_4c [4];
Quaternion local_3c [16];
Quaternion local_2c [28];
if (param_2 == 1) {
*(undefined4 *)param_1 = *(undefined4 *)param_3;
*(undefined4 *)(param_1 + 4) = *(undefined4 *)(param_3 + 4);
*(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_3 + 8);
*(undefined4 *)(param_1 + 0xc) = *(undefined4 *)(param_3 + 0xc);
return;
}
if (param_2 < 1) {
local_4c[0] = 0.0;
local_4c[1] = 0.0;
local_4c[2] = 0.0;
local_4c[3] = 0.0;
}
else {
iVar1 = 0;
local_58 = 0.0;
do {
while (param_4 != (float *)0x0) {
local_58 = local_58 + param_4[iVar1];
iVar1 = iVar1 + 1;
if (iVar1 == param_2) goto LAB_000a4670;
}
iVar1 = iVar1 + 1;
local_58 = local_58 + 1.0;
} while (iVar1 != param_2);
LAB_000a4670:
if (local_58 <= 0.0) {
local_58 = 1.0;
}
else {
local_58 = 1.0 / local_58;
}
local_4c[0] = 0.0;
iVar1 = 0;
local_4c[1] = 0.0;
local_4c[2] = 0.0;
local_4c[3] = 0.0;
pQVar3 = param_3;
do {
fVar4 = local_58;
if (param_4 != (float *)0x0) {
fVar4 = local_58 * param_4[iVar1];
}
QuaternionAlign(param_3,pQVar3,local_3c);
QuaternionLn(local_3c,local_2c);
iVar2 = 0;
do {
local_4c[iVar2] = *(float *)(local_2c + iVar2 * 4) * fVar4 + local_4c[iVar2];
iVar2 = iVar2 + 1;
} while (iVar2 != 4);
iVar1 = iVar1 + 1;
pQVar3 = pQVar3 + 0x10;
} while (iVar1 != param_2);
}
QuaternionExp((Quaternion *)local_4c,param_1);
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.