L L4D2node

CCollisionProperty::CollisionToNormalizedSpace

0x00429da0 · 330 bytes · __thiscall

_ZNK18CCollisionProperty26CollisionToNormalizedSpaceERK6VectorPS0_

Decompiled

undefined (3 params)

/* WARNING: Removing unreachable block (ram,0x00429dda) */
/* WARNING: Removing unreachable block (ram,0x00429ee9) */
/* CCollisionProperty::CollisionToNormalizedSpace(Vector const&, Vector*) const */

Vector * __thiscall
CCollisionProperty::CollisionToNormalizedSpace
          (CCollisionProperty *this,Vector *param_1,Vector *param_2)

{
  int iVar1;
  float fVar2;
  float fVar3;
  float fVar4;
  float fVar5;
  
  if ((AllocTempVector()::s_vecTemp == '\0') &&
     (iVar1 = __cxa_guard_acquire(&AllocTempVector()::s_vecTemp), iVar1 != 0)) {
    __cxa_guard_release(&AllocTempVector()::s_vecTemp);
  }
  if ((AllocTempVector()::s_nIndex == '\0') &&
     (iVar1 = __cxa_guard_acquire(&AllocTempVector()::s_nIndex), iVar1 != 0)) {
    AllocTempVector()::s_nIndex = 0;
    __cxa_guard_release(&AllocTempVector()::s_nIndex);
  }
  AllocTempVector()::s_nIndex = AllocTempVector()::s_nIndex + 0x10001 & 0x7f;
  LOCK();
  UNLOCK();
  iVar1 = AllocTempVector()::s_nIndex * 0xc;
  fVar5 = 0.5;
  fVar4 = *(float *)(this + 0x14) - *(float *)(this + 8);
  *(float *)(AllocTempVector()::s_vecTemp + iVar1) = fVar4;
  fVar3 = *(float *)(this + 0x18) - *(float *)(this + 0xc);
  *(float *)(AllocTempVector()::s_vecTemp + iVar1 + 4) = fVar3;
  fVar2 = *(float *)(this + 0x1c) - *(float *)(this + 0x10);
  *(float *)(AllocTempVector()::s_vecTemp + iVar1 + 8) = fVar2;
  if (fVar4 != 0.0) {
    fVar5 = (*(float *)param_1 - *(float *)(this + 8)) / fVar4;
  }
  *(float *)param_2 = fVar5;
  fVar4 = 0.5;
  if (fVar3 != 0.0) {
    fVar4 = (*(float *)(param_1 + 4) - *(float *)(this + 0xc)) / fVar3;
  }
  *(float *)(param_2 + 4) = fVar4;
  fVar3 = 0.5;
  if (fVar2 != 0.0) {
    fVar3 = (*(float *)(param_1 + 8) - *(float *)(this + 0x10)) / fVar2;
  }
  *(float *)(param_2 + 8) = fVar3;
  return param_2;
}

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)