.doc/ext/reflex/shape.cpp in reflexion-0.1.32 vs .doc/ext/reflex/shape.cpp in reflexion-0.1.33
- old
+ new
@@ -104,47 +104,24 @@
CHECK;
return value(THIS->is_sensor());
}
static
-VALUE set_category_bits(VALUE self, VALUE bits)
+VALUE on_draw(VALUE self, VALUE event)
{
CHECK;
- THIS->set_category_bits(to<uint>(bits));
- return bits;
+ CALL(on_draw(to<Reflex::DrawEvent*>(event)));
}
static
-VALUE get_category_bits(VALUE self)
+VALUE will_contact(VALUE self, VALUE shape)
{
CHECK;
- return value(THIS->category_bits());
+ return value(CALL(will_contact(to<Reflex::Shape*>(shape))));
}
static
-VALUE set_collision_mask(VALUE self, VALUE mask)
-{
- CHECK;
- THIS->set_collision_mask(to<uint>(mask));
- return mask;
-}
-
-static
-VALUE get_collision_mask(VALUE self)
-{
- CHECK;
- return value(THIS->collision_mask());
-}
-
-static
-VALUE on_draw(VALUE self, VALUE event)
-{
- CHECK;
- CALL(on_draw(to<Reflex::DrawEvent*>(event)));
-}
-
-static
VALUE on_contact(VALUE self, VALUE event)
{
CHECK;
CALL(on_contact(to<Reflex::ContactEvent*>(event)));
}
@@ -182,14 +159,11 @@
rb_define_method(cShape, "friction", RUBY_METHOD_FUNC(get_friction), 0);
rb_define_method(cShape, "restitution=", RUBY_METHOD_FUNC(set_restitution), 1);
rb_define_method(cShape, "restitution", RUBY_METHOD_FUNC(get_restitution), 0);
rb_define_method(cShape, "sensor=", RUBY_METHOD_FUNC(set_sensor), 1);
rb_define_method(cShape, "sensor", RUBY_METHOD_FUNC(is_sensor), 0);
- rb_define_method(cShape, "category_bits=", RUBY_METHOD_FUNC(set_category_bits), 1);
- rb_define_method(cShape, "category_bits", RUBY_METHOD_FUNC(get_category_bits), 0);
- rb_define_method(cShape, "collision_mask=", RUBY_METHOD_FUNC(set_collision_mask), 1);
- rb_define_method(cShape, "collision_mask", RUBY_METHOD_FUNC(get_collision_mask), 0);
rb_define_method(cShape, "on_draw", RUBY_METHOD_FUNC(on_draw), 1);
+ cShape.define_method( "will_contact?", will_contact);
cShape.define_private_method("call_contact!", on_contact);
cShape.define_private_method("call_contact_begin!", on_contact_begin);
cShape.define_private_method("call_contact_end!", on_contact_end);
define_selector_methods<Reflex::Shape>(cShape);