struct {
int a;
float b;
Vec3D c;
Mat4D d;
} SomeStruct;
var SS_a = 1;
var SS_b = 2;
var SS_c = 3;
var SS_d = 4;
// this is sort of an enum, I use the struct name as a prefix
// to avoid name clashing
var a_struct = new Array();
a_struct[0] = "SomeStruct"; // just doing this internally
a_struct[SS_a] = 15;
a_struct[SS_b] = 3.141259
a_struct[SS_c] = new Vec3D(1,2,3);
a_struct[SS_d] = new Mat4D();
AFunction(a_struct); // use the structure
...
function AFunction(s) {
// instead of s.a, use
print(s[SS_a]);
}
Angelscript offers structures and classes. That's one of the reasons why I think Angelscript will be a excellent scripting language for Cheetah3D.
Bye,
Martin