| 4626 | } |
| 4627 | |
| 4628 | int CScriptObjectEntity::GetEntitiesInContact(IFunctionHandler *pH) |
| 4629 | { |
| 4630 | Vec3 mins, maxs; |
| 4631 | m_pEntity->GetBBox(mins, maxs); |
| 4632 | vectorf minbox, maxbox; |
| 4633 | minbox = vectorf(mins); |
| 4634 | maxbox = vectorf(maxs); |
| 4635 | IPhysicalWorld *pWorld=m_pISystem->GetIPhysicalWorld(); |
| 4636 | IPhysicalEntity **ppColliders; |
| 4637 | int cnt = 0,valid=0; |
| 4638 | |
| 4639 | if (cnt = pWorld->GetEntitiesInBox(minbox, maxbox, ppColliders,ent_living|ent_rigid|ent_sleeping_rigid|ent_static)) |
| 4640 | { |
| 4641 | // execute on collide for all of the entities |
| 4642 | _SmartScriptObject pObj(m_pScriptSystem); |
| 4643 | for (int i = 0; i < cnt; i++) |
| 4644 | { |
| 4645 | |
| 4646 | IEntity *pEntity =(IEntity *) ppColliders[i]->GetForeignData(); |
| 4647 | |
| 4648 | if (pEntity) |
| 4649 | { |
| 4650 | if (pEntity->IsGarbage()) |
| 4651 | continue; |
| 4652 | |
| 4653 | if (pEntity->GetId() == m_pEntity->GetId()) |
| 4654 | continue; |
| 4655 | |
| 4656 | if (pEntity->IsStatic()) |
| 4657 | continue; |
| 4658 | valid++; |
| 4659 | pObj->SetAt(pEntity->GetId(),pEntity->GetScriptObject()); |
| 4660 | } |
| 4661 | } |
| 4662 | if(valid) |
| 4663 | { |
| 4664 | return pH->EndFunction(pObj); |
| 4665 | } |
| 4666 | } |
| 4667 | |
| 4668 | return pH->EndFunctionNull(); |
| 4669 | } |
| 4670 | |
| 4671 | |
| 4672 | int CScriptObjectEntity::SetDefaultIdleAnimations(IFunctionHandler *pH) |
nothing calls this directly
no test coverage detected