L L4D2node

COcclusionSystem::SetView

0x001cb320 · 487 bytes · __thiscall

_ZN16COcclusionSystem7SetViewERK6VectorfRK7VMatrixS5_RK6VPlane

Decompiled

undefined (6 params)

/* COcclusionSystem::SetView(Vector const&, float, VMatrix const&, VMatrix const&, VPlane const&) */

void __thiscall
COcclusionSystem::SetView
          (COcclusionSystem *this,Vector *param_1,float param_2,VMatrix *param_3,VMatrix *param_4,
          VPlane *param_5)

{
  float fVar1;
  float fVar2;
  float fVar3;
  int iVar4;
  undefined4 uVar5;
  float fVar6;
  double dVar7;
  
  *(undefined4 *)(this + 0x98) = *(undefined4 *)param_1;
  *(undefined4 *)(this + 0x9c) = *(undefined4 *)(param_1 + 4);
  *(undefined4 *)(this + 0xa0) = *(undefined4 *)(param_1 + 8);
  VMatrix::operator=((VMatrix *)(this + 0x48),param_3);
  *(float *)(this + 0x88) = -*(float *)(param_4 + 0x2c) / *(float *)param_4;
  *(float *)(this + 0x8c) = -*(float *)(param_4 + 0x2c) / *(float *)(param_4 + 0x14);
  *(uint *)(this + 0x90) = *(uint *)(param_4 + 0x2c) ^ 0x80000000;
  *(uint *)(this + 0x94) = *(uint *)(param_4 + 0x28) ^ 0x80000000;
  MatrixMultiply(param_4,param_3,(VMatrix *)(this + 8));
  fVar6 = *(float *)param_5;
  *(float *)(this + 0xa4) = fVar6;
  fVar1 = *(float *)(param_5 + 4);
  *(float *)(this + 0xa8) = fVar1;
  fVar2 = *(float *)(param_5 + 8);
  *(float *)(this + 0xac) = fVar2;
  fVar3 = *(float *)(param_5 + 0xc);
  this[0xb4] = (COcclusionSystem)0x3;
  this[4] = (COcclusionSystem)0x1;
  *(float *)(this + 0xb0) = fVar3;
  fVar6 = (fVar3 - (fVar6 * *(float *)param_1 + fVar2 * *(float *)(param_1 + 8))) -
          fVar1 * *(float *)(param_1 + 4);
  *(float *)(this + 0xb8) = fVar6;
  dVar7 = tan((double)(param_2 * 0.5) * 0.017453292519943295);
  uVar5 = r_occlusionspew._28_4_;
  fVar6 = fVar6 / (float)(dVar7 * (double)fVar6);
  *(float *)(this + 0xbc) = fVar6 * fVar6;
  if ((*(int *)(uVar5 + 0x30) != 0) && (iVar4 = *(int *)(this + 700), iVar4 != 0)) {
    Msg("Occl %.2f (%d/%d)\n",(double)(((float)*(int *)(this + 0x2c0) / (float)iVar4) * 100.0),
        *(int *)(this + 0x2c0),iVar4);
    *(undefined4 *)(this + 700) = 0;
    *(undefined4 *)(this + 0x2c0) = 0;
    return;
  }
  return;
}

SourceMod gamedata

paste into addons/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.



        

        

          

Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.

Return-type handling cheatsheet (DHookReturn)