![]() |
MAK Legion API Documentation
|
Contains the simple give example for Legion ownership divestiture. More...
Functions | |
| DtFilename | theExitFile ("clutterExit.sig") |
| void | parseArgsForConfigFile (int argc, char **argv) |
| void | printHelp (int argc, char **argv, const std::string &helpString) |
| int | main (int argc, char **argv) |
Variables | |
| int | MAX_ENTITY = 10000 |
| int | MAX_GRID = 10000 |
| int | minx = 0 |
| int | miny = 0 |
| int | maxx = MAX_GRID |
| int | maxy = MAX_GRID |
| float | referenceLatitude = 0.0 |
| float | referenceLongitude = 0.0 |
| float | theFramerate = 1.0 |
| float | theFrameTime = 1.0 / theFramerate |
| bool | theToggleForceId = false |
| std::string | theConfigFile = "legionClutter.lua" |
Contains the simple give example for Legion ownership divestiture.
Contains the simple transfer ownership example for Legion ownership acquisition.
Contains the simple take example for Legion ownership acquisition.
Contains the simple listen example for Legion connection.
An entity is created and initialized but not simulated. When an acquisition request is received via callback, the entity is divested and a new entity is created.
There 2 transfer modes - automatic (default) and manual (-m on command line) To start, no entity is simulated. In automatic mode, a request to acquire an entity is made via the requestAcquisition service. The request is not made until there are entities available to be taken. After acquiring an entity via the OwnershipAcquired callback, the entity is simulated to move to a destination. Upon reaching the destination, the entity is destroyed and a new cycle of acquiring and simulating is begun. In manual mode, the invocation of the requestAcquisition service must be manually triggered via the command prompt (pressing the 't' key). A simulating entity may be preemptively destroyed by pressing the 'd' key. Transfer mode can be switched from automatic to manual by pressing the 'm' key and vice versa the 'a' key.
The client can create an entity or attempt to acquire an entity. The following commands allow the user to trigger the operations that perform ownership transfer. Note: the command token is case insensitive. 'c' - create an entity 't' - request ownership 'g' - divest ownership (use after receiving ownership divest request) 'd' - destroy the entity 'a' - make divesting automatic 'm' - make divesting manual (default mode; requires 'g' command)
| int main | ( | int | argc, |
| char ** | argv | ||
| ) |
References Legion::SimulationDatabase::beginFrame(), Legion::Connection::clientId(), Legion::SimulationDatabase::endFrame(), Clutter::SimEngine::finish(), Legion::Configuration::helpString(), Legion::Connection::isConnected(), Clutter::SimEngine::isPaused(), Legion::Configuration::loadParameters(), MAX_ENTITY, maxx, maxy, minx, miny, Legion::Configuration::parameter(), parseArgsForConfigFile(), printHelp(), Legion::Configuration::processArguments(), referenceLatitude, referenceLongitude, Legion::Connection::setIntent(), Legion::Connection::setInterest(), Legion::BoundarySpatialPlanar::setLowerBound(), Legion::Configuration::setParameter(), Legion::BoundarySpatialPlanar::setUpperBound(), Clutter::SimEngine::simTime(), Legion::Connection::startProcessingMessages(), theConfigFile, theExitFile(), theFramerate, theFrameTime, theToggleForceId, Clutter::SimEngine::tick(), Clutter::SimEngine::toggleForceId(), and Legion::Connection::waitUntilDoneProcessingMessages().
| void parseArgsForConfigFile | ( | int | argc, |
| char ** | argv | ||
| ) |
References theConfigFile.
Referenced by main().
| void printHelp | ( | int | argc, |
| char ** | argv, | ||
| const std::string & | helpString | ||
| ) |
References theConfigFile.
Referenced by main().
| DtFilename theExitFile | ( | "clutterExit.sig" | ) |
Referenced by main().
| int MAX_ENTITY = 10000 |
Referenced by main().
| int MAX_GRID = 10000 |
| int minx = 0 |
Referenced by main().
| int miny = 0 |
Referenced by main().
| float referenceLatitude = 0.0 |
Referenced by main().
| float referenceLongitude = 0.0 |
Referenced by main().
| std::string theConfigFile = "legionClutter.lua" |
| float theFramerate = 1.0 |
Referenced by main().
| float theFrameTime = 1.0 / theFramerate |
Referenced by main().
| bool theToggleForceId = false |
Referenced by main().