Class: Chobo::Vec2
- Inherits:
-
Object
- Object
- Chobo::Vec2
- Defined in:
- lib/chobo/vec2.rb
Instance Attribute Summary collapse
-
#x ⇒ Object
Returns the value of attribute x.
-
#y ⇒ Object
Returns the value of attribute y.
Instance Method Summary collapse
-
#initialize(x = 0.0, y = 0.0) ⇒ Vec2
constructor
A new instance of Vec2.
Constructor Details
#initialize(x = 0.0, y = 0.0) ⇒ Vec2
Returns a new instance of Vec2.
5 6 7 |
# File 'lib/chobo/vec2.rb', line 5 def initialize x = 0.0, y = 0.0 @x, @y = x, y end |
Instance Attribute Details
#x ⇒ Object
Returns the value of attribute x.
3 4 5 |
# File 'lib/chobo/vec2.rb', line 3 def x @x end |
#y ⇒ Object
Returns the value of attribute y.
3 4 5 |
# File 'lib/chobo/vec2.rb', line 3 def y @y end |