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

Method SelectObjects

Editor/Objects/ObjectManager.cpp:1092–1126  ·  view source on GitHub ↗

Select objects withing specified distance from givven position.

Source from the content-addressed store, hash-verified

1090
1091//! Select objects withing specified distance from givven position.
1092int CObjectManager::SelectObjects( const BBox &box,bool bUnselect )
1093{
1094 int numSel = 0;
1095
1096 BBox objBounds;
1097 for (Objects::iterator it = m_objects.begin(); it != m_objects.end(); ++it)
1098 {
1099 CBaseObject *obj = it->second;
1100
1101 if (obj->IsHidden())
1102 continue;
1103 if (obj->IsFrozen())
1104 continue;
1105
1106 if (obj->GetGroup())
1107 continue;
1108
1109
1110 obj->GetBoundBox( objBounds );
1111 if (box.IsIntersectBox(objBounds))
1112 {
1113 numSel++;
1114 if (!bUnselect)
1115 SelectObject( obj );
1116 else
1117 UnselectObject( obj );
1118 }
1119 // If its group.
1120 if (obj->GetRuntimeClass() == RUNTIME_CLASS(CGroup))
1121 {
1122 numSel += ((CGroup*)obj)->SelectObjects( box,bUnselect );
1123 }
1124 }
1125 return numSel;
1126}
1127
1128//////////////////////////////////////////////////////////////////////////
1129void CObjectManager::DeleteSelection()

Callers

nothing calls this directly

Calls 8

beginMethod · 0.45
endMethod · 0.45
IsHiddenMethod · 0.45
IsFrozenMethod · 0.45
GetGroupMethod · 0.45
GetBoundBoxMethod · 0.45
IsIntersectBoxMethod · 0.45
GetRuntimeClassMethod · 0.45

Tested by

no test coverage detected