예제 #1
0
static VALUE Drawable_get_rightVector(VALUE vSelf) {
	// Get C++ object pointer from vSelf
	Drawable *pSelf;
	Data_Get_Struct(vSelf, Drawable, pSelf);
	float f = pSelf->GetRotation() * (PI/180.0f);
	VALUE v = rb_ary_new();
	rb_ary_push(v, rb_float_new(COSF(f)));
	rb_ary_push(v, rb_float_new(-SINF(f)));
	return v;
}
예제 #2
0
static VALUE Drawable_get_rotation(VALUE vSelf) {
	// Get C++ object pointer from vSelf
	Drawable *pSelf;
	Data_Get_Struct(vSelf, Drawable, pSelf);
	return rb_float_new(pSelf->GetRotation());
}
예제 #3
0
static VALUE Drawable_to_s(VALUE vSelf) {
	// Get C++ object pointer from vSelf
	Drawable *pSelf;
	Data_Get_Struct(vSelf, Drawable, pSelf);
	char szBuffer[256];
	sprintf(szBuffer, "Left=%f, Top=%f, Scale=[%f,%f], Rotation=%f", pSelf->GetLeft(), pSelf->GetTop(), pSelf->GetScaleX(), pSelf->GetScaleX(), pSelf->GetRotation());
	return rb_str_new2(szBuffer);
}