Sommaire

Scripting




Pseudo-C scripting language

The scripting engine does compile on each platform as a pseudo-C syntax implementation.
The list of the built-in functions that can be called from the script that allows you to program the interactions with 3D data, textures and other data is given in TUTORIAL 9.
Here are some explanation on how to develop this pseudo-C scripts.

       Allowed data types representations:

       (int name):    Integer, 4 bytes
       (float name):    Real, 4 bytes
       (char name):    0..255, 1 byte
       (int name[nb]):    Integer array, nb*4 bytes
       (float name[nb]):    Float array, nb*4 bytes
       (char name[nb]):    Char array, nb bytes
       (char* name):    potential array of char
       (int name[nb][nb2]):    Integer array, nb*nb2*4 bytes
       (float name[nb][nb2]):    Float array, nb*nb2*4 bytes
       (vector name):    Vector, 3 floats fields: x,y,z
       (matrix name):    Matrix, 16 floats fields: (a11,a12,..,a44)




Pseudo Class type functions and definitions

What has been done for main structures in this pseudo-C scripts ?

       Vectors:
         v.Zero();
         v.Init(x0,y0,z0);

       Matrices:
         m.Id();
         m.Rotation(rx,ry,rz);    // radians, 0,0,0 is Id
         m.RotationDegrees(rx,ry,rz);    // degrees, 0,0,0 is Id
         m.Scaling(sx,sy,sz);    // 1,1,1 is Id
         m.Translation(tx,ty,tz);    // 0,0,0 is Id
         m.DirectionX(ux,uy,uz);
         m.DirectionY(ux,uy,uz);
         m.DirectionZ(ux,uy,uz);

       float, int, vector, matrix:
         the operators + - * / are always accessible for each types as a predefined global type
         the operators += -= is defined and optimized for ints and floats
         the operators += -= *= /= is not well defined for vectors and matrix until -3.8.57-

       Structures:
         struct NewDataType
         {
            int
            float
            int name[nb]
            float name[nb]
            vector
            matrix
         };

         // struct NewDataType Array[nb];

         Since 3.8.56, same type fields can be writen on the same definition line.
         Before 3.8.56, each field must be single defined.




Concepts

Fundamentals of the -NED Class- with efficient scripts.

       3 entry points must be defined for the class single script to be validated:
          void OPEN()
          void LOOP()
          void CLOSE()

       128 global variables can be defined
       128 function local variables can be defined even while parsing
       a given function can be parametrized until 16 parameters
       Return values can be "void", "int" or "float"

       A numerous basic variables to access states and counts are defined
       A numerous list of functions to access states and counts, and predefined algorithms are defined

       There is not base for pointer types, except (char*) and even considering access to a variable,
       the name of it can be passed in some efficient functions : "VariableName" or highlighted $VariableName$
       Basically "..." or $...$ is classified as char* in function parameters