L L4D2node

CBaseRopePhysics::ApplyConstraints

0x005931b0 · 362 bytes · __thiscall

_ZN16CBaseRopePhysics16ApplyConstraintsEPN14CSimplePhysics5CNodeEi

Decompiled

undefined (3 params)

/* CBaseRopePhysics::ApplyConstraints(CSimplePhysics::CNode*, int) */

void __thiscall
CBaseRopePhysics::ApplyConstraints(CBaseRopePhysics *this,CNode *param_1,int param_2)

{
  undefined4 *puVar1;
  float *pfVar2;
  float *pfVar3;
  int *piVar4;
  int iVar5;
  int iVar6;
  float fVar7;
  float fVar8;
  float fVar9;
  float fVar10;
  float fVar11;
  undefined1 auVar12 [16];
  
  iVar5 = 3;
  do {
    if (1 < *(int *)(this + 0xc)) {
      iVar6 = 0;
      do {
        puVar1 = (undefined4 *)(*(int *)(this + 0x10) + iVar6 * 8);
        pfVar2 = (float *)*puVar1;
        pfVar3 = (float *)puVar1[1];
        fVar8 = pfVar2[2] - pfVar3[2];
        fVar10 = *pfVar2 - *pfVar3;
        fVar9 = pfVar2[1] - pfVar3[1];
        fVar7 = fVar10 * fVar10 + fVar8 * fVar8 + fVar9 * fVar9;
        fVar11 = *(float *)(this + 0x18);
        if (fVar11 == 0.0) {
          fVar11 = *(float *)(*(int *)(this + 0x1c) + iVar6 * 4);
        }
        if (fVar11 < fVar7) {
          auVar12 = rsqrtss(ZEXT416((uint)fVar11),ZEXT416((uint)fVar7));
          fVar11 = auVar12._0_4_;
          fVar11 = 1.0 - (fVar7 * fVar11 * fVar11 + -3.0) * fVar11 * -0.5 * *(float *)(this + 0x14);
          fVar10 = fVar10 * 0.5 * fVar11;
          fVar7 = fVar9 * 0.5 * fVar11;
          fVar11 = fVar8 * 0.5 * fVar11;
          *pfVar2 = *pfVar2 - fVar10;
          pfVar2[1] = pfVar2[1] - fVar7;
          pfVar2[2] = pfVar2[2] - fVar11;
          pfVar2 = (float *)puVar1[1];
          *pfVar2 = fVar10 + *pfVar2;
          pfVar2[1] = fVar7 + pfVar2[1];
          pfVar2[2] = fVar11 + pfVar2[2];
        }
        iVar6 = iVar6 + 1;
      } while (iVar6 < *(int *)(this + 0xc) + -1);
    }
    piVar4 = *(int **)(this + 4);
    if (piVar4 != (int *)0x0) {
      (**(code **)(*piVar4 + 4))(piVar4,param_1,param_2);
    }
    iVar5 = iVar5 + -1;
  } while (iVar5 != 0);
  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)