lib/mittsu/math/matrix4.rb in mittsu-0.1.1 vs lib/mittsu/math/matrix4.rb in mittsu-0.1.2
- old
+ new
@@ -2,10 +2,12 @@
module Mittsu
class Matrix4
attr_accessor :elements
+ DIMENSIONS = 4
+
def initialize()
@elements = [
1.0, 0.0, 0.0, 0.0,
0.0, 1.0, 0.0, 0.0,
0.0, 0.0, 1.0, 0.0,
@@ -559,9 +561,13 @@
end
def from_array(array)
self.elements[0..array.length] = array
self
+ end
+
+ def ==(other)
+ other.elements == @elements
end
def to_a
te = self.elements
[