Changeset 14339 for lang/ruby/pitagora

Show
Ignore:
Timestamp:
06/21/08 16:54:51 (5 years ago)
Author:
takeru
Message:

demo fix

Location:
lang/ruby/pitagora/trunk/ode_ruby
Files:
6 added
2 modified

Legend:

Unmodified
Added
Removed
  • lang/ruby/pitagora/trunk/ode_ruby/demo/test2.rb

    r14321 r14339  
    44require 'monitor' 
    55require 'yaml' 
     6require 'erb' 
    67 
    78def log(s) 
     
    4142#p Ode_cpp::dWorldGetContactMaxCorrectingVel($world.id) 
    4243#p Ode_cpp::dWorldGetContactSurfaceLayer($world.id) 
    43 Ode_cpp::dWorldSetContactMaxCorrectingVel($world.id, 1000.0) 
    44 Ode_cpp::dWorldSetContactSurfaceLayer($world.id, 0.001) 
    45 Ode_cpp::dWorldSetAutoDisableAverageSamplesCount($world.id, 10) 
     44#Ode_cpp::dWorldSetContactMaxCorrectingVel($world.id, 1000.0) 
     45#Ode_cpp::dWorldSetContactSurfaceLayer($world.id, 0.001) 
     46#Ode_cpp::dWorldSetAutoDisableAverageSamplesCount($world.id, 10) 
    4647 
    4748# Base/Box/Sphere/Capsule/Cylinder 
     
    125126 
    126127def load_from_yaml(fn) 
    127   yaml_obj = YAML.load_file(fn) 
     128  #yaml_obj = YAML.load_file(fn) 
     129  yaml_obj = YAML::load(ERB.new(IO.read( fn )).result) 
     130   
    128131  yaml_obj.each do |hash| 
    129132    klass = eval(hash[:class]) 
     
    274277     
    275278    # スライドタイトル0 
    276     #xyz=[15.7971229553223, 5.94557666778564, 1.14663815498352] 
    277     #hpr=[177.560760498047, -10.6020441055298, 0.0] 
    278279    xyz=[15.8511810302734, 11.0112943649292, 1.18576812744141] 
    279280    hpr=[-179.67204284668, -9.92193984985352, 0.0] 
    280281     
    281     # tmp1 
     282    # tmp1 はじめの坂 
    282283    #xyz=[15.0797939300537, -8.75014877319336, 3.6630527973175] 
    283284    #hpr=[-162.504684448242, -10.6020441055298, 0.0] 
     285     
     286    # tmp2 最後の坂 
     287    #xyz=[14.5021448135376, 4.13276433944702, 6.16305589675903] 
     288    #hpr=[83.4953155517578, -31.60205078125, 0.0] 
     289 
     290    # tmp3 最後のBOX 
     291    #xyz=[-1.51419591903687, 4.49123239517212, 3.6630527973175] 
     292    #hpr=[129.995315551758, -4.10204410552979, 0.0] 
    284293     
    285294    self.set_viewpoint(xyz, hpr) 
     
    318327      contact.surface.mu         = Float::MAX 
    319328      contact.surface.mu2        = 0.0 
    320       contact.surface.bounce     = 0.1 
     329#      contact.surface.bounce     = 0.1 
     330      contact.surface.bounce     = 0.5 
    321331      contact.surface.bounce_vel = 0.1 
    322332      contact.surface.soft_cfm   = 0.01 
  • lang/ruby/pitagora/trunk/ode_ruby/save/state_5.yaml

    r14321 r14339  
    7272 
    7373- :class: Box 
    74   :name: "大きな坂の" 
     74  :name: "大きな坂の" 
    7575  :pars:  
    7676  - - 2 
    77     - 10 
     77    - 5 
    7878    - 3 
    7979  - 1 
     
    119119  :texture: 0 
    120120  :color:  
    121   - 1.0 
    122   - 0.5 
    123   - 0.5 
     121  - 0.7 
     122  - 0.2 
     123  - 0.2 
    124124 
    125125- :class: Box 
     
    158158 
    159159- :class: Sphere 
    160   :name: "ボール" 
     160  :name: "黄色いボール" 
    161161  :pars:  
    162162  - 1.5 
     
    165165  - -10.0 
    166166  - -10.0 
    167   -  4.0 
     167  -  8.0 
    168168  :texture: 0 
    169169  :color:  
     
    292292#============ 
    293293 
     294- :class: Box 
     295  :name: "最後のボールの台" 
     296  :pars:  
     297  - - 4 
     298    - 0.5 
     299    - 4 
     300  - 1 
     301  :position:  
     302  - 18.0 
     303  - 15.0 
     304  -  2.0 
     305  :texture: 0 
     306  :color:  
     307  - 0.0 
     308  - 0.7 
     309  - 1.5 
     310 
    294311- :class: Sphere 
    295   :name: "ボール1" 
    296   :pars:  
    297   - 1.0 
    298   - 0.1 
    299   :position:  
    300   - 17.0 
    301   - 16.0 
    302   -  2.0 
     312  :name: "赤いボール" 
     313  :pars:  
     314  - 1.0 
     315  - 0.1 
     316  :position:  
     317  - 18.0 
     318  - 15 
     319  -  7.0 
    303320  :texture: 0 
    304321  :color:  
     
    308325 
    309326 
     327- :class: Box 
     328  :name: "最後の台" 
     329  :pars:  
     330  - - 3 
     331    - 4 
     332    - 3 
     333  - 1 
     334  :position:  
     335  - 18.0 
     336  - 18.0 
     337  -  1.5 
     338  :texture: 0 
     339  :color:  
     340  - 0.0 
     341  - 1.7 
     342  - 1.5 
     343 
     344- :class: Box 
     345  :name: "最後の坂" 
     346  :pars:  
     347  - - 12 
     348    - 4 
     349    - 0.1 
     350  - 1 
     351  :position:  
     352  - 13.0 
     353  - 18.0 
     354  -  3.2 
     355  :texture: 0 
     356  :color:  
     357  - 0.0 
     358  - 1.2 
     359  - 0.5 
     360 
     361- :class: Box 
     362  :name: "最後の坂の枠" 
     363  :pars:  
     364  - - 12 
     365    - 0.3 
     366    - 0.3 
     367  - 1 
     368  :position:  
     369  - 13.0 
     370  - 19.0 
     371  -  3.5 
     372  :texture: 0 
     373  :color:  
     374  - 1.5 
     375  - 0.2 
     376  - 0.5 
     377 
     378 
    310379#================================================== 
    311380 
     
    593662 
    594663- :class: Box 
    595   :name: "slide 5" 
     664  :name: "slide 5-0" 
    596665  :pars:  
    597666  - - 1 
     
    600669  - 1 
    601670  :position:  
    602   - 15.0 
    603   - 15.0 
     671  - -10.0 
     672  - 19.0 
    604673  - 1.0 
    605674  :texture: 1015 
     
    621690  - 0.173648177666931 
    622691  - 0.0 
     692 
     693<% (1..1).each do |l| %> 
     694<% (1..3).each do |m| %> 
     695<% z = 0 %> 
     696<% (1..4).each do |n| %> 
     697<% h = 2-n/8.0; z += h %> 
     698- :class: Box 
     699  :name: "slide 5-<%=l%>_<%=m%>_<%=n%>" 
     700  :pars:  
     701  - - <%= h %> 
     702    - <%= h %> 
     703    - <%= h %> 
     704  - 0.0001 
     705  :position:  
     706  - <%=  -12.0 +   l *2.1  -2.1*(m%2) %> 
     707  - <%=   12.5 +   m *1.05 %> 
     708  - <%= z-h/2.0 %> 
     709  :texture: <%= [1021,1022,1023,1015][n-1] %> 
     710  :color:  
     711  - <%= 2.0 %> 
     712  - <%= 1.5 %> 
     713  - <%= 1.5 %> 
     714<% end %> 
     715<% end %> 
     716<% end %> 
    623717 
    624718- :class: Box