| 2221 | } |
| 2222 | |
| 2223 | int 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 |
nothing calls this directly
no test coverage detected