reflexion 0.1.34 → 0.1.36
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.doc/ext/reflex/frame_event.cpp +27 -2
- data/.doc/ext/reflex/view.cpp +25 -0
- data/.github/workflows/utils.rb +2 -1
- data/ChangeLog.md +15 -0
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/ext/reflex/extconf.rb +0 -3
- data/ext/reflex/frame_event.cpp +33 -5
- data/ext/reflex/view.cpp +28 -0
- data/include/reflex/event.h +10 -2
- data/include/reflex/ruby/view.h +9 -0
- data/include/reflex/view.h +12 -4
- data/lib/reflex/application.rb +2 -3
- data/lib/reflex/autoinit.rb +0 -3
- data/lib/reflex/bitmap.rb +0 -3
- data/lib/reflex/bounds.rb +0 -3
- data/lib/reflex/button.rb +0 -3
- data/lib/reflex/camera.rb +0 -3
- data/lib/reflex/capture_event.rb +0 -3
- data/lib/reflex/color.rb +0 -3
- data/lib/reflex/color_space.rb +0 -3
- data/lib/reflex/contact_event.rb +0 -3
- data/lib/reflex/draw_event.rb +0 -3
- data/lib/reflex/ellipse_shape.rb +0 -3
- data/lib/reflex/ext.rb +0 -3
- data/lib/reflex/extension.rb +0 -3
- data/lib/reflex/filter.rb +0 -3
- data/lib/reflex/fixture.rb +0 -3
- data/lib/reflex/focus_event.rb +0 -3
- data/lib/reflex/font.rb +0 -3
- data/lib/reflex/frame_event.rb +2 -4
- data/lib/reflex/helper.rb +0 -3
- data/lib/reflex/image.rb +0 -3
- data/lib/reflex/image_view.rb +0 -3
- data/lib/reflex/key_event.rb +0 -3
- data/lib/reflex/line_shape.rb +0 -3
- data/lib/reflex/list_view.rb +0 -3
- data/lib/reflex/matrix.rb +0 -3
- data/lib/reflex/model.rb +0 -3
- data/lib/reflex/model_owner.rb +0 -3
- data/lib/reflex/model_view.rb +0 -3
- data/lib/reflex/painter.rb +0 -3
- data/lib/reflex/point.rb +0 -3
- data/lib/reflex/pointer.rb +0 -3
- data/lib/reflex/pointer_event.rb +0 -3
- data/lib/reflex/polygon.rb +0 -3
- data/lib/reflex/polygon_shape.rb +0 -3
- data/lib/reflex/polyline.rb +0 -3
- data/lib/reflex/rect_shape.rb +0 -3
- data/lib/reflex/reflex.rb +0 -3
- data/lib/reflex/scroll_event.rb +0 -3
- data/lib/reflex/selector.rb +0 -3
- data/lib/reflex/shader.rb +0 -3
- data/lib/reflex/shape.rb +0 -3
- data/lib/reflex/style.rb +0 -3
- data/lib/reflex/style_length.rb +0 -3
- data/lib/reflex/text_view.rb +0 -3
- data/lib/reflex/timer.rb +0 -3
- data/lib/reflex/timer_event.rb +0 -3
- data/lib/reflex/update_event.rb +0 -3
- data/lib/reflex/view.rb +10 -4
- data/lib/reflex/wheel_event.rb +0 -3
- data/lib/reflex/window.rb +2 -3
- data/lib/reflex.rb +0 -3
- data/lib/reflexion/include.rb +0 -3
- data/lib/reflexion.rb +0 -3
- data/reflex.gemspec +5 -5
- data/samples/app.rb +0 -3
- data/samples/bats.rb +0 -3
- data/samples/camera.rb +0 -3
- data/samples/checker.rb +0 -3
- data/samples/fans.rb +0 -3
- data/samples/fps.rb +0 -3
- data/samples/grid.rb +0 -3
- data/samples/hello.rb +0 -3
- data/samples/image.rb +0 -3
- data/samples/key.rb +0 -3
- data/samples/layout.rb +0 -3
- data/samples/model.rb +0 -3
- data/samples/physics.rb +0 -3
- data/samples/reflexion/breakout.rb +0 -3
- data/samples/reflexion/hello.rb +0 -3
- data/samples/reflexion/jump_action.rb +0 -3
- data/samples/reflexion/noise.rb +0 -3
- data/samples/reflexion/paint.rb +0 -3
- data/samples/reflexion/physics.rb +0 -3
- data/samples/reflexion/pulse.rb +0 -3
- data/samples/repl.rb +0 -3
- data/samples/shader.rb +0 -3
- data/samples/shapes.rb +0 -3
- data/samples/text.rb +0 -3
- data/samples/tree.rb +0 -3
- data/samples/views.rb +0 -3
- data/samples/visuals.rb +0 -3
- data/src/body.cpp +14 -0
- data/src/body.h +4 -0
- data/src/event.cpp +54 -32
- data/src/osx/native_window.mm +1 -1
- data/src/view.cpp +136 -61
- data/src/window.cpp +4 -2
- data/test/helper.rb +0 -3
- data/test/test_application.rb +4 -3
- data/test/test_capture_event.rb +0 -3
- data/test/test_contact_event.rb +0 -3
- data/test/test_draw_event.rb +0 -3
- data/test/test_event.rb +1 -4
- data/test/test_focus_event.rb +0 -3
- data/test/test_frame_event.rb +22 -7
- data/test/test_has_frame.rb +0 -3
- data/test/test_key_event.rb +0 -3
- data/test/test_model.rb +0 -3
- data/test/test_model_owner.rb +0 -3
- data/test/test_pointer.rb +0 -3
- data/test/test_pointer_event.rb +0 -3
- data/test/test_reflex_init.rb +0 -3
- data/test/test_scroll_event.rb +0 -3
- data/test/test_selector.rb +0 -3
- data/test/test_shape.rb +0 -3
- data/test/test_style.rb +0 -3
- data/test/test_style_length.rb +0 -3
- data/test/test_timer_event.rb +0 -3
- data/test/test_update_event.rb +0 -3
- data/test/test_view.rb +37 -3
- data/test/test_wheel_event.rb +0 -3
- data/test/test_window.rb +4 -3
- metadata +10 -11
- data/task/box2d.rake +0 -46
data/lib/reflex/model_view.rb
CHANGED
data/lib/reflex/painter.rb
CHANGED
data/lib/reflex/point.rb
CHANGED
data/lib/reflex/pointer.rb
CHANGED
data/lib/reflex/pointer_event.rb
CHANGED
data/lib/reflex/polygon.rb
CHANGED
data/lib/reflex/polygon_shape.rb
CHANGED
data/lib/reflex/polyline.rb
CHANGED
data/lib/reflex/rect_shape.rb
CHANGED
data/lib/reflex/reflex.rb
CHANGED
data/lib/reflex/scroll_event.rb
CHANGED
data/lib/reflex/selector.rb
CHANGED
data/lib/reflex/shader.rb
CHANGED
data/lib/reflex/shape.rb
CHANGED
data/lib/reflex/style.rb
CHANGED
data/lib/reflex/style_length.rb
CHANGED
data/lib/reflex/text_view.rb
CHANGED
data/lib/reflex/timer.rb
CHANGED
data/lib/reflex/timer_event.rb
CHANGED
data/lib/reflex/update_event.rb
CHANGED
data/lib/reflex/view.rb
CHANGED
@@ -1,6 +1,3 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
|
3
|
-
|
4
1
|
require 'forwardable'
|
5
2
|
require 'xot/setter'
|
6
3
|
require 'xot/bit_flag_accessor'
|
@@ -100,6 +97,14 @@ module Reflex
|
|
100
97
|
to_enum :each_shape
|
101
98
|
end
|
102
99
|
|
100
|
+
def pivot=(arg)
|
101
|
+
case arg
|
102
|
+
when Point then set_pivot! arg.x, arg.y, arg.z
|
103
|
+
when Array then set_pivot! arg[0], arg[1], arg[2] || 0
|
104
|
+
else raise ArgumentError
|
105
|
+
end
|
106
|
+
end
|
107
|
+
|
103
108
|
def capturing?(*args)
|
104
109
|
cap = capture
|
105
110
|
args.all? {|type| cap.include? type}
|
@@ -114,7 +119,8 @@ module Reflex
|
|
114
119
|
def on_contact_end(e)
|
115
120
|
end
|
116
121
|
|
117
|
-
universal_accessor :shape, :name, :selector,
|
122
|
+
universal_accessor :shape, :name, :selector,
|
123
|
+
:frame, :angle, :pivot, :zoom, :capture,
|
118
124
|
:density, :friction, :restitution,
|
119
125
|
:linear_velocity, :angular_velocity, :gravity_scale,
|
120
126
|
:gravity, :time_scale,
|
data/lib/reflex/wheel_event.rb
CHANGED
data/lib/reflex/window.rb
CHANGED
@@ -1,10 +1,8 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
|
3
|
-
|
4
1
|
require 'forwardable'
|
5
2
|
require 'xot/setter'
|
6
3
|
require 'xot/universal_accessor'
|
7
4
|
require 'xot/block_util'
|
5
|
+
require 'xot/inspectable'
|
8
6
|
require 'reflex/ext'
|
9
7
|
require 'reflex/helper'
|
10
8
|
|
@@ -15,6 +13,7 @@ module Reflex
|
|
15
13
|
class Window
|
16
14
|
|
17
15
|
include Xot::Setter
|
16
|
+
include Xot::Inspectable
|
18
17
|
include Hookable
|
19
18
|
include HasFrame
|
20
19
|
|
data/lib/reflex.rb
CHANGED
data/lib/reflexion/include.rb
CHANGED
data/lib/reflexion.rb
CHANGED
data/reflex.gemspec
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# -*- mode: ruby
|
1
|
+
# -*- mode: ruby -*-
|
2
2
|
|
3
3
|
|
4
4
|
File.expand_path('lib', __dir__)
|
@@ -28,10 +28,10 @@ Gem::Specification.new do |s|
|
|
28
28
|
s.platform = Gem::Platform::RUBY
|
29
29
|
s.required_ruby_version = '>= 2.7.0'
|
30
30
|
|
31
|
-
s.add_runtime_dependency 'xot', '~> 0.1.
|
32
|
-
s.add_runtime_dependency 'rucy', '~> 0.1.
|
33
|
-
s.add_runtime_dependency 'beeps', '~> 0.1.
|
34
|
-
s.add_runtime_dependency 'rays', '~> 0.1.
|
31
|
+
s.add_runtime_dependency 'xot', '~> 0.1.35'
|
32
|
+
s.add_runtime_dependency 'rucy', '~> 0.1.35'
|
33
|
+
s.add_runtime_dependency 'beeps', '~> 0.1.36'
|
34
|
+
s.add_runtime_dependency 'rays', '~> 0.1.35'
|
35
35
|
|
36
36
|
s.add_development_dependency 'rake'
|
37
37
|
s.add_development_dependency 'test-unit'
|
data/samples/app.rb
CHANGED
data/samples/bats.rb
CHANGED
data/samples/camera.rb
CHANGED
data/samples/checker.rb
CHANGED
data/samples/fans.rb
CHANGED
data/samples/fps.rb
CHANGED
data/samples/grid.rb
CHANGED
data/samples/hello.rb
CHANGED
data/samples/image.rb
CHANGED
data/samples/key.rb
CHANGED
data/samples/layout.rb
CHANGED
data/samples/model.rb
CHANGED
data/samples/physics.rb
CHANGED
data/samples/reflexion/hello.rb
CHANGED
data/samples/reflexion/noise.rb
CHANGED
data/samples/reflexion/paint.rb
CHANGED
data/samples/reflexion/pulse.rb
CHANGED
data/samples/repl.rb
CHANGED
data/samples/shader.rb
CHANGED
data/samples/shapes.rb
CHANGED
data/samples/text.rb
CHANGED
data/samples/tree.rb
CHANGED
data/samples/views.rb
CHANGED
data/samples/visuals.rb
CHANGED
data/src/body.cpp
CHANGED
@@ -126,6 +126,14 @@ namespace Reflex
|
|
126
126
|
self->b2body->ApplyAngularImpulse(impulse, true);
|
127
127
|
}
|
128
128
|
|
129
|
+
void
|
130
|
+
Body::awake ()
|
131
|
+
{
|
132
|
+
validate(this);
|
133
|
+
|
134
|
+
self->b2body->SetAwake(true);
|
135
|
+
}
|
136
|
+
|
129
137
|
float
|
130
138
|
Body::meter2pixel (float meter) const
|
131
139
|
{
|
@@ -141,6 +149,12 @@ namespace Reflex
|
|
141
149
|
to_b2vec2(x, y, self->ppm), Xot::deg2rad(degree));
|
142
150
|
}
|
143
151
|
|
152
|
+
void
|
153
|
+
Body::set_transform (const Point& position, float degree)
|
154
|
+
{
|
155
|
+
set_transform(position.x, position.y, degree);
|
156
|
+
}
|
157
|
+
|
144
158
|
Point
|
145
159
|
Body::position () const
|
146
160
|
{
|
data/src/body.h
CHANGED
@@ -41,10 +41,14 @@ namespace Reflex
|
|
41
41
|
|
42
42
|
void apply_angular_impulse (float impulse);
|
43
43
|
|
44
|
+
void awake ();
|
45
|
+
|
44
46
|
float meter2pixel (float meter = 1) const;
|
45
47
|
|
46
48
|
void set_transform (coord x, coord y, float degree);
|
47
49
|
|
50
|
+
void set_transform (const Point& position, float degree);
|
51
|
+
|
48
52
|
Point position () const;
|
49
53
|
|
50
54
|
float angle () const;
|