struct IEntityAreaProxy : public IEntityProxy { enum EAreaProxyFlags { FLAG_NOT_UPDATE_AREA = BIT(1), FLAG_NOT_SERIALIZE = BIT(2) }; };
IEntityProxy.h
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.
enum EAreaProxyFlags { FLAG_NOT_UPDATE_AREA = BIT(1), FLAG_NOT_SERIALIZE = BIT(2) };
IEntityProxy.h
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 |
virtual void AddConvexHullToSolid(const Vec3* verticesOfConvexHull, bool bObstruction, int numberOfVertices) = 0;
Add a convexhull to a solid. This function have to be called after calling BeginSettingSolid()
virtual void AddEntity(EntityGUID guid) = 0;
Add target entity to the area. When someone enters/leaves an area, it will send ENTERAREA,LEAVEAREA,AREAFADE, events to these target entities.
virtual void AddEntity(EntityId id) = 0;
Add target entity to the area. When someone enters/leaves an area, it will send ENTERAREA,LEAVEAREA,AREAFADE, events to these target entities.
virtual void BeginSettingSolid(const Matrix34& worldTM) = 0;
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.
virtual float CalcPointNearDistSq(EntityId const nEntityID, Vec3 const& Point3d, Vec3& OnHull3d) = 0;
computes and returned squared distance to a point which is outside OnHull3d is the closest point on the hull of the area
virtual bool CalcPointWithin(EntityId const nEntityID, Vec3 const& Point3d, bool const bIgnoreHeight = false) const = 0;
checks if a given point is inside the area ignoring the height speeds up the check
virtual void ClearEntities() = 0;
Removes all added target entities.
virtual float ClosestPointOnHullDistSq(EntityId const nEntityID, Vec3 const& Point3d, Vec3& OnHull3d) = 0;
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
virtual void EndSettingSolid() = 0;
Finish setting a solid geometry. Generally the BSPTree based on convexhulls which is set before is created in this function.
virtual EEntityAreaType GetAreaType() const = 0;
Retrieve area type. Return: One of EEntityAreaType enumerated types.
virtual void GetBox(Vec3& min, Vec3& max) = 0;
Retrieve min and max in local space of area box.
virtual int GetFlags() = 0;
Area flags.
virtual int GetGroup() const = 0;
Retrieve area group id.
virtual float GetHeight() = 0;
Retrieve shape area height, if height is 0 area is 2D.
virtual int GetID() const = 0;
Retrieve area ID.
virtual const Vec3* GetPoints() = 0;
Retrieve array of points for shape area, will return NULL for all other area types.
virtual int GetPointsCount() = 0;
Retrieve number of points for shape area, return 0 if not area type is not shape.
virtual int GetPriority() const = 0;
Retrieve area priority.
virtual float GetProximity() = 0;
Retrieves area proximity.
virtual void GetSphere(Vec3& vCenter, float & fRadius) = 0;
Retrieve center and radius of the sphere area in local space.
virtual void SetBox(const Vec3& min, const Vec3& max, const bool* const pabSoundObstructionSides, size_t const nSideCount) = 0;
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.
virtual void SetFlags(int nAreaProxyFlags) = 0;
virtual void SetGravityVolume(const Vec3 * pPoints, int nNumPoints, float fRadius, float fGravity, bool bDontDisableInvisible, float fFalloff, float fDamping) = 0;
virtual void SetGroup(const int id) = 0;
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).
virtual void SetID(const int id) = 0;
Set area ID, this id will be provided to the script callback OnEnterArea , OnLeaveArea.
virtual void SetPoints(const Vec3* const vPoints, const bool* const pabSoundObstructionSegments, int const nPointsCount, float const fHeight) = 0;
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. |
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.
virtual void SetPriority(const int nPriority) = 0;
Set priority defines the individual priority of an area, Area with same group ideas will depend on which has the higher priority
virtual void SetProximity(float fProximity) = 0;
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.
virtual void SetSoundObstructionOnAreaFace(int unsigned const nFaceIndex, bool const bObstructs) = 0;
Sets sound obstruction depending on area type
virtual void SetSphere(const Vec3& vCenter, float fRadius) = 0;
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.