Arma Reforger Script API
Loading...
Searching...
No Matches
SCR_AIMovementDetector Interface Reference

This class is a state machine which estimates if entity is currently moving or is stopped. More...

Public Member Functions

void SCR_AIMovementDetector (IEntity myEntity)
 
bool GetMoving ()
 Returns current state, and updates it in lazy manner, not more often than once per UPDATE_INTERVAL_S.
 

Protected Member Functions

void Update (WorldTimestamp worldTime)
 

Protected Attributes

vector m_vPrevPos
 
vector m_vPosStopped
 
IEntity m_OwnerEntity
 
WorldTimestamp m_TimeLastStopped
 
WorldTimestamp m_TimeLastMoved
 
WorldTimestamp m_TimeLastUpdate
 
bool m_bMoving
 

Static Protected Attributes

static const float STOPPED_RADIUS = 6
 
static const float STOPPED_RADIUS_SQ = STOPPED_RADIUS * STOPPED_RADIUS
 
static const float TIME_STOPPED_S = 0.7
 
static const float TIME_MOVING_S = 0.17
 
static const float UPDATE_INTERVAL_S = 0.2
 

Detailed Description

This class is a state machine which estimates if entity is currently moving or is stopped.

Main goal is to determine if player, as infantry group leader, intends to move, or intends to stay around same place. But it is used for AI squad leaders same way.

Constructor & Destructor Documentation

◆ SCR_AIMovementDetector()

void SCR_AIMovementDetector.SCR_AIMovementDetector ( IEntity myEntity)

Member Function Documentation

◆ GetMoving()

bool SCR_AIMovementDetector.GetMoving ( )

Returns current state, and updates it in lazy manner, not more often than once per UPDATE_INTERVAL_S.

◆ Update()

void SCR_AIMovementDetector.Update ( WorldTimestamp worldTime)
protected

Member Data Documentation

◆ m_bMoving

bool SCR_AIMovementDetector.m_bMoving
protected

◆ m_OwnerEntity

IEntity SCR_AIMovementDetector.m_OwnerEntity
protected

◆ m_TimeLastMoved

WorldTimestamp SCR_AIMovementDetector.m_TimeLastMoved
protected

◆ m_TimeLastStopped

WorldTimestamp SCR_AIMovementDetector.m_TimeLastStopped
protected

◆ m_TimeLastUpdate

WorldTimestamp SCR_AIMovementDetector.m_TimeLastUpdate
protected

◆ m_vPosStopped

vector SCR_AIMovementDetector.m_vPosStopped
protected

◆ m_vPrevPos

vector SCR_AIMovementDetector.m_vPrevPos
protected

◆ STOPPED_RADIUS

const float SCR_AIMovementDetector.STOPPED_RADIUS = 6
staticprotected

◆ STOPPED_RADIUS_SQ

const float SCR_AIMovementDetector.STOPPED_RADIUS_SQ = STOPPED_RADIUS * STOPPED_RADIUS
staticprotected

◆ TIME_MOVING_S

const float SCR_AIMovementDetector.TIME_MOVING_S = 0.17
staticprotected

◆ TIME_STOPPED_S

const float SCR_AIMovementDetector.TIME_STOPPED_S = 0.7
staticprotected

◆ UPDATE_INTERVAL_S

const float SCR_AIMovementDetector.UPDATE_INTERVAL_S = 0.2
staticprotected

The documentation for this interface was generated from the following file: