lib/mittsu/extras/helpers/camera_helper.rb in mittsu-0.3.1 vs lib/mittsu/extras/helpers/camera_helper.rb in mittsu-0.3.2
- old
+ new
@@ -13,62 +13,62 @@
@point_map = {}
# colors
- @hex_frustrum = 0xffaa00
- @hex_cone = 0xff0000
- @hex_up = 0x00aaff
- @hex_target = 0xffffff
- @hex_cross = 0x333333
+ hex_frustrum = 0xffaa00
+ hex_cone = 0xff0000
+ hex_up = 0x00aaff
+ hex_target = 0xffffff
+ hex_cross = 0x333333
# near
- add_line(:n1, :n2, @hex_frustrum)
- add_line(:n2, :n4, @hex_frustrum)
- add_line(:n4, :n3, @hex_frustrum)
- add_line(:n3, :n1, @hex_frustrum)
+ add_line(:n1, :n2, hex_frustrum)
+ add_line(:n2, :n4, hex_frustrum)
+ add_line(:n4, :n3, hex_frustrum)
+ add_line(:n3, :n1, hex_frustrum)
# far
- add_line(:f1, :f2, @hex_frustrum)
- add_line(:f2, :f4, @hex_frustrum)
- add_line(:f4, :f3, @hex_frustrum)
- add_line(:f3, :f1, @hex_frustrum)
+ add_line(:f1, :f2, hex_frustrum)
+ add_line(:f2, :f4, hex_frustrum)
+ add_line(:f4, :f3, hex_frustrum)
+ add_line(:f3, :f1, hex_frustrum)
# sides
- add_line(:n1, :f1, @hex_frustrum)
- add_line(:n2, :f2, @hex_frustrum)
- add_line(:n3, :f3, @hex_frustrum)
- add_line(:n4, :f4, @hex_frustrum)
+ add_line(:n1, :f1, hex_frustrum)
+ add_line(:n2, :f2, hex_frustrum)
+ add_line(:n3, :f3, hex_frustrum)
+ add_line(:n4, :f4, hex_frustrum)
# cone
- add_line(:p, :n1, @hex_frustrum)
- add_line(:p, :n2, @hex_frustrum)
- add_line(:p, :n3, @hex_frustrum)
- add_line(:p, :n4, @hex_frustrum)
+ add_line(:p, :n1, hex_cone)
+ add_line(:p, :n2, hex_cone)
+ add_line(:p, :n3, hex_cone)
+ add_line(:p, :n4, hex_cone)
# up
- add_line(:u1, :u2, @hex_frustrum)
- add_line(:u2, :u3, @hex_frustrum)
- add_line(:u3, :u1, @hex_frustrum)
+ add_line(:u1, :u2, hex_up)
+ add_line(:u2, :u3, hex_up)
+ add_line(:u3, :u1, hex_up)
# target
- add_line(:c, :t, @hex_frustrum)
- add_line(:p, :c, @hex_frustrum)
+ add_line(:c, :t, hex_target)
+ add_line(:p, :c, hex_cross)
# cross
- add_line(:cn1, :cn2, @hex_frustrum)
- add_line(:cn3, :cn4, @hex_frustrum)
+ add_line(:cn1, :cn2, hex_cross)
+ add_line(:cn3, :cn4, hex_cross)
- add_line(:cf1, :cf2, @hex_frustrum)
- add_line(:cf3, :cf4, @hex_frustrum)
+ add_line(:cf1, :cf2, hex_cross)
+ add_line(:cf3, :cf4, hex_cross)
super(@geometry, @material, LinePieces)
@camera = camera
@@ -99,14 +99,14 @@
set_point(:n3, -w, h, -1.0)
set_point(:n4, w, h, -1.0)
# far
- set_point(:f1, -w, -h, -1.0)
- set_point(:f2, w, -h, -1.0)
- set_point(:f3, -w, h, -1.0)
- set_point(:f4, w, h, -1.0)
+ set_point(:f1, -w, -h, 1.0)
+ set_point(:f2, w, -h, 1.0)
+ set_point(:f3, -w, h, 1.0)
+ set_point(:f4, w, h, 1.0)
# up
set_point(:u1, w * 0.7, h * 1.1, -1.0)
set_point(:u2, -w * 0.7, h * 1.1, -1.0)
@@ -117,13 +117,13 @@
set_point(:cf1, -w, 0.0, 1.0)
set_point(:cf2, w, 0.0, 1.0)
set_point(:cf3, 0.0, -h, 1.0)
set_point(:cf4, 0.0, h, 1.0)
- set_point(:cn1, -w, 0.0, 1.0)
- set_point(:cn2, w, 0.0, 1.0)
- set_point(:cn3, 0.0, -h, 1.0)
- set_point(:cn4, 0.0, h, 1.0)
+ set_point(:cn1, -w, 0.0, -1.0)
+ set_point(:cn2, w, 0.0, -1.0)
+ set_point(:cn3, 0.0, -h, -1.0)
+ set_point(:cn4, 0.0, h, -1.0)
@geometry.vertices_need_update = true
end
private