VR-Forces 5.0.2 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Hostility Manager

The Hostility Manager (DtHostilityManager, in hostilityManager.h) is a single, centralized manager owned by the Simulation Manager.

It keeps track of hostility relationships between different forces. Each force can be hostile to any of the other forces. However, the relationships are not reciprocal. For example, Force A could be hostile toward Force B without Force B being hostile to Force A.

Force hostility is used for simulation object detection and target selection. By default, sensors only detect targets toward which their parent simulation object is hostile. Similary, only hostile simulation objects are selected as targets.

By default, Force Friendly and Force Opposing are mutually hostile to each other. You can change the default hostility relationships by editing the forceHostilty.mtl file for the simulation model set you are using (for example, ./data/simulationModelSets/<model_set>/forceHostilty.mtl). You can change force hostility during runtime. The settings are saved as part of the scenario. The hostility loaded with a scenario overrides the hostility loaded by the simulation model set's hostility file.

You can access the Hostility Manager from the Simulation Manager using the hostilityManager() member function. The following example sets Force Friendly to be hostile to Force Neutral:

simManager()->hostilityManager()->setHostility(DtForceFriendly, DtForceNeutral, true);

Document ID: Generated on Sun Dec 4 20:22:03 EST 2022 from SVN revision 249613
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)