/* */ static VALUE Vector3_Add( VALUE self, VALUE aRightOperand ) { VALUE rightVector = Vector3_ForceType( aRightOperand ); // Get values VALUE leftX = rb_funcall( self, rb_intern( "x" ), 0 ); VALUE leftY = rb_funcall( self, rb_intern( "y" ), 0 ); VALUE leftZ = rb_funcall( self, rb_intern( "z" ), 0 ); VALUE rightX = rb_funcall( rightVector, rb_intern( "x" ), 0 ); VALUE rightY = rb_funcall( rightVector, rb_intern( "y" ), 0 ); VALUE rightZ = rb_funcall( rightVector, rb_intern( "z" ), 0 ); // Do calculation VALUE newX = rb_funcall( leftX, rb_intern( "+" ), 1, rightX ); VALUE newY = rb_funcall( leftY, rb_intern( "+" ), 1, rightY ); VALUE newZ = rb_funcall( leftZ, rb_intern( "+" ), 1, rightZ ); return rb_funcall( globalVector3Class, rb_intern( "new" ), 2, newX, newY, newZ ); }