101 if (entity.IsParticle())
103 if (entity.IsScriptedLight())
105 if (entity.IsBeingPlaced())
107 if (entity.IsHologram())
109 if (entity.
IsMan() || entity.IsZombie() || entity.IsZombieMilitary())
112 vector entityPosition = entity.GetPosition();
114 if (entity && entity.
IsMan())
119 entityPosition = vicinityPlayer.GetBonePositionWS(vicinityPlayer.GetBoneIndexByName(
"spine3"));
122 else if (entity && (entity.IsZombie() || entity.IsZombieMilitary()))
127 entityPosition = zombie.GetBonePositionWS(zombie.GetBoneIndexByName(
"spine3"));
132 if (FreeDebugCamera.GetInstance() && FreeDebugCamera.GetInstance().IsActive())
137 vector entityDirection = player.GetPosition() - entityPosition;
139 entityDirection[1] = 0;
141 vector playerDirection = MiscGameplayFunctions.GetHeadingVector(player);
143 playerDirection[1] = 0;
145 float dotRadians =
vector.
Dot(playerDirection, entityDirection);
146 if (dotRadians > -0.5)
216 vector playerPosition = player.GetPosition();
217 vector playerHeadPositionFixed = MiscGameplayFunctions.GetPlayerHeadPosition(player);
218 vector headingDirection = MiscGameplayFunctions.GetHeadingVector(player);
221 bool cameraActive = FreeDebugCamera.GetInstance() && FreeDebugCamera.GetInstance().IsActive();
224 playerPosition = FreeDebugCamera.GetInstance().GetPosition();
225 playerHeadPositionFixed = playerPosition;
227 float headingAngle = FreeDebugCamera.GetInstance().GetOrientation()[0] *
Math.
DEG2RAD;
229 headingDirection[0] =
Math.
Cos(headingAngle);
230 headingDirection[1] = 0;
231 headingDirection[2] =
Math.
Sin(headingAngle);
246 foreach (
CargoBase cargoObject : proxyCargos)
250 foreach (
Object actorInRadius : objectsInVicinity)
253 allFoundObjects.Insert(actorInRadius);
259 filteredObjects.Insert(actorInRadius);
262 if (objectsInVicinity)
263 objectsInVicinity.Clear();
270 foreach (
Object objectInRadius : objectsInVicinity)
273 allFoundObjects.Insert(objectInRadius);
279 filteredObjects.Insert(objectInRadius);
282 if (objectsInVicinity)
283 objectsInVicinity.Clear();
292 foreach (
Object objectInCone : objectsInVicinity)
295 allFoundObjects.Insert(objectInCone);
304 if (
Class.
CastTo(ent,objectInCone) && ent.GetInventory())
307 filteredObjects.Insert(objectInCone);
311 rayInput =
new RaycastRVParams(playerHeadPositionFixed, objectInCone.GetPosition());
313 rayInput.
type = ObjIntersectView;
323 if (result.hierLevel > 0)
325 if (result.parent.CanProxyObstruct())
328 if (result.parent == objectInCone)
330 filteredObjects.Insert(objectInCone);
336 if (result.obj == objectInCone)
338 filteredObjects.Insert(objectInCone);
354 params.
SetParams(playerPosition, headingDirection.
VectorToAngles(), boxEdgeLength * 2, ObjIntersect.View, ObjIntersect.Fire,
true);
356 if (
g_Game.IsBoxCollidingGeometryProxy(params, {player}, results))
358 foreach (BoxCollidingResult bResult : results)
360 if (bResult.obj && (bResult.obj.CanObstruct() || bResult.obj.CanProxyObstruct()))
363 allFoundObjects.Insert(bResult.obj);
366 if (bResult.parent && (bResult.parent.CanObstruct() || bResult.parent.CanProxyObstruct()))
369 allFoundObjects.Insert(bResult.parent);
376 MiscGameplayFunctions.FilterObstructingObjects(allFoundObjects, obstructingObjects);
379 if (obstructingObjects.Count() > 0 && !cameraActive)
382 if (filteredObjects.Count() > 10)
387 foreach (
Object object: filteredObjectsGrouped)
392 foreach (
Object filteredObjectClose: filteredObjects)
415 foreach (
Object filteredObject: filteredObjects)