IMS2
Pre-Alpha
An Orbiter add-on to allow on-runtime construction of spacecraft from predefined modules
|
Defines an arbitrary amount of animations as a module function. More...
Public Member Functions | |
bool | LoadFromFile (string configfile, IMSFILE cfg) |
Loads the data from config file. More... | |
Public Member Functions inherited from IMS_ModuleFunctionData_Base | |
virtual bool | HasGui () |
This function serves to check whether a module function has a GUI before creating it. More... | |
FUNCTIONTYPE | GetType () |
string | GetName () |
Private Member Functions | |
ANIMATIONDATA | loadAnimation (string id, IMSFILE cfg) |
ANIMCOMPONENTDATA | loadAnimComponent (IMSFILE cfg) |
bool | processConfigLine (vector< string > &tokens) |
Receives all lines of the config file that concern this ModuleFunction one by one. More... | |
bool | validateData (string configfile) |
Validates the data for completeness after loading. More... | |
Private Attributes | |
vector< ANIMATIONDATA > | animations |
Friends | |
class | IMS_ModuleFunction_Animation |
Additional Inherited Members | |
Protected Attributes inherited from IMS_ModuleFunctionData_Base | |
FUNCTIONTYPE | type |
Stores the type of the ModuleFunction. | |
string | name = "" |
Stores the Name of the ModuleFunction. | |
Defines an arbitrary amount of animations as a module function.
Note that all parts of this animation must be contained in and limited to the specific module it is declared in!
IMS2 handles animations as part of a module function just like any other module function. Contrary to other module functions, though, an animation module function has no purpose unless the animations inside it are referenced by other module functions in the same module. As a result, an animation module function usually consists of several animations, which again consist of several animation components. These components generally use the same data that is used by orbiter itself and provides a syntax familiar to SC3 ini files.
Some animations may depend on another animation in this module. For example, a module that has two folded up antennas might have them folded in a way that one antena is folded on top of the other, ergo the other can't deploy unless the first one is deployed, while the first one cannot fold up unless the other one is folded up. An arbitrary number of dependencies can be defined for any animation.
Animation components work practically the same to how they work in orbiter or in SC3. As such, it is highly recommended to read up on animations in the orbiter API guide (not the code, but the concepts).
|
virtual |
Loads the data from config file.
configfile | The name of the config file |
cfg | The config file itself, wrapped in an IMSFILE structure for oapi independency |
Reimplemented from IMS_ModuleFunctionData_Base.
|
inlineprivatevirtual |
Receives all lines of the config file that concern this ModuleFunction one by one.
Overload this function to receive the relevant data of your module.
tokens | a vector of strings that contains the individual parts of the line, delimited by whitespace or '=' |
Implements IMS_ModuleFunctionData_Base.
|
inlineprivatevirtual |
Validates the data for completeness after loading.
Implement this function to validate your data at the end of the loading process. Check if everything's there that needs to be, and write log messages if it isn't.
configfile | The name of the configfile, so you can add it to your messages so config writers find their mistakes faster. |
Implements IMS_ModuleFunctionData_Base.