Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10274


Ignore:
Timestamp:
Feb 15, 2015, 11:11:59 PM (9 years ago)
Author:
landauf
Message:

fixed #419 http://www.orxonox.net/ticket/419
physics is only activated if a WorldEntity is active. so we should toggle physics if activity changes.

Location:
code/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/data/levels/iJohnVane_TriptoArea51.oxw

    r9992 r10274  
    376376
    377377   <MovableEntity   
    378       position = "<?lua print(math.random()* 600-300) ?>,<?lua print(math.random() * 40000 + 110000) ?>,<?lua print(math.random() * 600-300) ?>"
     378      position = "<?lua print(math.random()* 600-300) ?>,<?lua print(math.random() * 40000 + 97000) ?>,<?lua print(math.random() * 600-300) ?>"
    379379      scale = "<?lua print(j * 40)?>"
    380380      velocity = "<?lua print(x*20-10)?>, <?lua print(y*60-160)?>, <?lua print(z*20-10)?>"
     
    382382      collisiondamage = 0.05
    383383      enablecollisiondamage = true
    384       active = true
     384      active = false
    385385   >                 
    386386          <attached>           
    387               <Model mass="<?lua print(j * 1000) ?>" mesh="ast<?lua print( math.mod(i,6) + 1) ?>.mesh" >
    388                   <events>           
    389                     <visibility>           
    390                       <EventListener event="portal3" />           
    391                     </visibility>           
    392                   </events>
    393               </Model>                         
     387              <Model mass="<?lua print(j * 1000) ?>" mesh="ast<?lua print( math.mod(i,6) + 1) ?>.mesh" />
    394388          </attached>
    395389         <collisionShapes>
    396390             <SphereCollisionShape radius="<?lua print(j * 50) ?>" />
    397391         </collisionShapes>   
     392         <events>           
     393           <activity>           
     394             <EventListener event="portal3" />           
     395           </activity>           
     396         </events>
    398397   </MovableEntity>
    399398
     
    414413   ?>
    415414   <MovableEntity   
    416       position = "<?lua print(math.random()* 240-120) ?>,<?lua print(math.random() * 40000 + 110000) ?>,<?lua print(math.random()* 240-120) ?>"
     415      position = "<?lua print(math.random()* 240-120) ?>,<?lua print(math.random() * 40000 + 97000) ?>,<?lua print(math.random()* 240-120) ?>"
    417416      scale = "10"
    418417      velocity = "0, -160, 0"
     
    420419      collisiondamage = 0.05
    421420      enablecollisiondamage = true
    422       active = true
    423       visible = false
     421      active = false
    424422   >                     
    425423          <attached>           
    426               <Model mass="2000" mesh="ast<?lua print( math.mod(i,6) + 1) ?>.mesh" >
    427                   <events>           
    428                     <visibility>           
    429                       <EventListener event="portal3" />           
    430                     </visibility>           
    431                   </events>
    432               </Model>                   
     424              <Model mass="2000" mesh="ast<?lua print( math.mod(i,6) + 1) ?>.mesh" />
    433425          </attached>
    434426         <collisionShapes>
    435427             <SphereCollisionShape radius="10" />
    436428         </collisionShapes>   
     429         <events>           
     430           <activity>           
     431             <EventListener event="portal3" />           
     432           </activity>           
     433         </events>
    437434   </MovableEntity>
    438435   <?lua
  • code/trunk/src/orxonox/worldentities/WorldEntity.cc

    r9667 r10274  
    221221        if(GameMode::isMaster())
    222222        {
     223            // physics is only enabled if the WorldEntity is active
     224            if (this->isActive())
     225                this->activatePhysics();
     226            else
     227                this->deactivatePhysics();
     228
     229            // iterate over all children and change their activity as well
    223230            for (std::set<WorldEntity*>::const_iterator it = this->getAttachedObjects().begin(); it != this->getAttachedObjects().end(); it++)
    224231            {
     
    246253        if(GameMode::isMaster())
    247254        {
     255            // iterate over all children and change their visibility as well
    248256            for (std::set<WorldEntity*>::const_iterator it = this->getAttachedObjects().begin(); it != this->getAttachedObjects().end(); it++)
    249257            {
Note: See TracChangeset for help on using the changeset viewer.