Class: Bayonetta::Position
- Inherits:
-
LibBin::Structure
- Object
- LibBin::Structure
- Bayonetta::Position
- Includes:
- VectorAccessor
- Defined in:
- lib/bayonetta/wmb.rb
Instance Method Summary collapse
- #*(scal) ⇒ Object
- #+(other) ⇒ Object
- #-(other) ⇒ Object
- #-@ ⇒ Object
- #to_a ⇒ Object
- #to_s ⇒ Object
- #to_yaml_properties ⇒ Object
Methods included from VectorAccessor
Instance Method Details
#*(scal) ⇒ Object
504 505 506 507 508 509 510 |
# File 'lib/bayonetta/wmb.rb', line 504 def *(scal) b = Position::new b.x = @x*scal b.y = @y*scal b.z = @z*scal b end |
#+(other) ⇒ Object
496 497 498 499 500 501 502 |
# File 'lib/bayonetta/wmb.rb', line 496 def +(other) b = Position::new b.x = @x + other.x b.y = @y + other.y b.z = @z + other.z b end |
#-(other) ⇒ Object
480 481 482 483 484 485 486 |
# File 'lib/bayonetta/wmb.rb', line 480 def -(other) b = Position::new b.x = @x - other.x b.y = @y - other.y b.z = @z - other.z b end |
#-@ ⇒ Object
488 489 490 491 492 493 494 |
# File 'lib/bayonetta/wmb.rb', line 488 def -@ b = Position::new b.x = -@x b.y = -@y b.z = -@z b end |
#to_a ⇒ Object
520 521 522 |
# File 'lib/bayonetta/wmb.rb', line 520 def to_a [x, y, z] end |
#to_s ⇒ Object
516 517 518 |
# File 'lib/bayonetta/wmb.rb', line 516 def to_s "<#{@x}, #{@y}, #{@z}>" end |
#to_yaml_properties ⇒ Object
512 513 514 |
# File 'lib/bayonetta/wmb.rb', line 512 def to_yaml_properties [:@x, :@y, :@z] end |