You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to create a complex global variable in my environment and read it out in the fitness script. It is supposed to represent 4 3D positions, so it must be some sort of 4 by 3 matrix. Is there some nerd.createGlobalProperty thing to do that (and some way to "decode" the data back to usable position vectors, in the fitness script)? So far, I didn't even manage to convert a new Array([...],[...],...) into a string, such that it would pass as a globalDoubleProperty. Shouldn't be a problem, eventually, but isn't there a simpler way?
The text was updated successfully, but these errors were encountered:
Create 12 new double values in the VariableRepository using
nerd.createGlobalDoubleValue() and access these values in the script via
a declaration of nerd.defineVariable(). With this approach, all
variables would be automatically present in the script during each
execution step, which is comparably efficient. See http://www.ultopia.de/drupal/nerddoc/node/76#defVar
Create four string values to represent the position vectors as
string. You may use the helper function nerd.toVector3DString() to set
the values and nerd.getVectorElement(string vectorString, int index). Or
you could write your own helper scripts to read and write the string
representation of your own vector or matrix string. See http://www.ultopia.de/drupal/nerddoc/node/76#HelperFunctions.
Implement a new function to class ScriptingContext, e.g. bool
createGlobalVector3DProperty(const QString &propertyName, double x,
double y, double z); That function should be implemented similar to bool
createGlobalDoubleProperty(const QString &propertyName, double content =
0.0);
Hope this helps.
On 03/11/2014 06:12 PM, zflo wrote:
I would like to create a complex global variable in my environment and
read it out in the fitness script. It is supposed to represent 4 3D
positions, so it must be some sort of 4 by 3 matrix. Is there some
|nerd.createGlobalProperty| thing to do that (and some way to "decode"
the data back to usable position vectors, in the fitness script)? So
far, I didn't even manage to convert a |new Array([...],[...],...)|
into a string, such that it would pass as a globalDoubleProperty.
Shouldn't be a problem, eventually, but isn't there a simpler way?
—
Reply to this email directly or view it on GitHub #35.
I would like to create a complex global variable in my environment and read it out in the fitness script. It is supposed to represent 4 3D positions, so it must be some sort of 4 by 3 matrix. Is there some
nerd.createGlobalProperty
thing to do that (and some way to "decode" the data back to usable position vectors, in the fitness script)? So far, I didn't even manage to convert anew Array([...],[...],...)
into a string, such that it would pass as a globalDoubleProperty. Shouldn't be a problem, eventually, but isn't there a simpler way?The text was updated successfully, but these errors were encountered: