Class: Rays::Matrix

Inherits:
Object
  • Object
show all
Includes:
Comparable, Enumerable
Defined in:
lib/rays/matrix.rb

Instance Method Summary collapse

Instance Method Details

#each(&block) ⇒ Object



28
29
30
# File 'lib/rays/matrix.rb', line 28

def each(&block)
  to_a.each(&block)
end

#inspectObject



34
35
36
# File 'lib/rays/matrix.rb', line 34

def inspect()
  inspect_org.gsub(/\.?0+([^\.\d]|$)/) {$1}
end

#inspect_orgObject



32
# File 'lib/rays/matrix.rb', line 32

alias inspect_org inspect

#rotate(*args) ⇒ Object



24
25
26
# File 'lib/rays/matrix.rb', line 24

def rotate(*args)
  dup.rotate!(*args)
end

#scale(*args) ⇒ Object



20
21
22
# File 'lib/rays/matrix.rb', line 20

def scale(*args)
  dup.scale!(*args)
end

#translate(*args) ⇒ Object



16
17
18
# File 'lib/rays/matrix.rb', line 16

def translate(*args)
  dup.translate!(*args)
end

#transposeObject



12
13
14
# File 'lib/rays/matrix.rb', line 12

def transpose()
  dup.transpose!
end