-------------------------------------------------------------------------------------------------
| 2591 | //------------------------------------------------------------------------------------------------- |
| 2592 | // |
| 2593 | int CScriptObjectSystem::RayTraceCheck(IFunctionHandler *pH) |
| 2594 | { |
| 2595 | CHECK_PARAMETERS(4); |
| 2596 | CScriptObjectVector vPos(m_pScriptSystem, true); |
| 2597 | Vec3 src, dst; |
| 2598 | int skipId1, skipId2; |
| 2599 | |
| 2600 | pH->GetParam(1, *vPos); |
| 2601 | src = vPos.Get(); |
| 2602 | pH->GetParam(2, *vPos); |
| 2603 | dst = vPos.Get(); |
| 2604 | pH->GetParam(3, skipId1); |
| 2605 | pH->GetParam(4, skipId2); |
| 2606 | |
| 2607 | IEntity *skipEnt1 = m_pEntitySystem->GetEntity(skipId1); |
| 2608 | IEntity *skipEnt2 = m_pEntitySystem->GetEntity(skipId2); |
| 2609 | IPhysicalEntity *skipPhys1=NULL; |
| 2610 | IPhysicalEntity *skipPhys2=NULL; |
| 2611 | |
| 2612 | if(skipEnt1) skipPhys1 = skipEnt1->GetPhysics(); |
| 2613 | if(skipEnt2) skipPhys2 = skipEnt2->GetPhysics(); |
| 2614 | |
| 2615 | ray_hit RayHit; |
| 2616 | //TODO? add an extraparam to specify what kind of objects to check? now its world and static |
| 2617 | int nHits=m_pPhysicalWorld->RayWorldIntersection(src, dst-src, ent_static|ent_terrain, rwi_ignore_noncolliding | rwi_stop_at_pierceable, &RayHit, 1, skipPhys1, skipPhys2 ); |
| 2618 | |
| 2619 | return pH->EndFunction((bool)(nHits==0)); |
| 2620 | } |
| 2621 | |
| 2622 | |
| 2623 |
nothing calls this directly
no test coverage detected