Module: Assimp::Matrix

Defined in:
lib/assimp/math.rb

Constant Summary collapse

IDENTITY =
[
  1.0, 0.0, 0.0, 0.0,
  0.0, 1.0, 0.0, 0.0,
  0.0, 0.0, 1.0, 0.0,
  0.0, 0.0, 0.0, 1.0
].freeze

Class Method Summary collapse

Class Method Details

.multiply(left, right) ⇒ Object



28
29
30
31
32
33
34
# File 'lib/assimp/math.rb', line 28

def multiply(left, right)
  Array.new(16) do |offset|
    column = offset / 4
    row = offset % 4
    4.times.sum { |index| left[(index * 4) + row] * right[(column * 4) + index] }
  end.freeze
end