<%= "" %> model://sun model://ground_plane quick 50 cone_model <% # Test cone friction model # set equal friction coefficients, but use default directions require 'matrix' def a_to_s(v) Array(v).join(" ") end # box dimensions dx = 0.5 dy = dx dz = 0.2 box = {} box[:size] = Vector[dx, dy, dz] box[:mass] = 1 box[:ixx] = box[:mass] / 12.0 * (dy**2 + dz**2) box[:iyy] = box[:mass] / 12.0 * (dz**2 + dx**2) box[:izz] = box[:mass] / 12.0 * (dx**2 + dy**2) box_count = 32 box_angles = 2 * Math::PI * Vector[*(0..box_count-1)] / box_count radius = 9 box_angles.each_with_index do |a,i| name = "box_#{i}" pos_xy = radius * Vector[Math.cos(a), Math.sin(a)] vel_xy = pos_xy %> <%= a_to_s(pos_xy) %> 0.1 0 -0 0 <%= box[:mass] %> <%= box[:ixx] %> 0 0 <%= box[:iyy] %> 0 <%= box[:izz] %> <%= a_to_s(box[:size]) %> 0.3 0.3 <%= a_to_s(box[:size]) %> <%= a_to_s(vel_xy) %> 0 0 0 0 <% end %> -0.93396 -19.9626 11.7572 0 0.503643 1.6562 orbit perspective