L L4D2node

CalcBonePosition

0x00b98720 · 1166 bytes · __cdecl

_Z16CalcBonePositionifRK6VectorS1_PK18mstudio_rle_anim_tRS_

Decompiled

undefined (6 params)

/* CalcBonePosition(int, float, Vector const&, Vector const&, mstudio_rle_anim_t const*, Vector&) */

void CalcBonePosition(int param_1,float param_2,Vector *param_3,Vector *param_4,
                     mstudio_rle_anim_t *param_5,Vector *param_6)

{
  int iVar1;
  mstudio_rle_anim_t *pmVar2;
  mstudio_rle_anim_t mVar3;
  ushort uVar4;
  byte bVar5;
  int iVar6;
  mstudioanimvalue_t *pmVar7;
  Vector *pVVar8;
  int iVar9;
  float fVar10;
  float fVar11;
  float fVar12;
  float local_1c;
  float local_18 [2];
  
  mVar3 = param_5[1];
  if (((byte)mVar3 & 1) == 0) {
    if (((byte)mVar3 & 4) == 0) {
      if (((byte)mVar3 & 0x10) != 0) {
        *(undefined4 *)param_6 = 0;
        *(undefined4 *)(param_6 + 4) = 0;
        *(undefined4 *)(param_6 + 8) = 0;
        return;
      }
      *(undefined4 *)param_6 = *(undefined4 *)param_3;
      *(undefined4 *)(param_6 + 4) = *(undefined4 *)(param_3 + 4);
      *(undefined4 *)(param_6 + 8) = *(undefined4 *)(param_3 + 8);
    }
    else {
      iVar6 = ((int)((uint)(byte)mVar3 << 0x1c) >> 0x1f & 6U) + 4;
      if (param_2 <= 0.001) {
        iVar9 = 0;
        pVVar8 = param_6;
        do {
          pmVar7 = (mstudioanimvalue_t *)0x0;
          iVar1 = iVar9 * 4;
          if (0 < *(short *)(param_5 + iVar9 * 2 + iVar6)) {
            pmVar7 = (mstudioanimvalue_t *)
                     (param_5 + *(short *)(param_5 + iVar9 * 2 + iVar6) + iVar6);
          }
          iVar9 = iVar9 + 1;
          ExtractAnimValue(param_1,pmVar7,*(float *)(param_4 + iVar1),(float *)pVVar8);
          pVVar8 = pVVar8 + 4;
        } while (iVar9 != 3);
      }
      else {
        iVar9 = 0;
        do {
          pmVar7 = (mstudioanimvalue_t *)0x0;
          if (0 < *(short *)(param_5 + iVar9 * 2 + iVar6)) {
            pmVar7 = (mstudioanimvalue_t *)
                     (param_5 + *(short *)(param_5 + iVar9 * 2 + iVar6) + iVar6);
          }
          ExtractAnimValue(param_1,pmVar7,*(float *)(param_4 + iVar9 * 4),&local_1c,local_18);
          *(float *)(param_6 + iVar9 * 4) = local_1c * (1.0 - param_2) + param_2 * local_18[0];
          iVar9 = iVar9 + 1;
        } while (iVar9 != 3);
      }
      if (((byte)param_5[1] & 0x10) == 0) {
        *(float *)param_6 = *(float *)param_6 + *(float *)param_3;
        *(float *)(param_6 + 4) = *(float *)(param_6 + 4) + *(float *)(param_3 + 4);
        *(float *)(param_6 + 8) = *(float *)(param_6 + 8) + *(float *)(param_3 + 8);
        return;
      }
    }
    return;
  }
  pmVar2 = param_5 + ((byte)mVar3 >> 1 & 1) * 6 + ((byte)mVar3 >> 5 & 1) * 8 + 4;
  uVar4 = *(ushort *)pmVar2;
  if ((uVar4 & 0x7fff) == 0x7c00) {
    fVar11 = 65504.0;
    if ((short)uVar4 < 0) {
      fVar11 = -65504.0;
    }
  }
  else {
    bVar5 = (byte)(uVar4 >> 8);
    if ((bVar5 & 0x7c) == 0x7c) {
      fVar11 = 0.0;
      if ((uVar4 & 0x3ff) == 0) goto LAB_00b9887d;
    }
    else if (((uVar4 & 0x7c00) == 0) && ((uVar4 & 0x3ff) != 0)) {
      fVar11 = 1.0;
      if ((short)uVar4 < 0) {
        fVar11 = -1.0;
      }
      fVar11 = ((float)(uVar4 & 0x3ff) + 0.0) * 5.9604645e-08 * fVar11;
    }
    else {
LAB_00b9887d:
      fVar11 = (float)((uVar4 & 0x3ff) << 0xd | (uint)(bVar5 >> 7) << 0x1f |
                      (uint)((uVar4 >> 10 & 0x1f) != 0) * ((uVar4 >> 10 & 0x1f) + 0x70) * 0x800000);
    }
  }
  uVar4 = *(ushort *)(pmVar2 + 2);
  if ((uVar4 & 0x7fff) == 0x7c00) {
    fVar10 = 65504.0;
    if ((short)uVar4 < 0) {
      fVar10 = -65504.0;
    }
  }
  else {
    bVar5 = (byte)(uVar4 >> 8);
    if ((bVar5 & 0x7c) == 0x7c) {
      fVar10 = 0.0;
      if ((uVar4 & 0x3ff) == 0) goto LAB_00b988f4;
    }
    else if (((uVar4 & 0x7c00) == 0) && ((uVar4 & 0x3ff) != 0)) {
      fVar10 = 1.0;
      if ((short)uVar4 < 0) {
        fVar10 = -1.0;
      }
      fVar10 = ((float)(uVar4 & 0x3ff) + 0.0) * 5.9604645e-08 * fVar10;
    }
    else {
LAB_00b988f4:
      fVar10 = (float)((uVar4 & 0x3ff) << 0xd | (uint)(bVar5 >> 7) << 0x1f |
                      (uint)((uVar4 >> 10 & 0x1f) != 0) * ((uVar4 >> 10 & 0x1f) + 0x70) * 0x800000);
    }
  }
  uVar4 = *(ushort *)(pmVar2 + 4);
  if ((uVar4 & 0x7fff) == 0x7c00) {
    fVar12 = 65504.0;
    if ((short)uVar4 < 0) {
      fVar12 = -65504.0;
    }
  }
  else {
    bVar5 = (byte)(uVar4 >> 8);
    if ((bVar5 & 0x7c) == 0x7c) {
      fVar12 = 0.0;
      if ((uVar4 & 0x3ff) != 0) goto LAB_00b98a9d;
    }
    else if (((uVar4 & 0x7c00) == 0) && ((uVar4 & 0x3ff) != 0)) {
      fVar12 = 1.0;
      if ((short)uVar4 < 0) {
        fVar12 = -1.0;
      }
      fVar12 = ((float)(uVar4 & 0x3ff) + 0.0) * 5.9604645e-08 * fVar12;
      goto LAB_00b98a9d;
    }
    fVar12 = (float)((uVar4 & 0x3ff) << 0xd | (uint)(bVar5 >> 7) << 0x1f |
                    (uint)((uVar4 >> 10 & 0x1f) != 0) * ((uVar4 >> 10 & 0x1f) + 0x70) * 0x800000);
  }
LAB_00b98a9d:
  *(float *)param_6 = fVar11;
  *(float *)(param_6 + 4) = fVar10;
  *(float *)(param_6 + 8) = fVar12;
  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)