reflexion 0.1.34 → 0.1.36

Sign up to get free protection for your applications and to get access to all the features.
Files changed (128) hide show
  1. checksums.yaml +4 -4
  2. data/.doc/ext/reflex/frame_event.cpp +27 -2
  3. data/.doc/ext/reflex/view.cpp +25 -0
  4. data/.github/workflows/utils.rb +2 -1
  5. data/ChangeLog.md +15 -0
  6. data/Rakefile +1 -1
  7. data/VERSION +1 -1
  8. data/ext/reflex/extconf.rb +0 -3
  9. data/ext/reflex/frame_event.cpp +33 -5
  10. data/ext/reflex/view.cpp +28 -0
  11. data/include/reflex/event.h +10 -2
  12. data/include/reflex/ruby/view.h +9 -0
  13. data/include/reflex/view.h +12 -4
  14. data/lib/reflex/application.rb +2 -3
  15. data/lib/reflex/autoinit.rb +0 -3
  16. data/lib/reflex/bitmap.rb +0 -3
  17. data/lib/reflex/bounds.rb +0 -3
  18. data/lib/reflex/button.rb +0 -3
  19. data/lib/reflex/camera.rb +0 -3
  20. data/lib/reflex/capture_event.rb +0 -3
  21. data/lib/reflex/color.rb +0 -3
  22. data/lib/reflex/color_space.rb +0 -3
  23. data/lib/reflex/contact_event.rb +0 -3
  24. data/lib/reflex/draw_event.rb +0 -3
  25. data/lib/reflex/ellipse_shape.rb +0 -3
  26. data/lib/reflex/ext.rb +0 -3
  27. data/lib/reflex/extension.rb +0 -3
  28. data/lib/reflex/filter.rb +0 -3
  29. data/lib/reflex/fixture.rb +0 -3
  30. data/lib/reflex/focus_event.rb +0 -3
  31. data/lib/reflex/font.rb +0 -3
  32. data/lib/reflex/frame_event.rb +2 -4
  33. data/lib/reflex/helper.rb +0 -3
  34. data/lib/reflex/image.rb +0 -3
  35. data/lib/reflex/image_view.rb +0 -3
  36. data/lib/reflex/key_event.rb +0 -3
  37. data/lib/reflex/line_shape.rb +0 -3
  38. data/lib/reflex/list_view.rb +0 -3
  39. data/lib/reflex/matrix.rb +0 -3
  40. data/lib/reflex/model.rb +0 -3
  41. data/lib/reflex/model_owner.rb +0 -3
  42. data/lib/reflex/model_view.rb +0 -3
  43. data/lib/reflex/painter.rb +0 -3
  44. data/lib/reflex/point.rb +0 -3
  45. data/lib/reflex/pointer.rb +0 -3
  46. data/lib/reflex/pointer_event.rb +0 -3
  47. data/lib/reflex/polygon.rb +0 -3
  48. data/lib/reflex/polygon_shape.rb +0 -3
  49. data/lib/reflex/polyline.rb +0 -3
  50. data/lib/reflex/rect_shape.rb +0 -3
  51. data/lib/reflex/reflex.rb +0 -3
  52. data/lib/reflex/scroll_event.rb +0 -3
  53. data/lib/reflex/selector.rb +0 -3
  54. data/lib/reflex/shader.rb +0 -3
  55. data/lib/reflex/shape.rb +0 -3
  56. data/lib/reflex/style.rb +0 -3
  57. data/lib/reflex/style_length.rb +0 -3
  58. data/lib/reflex/text_view.rb +0 -3
  59. data/lib/reflex/timer.rb +0 -3
  60. data/lib/reflex/timer_event.rb +0 -3
  61. data/lib/reflex/update_event.rb +0 -3
  62. data/lib/reflex/view.rb +10 -4
  63. data/lib/reflex/wheel_event.rb +0 -3
  64. data/lib/reflex/window.rb +2 -3
  65. data/lib/reflex.rb +0 -3
  66. data/lib/reflexion/include.rb +0 -3
  67. data/lib/reflexion.rb +0 -3
  68. data/reflex.gemspec +5 -5
  69. data/samples/app.rb +0 -3
  70. data/samples/bats.rb +0 -3
  71. data/samples/camera.rb +0 -3
  72. data/samples/checker.rb +0 -3
  73. data/samples/fans.rb +0 -3
  74. data/samples/fps.rb +0 -3
  75. data/samples/grid.rb +0 -3
  76. data/samples/hello.rb +0 -3
  77. data/samples/image.rb +0 -3
  78. data/samples/key.rb +0 -3
  79. data/samples/layout.rb +0 -3
  80. data/samples/model.rb +0 -3
  81. data/samples/physics.rb +0 -3
  82. data/samples/reflexion/breakout.rb +0 -3
  83. data/samples/reflexion/hello.rb +0 -3
  84. data/samples/reflexion/jump_action.rb +0 -3
  85. data/samples/reflexion/noise.rb +0 -3
  86. data/samples/reflexion/paint.rb +0 -3
  87. data/samples/reflexion/physics.rb +0 -3
  88. data/samples/reflexion/pulse.rb +0 -3
  89. data/samples/repl.rb +0 -3
  90. data/samples/shader.rb +0 -3
  91. data/samples/shapes.rb +0 -3
  92. data/samples/text.rb +0 -3
  93. data/samples/tree.rb +0 -3
  94. data/samples/views.rb +0 -3
  95. data/samples/visuals.rb +0 -3
  96. data/src/body.cpp +14 -0
  97. data/src/body.h +4 -0
  98. data/src/event.cpp +54 -32
  99. data/src/osx/native_window.mm +1 -1
  100. data/src/view.cpp +136 -61
  101. data/src/window.cpp +4 -2
  102. data/test/helper.rb +0 -3
  103. data/test/test_application.rb +4 -3
  104. data/test/test_capture_event.rb +0 -3
  105. data/test/test_contact_event.rb +0 -3
  106. data/test/test_draw_event.rb +0 -3
  107. data/test/test_event.rb +1 -4
  108. data/test/test_focus_event.rb +0 -3
  109. data/test/test_frame_event.rb +22 -7
  110. data/test/test_has_frame.rb +0 -3
  111. data/test/test_key_event.rb +0 -3
  112. data/test/test_model.rb +0 -3
  113. data/test/test_model_owner.rb +0 -3
  114. data/test/test_pointer.rb +0 -3
  115. data/test/test_pointer_event.rb +0 -3
  116. data/test/test_reflex_init.rb +0 -3
  117. data/test/test_scroll_event.rb +0 -3
  118. data/test/test_selector.rb +0 -3
  119. data/test/test_shape.rb +0 -3
  120. data/test/test_style.rb +0 -3
  121. data/test/test_style_length.rb +0 -3
  122. data/test/test_timer_event.rb +0 -3
  123. data/test/test_update_event.rb +0 -3
  124. data/test/test_view.rb +37 -3
  125. data/test/test_wheel_event.rb +0 -3
  126. data/test/test_window.rb +4 -3
  127. metadata +10 -11
  128. data/task/box2d.rake +0 -46
@@ -1,6 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
-
3
-
4
1
  require 'reflex/model_owner'
5
2
 
6
3
 
@@ -1,6 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
-
3
-
4
1
  require 'rays/painter'
5
2
 
6
3
 
data/lib/reflex/point.rb CHANGED
@@ -1,6 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
-
3
-
4
1
  require 'rays/point'
5
2
 
6
3
 
@@ -1,6 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
-
3
-
4
1
  require 'xot/bit_flag_accessor'
5
2
  require 'xot/const_symbol_accessor'
6
3
  require 'reflex/ext'
@@ -1,6 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
-
3
-
4
1
  require 'forwardable'
5
2
  require 'reflex/ext'
6
3
 
@@ -1,6 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
-
3
-
4
1
  require 'rays/polygon'
5
2
  require 'rays/polygon_line'
6
3
 
@@ -1,6 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
-
3
-
4
1
  require 'xot/universal_accessor'
5
2
  require 'reflex/shape'
6
3
 
@@ -1,6 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
-
3
-
4
1
  require 'rays/polyline'
5
2
 
6
3
 
@@ -1,6 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
-
3
-
4
1
  require 'xot/universal_accessor'
5
2
  require 'reflex/shape'
6
3
 
data/lib/reflex/reflex.rb CHANGED
@@ -1,6 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
-
3
-
4
1
  require 'reflex/ext'
5
2
  require 'reflex/window'
6
3
 
@@ -1,6 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
-
3
-
4
1
  require 'reflex/ext'
5
2
 
6
3
 
@@ -1,6 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
-
3
-
4
1
  require 'xot/setter'
5
2
  require 'xot/block_util'
6
3
  require 'reflex/ext'
data/lib/reflex/shader.rb CHANGED
@@ -1,6 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
-
3
-
4
1
  require 'rays/shader'
5
2
 
6
3
 
data/lib/reflex/shape.rb CHANGED
@@ -1,6 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
-
3
-
4
1
  require 'xot/setter'
5
2
  require 'xot/universal_accessor'
6
3
  require 'xot/block_util'
data/lib/reflex/style.rb CHANGED
@@ -1,6 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
-
3
-
4
1
  require 'xot/setter'
5
2
  require 'xot/universal_accessor'
6
3
  require 'xot/block_util'
@@ -1,6 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
-
3
-
4
1
  require 'reflex/ext'
5
2
 
6
3
 
@@ -1,6 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
-
3
-
4
1
  require 'reflex/image'
5
2
  require 'reflex/bitmap'
6
3
  require 'reflex/view'
data/lib/reflex/timer.rb CHANGED
@@ -1,6 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
-
3
-
4
1
  require 'forwardable'
5
2
  require 'reflex/ext'
6
3
 
@@ -1,6 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
-
3
-
4
1
  require 'forwardable'
5
2
  require 'reflex/ext'
6
3
 
@@ -1,6 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
-
3
-
4
1
  require 'reflex/ext'
5
2
 
6
3
 
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, :frame, :angle, :zoom, :capture,
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,
@@ -1,6 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
-
3
-
4
1
  require 'reflex/ext'
5
2
 
6
3
 
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
@@ -1,6 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
-
3
-
4
1
  require 'reflex/autoinit'
5
2
  require 'reflex/extension'
6
3
 
@@ -1,5 +1,2 @@
1
- # -*- coding: utf-8 -*-
2
-
3
-
4
1
  require 'reflexion'
5
2
  include Reflexion
data/lib/reflexion.rb CHANGED
@@ -1,6 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
-
3
-
4
1
  require 'beeps'
5
2
  require 'rays'
6
3
  require 'reflex'
data/reflex.gemspec CHANGED
@@ -1,4 +1,4 @@
1
- # -*- mode: ruby; coding: utf-8 -*-
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.33'
32
- s.add_runtime_dependency 'rucy', '~> 0.1.33'
33
- s.add_runtime_dependency 'beeps', '~> 0.1.34'
34
- s.add_runtime_dependency 'rays', '~> 0.1.33'
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
@@ -1,6 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
-
3
-
4
1
  %w[xot rays reflex]
5
2
  .map {|s| File.expand_path "../../#{s}/lib", __dir__}
6
3
  .each {|s| $:.unshift s if !$:.include?(s) && File.directory?(s)}
data/samples/bats.rb CHANGED
@@ -1,6 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
-
3
-
4
1
  %w[xot rays reflex]
5
2
  .map {|s| File.expand_path "../../#{s}/lib", __dir__}
6
3
  .each {|s| $:.unshift s if !$:.include?(s) && File.directory?(s)}
data/samples/camera.rb CHANGED
@@ -1,6 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
-
3
-
4
1
  %w[xot rays reflex]
5
2
  .map {|s| File.expand_path "../../#{s}/lib", __dir__}
6
3
  .each {|s| $:.unshift s if !$:.include?(s) && File.directory?(s)}
data/samples/checker.rb CHANGED
@@ -1,6 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
-
3
-
4
1
  %w[xot rays reflex]
5
2
  .map {|s| File.expand_path "../../#{s}/lib", __dir__}
6
3
  .each {|s| $:.unshift s if !$:.include?(s) && File.directory?(s)}
data/samples/fans.rb CHANGED
@@ -1,6 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
-
3
-
4
1
  %w[xot rays reflex]
5
2
  .map {|s| File.expand_path "../../#{s}/lib", __dir__}
6
3
  .each {|s| $:.unshift s if !$:.include?(s) && File.directory?(s)}
data/samples/fps.rb CHANGED
@@ -1,6 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
-
3
-
4
1
  %w[xot rays reflex]
5
2
  .map {|s| File.expand_path "../../#{s}/lib", __dir__}
6
3
  .each {|s| $:.unshift s if !$:.include?(s) && File.directory?(s)}
data/samples/grid.rb CHANGED
@@ -1,6 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
-
3
-
4
1
  %w[xot rays reflex]
5
2
  .map {|s| File.expand_path "../../#{s}/lib", __dir__}
6
3
  .each {|s| $:.unshift s if !$:.include?(s) && File.directory?(s)}
data/samples/hello.rb CHANGED
@@ -1,6 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
-
3
-
4
1
  %w[xot rays reflex]
5
2
  .map {|s| File.expand_path "../../#{s}/lib", __dir__}
6
3
  .each {|s| $:.unshift s if !$:.include?(s) && File.directory?(s)}
data/samples/image.rb CHANGED
@@ -1,6 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
-
3
-
4
1
  %w[xot rays reflex]
5
2
  .map {|s| File.expand_path "../../#{s}/lib", __dir__}
6
3
  .each {|s| $:.unshift s if !$:.include?(s) && File.directory?(s)}
data/samples/key.rb CHANGED
@@ -1,6 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
-
3
-
4
1
  %w[xot rays reflex]
5
2
  .map {|s| File.expand_path "../../#{s}/lib", __dir__}
6
3
  .each {|s| $:.unshift s if !$:.include?(s) && File.directory?(s)}
data/samples/layout.rb CHANGED
@@ -1,6 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
-
3
-
4
1
  %w[xot rays reflex]
5
2
  .map {|s| File.expand_path "../../#{s}/lib", __dir__}
6
3
  .each {|s| $:.unshift s if !$:.include?(s) && File.directory?(s)}
data/samples/model.rb CHANGED
@@ -1,6 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
-
3
-
4
1
  %w[xot rays reflex]
5
2
  .map {|s| File.expand_path "../../#{s}/lib", __dir__}
6
3
  .each {|s| $:.unshift s if !$:.include?(s) && File.directory?(s)}
data/samples/physics.rb CHANGED
@@ -1,6 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
-
3
-
4
1
  %w[xot rays reflex]
5
2
  .map {|s| File.expand_path "../../#{s}/lib", __dir__}
6
3
  .each {|s| $:.unshift s if !$:.include?(s) && File.directory?(s)}
@@ -1,6 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
-
3
-
4
1
  %w[xot beeps rays reflex]
5
2
  .map {|s| File.expand_path "../../../#{s}/lib", __dir__}
6
3
  .each {|s| $:.unshift s if !$:.include?(s) && File.directory?(s)}
@@ -1,6 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
-
3
-
4
1
  %w[xot beeps rays reflex]
5
2
  .map {|s| File.expand_path "../../../#{s}/lib", __dir__}
6
3
  .each {|s| $:.unshift s if !$:.include?(s) && File.directory?(s)}
@@ -1,6 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
-
3
-
4
1
  %w[xot beeps rays reflex]
5
2
  .map {|s| File.expand_path "../../../#{s}/lib", __dir__}
6
3
  .each {|s| $:.unshift s if !$:.include?(s) && File.directory?(s)}
@@ -1,6 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
-
3
-
4
1
  %w[xot beeps rays reflex]
5
2
  .map {|s| File.expand_path "../../../#{s}/lib", __dir__}
6
3
  .each {|s| $:.unshift s if !$:.include?(s) && File.directory?(s)}
@@ -1,6 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
-
3
-
4
1
  %w[xot beeps rays reflex]
5
2
  .map {|s| File.expand_path "../../../#{s}/lib", __dir__}
6
3
  .each {|s| $:.unshift s if !$:.include?(s) && File.directory?(s)}
@@ -1,6 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
-
3
-
4
1
  %w[xot beeps rays reflex]
5
2
  .map {|s| File.expand_path "../../../#{s}/lib", __dir__}
6
3
  .each {|s| $:.unshift s if !$:.include?(s) && File.directory?(s)}
@@ -1,6 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
-
3
-
4
1
  %w[xot beeps rays reflex]
5
2
  .map {|s| File.expand_path "../../../#{s}/lib", __dir__}
6
3
  .each {|s| $:.unshift s if !$:.include?(s) && File.directory?(s)}
data/samples/repl.rb CHANGED
@@ -1,6 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
-
3
-
4
1
  %w[xot rays reflex]
5
2
  .map {|s| File.expand_path "../../#{s}/lib", __dir__}
6
3
  .each {|s| $:.unshift s if !$:.include?(s) && File.directory?(s)}
data/samples/shader.rb CHANGED
@@ -1,6 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
-
3
-
4
1
  %w[xot rays reflex]
5
2
  .map {|s| File.expand_path "../../#{s}/lib", __dir__}
6
3
  .each {|s| $:.unshift s if !$:.include?(s) && File.directory?(s)}
data/samples/shapes.rb CHANGED
@@ -1,6 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
-
3
-
4
1
  %w[xot rays reflex]
5
2
  .map {|s| File.expand_path "../../#{s}/lib", __dir__}
6
3
  .each {|s| $:.unshift s if !$:.include?(s) && File.directory?(s)}
data/samples/text.rb CHANGED
@@ -1,6 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
-
3
-
4
1
  %w[xot rays reflex]
5
2
  .map {|s| File.expand_path "../../#{s}/lib", __dir__}
6
3
  .each {|s| $:.unshift s if !$:.include?(s) && File.directory?(s)}
data/samples/tree.rb CHANGED
@@ -1,6 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
-
3
-
4
1
  %w[xot rays reflex]
5
2
  .map {|s| File.expand_path "../../#{s}/lib", __dir__}
6
3
  .each {|s| $:.unshift s if !$:.include?(s) && File.directory?(s)}
data/samples/views.rb CHANGED
@@ -1,6 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
-
3
-
4
1
  %w[xot rays reflex]
5
2
  .map {|s| File.expand_path "../../#{s}/lib", __dir__}
6
3
  .each {|s| $:.unshift s if !$:.include?(s) && File.directory?(s)}
data/samples/visuals.rb CHANGED
@@ -1,6 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
-
3
-
4
1
  %w[xot rays reflex]
5
2
  .map {|s| File.expand_path "../../#{s}/lib", __dir__}
6
3
  .each {|s| $:.unshift s if !$:.include?(s) && File.directory?(s)}
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;