89 if (entity.IsParticle())
91 if (entity.IsScriptedLight())
93 if (entity.IsBeingPlaced())
95 if (entity.IsHologram())
97 if (entity.
IsMan() || entity.IsZombie() || entity.IsZombieMilitary())
100 vector entityPosition = entity.GetPosition();
102 if (entity && entity.
IsMan())
107 entityPosition = vicinityPlayer.GetBonePositionWS(vicinityPlayer.GetBoneIndexByName(
"spine3"));
110 else if (entity && (entity.IsZombie() || entity.IsZombieMilitary()))
115 entityPosition = zombie.GetBonePositionWS(zombie.GetBoneIndexByName(
"spine3"));
119 vector entityDirection = player.GetPosition() - entityPosition;
121 entityDirection[1] = 0;
123 vector playerDirection = MiscGameplayFunctions.GetHeadingVector(player);
125 playerDirection[1] = 0;
127 float dotRadians =
vector.
Dot(playerDirection, entityDirection);
128 if (dotRadians > -0.5)
143 if (entity.IsParticle())
145 if (entity.IsScriptedLight())
147 if (entity.IsBeingPlaced())
149 if (entity.IsHologram())
169 if (entity == player)
171 if (entity.IsParticle())
173 if (entity.IsScriptedLight())
175 if (entity.IsBeingPlaced())
177 if (entity.IsHologram())
191 return MiscGameplayFunctions.CanIgnoreDistanceCheck(entity_ai);
203 vector playerPosition = player.GetPosition();
204 vector headingDirection = MiscGameplayFunctions.GetHeadingVector(player);
206 MiscGameplayFunctions.GetHeadBonePos(player, playerHeadPos);
219 foreach (
CargoBase cargoObject : proxyCargos)
223 foreach (
Object actorInRadius : objectsInVicinity)
227 allFoundObjects.Insert(actorInRadius);
235 filteredObjects.Insert(actorInRadius);
239 if (objectsInVicinity)
241 objectsInVicinity.Clear();
249 foreach (
Object objectInRadius : objectsInVicinity)
253 allFoundObjects.Insert(objectInRadius);
261 filteredObjects.Insert(objectInRadius);
265 if (objectsInVicinity)
267 objectsInVicinity.Clear();
277 foreach (
Object objectInCone : objectsInVicinity)
281 allFoundObjects.Insert(objectInCone);
290 rayInput =
new RaycastRVParams(playerHeadPos, objectInCone.GetPosition(), player, 0.1);
300 if (result.hierLevel > 0 && result.parent == objectInCone)
302 filteredObjects.Insert(objectInCone);
304 else if (result.hierLevel == 0 && result.obj == objectInCone)
306 filteredObjects.Insert(objectInCone);
320 params.
SetParams(playerPosition, headingDirection.
VectorToAngles(), boxEdgeLength * 2, ObjIntersect.View, ObjIntersect.Fire,
true);
322 if (
GetGame().IsBoxCollidingGeometryProxy(params, {player}, results))
324 foreach (BoxCollidingResult bResult : results)
326 if (bResult.obj && (bResult.obj.CanObstruct() || bResult.obj.CanProxyObstruct()))
330 allFoundObjects.Insert(bResult.obj);
334 if (bResult.parent && (bResult.parent.CanObstruct() || bResult.parent.CanProxyObstruct()))
338 allFoundObjects.Insert(bResult.parent);
346 MiscGameplayFunctions.FilterObstructingObjects(allFoundObjects, obstructingObjects);
348 if (obstructingObjects.Count() > 0)
350 if (filteredObjects.Count() > 10)
353 MiscGameplayFunctions.GetHeadBonePos(player, rayStart);
358 foreach (
Object object: filteredObjectsGrouped)
363 foreach (
Object filteredObjectClose: filteredObjects)
386 foreach (
Object filteredObject: filteredObjects)
393 return MiscGameplayFunctions.IsObjectObstructed(filtered_object);
401 private void DebugActorsSphereDraw(
float radius)
403 CleanupDebugShapes(rayShapes);
408 private void DebugObjectsSphereDraw(
float radius)
418 private void DebugConeDraw(
vector start,
float cone_angle)
432 endL[0] = endL[0] + xL;
433 endL[2] = endL[2] + zL;
434 endR[0] = endR[0] + xR;
435 endR[2] = endR[2] + zR;
444 foreach (
Shape shape : shapesArr)
445 Debug.RemoveShape(shape);
private void DayZPlayerUtils()
cannot be instantiated
class JsonUndergroundAreaTriggerData GetPosition
Class that holds parameters to feed into CGame.IsBoxCollidingGeometryProxy.
proto native void SetParams(vector center, vector orientation, vector edgeLength, ObjIntersect primaryType, ObjIntersect secondaryType, bool fullComponentInfo)
Set the parameters.
proto native void GetObjectsAtPosition3D(vector pos, float radius, out array< Object > objects, out array< CargoBase > proxyCargos)
Returns list of all objects in sphere "radius" around position "pos".
represents base for cargo storage for entities
Super root of all classes in Enforce script.
static proto bool RaycastRVProxy(notnull RaycastRVParams in, out notnull array< ref RaycastRVResult > results, array< Object > excluded=null)
static Shape DrawArrow(vector from, vector to, float size=0.5, int color=0xFFFFFFFF, int flags=0)
static Shape DrawLine(vector from, vector to, int color=0xFFFFFFFF, int flags=0)
static Shape DrawSphere(vector pos, float size=1, int color=0x1fff7f7f, ShapeFlags flags=ShapeFlags.TRANSP|ShapeFlags.NOOUTLINE)
script counterpart to engine's class Inventory
static proto native bool CheckManipulatedObjectsDistances(notnull EntityAI e0, notnull EntityAI e1, float radius)
override bool IsTakeable()
private const float CONE_HEIGHT_MIN
private const int OBJECT_OBSTRUCTION_WEIGHT
bool IsObstructed(Object filtered_object)
private const float UPDATE_FREQUENCY
private const float HEIGHT_OFFSET
bool ExcludeFromContainer_Phase3(Object object_in_cone)
private const float VICINITY_CONE_REACH_DISTANCE
void RefreshVicinityItems()
array< EntityAI > GetVicinityItems()
bool ExcludeFromContainer_Phase2(Object object_in_radius)
private ref array< CargoBase > m_VicinityCargos
static VicinityItemManager GetInstance()
private const float CONE_HEIGHT_MAX
void AddVicinityItems(Object object)
private const float VICINITY_CONE_DISTANCE
void AddVicinityCargos(CargoBase object)
private const string CE_CENTER
private const float VICINITY_LARGE_ACTOR_DISTANCE
bool ExcludeFromContainer_Phase1(Object actor_in_radius)
private const float VICINITY_CONE_ANGLE
void Update(float delta_time)
private const float VICINITY_DISTANCE
static private ref VicinityItemManager s_Instance
array< CargoBase > GetVicinityCargos()
private const float VICINITY_ACTOR_DISTANCE
private float m_RefreshCounter
private const float VICINITY_CONE_RADIANS
void ResetRefreshCounter()
private ref array< EntityAI > m_VicinityItems
bool CanIgnoreDistanceCheck(EntityAI entity_ai)
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
proto float Normalize()
Normalizes vector. Returns length.
static proto native float DistanceSq(vector v1, vector v2)
Returns the square distance between tips of two 3D vectors.
proto vector VectorToAngles()
Converts vector to spherical coordinates with radius = 1.
static float Dot(vector v1, vector v2)
Returns Dot product of vector v1 and vector v2.
const int INDEX_NOT_FOUND
proto native CGame GetGame()
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
static proto float Cos(float angle)
Returns cosinus of angle in radians.
static const float PI_HALF
static const float DEG2RAD
static proto float Sin(float angle)
Returns sinus of angle in radians.