CCollisionProperty::CalcNearestPoint
0x0042a460 · 377 bytes · __thiscall
_ZNK18CCollisionProperty16CalcNearestPointERK6VectorPS0_
Decompiled
undefined (3 params)
/* CCollisionProperty::CalcNearestPoint(Vector const&, Vector*) const */
void __thiscall
CCollisionProperty::CalcNearestPoint(CCollisionProperty *this,Vector *param_1,Vector *param_2)
{
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);
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);
VectorTransform(&local_28,pmVar2,(float *)param_2);
return;
}
pfVar1 = (float *)(**(code **)(*(int *)this + 0x20))(this);
*(float *)param_2 = *pfVar1 + local_28;
*(float *)(param_2 + 4) = pfVar1[1] + local_24;
*(float *)(param_2 + 8) = pfVar1[2] + local_20;
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.