L L4D2node

CCoreDispInfo::GenerateDispSurfTangentSpaces

0x000bfba0 · 753 bytes · __thiscall

_ZN13CCoreDispInfo29GenerateDispSurfTangentSpacesEv

Decompiled

undefined (1 param)

/* CCoreDispInfo::GenerateDispSurfTangentSpaces() */

void __thiscall CCoreDispInfo::GenerateDispSurfTangentSpaces(CCoreDispInfo *this)

{
  float fVar1;
  float fVar2;
  float fVar3;
  float fVar4;
  float fVar5;
  float fVar6;
  int iVar7;
  int iVar8;
  int iVar9;
  int iVar10;
  float fVar11;
  float fVar12;
  float fVar13;
  float fVar14;
  float fVar15;
  float fVar16;
  float local_28;
  float local_24;
  float local_20;
  
  fVar1 = *(float *)(this + 0x19c);
  fVar2 = *(float *)(this + 0x1a4);
  fVar3 = *(float *)(this + 0x1a0);
  fVar4 = *(float *)(this + 400);
  iVar8 = (1 << ((byte)*(undefined4 *)(this + 0xc) & 0x1f)) + 1;
  fVar5 = *(float *)(this + 0x194);
  fVar6 = *(float *)(this + 0x198);
  iVar8 = iVar8 * iVar8;
  if (0 < iVar8) {
    iVar9 = 0;
    iVar10 = 0;
    do {
      iVar7 = *(int *)(this + 0x1b8) + iVar10;
      *(float *)(iVar7 + 0x58) = fVar1;
      *(float *)(iVar7 + 0x60) = fVar2;
      *(float *)(iVar7 + 0x5c) = fVar3;
      VectorNormalize((Vector *)(*(int *)(this + 0x1b8) + iVar10 + 0x58));
      iVar7 = *(int *)(this + 0x1b8) + iVar10;
      *(float *)(iVar7 + 0x4c) =
           *(float *)(iVar7 + 0x60) * *(float *)(iVar7 + 0x44) -
           *(float *)(iVar7 + 0x5c) * *(float *)(iVar7 + 0x48);
      *(float *)(iVar7 + 0x54) =
           *(float *)(iVar7 + 0x5c) * *(float *)(iVar7 + 0x40) -
           *(float *)(iVar7 + 0x44) * *(float *)(iVar7 + 0x58);
      *(float *)(iVar7 + 0x50) =
           *(float *)(iVar7 + 0x48) * *(float *)(iVar7 + 0x58) -
           *(float *)(iVar7 + 0x60) * *(float *)(iVar7 + 0x40);
      VectorNormalize((Vector *)(*(int *)(this + 0x1b8) + iVar10 + 0x4c));
      iVar7 = *(int *)(this + 0x1b8) + iVar10;
      *(float *)(iVar7 + 0x58) =
           *(float *)(iVar7 + 0x48) * *(float *)(iVar7 + 0x50) -
           *(float *)(iVar7 + 0x44) * *(float *)(iVar7 + 0x54);
      *(float *)(iVar7 + 0x60) =
           *(float *)(iVar7 + 0x44) * *(float *)(iVar7 + 0x4c) -
           *(float *)(iVar7 + 0x50) * *(float *)(iVar7 + 0x40);
      *(float *)(iVar7 + 0x5c) =
           *(float *)(iVar7 + 0x54) * *(float *)(iVar7 + 0x40) -
           *(float *)(iVar7 + 0x48) * *(float *)(iVar7 + 0x4c);
      VectorNormalize((Vector *)(*(int *)(this + 0x1b8) + iVar10 + 0x58));
      fVar11 = *(float *)(this + 0x24) - *(float *)(this + 0x18);
      fVar14 = *(float *)(this + 0x3c) - *(float *)(this + 0x18);
      fVar13 = *(float *)(this + 0x28) - *(float *)(this + 0x1c);
      fVar12 = *(float *)(this + 0x40) - *(float *)(this + 0x1c);
      fVar16 = *(float *)(this + 0x44) - *(float *)(this + 0x20);
      fVar15 = *(float *)(this + 0x2c) - *(float *)(this + 0x20);
      local_28 = fVar12 * fVar15 - fVar16 * fVar13;
      local_24 = fVar16 * fVar11 - fVar15 * fVar14;
      local_20 = fVar13 * fVar14 - fVar11 * fVar12;
      VectorNormalize((Vector *)&local_28);
      if (0.0 < (fVar6 * fVar1 - fVar2 * fVar4) * local_24 +
                (fVar2 * fVar5 - fVar3 * fVar6) * local_28 +
                (fVar4 * fVar3 - fVar5 * fVar1) * local_20) {
        iVar7 = *(int *)(this + 0x1b8) + iVar10;
        *(uint *)(iVar7 + 0x4c) = *(uint *)(iVar7 + 0x4c) ^ 0x80000000;
        *(uint *)(iVar7 + 0x50) = *(uint *)(iVar7 + 0x50) ^ 0x80000000;
        *(uint *)(iVar7 + 0x54) = *(uint *)(iVar7 + 0x54) ^ 0x80000000;
      }
      iVar9 = iVar9 + 1;
      iVar10 = iVar10 + 0x90;
    } while (iVar9 != iVar8);
  }
  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)