Class: GMath3D::Quat

Inherits:
Object
  • Object
show all
Defined in:
lib/disp3D_ext.rb

Instance Method Summary collapse

Instance Method Details

#to_arrayObject

convert quat to array



7
8
9
10
11
12
13
14
15
# File 'lib/disp3D_ext.rb', line 7

def to_array
  rot_mat = Matrix.from_quat(self)
  rot_mat_array = [
    [rot_mat[0,0], rot_mat[0,1], rot_mat[0,2], 0],
    [rot_mat[1,0], rot_mat[1,1], rot_mat[1,2], 0],
    [rot_mat[2,0], rot_mat[2,1], rot_mat[2,2], 0],
    [0,0,0,1]]
  return rot_mat_array
end