CCollisionProperty::CalcSqrDistanceFromPoint
0x0042a710 · 274 bytes · __thiscall
_ZNK18CCollisionProperty24CalcSqrDistanceFromPointERK6Vector
Decompiled
undefined (2 params)
/* CCollisionProperty::CalcSqrDistanceFromPoint(Vector const&) const */
longdouble __thiscall
CCollisionProperty::CalcSqrDistanceFromPoint(CCollisionProperty *this,Vector *param_1)
{
float *pfVar1;
matrix3x4_t *pmVar2;
float local_34;
float local_30;
float local_2c;
float local_28;
float local_24;
float local_20;
if (((((byte)this[0x20] & 0x40) == 0) && (((byte)this[0x22] & 0xfd) != 0)) &&
((pfVar1 = (float *)(**(code **)(*(int *)this + 0x24))(this), vec3_angle != *pfVar1 ||
((DAT_01053d40 != pfVar1[1] || (DAT_01053d44 != pfVar1[2])))))) {
pmVar2 = (matrix3x4_t *)(**(code **)(*(int *)this + 0x28))(this);
VectorITransform((float *)param_1,pmVar2,&local_34);
}
else {
pfVar1 = (float *)(**(code **)(*(int *)this + 0x20))(this);
local_34 = *(float *)param_1 - *pfVar1;
local_30 = *(float *)(param_1 + 4) - pfVar1[1];
local_2c = *(float *)(param_1 + 8) - pfVar1[2];
}
CalcClosestPointOnAABB
((Vector *)(this + 8),(Vector *)(this + 0x14),(Vector *)&local_34,(Vector *)&local_28);
return (longdouble)
((local_34 - local_28) * (local_34 - local_28) +
(local_30 - local_24) * (local_30 - local_24) +
(local_2c - local_20) * (local_2c - local_20));
}
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.