CalcDistanceToLineSegment2D
0x00278ff0 · 105 bytes · __cdecl
_Z27CalcDistanceToLineSegment2DRK8Vector2DS1_S1_Pf
Decompiled
undefined (4 params)
/* CalcDistanceToLineSegment2D(Vector2D const&, Vector2D const&, Vector2D const&, float*) */
longdouble
CalcDistanceToLineSegment2D(Vector2D *param_1,Vector2D *param_2,Vector2D *param_3,float *param_4)
{
float local_14;
float local_10;
CalcClosestPointOnLineSegment2D(param_1,param_2,param_3,(Vector2D *)&local_14,param_4);
return (longdouble)
SQRT((*(float *)param_1 - local_14) * (*(float *)param_1 - local_14) +
(*(float *)(param_1 + 4) - local_10) * (*(float *)(param_1 + 4) - local_10));
}
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.