Please ask us for support!
In the Yoda directory is an example for a realtime-effects readout-application located.This exemple is as a Delphi Code and as a C++ Code available.With this application you could use Yoda to send data to your own coded simulator control software or interface.
The applied structure for the DLL transfer is:
struct Export
{
bool aktiv[40];
bool play[40];
int data[40];
int type[40];
};
'active' -indicates, if the effect was recognized, or not.
'play' -indicates, if the effect is played at the moment (green play symbol in yoda).
'data' -contains the directx value (magnitude) that can be used for further calculations.
'type' -contais the information about the type of effect (constant force, dumper, etc.) that can be gleaned out in the export area. The listed types there are equivalent to this value.
To use the code functions of the DLL later, you have to declare them above:
// Define the dll funktion "GetExport"
typedef Export (*TmyFunc1) (void);
TmyFunc1 GetExport = NULL;
// Define the dll funktion "EndYoda"
typedef bool (*TmyFunc2) (int info);
TmyFunc2 EndYoda = NULL;
// Set DLL handle
HINSTANCE hDLL;
After that, the DLL can be loaded as usual and the functions can be linked:
// Load the buffer DLL in same Directory or insert here other location.
hDLL = LoadLibrary (".\\buffer.dll");
if (hDLL == NULL){MessageBox("error while loading buffer.dll");}
// Get the API funktion "GetExport" from the DLL
GetExport = (TmyFunc1) GetProcAddress (hDLL, "GetExport");
// Get the API funktion "EndYoda" from the DLL
EndYoda = (TmyFunc2) GetProcAddress (hDLL, "EndYoda");
The structure can be loaded with Export Result = GetExport (); to use the extracted effects in your code.The recommended refresh rate is 190ms, because yoda is not faster.
The values are not calibrated to e.g 1G. They have to be calibrated manually for each game. This is handled by the Force-Profiler in the x-sim package. Whereas the Force-Sender just contains to code above, to be able to send the data via the network.
It is seldom, that a (value) magnitude shows the effective direction. But these could be exported and be calculated into the 3 dimensional space, likewise.
Have fun with this gimmick... and please ask us for support translated by egoexpress
|
|
Last Updated ( Tuesday, 09 January 2007 )
|