For my extension I am using Vector3d to create points for models.
VALUE pt1;
pt1 = rb_ary_new();
rb_ary_push(pt1, INT2FIX(100));
rb_ary_push(pt1, INT2FIX(0));
rb_ary_push(pt1, INT2FIX(0));
return pt1;
I can send an array no problem from c++ to ruby and create a point. I was wondering what is best way to send data from a Vector3d?
I was trying to it this way:
Vector3d vector = Vector3d();
vector.mx = 100;
vector.my = 100;
vector.mz = 0;
VALUE skp_vector, args[3];
args[0] = rb_float_new(vector.mx);
args[1] = rb_float_new(vector.my);
args[2] = rb_float_new(vector.mz);
return skp_vector
But this did not work. Any thoughts?