MCPcopy Create free account
hub / github.com/StrongPC123/Far-Cry-1-Source-Full / DoHam

Method DoHam

CrySystem/ScriptObjectEntity.cpp:3980–4014  ·  view source on GitHub ↗

updates huming rockets

Source from the content-addressed store, hash-verified

3978//
3979//updates huming rockets
3980int CScriptObjectEntity::DoHam(IFunctionHandler *pH)
3981{
3982 CHECK_PARAMETERS(1);
3983 pe_params_particle rpp;
3984
3985 Vec3 target;
3986 CScriptObjectVector oVec(m_pScriptSystem,true);
3987 pH->GetParam(1,*oVec);
3988 target=oVec.Get();
3989
3990 IPhysicalEntity *pe;
3991 pe=m_pEntity->GetPhysics();
3992 if(pe)
3993 {
3994 pe->GetParams(&rpp);
3995
3996 Vec3 pos = m_pEntity->GetPos();
3997 target = target - pos;
3998 Vec3 dir = rpp.heading;
3999
4000 Vec3 diff = target-dir;
4001 dir+=diff*m_pISystem->GetITimer()->GetFrameTime()*0.5f;
4002
4003// float dist = target.Length();
4004 // target.Normalize();
4005 // Vec3 delta = target - (Vec3)rpp.heading;
4006
4007
4008 rpp.heading = dir;
4009 rpp.heading.normalize();
4010
4011 pe->SetParams(&rpp);
4012 }
4013 return pH->EndFunction(-1);
4014}
4015
4016
4017

Callers

nothing calls this directly

Calls 10

GetITimerMethod · 0.80
EndFunctionMethod · 0.80
GetParamMethod · 0.45
GetMethod · 0.45
GetPhysicsMethod · 0.45
GetParamsMethod · 0.45
GetPosMethod · 0.45
GetFrameTimeMethod · 0.45
normalizeMethod · 0.45
SetParamsMethod · 0.45

Tested by

no test coverage detected