CTriggerVPhysicsMotion::Simulate
0x00b1c7c0 · 1284 bytes · __thiscall
_ZN22CTriggerVPhysicsMotion8SimulateEP24IPhysicsMotionControllerP14IPhysicsObjectfR6VectorS5_
Decompiled
undefined (6 params)
/* CTriggerVPhysicsMotion::Simulate(IPhysicsMotionController*, IPhysicsObject*, float, Vector&,
Vector&) */
undefined4 __thiscall
CTriggerVPhysicsMotion::Simulate
(CTriggerVPhysicsMotion *this,IPhysicsMotionController *param_1,IPhysicsObject *param_2,
float param_3,Vector *param_4,Vector *param_5)
{
longdouble lVar1;
longdouble lVar2;
float fVar3;
float fVar4;
float fVar5;
float fVar6;
float local_4c;
float local_48;
float local_44;
float local_40;
float local_3c;
float local_38;
float local_34;
float local_30;
float local_2c;
float local_28;
float local_24;
float local_20;
if (this[0x440] == (CTriggerVPhysicsMotion)0x0) {
*(undefined4 *)param_4 = 0;
*(undefined4 *)(param_4 + 4) = 0;
*(undefined4 *)(param_4 + 8) = 0;
*(undefined4 *)param_5 = 0;
*(undefined4 *)(param_5 + 4) = 0;
*(undefined4 *)(param_5 + 8) = 0;
if (*(float *)(this + 0x468) != 1.0) {
*(float *)(param_4 + 8) =
*(float *)(param_4 + 8) -
(*(float *)(this + 0x468) + -1.0) * *(float *)(sv_gravity._28_4_ + 0x2c);
}
if (*(float *)(this + 0x490) == 0.0) {
fVar5 = *(float *)(this + 0x46c);
}
else {
AngleVectors((QAngle *)(this + 0x494),(Vector *)&local_28);
fVar5 = *(float *)(this + 0x490);
*(float *)param_4 = local_28 * fVar5 + *(float *)param_4;
*(float *)(param_4 + 4) = local_24 * fVar5 + *(float *)(param_4 + 4);
*(float *)(param_4 + 8) = fVar5 * local_20 + *(float *)(param_4 + 8);
fVar5 = *(float *)(this + 0x46c);
}
if ((((fVar5 != 0.0) || (lVar1 = (longdouble)LinearLimit(this), (float)lVar1 != 0.0)) ||
(*(float *)(this + 0x484) != 1.0)) ||
((*(float *)(this + 0x488) != 0.0 || (*(float *)(this + 0x48c) != 1.0)))) {
fVar4 = 0.0;
(**(code **)(*(int *)param_2 + 0xd4))(param_2,&local_4c,&local_40);
local_4c = param_3 * *(float *)param_4 + local_4c;
local_48 = param_3 * *(float *)(param_4 + 4) + local_48;
local_44 = param_3 * *(float *)(param_4 + 8) + local_44;
local_28 = local_40;
local_24 = local_3c;
local_20 = local_38;
local_34 = local_4c;
local_30 = local_48;
local_2c = local_44;
lVar1 = (longdouble)VectorNormalize((Vector *)&local_34);
fVar6 = (float)lVar1;
lVar1 = (longdouble)VectorNormalize((Vector *)&local_28);
fVar5 = *(float *)(this + 0x46c);
fVar3 = fVar4;
if (fVar5 != 0.0) {
lVar2 = (longdouble)(**(code **)(*(int *)param_2 + 0x108))(param_2,(Vector *)&local_34);
fVar4 = *(float *)(this + 0x46c);
fVar5 = param_3 * -0.5 * fVar5 * (float)lVar2;
if (fVar5 <= -1.0) {
fVar5 = -1.0;
}
lVar2 = (longdouble)(**(code **)(*(int *)param_2 + 0x10c))(param_2,&local_28);
fVar4 = fVar4 * -0.5 * param_3 * (float)lVar2;
if (fVar4 <= -1.0) {
fVar4 = -1.0;
}
fVar4 = fVar4 / param_3;
fVar3 = fVar5 / param_3;
}
lVar2 = (longdouble)LinearLimit(this);
if (((float)lVar2 != 0.0) &&
(*(float *)(this + 0x470) <= fVar6 && fVar6 != *(float *)(this + 0x470))) {
lVar2 = (longdouble)LinearLimit(this);
fVar5 = ((float)lVar2 - fVar6) / param_3;
if ((*(float *)(this + 0x474) != 0.0) &&
(fVar6 = -*(float *)(this + 0x474) / param_3, fVar5 <= fVar6)) {
fVar5 = fVar6;
}
*(float *)param_4 = local_34 * fVar5 + *(float *)param_4;
*(float *)(param_4 + 4) = local_30 * fVar5 + *(float *)(param_4 + 4);
*(float *)(param_4 + 8) = fVar5 * local_2c + *(float *)(param_4 + 8);
}
fVar5 = *(float *)(this + 0x488);
if ((fVar5 != 0.0) && (fVar5 < (float)lVar1)) {
fVar5 = (fVar5 - (float)lVar1) / param_3;
*(float *)(param_5 + 4) = local_24 * fVar5 + *(float *)(param_5 + 4);
*(float *)(param_5 + 8) = local_20 * fVar5 + *(float *)(param_5 + 8);
*(float *)param_5 = fVar5 * local_28 + *(float *)param_5;
}
if (*(float *)(this + 0x484) != 1.0) {
fVar3 = (fVar3 + 1.0) * *(float *)(this + 0x484) - 1.0;
}
if (*(float *)(this + 0x48c) != 1.0) {
fVar4 = (fVar4 + 1.0) * *(float *)(this + 0x48c) - 1.0;
}
*(float *)(param_4 + 4) = local_48 * fVar3 + *(float *)(param_4 + 4);
*(float *)(param_4 + 8) = local_44 * fVar3 + *(float *)(param_4 + 8);
*(float *)param_4 = fVar3 * local_4c + *(float *)param_4;
*(float *)(param_5 + 8) = local_38 * fVar4 + *(float *)(param_5 + 8);
*(float *)(param_5 + 4) = local_3c * fVar4 + *(float *)(param_5 + 4);
*(float *)param_5 = fVar4 * local_40 + *(float *)param_5;
}
return 3;
}
return 0;
}
SourceMod gamedata
paste intoaddons/sourcemod/gamedata/<your_plugin>.txt
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.
Signatures + Functions block. The plugin uses
DHookCreateFromConf - DHooks reads return type, this-type,
calling convention, and argument types straight from the gamedata. Less
boilerplate in the plugin, types travel with the gamedata.
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.