L L4D2node

CPhysSlideConstraint::CreateConstraint

0x00772670 · 861 bytes · __thiscall

_ZN20CPhysSlideConstraint16CreateConstraintEP23IPhysicsConstraintGroupRK20hl_constraint_info_t

Decompiled

undefined (3 params)

/* CPhysSlideConstraint::CreateConstraint(IPhysicsConstraintGroup*, hl_constraint_info_t const&) */

void __thiscall
CPhysSlideConstraint::CreateConstraint
          (CPhysSlideConstraint *this,IPhysicsConstraintGroup *param_1,hl_constraint_info_t *param_2
          )

{
  int *piVar1;
  int *piVar2;
  float fVar3;
  matrix3x4_t *local_f4;
  float local_ec;
  float local_e8;
  float local_e4;
  matrix3x4_t local_e0 [48];
  float local_b0;
  float local_ac;
  float local_a8;
  matrix3x4_t local_80 [48];
  float local_50 [5];
  float local_3c;
  undefined4 local_38;
  undefined4 local_34;
  byte local_30;
  float local_2c;
  float local_28;
  undefined4 local_24;
  undefined4 local_20;
  
  SetIdentityMatrix(local_80);
  local_50[0] = 0.0;
  local_50[1] = 0.0;
  local_50[2] = 0.0;
  local_28 = 0.0;
  local_50[4] = *(float *)(this + 0x454) * 0.45454544;
  local_2c = 0.0;
  local_3c = *(float *)(this + 0x458) * 0.45454544;
  local_24 = 0;
  local_20 = 0;
  local_50[3] = 1.0;
  local_30 = ((byte)(*(uint *)(this + 0x148) >> 2) ^ 1) & 1;
  local_38 = *(undefined4 *)(param_2 + 0x24);
  local_34 = *(undefined4 *)(param_2 + 0x28);
  if (((byte)this[0x14d] & 8) != 0) {
    CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
  }
  local_ec = *(float *)(this + 0x480) - *(float *)(this + 0x2e0);
  local_e8 = *(float *)(this + 0x484) - *(float *)(this + 0x2e4);
  local_e4 = *(float *)(this + 0x488) - *(float *)(this + 0x2e8);
  VectorNormalize((Vector *)&local_ec);
  UTIL_SnapDirectionToAxis((Vector *)&local_ec,0.002);
  piVar1 = *(int **)(param_2 + 0x18);
  piVar2 = *(int **)(param_2 + 0x1c);
  if (piVar1 == (int *)0x0) {
    SetIdentityMatrix(local_e0);
  }
  else {
    (**(code **)(*piVar1 + 200))(piVar1,(matrix3x4_t *)&local_b0);
    MatrixInvert((matrix3x4_t *)&local_b0,local_e0);
  }
  local_f4 = local_e0;
  if (piVar2 == (int *)0x0) {
    SetIdentityMatrix((matrix3x4_t *)&local_b0);
  }
  else {
    (**(code **)(*piVar2 + 200))(piVar2,(matrix3x4_t *)&local_b0);
  }
  ConcatTransforms(local_f4,(matrix3x4_t *)&local_b0,local_80);
  (**(code **)(*piVar1 + 200))(piVar1,(matrix3x4_t *)&local_b0);
  VectorIRotate(&local_ec,(matrix3x4_t *)&local_b0,local_50);
  local_24 = *(undefined4 *)(this + 0x48c);
  if (((byte)this[0x148] & 2) != 0) {
    (**(code **)(**(int **)(param_2 + 0x1c) + 0xc4))
              (*(int **)(param_2 + 0x1c),(matrix3x4_t *)&local_b0,0);
    if (((byte)this[0x14d] & 8) != 0) {
      CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
    }
    fVar3 = *(float *)(this + 0x2e4) * local_e8 + *(float *)(this + 0x2e0) * local_ec +
            *(float *)(this + 0x2e8) * local_e4;
    local_28 = *(float *)(this + 0x484) * local_e8 + *(float *)(this + 0x480) * local_ec +
               *(float *)(this + 0x488) * local_e4;
    local_2c = fVar3;
    if (local_28 < fVar3) {
      local_2c = local_28;
      local_28 = fVar3;
    }
    fVar3 = local_e8 * local_ac + local_ec * local_b0 + local_e4 * local_a8;
    if (fVar3 < local_2c) {
      local_28 = local_28 - fVar3;
      local_2c = 0.0;
    }
    else {
      local_2c = local_2c - fVar3;
      if (local_28 < fVar3) {
        local_28 = 0.0;
      }
      else {
        local_28 = local_28 - fVar3;
      }
    }
  }
  (**(code **)(*physenv + 0x4c))
            (physenv,*(undefined4 *)(param_2 + 0x18),*(undefined4 *)(param_2 + 0x1c),param_1,
             local_80);
  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)