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

Method AddImpulseObj

CrySystem/ScriptObjectEntity.cpp:2223–2240  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2221}
2222
2223int CScriptObjectEntity::AddImpulseObj(IFunctionHandler *pH)
2224{
2225 CHECK_PARAMETERS(2);
2226
2227 Vec3 dir;
2228 float impulse;
2229
2230 CScriptObjectVector oVec(m_pScriptSystem,true);
2231 pH->GetParam(1,*oVec);
2232 dir=oVec.Get();
2233 pH->GetParam(2, impulse);
2234 if (GetLengthSquared(dir)*impulse>0)
2235 {
2236 m_pEntity->AddImpulse(0,m_pEntity->GetPos(),GetNormalized(dir)*impulse,true);
2237 m_pEntity->AddImpulse(0,m_pEntity->GetPos(),GetNormalized(dir)*impulse*2,false);
2238 }
2239 return pH->EndFunctionNull();
2240}
2241
2242
2243/*! Determines whether a given point is within an entities radius

Callers

nothing calls this directly

Calls 6

GetLengthSquaredFunction · 0.85
EndFunctionNullMethod · 0.80
GetParamMethod · 0.45
GetMethod · 0.45
AddImpulseMethod · 0.45
GetPosMethod · 0.45

Tested by

no test coverage detected