IVision::IsInFieldOfView
0x0075b460 · 249 bytes · __thiscall
_ZNK7IVision15IsInFieldOfViewERK6Vector
Decompiled
undefined (2 params)
/* IVision::IsInFieldOfView(Vector const&) const */
bool __thiscall IVision::IsInFieldOfView(IVision *this,Vector *param_1)
{
float fVar1;
int *piVar2;
bool bVar3;
float *pfVar4;
float *pfVar5;
float fVar6;
float fVar7;
float fVar8;
float fVar9;
piVar2 = *(int **)(this + 0x14);
if (piVar2 == (int *)0x0) {
return true;
}
fVar1 = *(float *)(this + 0x28);
pfVar4 = (float *)(**(code **)(*piVar2 + 0xbc))(piVar2);
pfVar5 = (float *)(**(code **)(**(int **)(this + 0x14) + 0xb8))(*(int **)(this + 0x14));
fVar8 = *(float *)param_1 - *pfVar5;
fVar9 = *(float *)(param_1 + 4) - pfVar5[1];
fVar7 = *(float *)(param_1 + 8) - pfVar5[2];
fVar6 = pfVar4[1] * fVar9 + *pfVar4 * fVar8 + pfVar4[2] * fVar7;
if (fVar1 <= 0.0) {
if (0.0 < fVar6) {
return true;
}
bVar3 = fVar6 * fVar6 <= fVar1 * fVar1 * (fVar9 * fVar9 + fVar8 * fVar8 + fVar7 * fVar7);
}
else {
bVar3 = false;
if (0.0 <= fVar6) {
bVar3 = fVar1 * fVar1 * (fVar9 * fVar9 + fVar8 * fVar8 + fVar7 * fVar7) <= fVar6 * fVar6;
}
}
return bVar3;
}
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.