reflexion 0.1.46 → 0.1.48

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5a4062ee8d1c690e98c931704ad4391af95561b221f74d86bf2146804c21dbb6
4
- data.tar.gz: 38d64b300b965e19ed14bd0597d40e7740768b4bab2d46d22d8fe470b92b261d
3
+ metadata.gz: f3d0609202b8620c5b7e5390dab43005bd7638529aaf8ea0b70e59f89590776e
4
+ data.tar.gz: 90739081a2547266e5393593524655eca4964e6d6c038655df675eac812a2622
5
5
  SHA512:
6
- metadata.gz: d02f70a9ee4caff213134e85c73fc365de659b0fb41e56d28cbd6b276e3e0102e1c83fef7836fdfb879c6d06f03a61950162d7ef72fcf958a34653abf205b904
7
- data.tar.gz: 10024ed109e6a4992c42bc2882c7ffc9d2cecd7a356fb223b22aa05fe49a2678529a7e6f366d6370759663831435449668a3115b359c20e165a8eb51677f2f7b
6
+ metadata.gz: 58cc9b938687a48640c9874ac9267fa9937012656350d378c55175a3b6cb229562535e48ffb4136c81927c32aca913c9c2ab55bc300e8ab11a78d7cb2d2dad44
7
+ data.tar.gz: 3fe06d4cbfcecd5c61caa472d6ab8598335cb78dcb19ae8a3b16f84c2392bd341313ba6ae67dbd0196804668e532a13f0a3d75ab657030d2be528efab2c773b5
@@ -76,6 +76,7 @@ Init_reflex_contact_event ()
76
76
  rb_define_method(cContactEvent, "action", RUBY_METHOD_FUNC(get_action), 0);
77
77
  rb_define_method(cContactEvent, "shape", RUBY_METHOD_FUNC(get_shape), 0);
78
78
  rb_define_method(cContactEvent, "view", RUBY_METHOD_FUNC(get_view), 0);
79
+
79
80
  cContactEvent.define_const("ACTION_NONE", Reflex::ContactEvent::ACTION_NONE);
80
81
  cContactEvent.define_const("BEGIN", Reflex::ContactEvent::BEGIN);
81
82
  cContactEvent.define_const("END", Reflex::ContactEvent::END);
@@ -75,6 +75,7 @@ Init_reflex_focus_event ()
75
75
  rb_define_method(cFocusEvent, "action", RUBY_METHOD_FUNC(get_action), 0);
76
76
  rb_define_method(cFocusEvent, "current", RUBY_METHOD_FUNC(get_current), 0);
77
77
  rb_define_method(cFocusEvent, "last", RUBY_METHOD_FUNC(get_last), 0);
78
+
78
79
  cFocusEvent.define_const("ACTION_NONE", Reflex::FocusEvent::ACTION_NONE);
79
80
  cFocusEvent.define_const("FOCUS", Reflex::FocusEvent::FOCUS);
80
81
  cFocusEvent.define_const("BLUR", Reflex::FocusEvent::BLUR);
@@ -298,6 +298,7 @@ Init_reflex_key_event ()
298
298
  rb_define_method(cKeyEvent, "modifiers", RUBY_METHOD_FUNC(get_modifiers), 0);
299
299
  rb_define_method(cKeyEvent, "repeat", RUBY_METHOD_FUNC(get_repeat), 0);
300
300
  cKeyEvent.define_method("captured?", is_captured);
301
+
301
302
  cKeyEvent.define_const("ACTION_NONE", Reflex::KeyEvent::ACTION_NONE);
302
303
  cKeyEvent.define_const("DOWN", Reflex::KeyEvent::DOWN);
303
304
  cKeyEvent.define_const("UP", Reflex::KeyEvent::UP);
@@ -145,6 +145,7 @@ Init_reflex_pointer ()
145
145
  rb_define_method(cPointer, "time", RUBY_METHOD_FUNC(get_time), 0);
146
146
  rb_define_method(cPointer, "prev", RUBY_METHOD_FUNC(get_prev), 0);
147
147
  rb_define_method(cPointer, "down", RUBY_METHOD_FUNC(get_down), 0);
148
+
148
149
  cPointer.define_const("TYPE_NONE", Reflex::Pointer::TYPE_NONE);
149
150
  cPointer.define_const("MOUSE", Reflex::Pointer::MOUSE);
150
151
  cPointer.define_const("MOUSE_LEFT", Reflex::Pointer::MOUSE_LEFT);
@@ -152,6 +153,7 @@ Init_reflex_pointer ()
152
153
  cPointer.define_const("MOUSE_MIDDLE", Reflex::Pointer::MOUSE_MIDDLE);
153
154
  cPointer.define_const("TOUCH", Reflex::Pointer::TOUCH);
154
155
  cPointer.define_const("PEN", Reflex::Pointer::PEN);
156
+
155
157
  cPointer.define_const("ACTION_NONE", Reflex::Pointer::ACTION_NONE);
156
158
  cPointer.define_const("DOWN", Reflex::Pointer::DOWN);
157
159
  cPointer.define_const("UP", Reflex::Pointer::UP);
data/ChangeLog.md CHANGED
@@ -1,6 +1,16 @@
1
1
  # reflex ChangeLog
2
2
 
3
3
 
4
+ ## [v0.1.48] - 2023-07-10
5
+
6
+ - Fix a problem that a rectangle shape would be split into 2 triangles for physics
7
+
8
+
9
+ ## [v0.1.47] - 2023-06-27
10
+
11
+ - NONE -> TYPE_NONE
12
+
13
+
4
14
  ## [v0.1.46] - 2023-06-22
5
15
 
6
16
  - Use UIScreen's 'nativeScale' instead of 'scale'
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.46
1
+ 0.1.48
@@ -82,6 +82,7 @@ Init_reflex_contact_event ()
82
82
  cContactEvent.define_method("action", get_action);
83
83
  cContactEvent.define_method("shape", get_shape);
84
84
  cContactEvent.define_method("view", get_view);
85
+
85
86
  cContactEvent.define_const("ACTION_NONE", Reflex::ContactEvent::ACTION_NONE);
86
87
  cContactEvent.define_const("BEGIN", Reflex::ContactEvent::BEGIN);
87
88
  cContactEvent.define_const("END", Reflex::ContactEvent::END);
@@ -81,6 +81,7 @@ Init_reflex_focus_event ()
81
81
  cFocusEvent.define_method("action", get_action);
82
82
  cFocusEvent.define_method("current", get_current);
83
83
  cFocusEvent.define_method("last", get_last);
84
+
84
85
  cFocusEvent.define_const("ACTION_NONE", Reflex::FocusEvent::ACTION_NONE);
85
86
  cFocusEvent.define_const("FOCUS", Reflex::FocusEvent::FOCUS);
86
87
  cFocusEvent.define_const("BLUR", Reflex::FocusEvent::BLUR);
@@ -308,6 +308,7 @@ Init_reflex_key_event ()
308
308
  cKeyEvent.define_method("modifiers", get_modifiers);
309
309
  cKeyEvent.define_method("repeat", get_repeat);
310
310
  cKeyEvent.define_method("captured?", is_captured);
311
+
311
312
  cKeyEvent.define_const("ACTION_NONE", Reflex::KeyEvent::ACTION_NONE);
312
313
  cKeyEvent.define_const("DOWN", Reflex::KeyEvent::DOWN);
313
314
  cKeyEvent.define_const("UP", Reflex::KeyEvent::UP);
@@ -159,6 +159,7 @@ Init_reflex_pointer ()
159
159
  cPointer.define_method("time", get_time);
160
160
  cPointer.define_method("prev", get_prev);
161
161
  cPointer.define_method("down", get_down);
162
+
162
163
  cPointer.define_const("TYPE_NONE", Reflex::Pointer::TYPE_NONE);
163
164
  cPointer.define_const("MOUSE", Reflex::Pointer::MOUSE);
164
165
  cPointer.define_const("MOUSE_LEFT", Reflex::Pointer::MOUSE_LEFT);
@@ -166,6 +167,7 @@ Init_reflex_pointer ()
166
167
  cPointer.define_const("MOUSE_MIDDLE", Reflex::Pointer::MOUSE_MIDDLE);
167
168
  cPointer.define_const("TOUCH", Reflex::Pointer::TOUCH);
168
169
  cPointer.define_const("PEN", Reflex::Pointer::PEN);
170
+
169
171
  cPointer.define_const("ACTION_NONE", Reflex::Pointer::ACTION_NONE);
170
172
  cPointer.define_const("DOWN", Reflex::Pointer::DOWN);
171
173
  cPointer.define_const("UP", Reflex::Pointer::UP);
data/reflex.gemspec CHANGED
@@ -27,7 +27,7 @@ Gem::Specification.new do |s|
27
27
 
28
28
  s.add_runtime_dependency 'xot', '~> 0.1.39'
29
29
  s.add_runtime_dependency 'rucy', '~> 0.1.39'
30
- s.add_runtime_dependency 'beeps', '~> 0.1.40'
30
+ s.add_runtime_dependency 'beeps', '~> 0.1.41'
31
31
  s.add_runtime_dependency 'rays', '~> 0.1.43'
32
32
 
33
33
  s.add_development_dependency 'rake'
data/src/shape.cpp CHANGED
@@ -793,6 +793,68 @@ namespace Reflex
793
793
 
794
794
  uint nsegment = 0;
795
795
 
796
+ Fixture* create_fixtures (Shape* shape) override
797
+ {
798
+ if (!has_rounds())
799
+ return create_rect_fixture(shape);
800
+ else if (nsegment <= 1)
801
+ return create_rect_fixture_without_division(shape);
802
+ else
803
+ return Super::create_fixtures(shape);
804
+ }
805
+
806
+ Fixture* create_rect_fixture (Shape* shape)
807
+ {
808
+ assert(shape);
809
+
810
+ if (!owner)
811
+ invalid_state_error(__FILE__, __LINE__);
812
+
813
+ Bounds f = get_frame();
814
+ float ppm = owner->meter2pixel();
815
+
816
+ coord l = to_b2coord(f.x, ppm);
817
+ coord t = to_b2coord(f.y, ppm);
818
+ coord r = to_b2coord(f.x + f.w, ppm);
819
+ coord b = to_b2coord(f.x + f.h, ppm);
820
+ b2Vec2 b2points[] = {{l, t}, {l, b}, {r, b}, {r, t}};
821
+
822
+ b2PolygonShape b2shape;
823
+ b2shape.Set(&b2points[0], 4);
824
+
825
+ return FixtureBuilder(shape, &b2shape).fixtures();
826
+ }
827
+
828
+ Fixture* create_rect_fixture_without_division (Shape* shape)
829
+ {
830
+ assert(shape);
831
+
832
+ if (!owner)
833
+ invalid_state_error(__FILE__, __LINE__);
834
+
835
+ Bounds f = get_frame();
836
+ float ppm = owner->meter2pixel();
837
+
838
+ Polygon polygon = Rays::create_rect(
839
+ f.x, f.y, f.width, f.height,
840
+ round_left_top, round_right_top,
841
+ round_left_bottom, round_right_bottom,
842
+ 1);
843
+ assert(polygon.size() == 1);
844
+
845
+ const Polyline& polyline = polygon[0];
846
+ assert(polyline[0].size() <= 8);
847
+
848
+ b2Vec2 b2points[8];
849
+ for (size_t i = 0; i < polyline.size(); ++i)
850
+ b2points[i] = to_b2vec2(polyline[i], ppm);
851
+
852
+ b2PolygonShape b2shape;
853
+ b2shape.Set(&b2points[0], polyline.size());
854
+
855
+ return FixtureBuilder(shape, &b2shape).fixtures();
856
+ }
857
+
796
858
  Polygon get_polygon_for_shape () const override
797
859
  {
798
860
  return Rays::create_rect(
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: reflexion
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.46
4
+ version: 0.1.48
5
5
  platform: ruby
6
6
  authors:
7
7
  - xordog
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-06-22 00:00:00.000000000 Z
11
+ date: 2023-07-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: xot
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 0.1.40
47
+ version: 0.1.41
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 0.1.40
54
+ version: 0.1.41
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rays
57
57
  requirement: !ruby/object:Gem::Requirement