Method: RMath3D::RMtx2#setIdentity

Defined in:
lib/rmath3d/rmath3d_plain.rb

#setIdentityObject

call-seq: setIdentity

Sets as identity matrix.



214
215
216
217
218
219
220
221
222
223
224
225
226
# File 'lib/rmath3d/rmath3d_plain.rb', line 214

def setIdentity
  for row in 0...2 do
    for col in 0...2 do
      index = 2*row + col
      if ( row == col )
        setElement( row, col, 1.0 )
      else
        setElement( row, col, 0.0 )
      end
    end
  end
  return self
end