L L4D2node

CPositionInterpolator_Rope::InterpolatePosition

0x00592480 · 464 bytes · __thiscall

_ZN26CPositionInterpolator_Rope19InterpolatePositionEfR6Vector

Decompiled

undefined (3 params)

/* CPositionInterpolator_Rope::InterpolatePosition(float, Vector&) */

void __thiscall
CPositionInterpolator_Rope::InterpolatePosition
          (CPositionInterpolator_Rope *this,float param_1,Vector *param_2)

{
  CBaseRopePhysics *this_00;
  undefined4 uVar1;
  float fVar2;
  float fVar3;
  float fVar4;
  float fVar5;
  float fVar6;
  float fVar7;
  int iVar8;
  undefined4 *puVar9;
  int iVar10;
  int iVar11;
  float fVar12;
  
  if (this[0x22c] != (CPositionInterpolator_Rope)0x0) {
    this_00 = (CBaseRopePhysics *)(this + 4);
    CBaseRopePhysics::SetNumNodes(this_00,*(int *)(this + 0x230));
    iVar11 = 0;
    if (0 < *(int *)(this + 0x10)) {
      iVar10 = 0;
      do {
        iVar10 = iVar10 + 1;
        uVar1 = *(undefined4 *)(this + 0x210);
        iVar8 = *(int *)(this + 0xc) + iVar11;
        *(undefined4 *)(iVar8 + 0xc) = uVar1;
        *(undefined4 *)(iVar8 + 0x10) = *(undefined4 *)(this + 0x214);
        *(undefined4 *)(iVar8 + 0x14) = *(undefined4 *)(this + 0x218);
        puVar9 = (undefined4 *)(*(int *)(this + 0xc) + iVar11);
        iVar11 = iVar11 + 0x24;
        *puVar9 = uVar1;
        puVar9[1] = *(undefined4 *)(iVar8 + 0x10);
        puVar9[2] = *(undefined4 *)(iVar8 + 0x14);
      } while (iVar10 < *(int *)(this + 0x10));
    }
    fVar12 = *(float *)(this + 0x210);
    fVar2 = *(float *)(this + 0x214);
    fVar3 = *(float *)(this + 0x21c);
    fVar4 = *(float *)(this + 0x220);
    fVar5 = *(float *)(this + 0x218);
    fVar6 = *(float *)(this + 0x224);
    fVar7 = *(float *)(this + 0x228);
    CBaseRopePhysics::Restart(this_00);
    CBaseRopePhysics::SetupSimulation
              (this_00,(SQRT((fVar12 - fVar3) * (fVar12 - fVar3) + (fVar2 - fVar4) * (fVar2 - fVar4)
                             + (fVar5 - fVar6) * (fVar5 - fVar6)) + fVar7) /
                       (float)(*(int *)(this + 0x10) + -1),(IHelper *)(this + 0x20c));
    CBaseRopePhysics::Simulate(this_00,5.0);
    this[0x22c] = (CPositionInterpolator_Rope)0x0;
  }
  fVar12 = (float)(*(int *)(this + 0x10) + -1) * param_1;
  iVar8 = (int)fVar12;
  iVar10 = (iVar8 * 9 + 9) * 4;
  iVar11 = *(int *)(this + 0xc) + iVar10;
  iVar10 = *(int *)(this + 0xc) + -0x24 + iVar10;
  fVar12 = fVar12 - (float)iVar8;
  *(float *)param_2 =
       (*(float *)(iVar11 + 0x18) - *(float *)(iVar10 + 0x18)) * fVar12 + *(float *)(iVar10 + 0x18);
  *(float *)(param_2 + 4) =
       (*(float *)(iVar11 + 0x1c) - *(float *)(iVar10 + 0x1c)) * fVar12 + *(float *)(iVar10 + 0x1c);
  *(float *)(param_2 + 8) =
       (*(float *)(iVar11 + 0x20) - *(float *)(iVar10 + 0x20)) * fVar12 + *(float *)(iVar10 + 0x20);
  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)