updates huming rockets
| 3978 | // |
| 3979 | //updates huming rockets |
| 3980 | int 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 |
nothing calls this directly
no test coverage detected