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

Method GetEntitiesInContact

CrySystem/ScriptObjectEntity.cpp:4628–4669  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4626}
4627
4628int 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
4672int CScriptObjectEntity::SetDefaultIdleAnimations(IFunctionHandler *pH)

Callers

nothing calls this directly

Calls 11

GetIPhysicalWorldMethod · 0.80
GetEntitiesInBoxMethod · 0.80
IsGarbageMethod · 0.80
SetAtMethod · 0.80
EndFunctionMethod · 0.80
EndFunctionNullMethod · 0.80
GetBBoxMethod · 0.45
GetForeignDataMethod · 0.45
GetIdMethod · 0.45
IsStaticMethod · 0.45
GetScriptObjectMethod · 0.45

Tested by

no test coverage detected