Class: Collada::Parser::MatrixParameter
- Defined in:
- lib/collada/parser/support.rb
Instance Attribute Summary collapse
-
#size ⇒ Object
readonly
Returns the value of attribute size.
Attributes inherited from Parameter
Instance Method Summary collapse
-
#initialize(name, type, dimensions) ⇒ MatrixParameter
constructor
A new instance of MatrixParameter.
- #read(value) ⇒ Object
Methods inherited from Parameter
Constructor Details
#initialize(name, type, dimensions) ⇒ MatrixParameter
Returns a new instance of MatrixParameter.
190 191 192 193 194 195 |
# File 'lib/collada/parser/support.rb', line 190 def initialize(name, type, dimensions) super name, type @rows = dimensions[1] @size = dimensions[0] * dimensions[1] end |
Instance Attribute Details
#size ⇒ Object (readonly)
Returns the value of attribute size.
197 198 199 |
# File 'lib/collada/parser/support.rb', line 197 def size @size end |
Instance Method Details
#read(value) ⇒ Object
199 200 201 |
# File 'lib/collada/parser/support.rb', line 199 def read(value) Matrix[*(value.each_slice(@rows).to_a)] end |