IEntityAreaProxy

C++
struct IEntityAreaProxy : public IEntityProxy {
  enum EAreaProxyFlags {
    FLAG_NOT_UPDATE_AREA = BIT(1),
    FLAG_NOT_SERIALIZE = BIT(2)
  };
};
File

IEntityProxy.h

Description

Area proxy allow for entity to host an area trigger. Area can be shape, box or sphere, when marked entities cross this area border, it will send ENTITY_EVENT_ENTERAREA,ENTITY_EVENT_LEAVEAREA,ENTITY_EVENT_AREAFADE, events to the target entities.

IEntityAreaProxy::EAreaProxyFlags Enumeration
C++
enum EAreaProxyFlags {
  FLAG_NOT_UPDATE_AREA = BIT(1),
  FLAG_NOT_SERIALIZE = BIT(2)
};
File

IEntityProxy.h

Members
Members
Description
FLAG_NOT_UPDATE_AREA = BIT(1)
When set points in the area will not be updated.
FLAG_NOT_SERIALIZE = BIT(2)
Areas with this flag will not be serialized
IEntityAreaProxy::AddConvexHullToSolid Method
C++
virtual void AddConvexHullToSolid(const Vec3* verticesOfConvexHull, bool bObstruction, int numberOfVertices) = 0;
Description

Add a convexhull to a solid. This function have to be called after calling BeginSettingSolid()

See Also
IEntityAreaProxy::AddEntity Method (EntityGUID)
C++
virtual void AddEntity(EntityGUID guid) = 0;
Description

Add target entity to the area. When someone enters/leaves an area, it will send ENTERAREA,LEAVEAREA,AREAFADE, events to these target entities.

See Also
IEntityAreaProxy::AddEntity Method (EntityId)
C++
virtual void AddEntity(EntityId id) = 0;
Description

Add target entity to the area. When someone enters/leaves an area, it will send ENTERAREA,LEAVEAREA,AREAFADE, events to these target entities.

See Also
IEntityAreaProxy::BeginSettingSolid Method
C++
virtual void BeginSettingSolid(const Matrix34& worldTM) = 0;
Description

This function need to be called before setting convexhulls for a AreaSolid, And then AddConvexHullSolid() function is called as the number of convexhulls consisting of a geometry.

See Also
IEntityAreaProxy::CalcPointNearDistSq Method
C++
virtual float CalcPointNearDistSq(EntityId const nEntityID, Vec3 const& Point3d, Vec3& OnHull3d) = 0;
Description

computes and returned squared distance to a point which is outside OnHull3d is the closest point on the hull of the area

IEntityAreaProxy::CalcPointWithin Method
C++
virtual bool CalcPointWithin(EntityId const nEntityID, Vec3 const& Point3d, bool const bIgnoreHeight = false) const = 0;
Description

checks if a given point is inside the area ignoring the height speeds up the check

IEntityAreaProxy::ClearEntities Method
C++
virtual void ClearEntities() = 0;
Description

Removes all added target entities.

See Also
IEntityAreaProxy::ClosestPointOnHullDistSq Method
C++
virtual float ClosestPointOnHullDistSq(EntityId const nEntityID, Vec3 const& Point3d, Vec3& OnHull3d) = 0;
Description

computes and returned squared distance from a point to the hull of the area OnHull3d is the closest point on the hull of the area This function is not sensitive of if the point is inside or outside the area

IEntityAreaProxy::EndSettingSolid Method
C++
virtual void EndSettingSolid() = 0;
Description

Finish setting a solid geometry. Generally the BSPTree based on convexhulls which is set before is created in this function.

See Also
IEntityAreaProxy::GetAreaType Method
C++
virtual EEntityAreaType GetAreaType() const = 0;
Description

Retrieve area type. Return: One of EEntityAreaType enumerated types.

IEntityAreaProxy::GetBox Method
C++
virtual void GetBox(Vec3& min, Vec3& max) = 0;
Description

Retrieve min and max in local space of area box.

See Also
IEntityAreaProxy::GetFlags Method
C++
virtual int GetFlags() = 0;
Description

Area flags.

IEntityAreaProxy::GetGroup Method
C++
virtual int GetGroup() const = 0;
Description

Retrieve area group id.

See Also
IEntityAreaProxy::GetHeight Method
C++
virtual float GetHeight() = 0;
Description

Retrieve shape area height, if height is 0 area is 2D.

See Also
IEntityAreaProxy::GetID Method
C++
virtual int GetID() const = 0;
Description

Retrieve area ID.

See Also
IEntityAreaProxy::GetPoints Method
C++
virtual const Vec3* GetPoints() = 0;
Description

Retrieve array of points for shape area, will return NULL for all other area types.

See Also
IEntityAreaProxy::GetPointsCount Method
C++
virtual int GetPointsCount() = 0;
Description

Retrieve number of points for shape area, return 0 if not area type is not shape.

See Also
IEntityAreaProxy::GetPriority Method
C++
virtual int GetPriority() const = 0;
Description

Retrieve area priority.

See Also
IEntityAreaProxy::GetProximity Method
C++
virtual float GetProximity() = 0;
Description

Retrieves area proximity.

See Also
IEntityAreaProxy::GetSphere Method
C++
virtual void GetSphere(Vec3& vCenter, float & fRadius) = 0;
Description

Retrieve center and radius of the sphere area in local space.

See Also
IEntityAreaProxy::SetBox Method
C++
virtual void SetBox(const Vec3& min, const Vec3& max, const bool* const pabSoundObstructionSides, size_t const nSideCount) = 0;
Description

Sets area to be a Box, min and max must be in local entity space. Host entity orientation will define the actual world position and orientation of area box.

See Also
IEntityAreaProxy::SetFlags Method
C++
virtual void SetFlags(int nAreaProxyFlags) = 0;
IEntityAreaProxy::SetGravityVolume Method
C++
virtual void SetGravityVolume(const Vec3 * pPoints, int nNumPoints, float fRadius, float fGravity, bool bDontDisableInvisible, float fFalloff, float fDamping) = 0;
IEntityAreaProxy::SetGroup Method
C++
virtual void SetGroup(const int id) = 0;
Description

Set area group id, areas with same group id act as an exclusive areas, If 2 areas with same group id overlap, entity will be considered in the most internal area (closest to entity).

See Also
IEntityAreaProxy::SetID Method
C++
virtual void SetID(const int id) = 0;
Description

Set area ID, this id will be provided to the script callback OnEnterArea , OnLeaveArea.

See Also
IEntityAreaProxy::SetPoints Method
C++
virtual void SetPoints(const Vec3* const vPoints, const bool* const pabSoundObstructionSegments, int const nPointsCount, float const fHeight) = 0;
Parameters
Parameters
Description
const Vec3* const vPoints
Array of 3D vectors defining shape vertices.
float const fHeight
Height of the shape .
vObstructSound
Array of corresponding booleans that indicate sound obstruction
nPoints
Number of vertices in vPoints array.
Description

Sets area to be a shape, and assign points to this shape. Points are specified in local entity space, shape will always be constructed in XY plane, lowest Z of specified points will be used as a base Z plane. If fHeight parameter is 0, shape will be considered 2D shape, and during intersection Z will be ignored If fHeight is not zero shape will be considered 3D and will accept intersection within vertical range from baseZ to baseZ+fHeight.

See Also
IEntityAreaProxy::SetPriority Method
C++
virtual void SetPriority(const int nPriority) = 0;
Description

Set priority defines the individual priority of an area, Area with same group ideas will depend on which has the higher priority

See Also
IEntityAreaProxy::SetProximity Method
C++
virtual void SetProximity(float fProximity) = 0;
Description

Set area proximity region near the border. When someone is moving within this proximity region from the area outside border Area will generate ENTITY_EVENT_AREAFADE event to the target entity, with a fade ratio from 0, to 1. Where 0 will be at he area outside border, and 1 inside the area in distance fProximity from the outside area border.

See Also
IEntityAreaProxy::SetSoundObstructionOnAreaFace Method
C++
virtual void SetSoundObstructionOnAreaFace(int unsigned const nFaceIndex, bool const bObstructs) = 0;
Description

Sets sound obstruction depending on area type

IEntityAreaProxy::SetSphere Method
C++
virtual void SetSphere(const Vec3& vCenter, float fRadius) = 0;
Description

Sets area to be a Sphere, center and radius must be specified in local entity space. Host entity world position will define the actual world position of the area sphere.

See Also