Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 869 for code/branches


Ignore:
Timestamp:
Mar 9, 2008, 4:04:23 AM (17 years ago)
Author:
landauf
Message:

cool shit's happening here… it works! wow. I wonder why, but hey, don't ask, just commit. this update might also be helpful for the network guys.

  • fixed a bug in XMLPort
  • fixed a bug in the MultiTypes
  • implemented some XMLPort functions in Model, SpaceShip, Skybox and Ambient (and of course the WorldEntity), but this is just a workaround as all those classes are more or less just temporary solutions
Location:
code/branches/core
Files:
21 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core/bin/levels/sample.oxw

    r856 r869  
    1 <description>
    2   This is an orxonox sample level.
    3 </description>
    4 
    5 <loading>
    6   <background color="000000" image="textures/load_screens/ambush.png" />
    7   <bar top="200" left="50" width="300" height="20" image="textures/load_screens/ambush-loadbar.png" />
    8 </loading>
    9 
    10 <!--
    11 <ambient>
    12   <ogg src="allgorythm-lift_up" />
    13   <ogg src="allgorythm-resonance_blaster" />
    14   <ogg src="luke_grey_-_hypermode" />
    15   <ogg src="task_horizon_-_menu1" />
    16   <ogg src="tha_silent_partner_-_void" />
    17 </ambient>
    18 -->
    19 <!-- Keep a minimum distance of >100 to the object, otherwise the camara thinks it's in the object -->
    20 <!-- the value has to negative, as we want the camara behind the object -->
    21 <!--
    22 <Camera name="Camera" pos="0,50,-150" lookat="0,20,0" node="2OgreHeadNode" />
    23 <SpaceShip camera="true" position="0,0,0" scale="10" yaw="-90" pitch="-90" mesh="assf3.mesh"  forward="250" rotateupdown="100" rotaterightleft="100" looprightleft="100" />
    24 -->
    251<Ambient colourvalue="1,1,1" />
    262<Skybox src="Orxonox/StarSkyBox" />
    273
    28 <!--Fighter camera="true" position="0,0,0" scale="10" yaw="-90" pitch="-90" mesh="assf3.mesh"  forward="500" rotateupdown="200" rotaterightleft="200" looprightleft="200" /-->
    29 <SpaceShip camera="true" position="0,0,0" scale="10" yaw="-90" pitch="-90" mesh="assf5.mesh" maxSpeed="500" maxSideAndBackSpeed="50" maxRotation="1.0" transAcc="200" rotAcc="3.0" transDamp="75" rotDamp="1.0" />
     4<!--Fighter camera="true" position="0,0,0" scale="10" yawpitchroll="-90,-90,0" mesh="assf3.mesh"  forward="500" rotateupdown="200" rotaterightleft="200" looprightleft="200" /-->
     5<SpaceShip camera="true" position="0,0,0" scale="10" yawpitchroll="-90,-90,0" mesh="assf5.mesh" maxSpeed="500" maxSideAndBackSpeed="50" maxRotation="1.0" transAcc="200" rotAcc="3.0" transDamp="75" rotDamp="1.0" />
    306
    317<NPC position="0,100,400" scale="1" mesh="razor.mesh"/>
     
    3511<NPC position="100,0,400" scale="1" mesh="razor.mesh"/>
    3612
    37 <Model name="starship" position="(200,0,500)" scale="10" mesh="starship.mesh" yaw="-90" pitch="-90" />
    38 <Model name="drone" position="-200,0,500" scale="10" mesh="drone.mesh" yaw="-90" pitch="-90">
     13<Model name="starship" position="200,0,500" scale="10" mesh="starship.mesh" yawpitchroll="-90,-90,0" />
     14<Model name="drone" position="-200,0,500" scale="10" mesh="drone.mesh" yawpitchroll="-90,-90,0">
    3915  <attached>
    40     <Model name="drone2" position="200,-100,-500" scale="10" mesh="drone.mesh" yaw="-90" pitch="-90">
     16    <Model name="drone2" position="200,-100,-500" scale="10" mesh="drone.mesh" yawpitchroll="-90,-90,0">
    4117      <attached>
    42         <Model name="starship2" position="(500,200,-500)" scale="10" mesh="starship.mesh" yaw="-90" pitch="-90" />
     18        <Model name="starship2" position="500,200,-500" scale="10" mesh="starship.mesh" yawpitchroll="-90,-90,0" />
    4319      </attached>
    4420    </Model>
    4521  </attached>
    4622</Model>
    47 <!--
    48 <Model position="-200,1000,500" scale="10" mesh="hoover_body.mesh" yaw="-90" pitch="-90" />
    49 <Model position="-200,1000,500" scale="10" mesh="hoover_gear0.mesh" yaw="-90" pitch="-90" />
    50 <Model position="-200,1000,500" scale="10" mesh="hoover_gear1.mesh" yaw="-90" pitch="-90" />
    51 <Model position="-200,1000,500" scale="10" mesh="hoover_gear2.mesh" yaw="-90" pitch="-90" />
    52 <Model position="-200,1000,500" scale="10" mesh="hoover_turbine.mesh" yaw="-90" pitch="-90" />
     23
     24<Model position="-200,1000,500" scale="10" mesh="hoover_body.mesh" yawpitchroll="-90,-90,0" />
     25<Model position="-200,1000,500" scale="10" mesh="hoover_gear0.mesh" yawpitchroll="-90,-90,0" />
     26<Model position="-200,1000,500" scale="10" mesh="hoover_gear1.mesh" yawpitchroll="-90,-90,0" />
     27<Model position="-200,1000,500" scale="10" mesh="hoover_gear2.mesh" yawpitchroll="-90,-90,0" />
     28<Model position="-200,1000,500" scale="10" mesh="hoover_turbine.mesh" yawpitchroll="-90,-90,0" />
    5329
    5430
     
    5632<Model position="12893,-1583,-17939" scale="48" mesh="ast1.mesh" rotationAxis="0.0597998,0.923364,0" rotationRate="36" />
    5733<Model position="-2107,259,-19814" scale="29" mesh="ast4.mesh" rotationAxis="0.298639,0.96907,0" rotationRate="32" />
    58 -->
    59 <!-- Unused at the moment -->
    60 <!--  <SpaceshipSteeringObject node="OgreHeadNode" forward="500" rotateupdown="200" rotaterightleft="200" looprightleft="200" /> -->
    61 <!--
    62 <script file="intro.lua" />
    63 -->
     34
     35    <Model position="-9583,-2284,-19904" scale="33" mesh="ast5.mesh" rotationAxis="0,0.675659,0.0196445" rotationRate="44" />
     36    <Model position="-19597,-15494,3163" scale="37" mesh="ast5.mesh" rotationAxis="0.477996,0,0.048639" rotationRate="23" />
     37    <Model position="-182,6442,-4496" scale="25" mesh="ast5.mesh" rotationAxis="0.142225,0,0.154393" rotationRate="37" />
     38    <Model position="1004,-19639,-13744" scale="21" mesh="ast1.mesh" rotationAxis="0.974865,0.299775,0" rotationRate="29" />
     39    <Model position="-13204,-10191,-1555" scale="31" mesh="ast1.mesh" rotationAxis="0.41675,0,0.385001" rotationRate="42" />
     40    <Model position="-1843,12203,2346" scale="81" mesh="ast5.mesh" rotationAxis="0.221171,0,0.331917" rotationRate="41" />
     41    <Model position="-1560,-1443,-17416" scale="68" mesh="ast1.mesh" rotationAxis="0.653787,0.00935241,0" rotationRate="44" />
     42    <Model position="-7723,18661,3363" scale="94" mesh="ast5.mesh" rotationAxis="0.450345,0,0.417313" rotationRate="29" />
     43    <Model position="-8122,5764,16342" scale="45" mesh="ast4.mesh" rotationAxis="0.268558,0,0.089161" rotationRate="30" />
     44    <Model position="17575,-14054,-16710" scale="80" mesh="ast1.mesh" rotationAxis="0,0.615899,0.571064" rotationRate="18" />
     45    <Model position="-15304,-17381,4149" scale="32" mesh="ast6.mesh" rotationAxis="0.015051,0,0.764924" rotationRate="10" />
     46    <Model position="5587,2382,-13876" scale="49" mesh="ast4.mesh" rotationAxis="0.501173,0.208012,0" rotationRate="27" />
     47    <Model position="12167,-12466,-3364" scale="29" mesh="ast3.mesh" rotationAxis="0.897424,0.896971,0" rotationRate="21" />
     48    <Model position="3157,12173,4070" scale="78" mesh="ast2.mesh" rotationAxis="0.496178,0.760223,0" rotationRate="36" />
     49    <Model position="-13948,-6497,18368" scale="96" mesh="ast3.mesh" rotationAxis="0,0.0655793,0.17843" rotationRate="47" />
     50    <Model position="9304,-16367,-8429" scale="112" mesh="ast3.mesh" rotationAxis="0,0.220054,0.123838" rotationRate="10" />
     51    <Model position="-19293,9147,5573" scale="97" mesh="ast6.mesh" rotationAxis="0,0.0590435,0.200379" rotationRate="27" />
     52    <Model position="-13022,13902,19960" scale="67" mesh="ast6.mesh" rotationAxis="0,0.637161,0.286825" rotationRate="22" />
     53    <Model position="16898,12368,4477" scale="41" mesh="ast3.mesh" rotationAxis="0.962958,0,0.0295571" rotationRate="30" />
     54    <Model position="6687,12586,-11721" scale="33" mesh="ast2.mesh" rotationAxis="0.596958,0.326804,0" rotationRate="24" />
     55    <Model position="15066,11759,5229" scale="47" mesh="ast5.mesh" rotationAxis="0,0.993547,0.7269" rotationRate="45" />
     56    <Model position="7329,-9876,2203" scale="78" mesh="ast4.mesh" rotationAxis="0,0.170628,0.522448" rotationRate="31" />
     57    <Model position="-9132,9542,-14753" scale="20" mesh="ast6.mesh" rotationAxis="0.578006,0.738023,0" rotationRate="47" />
     58    <Model position="12958,2638,9476" scale="107" mesh="ast2.mesh" rotationAxis="0.815402,0.549519,0" rotationRate="42" />
     59    <Model position="3327,-10549,9196" scale="102" mesh="ast3.mesh" rotationAxis="0.403431,0,0.392179" rotationRate="43" />
     60    <Model position="-8947,15802,-16153" scale="72" mesh="ast3.mesh" rotationAxis="0,0.863891,0.789231" rotationRate="28" />
     61    <Model position="-5340,12944,14528" scale="108" mesh="ast2.mesh" rotationAxis="0.91406,0.865657,0" rotationRate="34" />
     62    <Model position="5107,5365,-5004" scale="75" mesh="ast6.mesh" rotationAxis="0,0.663461,0.406224" rotationRate="13" />
     63    <Model position="-6998,18403,8238" scale="70" mesh="ast6.mesh" rotationAxis="0.550689,0,0.834949" rotationRate="41" />
     64    <Model position="-9089,7495,-15512" scale="59" mesh="ast6.mesh" rotationAxis="0.0784585,0,0.580422" rotationRate="16" />
     65    <Model position="-6698,19465,14091" scale="70" mesh="ast5.mesh" rotationAxis="0,0.0536133,0.663091" rotationRate="48" />
     66    <Model position="-9943,9390,19361" scale="115" mesh="ast3.mesh" rotationAxis="0.745415,0.302601,0" rotationRate="25" />
     67    <Model position="9341,-6947,7223" scale="49" mesh="ast1.mesh" rotationAxis="0.0217983,0.829754,0" rotationRate="40" />
     68    <Model position="10259,8970,-7673" scale="70" mesh="ast3.mesh" rotationAxis="0,0.705347,0.0544375" rotationRate="30" />
     69    <Model position="4538,-17169,-15829" scale="119" mesh="ast4.mesh" rotationAxis="0.659901,0,0.6408" rotationRate="42" />
     70    <Model position="7746,-9746,14917" scale="89" mesh="ast4.mesh" rotationAxis="0.579678,0,0.632015" rotationRate="46" />
     71    <Model position="-4550,1554,11166" scale="49" mesh="ast1.mesh" rotationAxis="0.805799,0.905452,0" rotationRate="25" />
     72    <Model position="-4571,-14392,14887" scale="20" mesh="ast2.mesh" rotationAxis="0.163796,0.62884,0" rotationRate="38" />
     73    <Model position="18390,-19165,-6118" scale="28" mesh="ast2.mesh" rotationAxis="0.386394,0,0.290423" rotationRate="39" />
     74    <Model position="-19119,8707,-11377" scale="119" mesh="ast1.mesh" rotationAxis="0.912683,0,0.722097" rotationRate="17" />
     75    <Model position="-15827,6956,-3785" scale="32" mesh="ast1.mesh" rotationAxis="0.901503,0,0.548708" rotationRate="29" />
     76    <Model position="1956,-13954,18055" scale="59" mesh="ast1.mesh" rotationAxis="0,0.0523992,0.756846" rotationRate="15" />
     77    <Model position="2197,-13870,-11528" scale="92" mesh="ast2.mesh" rotationAxis="0.469413,0,0.742143" rotationRate="13" />
     78    <Model position="7377,6656,5591" scale="64" mesh="ast6.mesh" rotationAxis="0,0.599119,0.890718" rotationRate="36" />
     79    <Model position="16123,8784,-7928" scale="50" mesh="ast6.mesh" rotationAxis="0.648018,0,0.522075" rotationRate="41" />
     80    <Model position="-12751,-2191,-11527" scale="94" mesh="ast2.mesh" rotationAxis="0,0.715065,0.332238" rotationRate="36" />
     81    <Model position="18020,-16499,18874" scale="31" mesh="ast6.mesh" rotationAxis="0,0.0608362,0.523216" rotationRate="13" />
     82    <Model position="-15807,-7678,16780" scale="37" mesh="ast1.mesh" rotationAxis="0,0.658659,0.0366738" rotationRate="18" />
     83    <Model position="-17711,-14807,13817" scale="82" mesh="ast6.mesh" rotationAxis="0.16894,0,0.131653" rotationRate="10" />
     84    <Model position="-4428,5259,9741" scale="66" mesh="ast6.mesh" rotationAxis="0.424995,0.0971331,0" rotationRate="39" />
     85    <Model position="1682,8250,263" scale="34" mesh="ast2.mesh" rotationAxis="0,0.509205,0.22658" rotationRate="35" />
     86    <Model position="13624,-5594,12058" scale="61" mesh="ast5.mesh" rotationAxis="0,0.786326,0.21092" rotationRate="41" />
     87    <Model position="-5772,8251,15090" scale="89" mesh="ast6.mesh" rotationAxis="0.446662,0,0.039521" rotationRate="46" />
     88    <Model position="18732,8386,-17834" scale="115" mesh="ast3.mesh" rotationAxis="0.484641,0.0994628,0" rotationRate="29" />
     89    <Model position="-4662,-13023,1337" scale="116" mesh="ast3.mesh" rotationAxis="0.575875,0.380544,0" rotationRate="34" />
     90    <Model position="3193,-18575,-13293" scale="55" mesh="ast3.mesh" rotationAxis="0,0.562414,0.669598" rotationRate="23" />
     91    <Model position="-18127,15281,-9961" scale="59" mesh="ast5.mesh" rotationAxis="0,0.430401,0.690096" rotationRate="20" />
     92    <Model position="-3978,-10245,108" scale="80" mesh="ast4.mesh" rotationAxis="0,0.0821224,0.236512" rotationRate="25" />
     93    <Model position="-11319,-12567,5192" scale="109" mesh="ast2.mesh" rotationAxis="0.39942,0,0.537407" rotationRate="24" />
     94    <Model position="-4977,-3230,-7025" scale="34" mesh="ast2.mesh" rotationAxis="0,0.464353,0.474219" rotationRate="31" />
     95    <Model position="10069,-14931,15176" scale="97" mesh="ast6.mesh" rotationAxis="0.173174,0.520451,0" rotationRate="26" />
     96    <Model position="2766,-16062,-10919" scale="78" mesh="ast4.mesh" rotationAxis="0.521386,0,0.717508" rotationRate="36" />
     97    <Model position="-9128,12247,2916" scale="67" mesh="ast2.mesh" rotationAxis="0.347868,0.717047,0" rotationRate="28" />
     98    <Model position="6440,-16563,-18432" scale="36" mesh="ast5.mesh" rotationAxis="0.265539,0,0.71717" rotationRate="35" />
     99    <Model position="12669,-1534,2196" scale="71" mesh="ast2.mesh" rotationAxis="0,0.472099,0.464159" rotationRate="40" />
     100    <Model position="172,-18075,11429" scale="108" mesh="ast5.mesh" rotationAxis="0.0320382,0.32207,0" rotationRate="16" />
     101    <Model position="2426,8901,-3677" scale="114" mesh="ast5.mesh" rotationAxis="0.778803,0.0691138,0" rotationRate="46" />
     102    <Model position="-4576,-13668,14863" scale="40" mesh="ast6.mesh" rotationAxis="0.979052,0.428032,0" rotationRate="30" />
     103    <Model position="9222,-15457,4825" scale="24" mesh="ast6.mesh" rotationAxis="0,0.106496,0.409635" rotationRate="38" />
     104    <Model position="-3613,-4696,-13838" scale="82" mesh="ast4.mesh" rotationAxis="0.676407,0,0.69673" rotationRate="16" />
     105    <Model position="12743,-1674,8050" scale="78" mesh="ast3.mesh" rotationAxis="0.161952,0.389888,0" rotationRate="19" />
     106    <Model position="3398,-19196,10512" scale="96" mesh="ast1.mesh" rotationAxis="0,0.799917,0.520012" rotationRate="38" />
     107    <Model position="-2837,-9264,-11236" scale="97" mesh="ast4.mesh" rotationAxis="0.892116,0,0.048004" rotationRate="22" />
     108    <Model position="13220,-13790,-9710" scale="90" mesh="ast5.mesh" rotationAxis="0,0.931551,0.148539" rotationRate="19" />
     109    <Model position="-9560,19189,2493" scale="24" mesh="ast2.mesh" rotationAxis="0.169182,0.962125,0" rotationRate="22" />
     110    <Model position="-18545,-13577,5941" scale="92" mesh="ast4.mesh" rotationAxis="0,0.145122,0.499773" rotationRate="24" />
     111    <Model position="-12874,-481,7016" scale="89" mesh="ast4.mesh" rotationAxis="0,0.878644,0.744372" rotationRate="31" />
     112    <Model position="5290,-11553,-15958" scale="103" mesh="ast4.mesh" rotationAxis="0,0.0858311,0.860834" rotationRate="26" />
     113    <Model position="-18189,19019,16471" scale="72" mesh="ast4.mesh" rotationAxis="0,0.206421,0.423981" rotationRate="33" />
     114    <Model position="13736,17565,-4338" scale="72" mesh="ast1.mesh" rotationAxis="0.647033,0,0.0993164" rotationRate="26" />
     115    <Model position="-11103,-18306,17096" scale="112" mesh="ast6.mesh" rotationAxis="0.938456,0.184833,0" rotationRate="17" />
     116    <Model position="16665,322,-13614" scale="57" mesh="ast5.mesh" rotationAxis="0,0.850806,0.942188" rotationRate="30" />
     117    <Model position="-13234,-5004,-19934" scale="100" mesh="ast6.mesh" rotationAxis="0.712244,0.214422,0" rotationRate="30" />
     118    <Model position="2334,-2954,-17614" scale="50" mesh="ast5.mesh" rotationAxis="0.62725,0,0.646295" rotationRate="22" />
     119    <Model position="16214,-12149,-6186" scale="72" mesh="ast1.mesh" rotationAxis="0,0.6434,0.0914027" rotationRate="40" />
     120    <Model position="-11746,15630,-12814" scale="92" mesh="ast1.mesh" rotationAxis="0.0516508,0,0.534206" rotationRate="31" />
     121    <Model position="19389,-8340,17620" scale="96" mesh="ast5.mesh" rotationAxis="0.806963,0.925497,0" rotationRate="19" />
     122    <Model position="12269,18075,5380" scale="103" mesh="ast6.mesh" rotationAxis="0,0.685539,0.0816417" rotationRate="38" />
     123    <Model position="16499,13080,-14830" scale="58" mesh="ast3.mesh" rotationAxis="0.776935,0.430662,0" rotationRate="21" />
     124    <Model position="14398,-9629,16663" scale="90" mesh="ast2.mesh" rotationAxis="0.405098,0.0716397,0" rotationRate="31" />
     125    <Model position="16021,-8497,-11384" scale="73" mesh="ast1.mesh" rotationAxis="0.284874,0.262371,0" rotationRate="22" />
     126    <Model position="-12197,19157,-5268" scale="46" mesh="ast6.mesh" rotationAxis="0.301399,0,0.852104" rotationRate="42" />
     127    <Model position="3523,-10238,-17036" scale="58" mesh="ast3.mesh" rotationAxis="0.408875,0,0.896493" rotationRate="32" />
     128    <Model position="-9942,2328,437" scale="47" mesh="ast6.mesh" rotationAxis="0.391488,0.552897,0" rotationRate="18" />
     129    <Model position="-5089,13146,2485" scale="115" mesh="ast3.mesh" rotationAxis="0,0.77605,0.0301674" rotationRate="46" />
     130    <Model position="-3325,16428,-42" scale="59" mesh="ast4.mesh" rotationAxis="0.80208,0.306772,0" rotationRate="11" />
     131    <Model position="-8399,370,12441" scale="58" mesh="ast4.mesh" rotationAxis="0,0.673135,0.940884" rotationRate="46" />
     132    <Model position="12101,13398,-15098" scale="58" mesh="ast2.mesh" rotationAxis="0.168778,0,0.0517661" rotationRate="38" />
     133    <Model position="-2875,-11869,11008" scale="55" mesh="ast3.mesh" rotationAxis="0,0.248125,0.642059" rotationRate="40" />
     134    <Model position="1690,-9053,14913" scale="52" mesh="ast4.mesh" rotationAxis="0.454649,0.81489,0" rotationRate="23" />
     135    <Model position="17507,7536,-8757" scale="29" mesh="ast3.mesh" rotationAxis="0.947894,0,0.283392" rotationRate="41" />
     136    <Model position="-1623,-12605,-14277" scale="58" mesh="ast3.mesh" rotationAxis="0,0.253805,0.162647" rotationRate="46" />
     137    <Model position="-4045,-535,-14585" scale="88" mesh="ast4.mesh" rotationAxis="0.257327,0,0.894532" rotationRate="24" />
     138    <Model position="-9199,715,4150" scale="117" mesh="ast5.mesh" rotationAxis="0.359984,0,0.231855" rotationRate="18" />
     139    <Model position="3202,-6145,19403" scale="97" mesh="ast6.mesh" rotationAxis="0,0.470211,0.784929" rotationRate="11" />
     140    <Model position="127,-9694,1418" scale="62" mesh="ast1.mesh" rotationAxis="0.0974775,0.108828,0" rotationRate="33" />
     141    <Model position="-1033,-8523,14218" scale="89" mesh="ast1.mesh" rotationAxis="0.483568,0,0.581196" rotationRate="14" />
     142    <Model position="-28,-1140,7779" scale="47" mesh="ast2.mesh" rotationAxis="0.0572967,0.588805,0" rotationRate="25" />
     143    <Model position="-2434,-17785,-6679" scale="104" mesh="ast2.mesh" rotationAxis="0,0.458048,0.639973" rotationRate="37" />
     144    <Model position="4260,8520,-1144" scale="51" mesh="ast3.mesh" rotationAxis="0.403191,0,0.167267" rotationRate="33" />
     145    <Model position="-3288,-10630,-16957" scale="111" mesh="ast4.mesh" rotationAxis="0.451879,0.909329,0" rotationRate="34" />
     146    <Model position="9481,13063,8871" scale="74" mesh="ast6.mesh" rotationAxis="0.962342,0,0.728256" rotationRate="12" />
     147    <Model position="-13869,-19298,8075" scale="107" mesh="ast4.mesh" rotationAxis="0.989258,0,0.644457" rotationRate="38" />
     148    <Model position="946,11917,5191" scale="109" mesh="ast5.mesh" rotationAxis="0.495949,0,0.243745" rotationRate="20" />
     149    <Model position="7633,-4709,8785" scale="77" mesh="ast2.mesh" rotationAxis="0.167179,0,0.393167" rotationRate="10" />
     150    <Model position="-19647,-5229,19334" scale="48" mesh="ast6.mesh" rotationAxis="0.358825,0.560023,0" rotationRate="20" />
     151    <Model position="-17999,8929,-15681" scale="112" mesh="ast3.mesh" rotationAxis="0,0.243106,0.553743" rotationRate="37" />
     152    <Model position="8866,-1606,7639" scale="23" mesh="ast4.mesh" rotationAxis="0,0.605223,0.587725" rotationRate="31" />
     153    <Model position="-11575,15941,-9048" scale="32" mesh="ast4.mesh" rotationAxis="0.0341828,0.453673,0" rotationRate="45" />
     154    <Model position="13969,15246,-7756" scale="109" mesh="ast5.mesh" rotationAxis="0.755033,0,0.296033" rotationRate="20" />
     155    <Model position="-2325,19875,-19124" scale="86" mesh="ast2.mesh" rotationAxis="0.966503,0.242477,0" rotationRate="12" />
     156    <Model position="10304,19403,4335" scale="77" mesh="ast4.mesh" rotationAxis="0,0.00236773,0.681625" rotationRate="47" />
     157    <Model position="18514,-3055,13163" scale="78" mesh="ast5.mesh" rotationAxis="0,0.515333,0.653287" rotationRate="43" />
     158    <Model position="5789,11308,15861" scale="37" mesh="ast5.mesh" rotationAxis="0,0.382628,0.808718" rotationRate="45" />
     159    <Model position="-2178,6872,18230" scale="77" mesh="ast2.mesh" rotationAxis="0.297912,0,0.219303" rotationRate="31" />
     160    <Model position="7070,-4542,19838" scale="105" mesh="ast5.mesh" rotationAxis="0.687377,0.740396,0" rotationRate="22" />
     161    <Model position="-12823,16872,9832" scale="58" mesh="ast1.mesh" rotationAxis="0.58246,0,0.787929" rotationRate="20" />
     162    <Model position="2918,6409,8922" scale="68" mesh="ast1.mesh" rotationAxis="0.17433,0,0.826748" rotationRate="39" />
     163    <Model position="-8622,5979,-8353" scale="36" mesh="ast5.mesh" rotationAxis="0.0687289,0.268192,0" rotationRate="46" />
     164    <Model position="5979,-7415,3301" scale="31" mesh="ast6.mesh" rotationAxis="0,0.0143773,0.425826" rotationRate="46" />
     165    <Model position="-7788,19257,6317" scale="106" mesh="ast2.mesh" rotationAxis="0,0.266194,0.403447" rotationRate="39" />
     166    <Model position="12192,-12550,8480" scale="60" mesh="ast1.mesh" rotationAxis="0,0.734682,0.846663" rotationRate="25" />
     167    <Model position="440,17184,-7600" scale="113" mesh="ast4.mesh" rotationAxis="0.449652,0,0.149964" rotationRate="24" />
     168    <Model position="-12127,-16899,-8417" scale="110" mesh="ast6.mesh" rotationAxis="0,0.650716,0.368006" rotationRate="11" />
     169    <Model position="-9670,-7112,18003" scale="30" mesh="ast5.mesh" rotationAxis="0,0.139076,0.954704" rotationRate="14" />
     170    <Model position="-12697,177,7300" scale="75" mesh="ast3.mesh" rotationAxis="0.266301,0.479015,0" rotationRate="42" />
     171    <Model position="8585,-11163,10773" scale="88" mesh="ast4.mesh" rotationAxis="0.466253,0,0.430903" rotationRate="47" />
     172    <Model position="11710,-10481,-1554" scale="86" mesh="ast1.mesh" rotationAxis="0,0.964012,0.587305" rotationRate="35" />
     173    <Model position="-2643,-17331,-997" scale="77" mesh="ast1.mesh" rotationAxis="0.156293,0,0.663295" rotationRate="39" />
     174    <Model position="19531,-19531,-12541" scale="24" mesh="ast2.mesh" rotationAxis="0,0.848482,0.338155" rotationRate="17" />
     175    <Model position="7408,8762,3078" scale="26" mesh="ast5.mesh" rotationAxis="0.993064,0.489089,0" rotationRate="21" />
     176    <Model position="-14555,8711,8121" scale="20" mesh="ast6.mesh" rotationAxis="0.831339,0,0.151149" rotationRate="32" />
     177    <Model position="13295,-1765,5131" scale="26" mesh="ast1.mesh" rotationAxis="0,0.357794,0.743133" rotationRate="30" />
     178    <Model position="-19884,7732,-1186" scale="115" mesh="ast3.mesh" rotationAxis="0.958775,0,0.669833" rotationRate="23" />
     179    <Model position="18179,-17940,-19923" scale="20" mesh="ast5.mesh" rotationAxis="0.878644,0,0.217331" rotationRate="44" />
     180    <Model position="300,-9529,2789" scale="51" mesh="ast3.mesh" rotationAxis="0.54208,0,0.14456" rotationRate="37" />
     181    <Model position="14279,-9293,-11689" scale="114" mesh="ast3.mesh" rotationAxis="0,0.601114,0.645571" rotationRate="33" />
     182    <Model position="-14721,-14492,-18237" scale="76" mesh="ast3.mesh" rotationAxis="0.261656,0.207217,0" rotationRate="28" />
     183    <Model position="-1436,16914,6450" scale="73" mesh="ast1.mesh" rotationAxis="0.0323497,0,0.291569" rotationRate="28" />
     184    <Model position="19533,5238,-16963" scale="65" mesh="ast5.mesh" rotationAxis="0.0116926,0.373665,0" rotationRate="18" />
     185    <Model position="13828,8837,-12011" scale="111" mesh="ast5.mesh" rotationAxis="0,0.153227,0.382767" rotationRate="22" />
     186    <Model position="-18321,8723,2799" scale="49" mesh="ast6.mesh" rotationAxis="0.96622,0.89771,0" rotationRate="30" />
     187    <Model position="-15854,16336,11058" scale="103" mesh="ast2.mesh" rotationAxis="0.0964953,0,0.375937" rotationRate="27" />
     188    <Model position="-18187,-9952,-18073" scale="22" mesh="ast6.mesh" rotationAxis="0.61819,0.17807,0" rotationRate="33" />
     189    <Model position="-15558,-3796,17538" scale="113" mesh="ast2.mesh" rotationAxis="0.384199,0,0.383805" rotationRate="15" />
     190    <Model position="1366,12633,14581" scale="97" mesh="ast6.mesh" rotationAxis="0.930072,0,0.824122" rotationRate="22" />
     191    <Model position="-17562,12612,-2860" scale="85" mesh="ast1.mesh" rotationAxis="0.872863,0,0.10971" rotationRate="45" />
     192    <Model position="-6467,11186,272" scale="43" mesh="ast4.mesh" rotationAxis="0,0.12058,0.8878" rotationRate="32" />
     193    <Model position="-9182,-5778,-18432" scale="72" mesh="ast4.mesh" rotationAxis="0,0.317,0.972754" rotationRate="28" />
     194    <Model position="-2685,2227,-7017" scale="75" mesh="ast1.mesh" rotationAxis="0.00795897,0.859802,0" rotationRate="13" />
     195    <Model position="202,2704,7869" scale="94" mesh="ast5.mesh" rotationAxis="0,0.0867517,0.971227" rotationRate="49" />
     196    <Model position="3157,2393,4862" scale="45" mesh="ast2.mesh" rotationAxis="0.143034,0,0.945654" rotationRate="46" />
     197    <Model position="17734,11752,-2817" scale="37" mesh="ast3.mesh" rotationAxis="0.380276,0,0.284309" rotationRate="16" />
     198    <Model position="5533,9168,-2009" scale="23" mesh="ast5.mesh" rotationAxis="0,0.59324,0.275897" rotationRate="28" />
     199    <Model position="-5583,14555,-13629" scale="99" mesh="ast2.mesh" rotationAxis="0.246217,0,0.279914" rotationRate="12" />
     200    <Model position="5755,18319,-13966" scale="111" mesh="ast1.mesh" rotationAxis="0.945343,0.981593,0" rotationRate="19" />
     201    <Model position="-506,19330,10258" scale="57" mesh="ast2.mesh" rotationAxis="0.156282,0.449472,0" rotationRate="28" />
     202    <Model position="-18180,10800,-19387" scale="111" mesh="ast4.mesh" rotationAxis="0,0.138856,0.558955" rotationRate="46" />
     203    <Model position="-19442,9153,6667" scale="65" mesh="ast3.mesh" rotationAxis="0.496782,0,0.891285" rotationRate="18" />
     204    <Model position="-1991,12109,-18981" scale="39" mesh="ast1.mesh" rotationAxis="0.251609,0.291046,0" rotationRate="16" />
     205    <Model position="3016,6118,758" scale="102" mesh="ast4.mesh" rotationAxis="0.0817345,0.394506,0" rotationRate="36" />
     206    <Model position="-5930,6728,8780" scale="57" mesh="ast6.mesh" rotationAxis="0.266048,0.376193,0" rotationRate="19" />
     207    <Model position="-747,-11495,13870" scale="44" mesh="ast3.mesh" rotationAxis="0.414018,0,0.750772" rotationRate="21" />
     208    <Model position="305,-7504,9849" scale="83" mesh="ast1.mesh" rotationAxis="0.984976,0,0.0811671" rotationRate="25" />
     209    <Model position="4685,-10642,-2497" scale="85" mesh="ast6.mesh" rotationAxis="0.415558,0.751553,0" rotationRate="27" />
     210    <Model position="17354,16699,2394" scale="44" mesh="ast1.mesh" rotationAxis="0.693572,0.147356,0" rotationRate="35" />
     211    <Model position="9192,-17477,-14279" scale="61" mesh="ast2.mesh" rotationAxis="0.461486,0,0.928585" rotationRate="41" />
     212    <Model position="8023,-15706,-19451" scale="98" mesh="ast6.mesh" rotationAxis="0,0.000410601,0.90886" rotationRate="23" />
     213    <Model position="-4958,16296,-4095" scale="109" mesh="ast1.mesh" rotationAxis="0.533062,0,0.249216" rotationRate="47" />
     214    <Model position="843,16586,-13247" scale="36" mesh="ast6.mesh" rotationAxis="0,0.594639,0.732396" rotationRate="38" />
     215    <Model position="19074,8315,17723" scale="95" mesh="ast2.mesh" rotationAxis="0.966402,0,0.119558" rotationRate="44" />
     216    <Model position="-12490,734,18210" scale="35" mesh="ast4.mesh" rotationAxis="0.0976298,0.455641,0" rotationRate="24" />
     217    <Model position="-11940,6896,-17968" scale="33" mesh="ast1.mesh" rotationAxis="0,0.77757,0.432964" rotationRate="39" />
     218    <Model position="-2941,-2680,-17184" scale="54" mesh="ast2.mesh" rotationAxis="0.350042,0,0.659718" rotationRate="22" />
     219    <Model position="-9114,5177,-14254" scale="69" mesh="ast1.mesh" rotationAxis="0.65862,0.380363,0" rotationRate="27" />
     220    <Model position="-7909,1216,-6815" scale="44" mesh="ast2.mesh" rotationAxis="0,0.031546,0.392351" rotationRate="31" />
     221    <Model position="1091,-3609,53" scale="27" mesh="ast1.mesh" rotationAxis="0.702045,0.669888,0" rotationRate="17" />
     222    <Model position="8211,-10441,-7536" scale="30" mesh="ast3.mesh" rotationAxis="0,0.792689,0.311823" rotationRate="17" />
     223    <Model position="1533,8849,17655" scale="38" mesh="ast6.mesh" rotationAxis="0,0.742122,0.71549" rotationRate="49" />
     224    <Model position="6546,-5931,9791" scale="71" mesh="ast1.mesh" rotationAxis="0.373001,0,0.854548" rotationRate="47" />
     225    <Model position="14884,-14921,13589" scale="20" mesh="ast4.mesh" rotationAxis="0,0.874073,0.518839" rotationRate="28" />
     226    <Model position="-4888,1727,-581" scale="40" mesh="ast1.mesh" rotationAxis="0,0.612156,0.58926" rotationRate="49" />
     227    <Model position="16617,1806,15260" scale="28" mesh="ast1.mesh" rotationAxis="0.437493,0,0.353516" rotationRate="27" />
     228    <Model position="17792,4774,-5272" scale="101" mesh="ast3.mesh" rotationAxis="0,0.916476,0.853167" rotationRate="46" />
     229    <Model position="12856,255,-5396" scale="47" mesh="ast6.mesh" rotationAxis="0,0.18605,0.637593" rotationRate="26" />
     230    <Model position="-17573,-12764,13494" scale="107" mesh="ast5.mesh" rotationAxis="0.573851,0,0.982895" rotationRate="16" />
     231    <Model position="19722,-1137,-18060" scale="71" mesh="ast5.mesh" rotationAxis="0.273151,0.392637,0" rotationRate="34" />
     232    <Model position="12155,-1739,-17329" scale="31" mesh="ast2.mesh" rotationAxis="0,0.891737,0.832436" rotationRate="22" />
     233    <Model position="-4996,-11586,-15279" scale="119" mesh="ast2.mesh" rotationAxis="0,0.123074,0.209338" rotationRate="16" />
     234    <Model position="-13104,865,-611" scale="57" mesh="ast3.mesh" rotationAxis="0.393178,0,0.345322" rotationRate="18" />
     235    <Model position="15005,-9877,15622" scale="97" mesh="ast1.mesh" rotationAxis="0,0.152896,0.0210835" rotationRate="25" />
     236    <Model position="17583,9888,16829" scale="76" mesh="ast2.mesh" rotationAxis="0,0.947973,0.28026" rotationRate="15" />
     237    <Model position="-5279,15909,15382" scale="82" mesh="ast1.mesh" rotationAxis="0,0.499884,0.773145" rotationRate="18" />
     238    <Model position="-5938,14646,17243" scale="56" mesh="ast6.mesh" rotationAxis="0,0.0967167,0.348338" rotationRate="16" />
     239    <Model position="19518,17215,-1274" scale="119" mesh="ast1.mesh" rotationAxis="0.223859,0,0.252346" rotationRate="44" />
     240    <Model position="-16237,-17619,-6745" scale="65" mesh="ast6.mesh" rotationAxis="0.0241466,0.491285,0" rotationRate="39" />
     241    <Model position="12763,1468,-3165" scale="78" mesh="ast3.mesh" rotationAxis="0.800474,0.278164,0" rotationRate="37" />
     242    <Model position="13946,-7517,13683" scale="92" mesh="ast1.mesh" rotationAxis="0.142206,0.894399,0" rotationRate="40" />
     243    <Model position="-5491,-1084,-11117" scale="84" mesh="ast2.mesh" rotationAxis="0.174864,0,0.298694" rotationRate="14" />
     244    <Model position="2799,9189,7344" scale="54" mesh="ast3.mesh" rotationAxis="0.330476,0.71494,0" rotationRate="31" />
     245    <Model position="-18445,-17042,3296" scale="110" mesh="ast6.mesh" rotationAxis="0,0.320011,0.644437" rotationRate="20" />
     246    <Model position="-15377,5559,-12082" scale="26" mesh="ast4.mesh" rotationAxis="0,0.451157,0.102375" rotationRate="20" />
     247    <Model position="-2331,-14260,17200" scale="85" mesh="ast5.mesh" rotationAxis="0.0446891,0.515642,0" rotationRate="37" />
     248    <Model position="-9613,-4258,4537" scale="103" mesh="ast1.mesh" rotationAxis="0.820812,0.60695,0" rotationRate="13" />
     249    <Model position="-6169,19264,-4878" scale="69" mesh="ast3.mesh" rotationAxis="0,0.585115,0.235653" rotationRate="32" />
     250    <Model position="8717,-16685,9115" scale="37" mesh="ast4.mesh" rotationAxis="0.0512168,0.899599,0" rotationRate="15" />
     251    <Model position="18826,17155,4947" scale="84" mesh="ast4.mesh" rotationAxis="0.204495,0,0.838098" rotationRate="48" />
     252    <Model position="7971,3645,-9858" scale="65" mesh="ast3.mesh" rotationAxis="0.348379,0,0.384062" rotationRate="19" />
     253    <Model position="9202,8689,-6795" scale="37" mesh="ast4.mesh" rotationAxis="0.826781,0,0.641626" rotationRate="40" />
     254    <Model position="-12115,6664,5786" scale="105" mesh="ast1.mesh" rotationAxis="0.794331,0.43244,0" rotationRate="40" />
     255    <Model position="17142,15709,-8725" scale="57" mesh="ast5.mesh" rotationAxis="0,0.561188,0.300935" rotationRate="36" />
     256    <Model position="1991,-11949,-15733" scale="68" mesh="ast1.mesh" rotationAxis="0,0.390655,0.623811" rotationRate="41" />
     257    <Model position="-6787,1792,287" scale="71" mesh="ast6.mesh" rotationAxis="0.161019,0.130015,0" rotationRate="36" />
     258    <Model position="-7223,-13574,-11873" scale="24" mesh="ast4.mesh" rotationAxis="0.792203,0,0.177188" rotationRate="38" />
  • code/branches/core/src/orxonox/CMakeLists.txt

    r852 r869  
    66#  SpaceshipSteering.cc
    77#  hud/HUD.cc
    8 #  particle/ParticleInterface.cc
    9 #  tools/BillboardSet.cc
     8  particle/ParticleInterface.cc
     9  tools/BillboardSet.cc
    1010#  tools/Light.cc
    1111  tools/Mesh.cc
    1212  tools/Timer.cc
    13 #  objects/Ambient.cc
     13  objects/Ambient.cc
    1414#  objects/Camera.cc
    15 #  objects/Explosion.cc
     15  objects/Explosion.cc
    1616#  objects/Fighter.cc
    1717  objects/Model.cc
    1818#  objects/NPC.cc
    19 #  objects/Projectile.cc
    20 #  objects/Skybox.cc
    21 #  objects/SpaceShip.cc
     19  objects/Projectile.cc
     20  objects/Skybox.cc
     21  objects/SpaceShip.cc
    2222#  objects/SpaceshipSteeringObject.cc
    2323  objects/test1.cc
  • code/branches/core/src/orxonox/Orxonox.cc

    r852 r869  
    209209  {
    210210    //TODO: start modules
    211 //    ogre_->startRender();
     211    ogre_->startRender();
    212212    //TODO: run engine
    213213    Factory::createClassHierarchy();
    214 //    createScene();
    215 //    setupScene();
    216 //    setupInputSystem();
     214    createScene();
     215    setupScene();
     216    setupInputSystem();
    217217    if(mode_!=CLIENT){ // remove this in future ---- presentation hack
    218218    }
     
    11461146        std::cout << "2\n";
    11471147
    1148 //    startRenderLoop();
     1148    startRenderLoop();
    11491149  }
    11501150
  • code/branches/core/src/orxonox/core/XMLPort.cc

    r856 r869  
    2828#include "XMLPort.h"
    2929#include "Language.h"
     30#include "Loader.h"
    3031
    3132namespace orxonox
     
    8283        return GetLocalisation(this->description_);
    8384    }
     85
     86    bool XMLPortObjectContainer::identifierIsIncludedInLoaderMask(const Identifier* identifier)
     87    {
     88        return Loader::currentMask_s.isIncluded(identifier);
     89    }
    8490}
  • code/branches/core/src/orxonox/core/XMLPort.h

    r858 r869  
    3737#include "CoreIncludes.h"
    3838#include "BaseObject.h"
    39 #include "Loader.h"
    4039
    4140#include "CorePrereqs.h"
     
    142141                                {
    143142                                    COUT(5) << tokens.size() << " parameter (using MultiTypeMath)." << std::endl;
    144                                     MultiTypeMath param1, param2, param3, param4, param5;
     143                                    MultiTypeMath param1 = MT_null, param2 = MT_null, param3 = MT_null, param4 = MT_null, param5 = MT_null;
    145144                                    if (tokens.size() >= 1) param1 = tokens[0];
    146                                     if (tokens.size() >= 2) param1 = tokens[1];
    147                                     if (tokens.size() >= 3) param1 = tokens[2];
    148                                     if (tokens.size() >= 4) param1 = tokens[3];
    149                                     if (tokens.size() >= 5) param1 = tokens[4];
     145                                    if (tokens.size() >= 2) param2 = tokens[1];
     146                                    if (tokens.size() >= 3) param3 = tokens[2];
     147                                    if (tokens.size() >= 4) param4 = tokens[3];
     148                                    if (tokens.size() >= 5) param5 = tokens[4];
    150149                                    COUT(5) << object->getLoaderIndentation() << "  " << attribute << std::endl;
    151                                     COUT(5) << object->getLoaderIndentation() << "  " << tokens[0] << " -> " << param1 << ", " << tokens[1] << " -> " << param2 << ", " << tokens[2] << " -> " << param3 << ", " << tokens[3] << " -> " << param4 << ", " << tokens[4] << " -> " << param5 << std::endl;
     150                                    COUT(5) << object->getLoaderIndentation() << "  " << param1 << ", " << param2 << ", " << param3 << ", " << param4 << ", " << param5 << std::endl;
    152151
    153152                                    (*this->loadfunction_)(object, param1, param2, param3, param4, param5);
     
    197196            XMLPortObjectContainer& description(const std::string description);
    198197            const std::string& getDescription();
     198            static bool identifierIsIncludedInLoaderMask(const Identifier* identifier);
    199199
    200200        protected:
     
    236236                                    if (identifier->isA(Class(O)))
    237237                                    {
    238                                         if (Loader::currentMask_s.isIncluded(identifier))
     238                                        if (this->identifierIsIncludedInLoaderMask(identifier))
    239239                                        {
    240240                                            COUT(4) << object->getLoaderIndentation() << "fabricating " << child->Value() << "..." << std::endl;
  • code/branches/core/src/orxonox/objects/Ambient.cc

    r845 r869  
    4040#include "../core/CoreIncludes.h"
    4141#include "../Orxonox.h"
     42#include "core/XMLPort.h"
    4243
    4344#include "Ambient.h"
     
    5859    void Ambient::loadParams(TiXmlElement* xmlElem)
    5960    {
    60         Ogre::SceneManager* mgr = orxonox::Orxonox::getSingleton()->getSceneManager();
    61 
    6261        if (xmlElem->Attribute("colourvalue"))
    6362        {
     
    6968                String2Number<float>(b, colourvalues[2]);
    7069
    71                 mgr->setAmbientLight(ColourValue(r,g,b));
     70                this->setAmbientLight(ColourValue(r, g, b));
    7271
    7372                COUT(4) << "Loader: Set ambient light: "<<r<<" " << g << " " << b  << std::endl << std::endl;
    7473        }
    7574   }
     75
     76   void Ambient::setAmbientLight(const ColourValue& colour)
     77   {
     78        Orxonox::getSingleton()->getSceneManager()->setAmbientLight(colour);
     79   }
     80
     81    /**
     82        @brief XML loading and saving.
     83        @param xmlelement The XML-element
     84        @param loading Loading (true) or saving (false)
     85        @return The XML-element
     86    */
     87    Element& Ambient::XMLPort(Element& xmlelement, bool loading)
     88    {
     89        BaseObject::XMLPort(xmlelement, loading);
     90
     91        XMLPortParamLoadOnly(Ambient, "colourvalue", setAmbientLight, xmlelement, loading);
     92
     93        return xmlelement;
     94    }
    7695}
  • code/branches/core/src/orxonox/objects/Ambient.h

    r845 r869  
    1414            virtual ~Ambient();
    1515
    16 
    1716            void loadParams(TiXmlElement* xmlElem);
     17            virtual Element& XMLPort(Element& xmlelement, bool loading);
     18            void setAmbientLight(const ColourValue& colour);
    1819
    1920        private:
  • code/branches/core/src/orxonox/objects/Model.cc

    r793 r869  
    3333#include "../core/CoreIncludes.h"
    3434#include "../Orxonox.h"
     35#include "core/XMLPort.h"
    3536
    3637#include "Model.h"
     
    6061    }
    6162
     63    /**
     64        @brief XML loading and saving.
     65        @param xmlelement The XML-element
     66        @param loading Loading (true) or saving (false)
     67        @return The XML-element
     68    */
     69    Element& Model::XMLPort(Element& xmlelement, bool loading)
     70    {
     71        WorldEntity::XMLPort(xmlelement, loading);
     72
     73        XMLPortParamLoadOnly(Model, "mesh", setMesh, xmlelement, loading);
     74
     75        create();
     76
     77        return xmlelement;
     78    }
     79
     80    void Model::setMesh(const std::string& meshname)
     81    {
     82        this->meshSrc_ = meshname;
     83    }
     84
    6285    bool Model::create(){
    6386      if(meshSrc_.compare("")!=0){
  • code/branches/core/src/orxonox/objects/Model.h

    r845 r869  
    1818            virtual ~Model();
    1919            virtual void loadParams(TiXmlElement* xmlElem);
     20            virtual Element& XMLPort(Element& xmlelement, bool loading);
     21            void setMesh(const std::string& meshname);
    2022            bool create();
    2123
  • code/branches/core/src/orxonox/objects/Skybox.cc

    r790 r869  
    3838#include "../core/CoreIncludes.h"
    3939#include "../core/Debug.h"
     40#include "core/XMLPort.h"
    4041
    4142#include "Skybox.h"
     
    5657    void Skybox::loadParams(TiXmlElement* xmlElem)
    5758    {
    58         Ogre::SceneManager* mgr = orxonox::Orxonox::getSingleton()->getSceneManager();
    59 
    6059        if (xmlElem->Attribute("src"))
    6160        {
    6261                std::string skyboxSrc = xmlElem->Attribute("src");
    63                 mgr->setSkyBox(true, skyboxSrc);
     62                this->setSkybox(skyboxSrc);
    6463
    6564                COUT(4) << "Loader: Set skybox: "<< skyboxSrc << std::endl << std::endl;
    6665        }
    6766   }
     67
     68   void Skybox::setSkybox(const std::string& skyboxname)
     69   {
     70        Orxonox::getSingleton()->getSceneManager()->setSkyBox(true, skyboxname);
     71   }
     72
     73    /**
     74        @brief XML loading and saving.
     75        @param xmlelement The XML-element
     76        @param loading Loading (true) or saving (false)
     77        @return The XML-element
     78    */
     79    Element& Skybox::XMLPort(Element& xmlelement, bool loading)
     80    {
     81        BaseObject::XMLPort(xmlelement, loading);
     82
     83        XMLPortParamLoadOnly(Skybox, "src", setSkybox, xmlelement, loading);
     84
     85        return xmlelement;
     86    }
    6887}
  • code/branches/core/src/orxonox/objects/Skybox.h

    r845 r869  
    1616            virtual ~Skybox();
    1717
    18 
    1918            void loadParams(TiXmlElement* xmlElem);
     19            virtual Element& XMLPort(Element& xmlelement, bool loading);
     20            void setSkybox(const std::string& skyboxname);
    2021
    2122        private:
  • code/branches/core/src/orxonox/objects/SpaceShip.cc

    r790 r869  
    4444#include "../particle/ParticleInterface.h"
    4545#include "Projectile.h"
     46#include "core/XMLPort.h"
    4647
    4748#include "SpaceShip.h"
     
    123124        this->brakeLoop(loop);
    124125*/
     126        this->init();
     127
    125128        COUT(3) << "Info: SpaceShip was loaded" << std::endl;
    126129    }
     
    132135    }
    133136
    134     void SpaceShip::setConfigValues()
    135     {
    136         SetConfigValue(bInvertYAxis_, false).description("Set this to true for joystick-like mouse behaviour (mouse up = ship down).");
    137         SetConfigValue(reloadTime_, 0.125).description("The reload time of the weapon in seconds");
    138         SetConfigValue(testvector_, Vector3()).description("asdfblah");
    139     }
    140 
    141     void SpaceShip::loadParams(TiXmlElement* xmlElem)
    142     {
    143         Model::loadParams(xmlElem);
    144 
    145 
     137    void SpaceShip::init()
     138    {
    146139        // START CREATING THRUSTER
    147140        this->tt_ = new ParticleInterface(Orxonox::getSingleton()->getSceneManager(),"twinthruster" + this->getName(),"Orxonox/engineglow");
     
    197190
    198191        // END of testing crosshair
    199 
     192    }
     193
     194    void SpaceShip::setConfigValues()
     195    {
     196        SetConfigValue(bInvertYAxis_, false).description("Set this to true for joystick-like mouse behaviour (mouse up = ship down).");
     197        SetConfigValue(reloadTime_, 0.125).description("The reload time of the weapon in seconds");
     198        SetConfigValue(testvector_, Vector3()).description("asdfblah");
     199    }
     200
     201    void SpaceShip::loadParams(TiXmlElement* xmlElem)
     202    {
     203        Model::loadParams(xmlElem);
    200204/*
    201205        if (xmlElem->Attribute("forward") && xmlElem->Attribute("rotateupdown") && xmlElem->Attribute("rotaterightleft") && xmlElem->Attribute("looprightleft"))
     
    242246        if (xmlElem->Attribute("camera"))
    243247        {
    244             Ogre::Camera *cam = Orxonox::getSingleton()->getSceneManager()->createCamera("ShipCam");
    245             this->camNode_ = this->getNode()->createChildSceneNode("CamNode");
    246 /*
    247 //            node->setInheritOrientation(false);
    248             cam->setPosition(Vector3(0,50,-150));
    249             cam->lookAt(Vector3(0,20,0));
    250             cam->roll(Degree(0));
    251 */
    252 
    253             cam->setPosition(Vector3(-200,0,35));
    254 //            cam->setPosition(Vector3(0,-350,0));
    255             cam->lookAt(Vector3(0,0,35));
    256             cam->roll(Degree(-90));
    257 
    258             this->camNode_->attachObject(cam);
    259             Orxonox::getSingleton()->getOgrePointer()->getRoot()->getAutoCreatedWindow()->addViewport(cam);
     248            this->setCamera();
    260249        }
     250    }
     251
     252    void SpaceShip::setCamera(const std::string& camera)
     253    {
     254        Ogre::Camera *cam = Orxonox::getSingleton()->getSceneManager()->createCamera("ShipCam");
     255        this->camNode_ = this->getNode()->createChildSceneNode("CamNode");
     256/*
     257//        node->setInheritOrientation(false);
     258        cam->setPosition(Vector3(0,50,-150));
     259        cam->lookAt(Vector3(0,20,0));
     260        cam->roll(Degree(0));
     261*/
     262
     263        cam->setPosition(Vector3(-200,0,35));
     264//        cam->setPosition(Vector3(0,-350,0));
     265        cam->lookAt(Vector3(0,0,35));
     266        cam->roll(Degree(-90));
     267
     268        this->camNode_->attachObject(cam);
     269        Orxonox::getSingleton()->getOgrePointer()->getRoot()->getAutoCreatedWindow()->addViewport(cam);
     270    }
     271
     272    void SpaceShip::setMaxSpeed(float value)
     273    { this->maxSpeed_ = value; }
     274    void SpaceShip::setMaxSideAndBackSpeed(float value)
     275    { this->maxSideAndBackSpeed_ = value; }
     276    void SpaceShip::setMaxRotation(float value)
     277    { this->maxRotation_ = value; this->maxRotationRadian_ = Radian(value); }
     278    void SpaceShip::setTransAcc(float value)
     279    { this->translationAcceleration_ = value; }
     280    void SpaceShip::setRotAcc(float value)
     281    { this->rotationAcceleration_ = value; this->rotationAccelerationRadian_ = Radian(value); }
     282    void SpaceShip::setTransDamp(float value)
     283    { this->translationDamping_ = value; }
     284    void SpaceShip::setRotDamp(float value)
     285    { this->rotationDamping_ = value; this->rotationDampingRadian_ = Radian(value); }
     286
     287    /**
     288        @brief XML loading and saving.
     289        @param xmlelement The XML-element
     290        @param loading Loading (true) or saving (false)
     291        @return The XML-element
     292    */
     293    Element& SpaceShip::XMLPort(Element& xmlelement, bool loading)
     294    {
     295        Model::XMLPort(xmlelement, loading);
     296
     297        XMLPortParamLoadOnly(SpaceShip, "camera", setCamera, xmlelement, loading);
     298        XMLPortParamLoadOnly(SpaceShip, "maxSpeed", setMaxSpeed, xmlelement, loading);
     299        XMLPortParamLoadOnly(SpaceShip, "maxSideAndBackSpeed", setMaxSideAndBackSpeed, xmlelement, loading);
     300        XMLPortParamLoadOnly(SpaceShip, "maxRotation", setMaxRotation, xmlelement, loading);
     301        XMLPortParamLoadOnly(SpaceShip, "transAcc", setTransAcc, xmlelement, loading);
     302        XMLPortParamLoadOnly(SpaceShip, "rotAcc", setRotAcc, xmlelement, loading);
     303        XMLPortParamLoadOnly(SpaceShip, "transDamp", setTransDamp, xmlelement, loading);
     304        XMLPortParamLoadOnly(SpaceShip, "rotDamp", setRotDamp, xmlelement, loading);
     305
     306        return xmlelement;
    261307    }
    262308
  • code/branches/core/src/orxonox/objects/SpaceShip.h

    r845 r869  
    2121            SpaceShip();
    2222            ~SpaceShip();
     23            void init();
    2324            void setConfigValues();
    2425            virtual void loadParams(TiXmlElement* xmlElem);
     26            virtual Element& XMLPort(Element& xmlelement, bool loading);
    2527            virtual void tick(float dt);
     28
     29            void setCamera(const std::string& camera = "");
     30            void setMaxSpeed(float value);
     31            void setMaxSideAndBackSpeed(float value);
     32            void setMaxRotation(float value);
     33            void setTransAcc(float value);
     34            void setRotAcc(float value);
     35            void setTransDamp(float value);
     36            void setRotDamp(float value);
    2637
    2738            bool mouseMoved(const OIS::MouseEvent &e);
  • code/branches/core/src/orxonox/objects/WorldEntity.cc

    r856 r869  
    158158    }
    159159
     160    void WorldEntity::setYawPitchRoll(const Degree& yaw, const Degree& pitch, const Degree& roll)
     161    {
     162        this->yaw(yaw);
     163        this->pitch(pitch);
     164        this->roll(roll);
     165    }
    160166
    161167    /**
     
    169175        BaseObject::XMLPort(xmlelement, loading);
    170176
    171         XMLPortParam(WorldEntity, "position", setPosition, getPosition, xmlelement, loading);
    172 //        XMLPortParam(WorldEntity, "direction", setDirection, getDirection, xmlelement, loading);
    173         XMLPortParamLoadOnly(WorldEntity, "yaw", setYaw, xmlelement, loading);
    174         XMLPortParamLoadOnly(WorldEntity, "pitch", setPitch, xmlelement, loading);
    175         XMLPortParamLoadOnly(WorldEntity, "roll", setRoll, xmlelement, loading);
     177        XMLPortParam(WorldEntity, "position", setPositionLoader2, getPosition, xmlelement, loading);
     178        XMLPortParamLoadOnly(WorldEntity, "direction", setDirectionLoader, xmlelement, loading);
     179        XMLPortParamLoadOnly(WorldEntity, "yawpitchroll", setYawPitchRoll, xmlelement, loading);
    176180        XMLPortParam(WorldEntity, "scale", setTotalScale, getScale, xmlelement, loading);
    177         XMLPortParam(WorldEntity, "rotationAxis", setRotationAxis, getRotationAxis, xmlelement, loading);
     181        XMLPortParam(WorldEntity, "rotationAxis", setRotationAxisLoader, getRotationAxis, xmlelement, loading);
    178182        XMLPortParam(WorldEntity, "rotationRate", setRotationRate, getRotationRate, xmlelement, loading);
    179183
  • code/branches/core/src/orxonox/objects/WorldEntity.h

    r856 r869  
    3939            inline void setPosition(const Vector3& pos)
    4040                { this->node_->setPosition(pos); }
    41 //            inline void setPosition(Real x, Real y, Real z)
    42 //                { this->node_->setPosition(x, y, z); }
     41            inline void setPositionLoader1(const Vector3& pos)
     42                { this->node_->setPosition(pos); }
     43            inline void setPositionLoader2(Real x, Real y, Real z)
     44                { this->node_->setPosition(x, y, z); }
     45            inline void setPosition(Real x, Real y, Real z)
     46                { this->node_->setPosition(x, y, z); }
    4347            inline const Vector3& getPosition() const
    4448                { return this->node_->getPosition(); }
     
    5963            inline void roll(const Radian &angle, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_LOCAL)
    6064                { this->node_->roll(angle, relativeTo); }
     65            void setYawPitchRoll(const Degree& yaw, const Degree& pitch, const Degree& roll);
    6166
    6267            inline void setYaw(const Degree &angle)
     
    7378            inline void rotate(const Vector3 &axis, const Radian &angle, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_LOCAL)
    7479              { this->node_->rotate(axis, angle, relativeTo); }
     80            inline void setDirectionLoader(Real x, Real y, Real z)
     81              { this->setDirection(x, y, z); }
    7582            inline void setDirection(Real x, Real y, Real z, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_LOCAL, const Vector3 &localDirectionVector=Vector3::NEGATIVE_UNIT_Z)
    7683              { this->node_->setDirection(x, y, z, relativeTo, localDirectionVector); }
     
    120127                { return this->acceleration_; }
    121128
     129            inline void setRotationAxisLoader(const Vector3& axis)
     130                { this->rotationAxis_ = axis; }
    122131            inline void setRotationAxis(const Vector3& axis)
    123132                { this->rotationAxis_ = axis; }
    124 //            inline void setRotationAxis(Real x, Real y, Real z)
    125 //                { this->rotationAxis_.x = x; this->rotationAxis_.y = y; this->rotationAxis_.z = z; }
     133            inline void setRotationAxis(Real x, Real y, Real z)
     134                { this->rotationAxis_.x = x; this->rotationAxis_.y = y; this->rotationAxis_.z = z; }
    126135            inline const Vector3& getRotationAxis() const
    127136                { return this->rotationAxis_; }
     
    130139//                { this->rotationRate_ = angle; }
    131140            inline void setRotationRate(const Degree& angle)
    132                 { this->rotationRate_ = angle; }
     141                { this->rotationRate_ = angle; this->setStatic(angle == Degree(0)); }
    133142            inline const Radian& getRotationRate() const
    134143                { return this->rotationRate_; }
  • code/branches/core/src/util/MultiTypeMath.cc

    r855 r869  
    8888}
    8989
     90MultiTypeMath::operator int() const
     91{ return (this->type_ == MT_int) ? this->value_.int_ : ConvertValueAndReturn<MultiTypeMath, int>(*this); }
     92MultiTypeMath::operator unsigned int() const
     93{ return (this->type_ == MT_uint) ? this->value_.uint_ : ConvertValueAndReturn<MultiTypeMath, unsigned int>(*this); }
     94MultiTypeMath::operator char() const
     95{ return (this->type_ == MT_char) ? this->value_.char_ : ConvertValueAndReturn<MultiTypeMath, char>(*this); }
     96MultiTypeMath::operator unsigned char() const
     97{ return (this->type_ == MT_uchar) ? this->value_.uchar_ : ConvertValueAndReturn<MultiTypeMath, unsigned char>(*this); }
     98MultiTypeMath::operator short() const
     99{ return (this->type_ == MT_short) ? this->value_.short_ : ConvertValueAndReturn<MultiTypeMath, short>(*this); }
     100MultiTypeMath::operator unsigned short() const
     101{ return (this->type_ == MT_ushort) ? this->value_.ushort_ : ConvertValueAndReturn<MultiTypeMath, unsigned short>(*this); }
     102MultiTypeMath::operator long() const
     103{ return (this->type_ == MT_long) ? this->value_.long_ : ConvertValueAndReturn<MultiTypeMath, long>(*this); }
     104MultiTypeMath::operator unsigned long() const
     105{ return (this->type_ == MT_ulong) ? this->value_.ulong_ : ConvertValueAndReturn<MultiTypeMath, unsigned long>(*this); }
     106MultiTypeMath::operator float() const
     107{ return (this->type_ == MT_float) ? this->value_.float_ : ConvertValueAndReturn<MultiTypeMath, float>(*this); }
     108MultiTypeMath::operator double() const
     109{ return (this->type_ == MT_double) ? this->value_.double_ : ConvertValueAndReturn<MultiTypeMath, double>(*this); }
     110MultiTypeMath::operator long double() const
     111{ return (this->type_ == MT_longdouble) ? this->value_.longdouble_ : ConvertValueAndReturn<MultiTypeMath, long double>(*this); }
     112MultiTypeMath::operator bool() const
     113{ return (this->type_ == MT_bool) ? this->value_.bool_ : ConvertValueAndReturn<MultiTypeMath, bool>(*this); }
     114MultiTypeMath::operator std::string() const
     115{ return (this->type_ == MT_string) ? this->string_ : ConvertValueAndReturn<MultiTypeMath, std::string>(*this); }
     116MultiTypeMath::operator const char*() const
     117{ return ((this->type_ == MT_constchar) ? this->string_ : ConvertValueAndReturn<MultiTypeMath, std::string>(*this)).c_str(); }
    90118MultiTypeMath::operator orxonox::Vector2() const
    91 {
    92     return (this->type_ == MT_vector2) ? this->vector2_ : ConvertValueAndReturn<MultiTypeMath, orxonox::Vector2>(*this);
    93 }
    94 
     119{ return (this->type_ == MT_vector2) ? this->vector2_ : ConvertValueAndReturn<MultiTypeMath, orxonox::Vector2>(*this); }
    95120MultiTypeMath::operator orxonox::Vector3() const
    96 {
    97     return (this->type_ == MT_vector3) ? this->vector3_ : ConvertValueAndReturn<MultiTypeMath, orxonox::Vector3>(*this);
    98 }
    99 
     121{ return (this->type_ == MT_vector3) ? this->vector3_ : ConvertValueAndReturn<MultiTypeMath, orxonox::Vector3>(*this); }
    100122MultiTypeMath::operator orxonox::Quaternion() const
    101 {
    102     return (this->type_ == MT_quaternion) ? this->quaternion_ : ConvertValueAndReturn<MultiTypeMath, orxonox::Quaternion>(*this);
    103 }
    104 
     123{ return (this->type_ == MT_quaternion) ? this->quaternion_ : ConvertValueAndReturn<MultiTypeMath, orxonox::Quaternion>(*this); }
    105124MultiTypeMath::operator orxonox::ColourValue() const
    106 {
    107     return (this->type_ == MT_colourvalue) ? this->colourvalue_ : ConvertValueAndReturn<MultiTypeMath, orxonox::ColourValue>(*this);
    108 }
    109 
     125{ return (this->type_ == MT_colourvalue) ? this->colourvalue_ : ConvertValueAndReturn<MultiTypeMath, orxonox::ColourValue>(*this); }
    110126MultiTypeMath::operator orxonox::Radian() const
    111 {
    112     return (this->type_ == MT_radian) ? this->radian_ : ConvertValueAndReturn<MultiTypeMath, orxonox::Radian>(*this);
    113 }
    114 
     127{ return (this->type_ == MT_radian) ? this->radian_ : ConvertValueAndReturn<MultiTypeMath, orxonox::Radian>(*this); }
    115128MultiTypeMath::operator orxonox::Degree() const
    116 {
    117     return (this->type_ == MT_degree) ? this->degree_ : ConvertValueAndReturn<MultiTypeMath, orxonox::Degree>(*this);
    118 }
     129{ return (this->type_ == MT_degree) ? this->degree_ : ConvertValueAndReturn<MultiTypeMath, orxonox::Degree>(*this); }
    119130
    120131void MultiTypeMath::setValue(const MultiTypeMath& mtm)
     
    171182std::ostream& operator<<(std::ostream& out, MultiTypeMath& mtm)
    172183{
    173     if (mtm.isA(MT_vector2))
    174         out << mtm.getVector2();
    175     else if (mtm.isA(MT_vector3))
    176         out << mtm.getVector3();
    177     else if (mtm.isA(MT_colourvalue))
    178         out << mtm.getColourValue();
    179     else if (mtm.isA(MT_quaternion))
    180         out << mtm.getQuaternion();
    181     else if (mtm.isA(MT_radian))
    182         out << mtm.getRadian();
    183     else if (mtm.isA(MT_degree))
    184         out << mtm.getDegree();
    185     else
    186         out << ((MultiTypeString)mtm);
    187 
     184    out << mtm.toString();
    188185    return out;
    189186}
  • code/branches/core/src/util/MultiTypeMath.h

    r854 r869  
    6060        inline MultiTypeMath(const orxonox::Degree&      value) { this->setValue(value); }
    6161        inline MultiTypeMath(const MultiTypeMath& mtm)          { this->setValue(mtm);   }
     62        virtual inline ~MultiTypeMath() {}
    6263
    6364        using MultiTypeString::operator=;
     
    8889        bool operator!=(const MultiTypeMath& mtm) const;
    8990
    90         operator orxonox::Vector2()     const;
    91         operator orxonox::Vector3()     const;
    92         operator orxonox::ColourValue() const;
    93         operator orxonox::Quaternion()  const;
    94         operator orxonox::Radian()      const;
    95         operator orxonox::Degree()      const;
     91        virtual operator int()                  const;
     92        virtual operator unsigned int()         const;
     93        virtual operator char()                 const;
     94        virtual operator unsigned char()        const;
     95        virtual operator short()                const;
     96        virtual operator unsigned short()       const;
     97        virtual operator long()                 const;
     98        virtual operator unsigned long()        const;
     99        virtual operator float ()               const;
     100        virtual operator double ()              const;
     101        virtual operator long double()          const;
     102        virtual operator bool()                 const;
     103        virtual operator std::string()          const;
     104        virtual operator const char*()          const;
     105        virtual operator orxonox::Vector2()     const;
     106        virtual operator orxonox::Vector3()     const;
     107        virtual operator orxonox::ColourValue() const;
     108        virtual operator orxonox::Quaternion()  const;
     109        virtual operator orxonox::Radian()      const;
     110        virtual operator orxonox::Degree()      const;
    96111
    97112        using MultiTypeString::setValue;
     
    126141        inline void getValue(orxonox::Degree*      variable) const { (*variable) = orxonox::Degree      (this->degree_);      }
    127142
    128         std::string toString() const;
    129         bool fromString(const std::string value);
     143        virtual std::string toString() const;
     144        virtual bool fromString(const std::string value);
    130145
    131146    protected:
  • code/branches/core/src/util/MultiTypePrimitive.cc

    r854 r869  
    129129
    130130MultiTypePrimitive::operator int() const
    131 {
    132     return (this->type_ == MT_int) ? this->value_.int_ : ConvertValueAndReturn<MultiTypePrimitive, int>(*this);
    133 }
    134 
     131{ return (this->type_ == MT_int) ? this->value_.int_ : ConvertValueAndReturn<MultiTypePrimitive, int>(*this); }
    135132MultiTypePrimitive::operator unsigned int() const
    136 {
    137     return (this->type_ == MT_uint) ? this->value_.uint_ : ConvertValueAndReturn<MultiTypePrimitive, unsigned int>(*this);
    138 }
    139 
     133{ return (this->type_ == MT_uint) ? this->value_.uint_ : ConvertValueAndReturn<MultiTypePrimitive, unsigned int>(*this); }
    140134MultiTypePrimitive::operator char() const
    141 {
    142     return (this->type_ == MT_char) ? this->value_.char_ : ConvertValueAndReturn<MultiTypePrimitive, char>(*this);
    143 }
    144 
     135{ return (this->type_ == MT_char) ? this->value_.char_ : ConvertValueAndReturn<MultiTypePrimitive, char>(*this); }
    145136MultiTypePrimitive::operator unsigned char() const
    146 {
    147     return (this->type_ == MT_uchar) ? this->value_.uchar_ : ConvertValueAndReturn<MultiTypePrimitive, unsigned char>(*this);
    148 }
    149 
     137{ return (this->type_ == MT_uchar) ? this->value_.uchar_ : ConvertValueAndReturn<MultiTypePrimitive, unsigned char>(*this); }
    150138MultiTypePrimitive::operator short() const
    151 {
    152     return (this->type_ == MT_short) ? this->value_.short_ : ConvertValueAndReturn<MultiTypePrimitive, short>(*this);
    153 }
    154 
     139{ return (this->type_ == MT_short) ? this->value_.short_ : ConvertValueAndReturn<MultiTypePrimitive, short>(*this); }
    155140MultiTypePrimitive::operator unsigned short() const
    156 {
    157     return (this->type_ == MT_ushort) ? this->value_.ushort_ : ConvertValueAndReturn<MultiTypePrimitive, unsigned short>(*this);
    158 }
    159 
     141{ return (this->type_ == MT_ushort) ? this->value_.ushort_ : ConvertValueAndReturn<MultiTypePrimitive, unsigned short>(*this); }
    160142MultiTypePrimitive::operator long() const
    161 {
    162     return (this->type_ == MT_long) ? this->value_.long_ : ConvertValueAndReturn<MultiTypePrimitive, long>(*this);
    163 }
    164 
     143{ return (this->type_ == MT_long) ? this->value_.long_ : ConvertValueAndReturn<MultiTypePrimitive, long>(*this); }
    165144MultiTypePrimitive::operator unsigned long() const
    166 {
    167     return (this->type_ == MT_ulong) ? this->value_.ulong_ : ConvertValueAndReturn<MultiTypePrimitive, unsigned long>(*this);
    168 }
    169 
     145{ return (this->type_ == MT_ulong) ? this->value_.ulong_ : ConvertValueAndReturn<MultiTypePrimitive, unsigned long>(*this); }
    170146MultiTypePrimitive::operator float() const
    171 {
    172     return (this->type_ == MT_float) ? this->value_.float_ : ConvertValueAndReturn<MultiTypePrimitive, float>(*this);
    173 }
    174 
     147{ return (this->type_ == MT_float) ? this->value_.float_ : ConvertValueAndReturn<MultiTypePrimitive, float>(*this); }
    175148MultiTypePrimitive::operator double() const
    176 {
    177     return (this->type_ == MT_double) ? this->value_.double_ : ConvertValueAndReturn<MultiTypePrimitive, double>(*this);
    178 }
    179 
     149{ return (this->type_ == MT_double) ? this->value_.double_ : ConvertValueAndReturn<MultiTypePrimitive, double>(*this); }
    180150MultiTypePrimitive::operator long double() const
    181 {
    182     return (this->type_ == MT_longdouble) ? this->value_.longdouble_ : ConvertValueAndReturn<MultiTypePrimitive, long double>(*this);
    183 }
    184 
     151{ return (this->type_ == MT_longdouble) ? this->value_.longdouble_ : ConvertValueAndReturn<MultiTypePrimitive, long double>(*this); }
    185152MultiTypePrimitive::operator bool() const
    186 {
    187     return (this->type_ == MT_bool) ? this->value_.bool_ : ConvertValueAndReturn<MultiTypePrimitive, bool>(*this);
    188 }
     153{ return (this->type_ == MT_bool) ? this->value_.bool_ : ConvertValueAndReturn<MultiTypePrimitive, bool>(*this); }
    189154
    190155void MultiTypePrimitive::setValue(const MultiTypePrimitive& mtp)
     
    258223std::ostream& operator<<(std::ostream& out, const MultiTypePrimitive& mtp)
    259224{
    260     if (mtp.isA(MT_int))
    261         out << mtp.getInt();
    262     else if (mtp.isA(MT_uint))
    263         out << mtp.getUnsignedInt();
    264     else if (mtp.isA(MT_char))
    265         out << mtp.getChar();
    266     else if (mtp.isA(MT_uchar))
    267         out << mtp.getUnsignedChar();
    268     else if (mtp.isA(MT_short))
    269         out << mtp.getShort();
    270     else if (mtp.isA(MT_ushort))
    271         out << mtp.getUnsignedShort();
    272     else if (mtp.isA(MT_long))
    273         out << mtp.getLong();
    274     else if (mtp.isA(MT_ulong))
    275         out << mtp.getUnsignedLong();
    276     else if (mtp.isA(MT_float))
    277         out << mtp.getFloat();
    278     else if (mtp.isA(MT_double))
    279         out << mtp.getDouble();
    280     else if (mtp.isA(MT_longdouble))
    281         out << mtp.getLongDouble();
    282     else if (mtp.isA(MT_bool))
    283         out << mtp.getBool();
    284 
     225    out << mtp.toString();
    285226    return out;
    286227}
  • code/branches/core/src/util/MultiTypePrimitive.h

    r853 r869  
    5353        inline MultiTypePrimitive(bool           value) { this->setValue(value); }
    5454        inline MultiTypePrimitive(const MultiTypePrimitive& mtp) { this->setValue(mtp); }
     55        virtual inline ~MultiTypePrimitive() {}
    5556
    5657        inline MultiTypePrimitive& operator=(MultiType      value) { this->type_ = MT_null; return *this; }
     
    9798        bool operator!=(const MultiTypePrimitive& mtp) const;
    9899
    99         operator int()            const;
    100         operator unsigned int()   const;
    101         operator char()           const;
    102         operator unsigned char()  const;
    103         operator short()          const;
    104         operator unsigned short() const;
    105         operator long()           const;
    106         operator unsigned long()  const;
    107         operator float ()         const;
    108         operator double ()        const;
    109         operator long double()    const;
    110         operator bool()           const;
     100        virtual operator int()            const;
     101        virtual operator unsigned int()   const;
     102        virtual operator char()           const;
     103        virtual operator unsigned char()  const;
     104        virtual operator short()          const;
     105        virtual operator unsigned short() const;
     106        virtual operator long()           const;
     107        virtual operator unsigned long()  const;
     108        virtual operator float ()         const;
     109        virtual operator double ()        const;
     110        virtual operator long double()    const;
     111        virtual operator bool()           const;
    111112
    112113        inline void setValue(int            value) { this->type_ = MT_int;        this->value_.int_        = value; }
     
    166167        inline bool      isA(MultiType type) const { return (this->type_ == type); }
    167168
    168         std::string toString() const;
    169         bool fromString(const std::string value);
     169        virtual std::string toString() const;
     170        virtual bool fromString(const std::string value);
    170171
    171172    protected:
  • code/branches/core/src/util/MultiTypeString.cc

    r853 r869  
    6464}
    6565
     66MultiTypeString::operator int() const
     67{ return (this->type_ == MT_int) ? this->value_.int_ : ConvertValueAndReturn<MultiTypeString, int>(*this); }
     68MultiTypeString::operator unsigned int() const
     69{ return (this->type_ == MT_uint) ? this->value_.uint_ : ConvertValueAndReturn<MultiTypeString, unsigned int>(*this); }
     70MultiTypeString::operator char() const
     71{ return (this->type_ == MT_char) ? this->value_.char_ : ConvertValueAndReturn<MultiTypeString, char>(*this); }
     72MultiTypeString::operator unsigned char() const
     73{ return (this->type_ == MT_uchar) ? this->value_.uchar_ : ConvertValueAndReturn<MultiTypeString, unsigned char>(*this); }
     74MultiTypeString::operator short() const
     75{ return (this->type_ == MT_short) ? this->value_.short_ : ConvertValueAndReturn<MultiTypeString, short>(*this); }
     76MultiTypeString::operator unsigned short() const
     77{ return (this->type_ == MT_ushort) ? this->value_.ushort_ : ConvertValueAndReturn<MultiTypeString, unsigned short>(*this); }
     78MultiTypeString::operator long() const
     79{ return (this->type_ == MT_long) ? this->value_.long_ : ConvertValueAndReturn<MultiTypeString, long>(*this); }
     80MultiTypeString::operator unsigned long() const
     81{ return (this->type_ == MT_ulong) ? this->value_.ulong_ : ConvertValueAndReturn<MultiTypeString, unsigned long>(*this); }
     82MultiTypeString::operator float() const
     83{ return (this->type_ == MT_float) ? this->value_.float_ : ConvertValueAndReturn<MultiTypeString, float>(*this); }
     84MultiTypeString::operator double() const
     85{ return (this->type_ == MT_double) ? this->value_.double_ : ConvertValueAndReturn<MultiTypeString, double>(*this); }
     86MultiTypeString::operator long double() const
     87{ return (this->type_ == MT_longdouble) ? this->value_.longdouble_ : ConvertValueAndReturn<MultiTypeString, long double>(*this); }
     88MultiTypeString::operator bool() const
     89{ return (this->type_ == MT_bool) ? this->value_.bool_ : ConvertValueAndReturn<MultiTypeString, bool>(*this); }
    6690MultiTypeString::operator std::string() const
    67 {
    68     return (this->type_ == MT_string) ? this->string_ : ConvertValueAndReturn<MultiTypeString, std::string>(*this);
    69 }
    70 
     91{ return (this->type_ == MT_string) ? this->string_ : ConvertValueAndReturn<MultiTypeString, std::string>(*this); }
    7192MultiTypeString::operator const char*() const
    72 {
    73     return ((this->type_ == MT_constchar) ? this->string_ : ConvertValueAndReturn<MultiTypeString, std::string>(*this)).c_str();
    74 }
     93{ return ((this->type_ == MT_constchar) ? this->string_ : ConvertValueAndReturn<MultiTypeString, std::string>(*this)).c_str(); }
    7594
    7695void MultiTypeString::setValue(const MultiTypeString& mts)
     
    104123std::ostream& operator<<(std::ostream& out, MultiTypeString& mts)
    105124{
    106     if (mts.isA(MT_constchar))
    107         out << mts.getConstChar();
    108     else if (mts.isA(MT_string))
    109         out << mts.getString();
    110     else
    111         out << ((MultiTypePrimitive)mts);
    112 
     125    out << mts.toString();
    113126    return out;
    114127}
  • code/branches/core/src/util/MultiTypeString.h

    r854 r869  
    5555        inline MultiTypeString(const std::string& value)   { this->setValue(value); }
    5656        inline MultiTypeString(const MultiTypeString& mts) { this->setValue(mts);   }
     57        virtual inline ~MultiTypeString() {}
    5758
    5859        using MultiTypePrimitive::operator=;
     
    7172        bool operator!=(const MultiTypeString& mts) const;
    7273
    73         operator std::string() const;
    74         operator const char*() const;
     74        virtual operator int()            const;
     75        virtual operator unsigned int()   const;
     76        virtual operator char()           const;
     77        virtual operator unsigned char()  const;
     78        virtual operator short()          const;
     79        virtual operator unsigned short() const;
     80        virtual operator long()           const;
     81        virtual operator unsigned long()  const;
     82        virtual operator float ()         const;
     83        virtual operator double ()        const;
     84        virtual operator long double()    const;
     85        virtual operator bool()           const;
     86        virtual operator std::string()    const;
     87        virtual operator const char*()    const;
    7588
    7689        using MultiTypePrimitive::setValue;
     
    89102        inline void getValue(const char** variable) const { (*variable) = this->string_.c_str(); }
    90103
    91         std::string toString() const;
    92         bool fromString(const std::string value);
     104        virtual std::string toString() const;
     105        virtual bool fromString(const std::string value);
    93106
    94107    protected:
Note: See TracChangeset for help on using the changeset viewer.