![]() |
MAK Legion 1.1 API Documentation
|
Contains the simple take example for Legion ownership acquisition. More...
Functions | |
| const std::string | theName ("take") |
| std::string | thePrivateData ("#Test Private Data#") |
| Legion::Span< char > | thePrivateDataSpan (thePrivateData.c_str(), thePrivateData.length()) |
| void | processArgumentsAndConfiguration (int argc, char *argv[], Legion::Configuration &configuration) |
| void | setMinMaxBoundary (Legion::BoundarySpatialPlanar &boundary, float minX, float minY, float maxX, float maxY) |
| void | checkConsoleCommands (MAK::DtCommandParser &commandInput) |
| void | requestOwnership (Legion::OwnershipManager *ownershipManager, const LOM::ReadEntityRepository &entityToAcquire) |
| void | processOwnershipAcquisitionRejected (Legion::TransactionIdentifier transactionId, Legion::Span< Legion::GlobalIdentifier > globalIds, Legion::Span< char > privateData) |
| void | processOwnershipAcquired (Legion::TransactionIdentifier transactionId, Legion::Span< Legion::GlobalIdentifier > globalIds, Legion::Span< char > privateData) |
| const std::string & | getPrivateData (Legion::Span< char > privateData) |
| int | main (int argc, char *argv[]) |
Variables | |
| std::string | theConfigFile = "legionExamples.lua" |
| float | theFrameRate = 10.0 |
| float | theReferenceLatitude = 0.0 |
| float | theReferenceLongitude = 0.0 |
| Legion::SimulationDatabase * | theSimDatabase = nullptr |
| LOM::EntityTypeView * | theEntityView = nullptr |
| LOM::WriteEntityRepository | theAcquiredEntity |
| Legion::TransactionIdentifier | theOwnershipTransactionId = 0 |
| bool | theDoRequestAcquisition = false |
| bool | theDoAcquireOwnership = false |
| bool | theDoDestroy = false |
Contains the simple take example for Legion ownership acquisition.
To start, no entity is simulated. The invocation of a requestAcquisition service is manually triggered via the command prompt (pressing the 't' key). The request is not made unless 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 can be initiated. A simulating entity may be preemptively destroyed by pressing the 'd' key.
| void checkConsoleCommands | ( | MAK::DtCommandParser & | commandInput | ) |
Referenced by main().
| const std::string& getPrivateData | ( | Legion::Span< char > | privateData | ) |
| int main | ( | int | argc, |
| char * | argv[] | ||
| ) |
References Legion::OwnershipManager::addAcquiredCallback(), Legion::OwnershipManager::addRequestRejectedCallback(), Legion::SimulationDatabase::beginFrame(), checkConsoleCommands(), Legion::ViewManager::createView(), Legion::SimulationDatabase::destroyInstance(), Legion::ViewManager::destroyView(), Legion::SimulationDatabase::endFrame(), Legion::Connection::isConnected(), Legion::Connection::ownershipManager(), processArgumentsAndConfiguration(), processOwnershipAcquired(), processOwnershipAcquisitionRejected(), Legion::Remote, requestOwnership(), Legion::Connection::setIntent(), Legion::Connection::setInterest(), setMinMaxBoundary(), Legion::Connection::startProcessingMessages(), theFrameRate, theName(), theReferenceLatitude, theReferenceLongitude, theSimDatabase, Legion::SimulationDatabase::viewManager(), Legion::Connection::waitUntilDoneProcessingMessages(), Legion::Vector3d::x, Legion::Vector3d::y, and Legion::Vector3d::z.
| void processArgumentsAndConfiguration | ( | int | argc, |
| char * | argv[], | ||
| Legion::Configuration & | configuration | ||
| ) |
| void processOwnershipAcquired | ( | Legion::TransactionIdentifier | transactionId, |
| Legion::Span< Legion::GlobalIdentifier > | globalIds, | ||
| Legion::Span< char > | privateData | ||
| ) |
References Legion::SimulationDatabase::findInstance(), getPrivateData(), and Legion::Span< DATA_TYPE >::size().
Referenced by main().
| void processOwnershipAcquisitionRejected | ( | Legion::TransactionIdentifier | transactionId, |
| Legion::Span< Legion::GlobalIdentifier > | globalIds, | ||
| Legion::Span< char > | privateData | ||
| ) |
Referenced by main().
| void requestOwnership | ( | Legion::OwnershipManager * | ownershipManager, |
| const LOM::ReadEntityRepository & | entityToAcquire | ||
| ) |
References Legion::OwnershipManager::requestAcquisition(), and thePrivateDataSpan().
Referenced by main().
| void setMinMaxBoundary | ( | Legion::BoundarySpatialPlanar & | boundary, |
| float | minX, | ||
| float | minY, | ||
| float | maxX, | ||
| float | maxY | ||
| ) |
| const std::string theName | ( | "take" | ) |
| std::string thePrivateData | ( | "#Test Private Data#" | ) |
| Legion::Span<char> thePrivateDataSpan | ( | thePrivateData. | c_str(), |
| thePrivateData. | length() | ||
| ) |
Referenced by requestOwnership().
| LOM::WriteEntityRepository theAcquiredEntity |
| std::string theConfigFile = "legionExamples.lua" |
| bool theDoAcquireOwnership = false |
| bool theDoDestroy = false |
| bool theDoRequestAcquisition = false |
| LOM::EntityTypeView* theEntityView = nullptr |
| float theFrameRate = 10.0 |
| Legion::TransactionIdentifier theOwnershipTransactionId = 0 |
| float theReferenceLatitude = 0.0 |
| float theReferenceLongitude = 0.0 |
| Legion::SimulationDatabase* theSimDatabase = nullptr |
Referenced by main().