Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 15, 2009, 10:21:59 AM (15 years ago)
Author:
rgrieder
Message:

Fixed dedicated (at least for presentation09.oxw).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/pch/src/orxonox/objects/worldentities/Planet.cc

    r3110 r3175  
    7070            return;
    7171
    72         Camera* activeCamera = CameraManager::getInstance().getActiveCamera();
    73         if(activeCamera)
     72        if (GameMode::showsGraphics())
    7473        {
    75             float distance = this->getPosition().distance( activeCamera->getWorldPosition() );
    76             //             COUT(2) << distance << std::endl;
    77             float planetRadius = this->getScale();
     74            Camera* activeCamera = CameraManager::getInstance().getActiveCamera();
     75            if(activeCamera)
     76            {
     77                float distance = this->getPosition().distance( activeCamera->getWorldPosition() );
     78                //             COUT(2) << distance << std::endl;
     79                float planetRadius = this->getScale();
    7880
    79             float newScale = 2 * distance / sqrt(distance*distance - planetRadius*planetRadius);
    80             float tempTest = newScale*(1+float(this->atmosphereSize)/float(this->imageSize));
    81             newScale = tempTest;
     81                float newScale = 2 * distance / sqrt(distance*distance - planetRadius*planetRadius);
     82                float tempTest = newScale*(1+float(this->atmosphereSize)/float(this->imageSize));
     83                newScale = tempTest;
    8284
    83             this->billboard_.getBillboardSet()->setDefaultDimensions(newScale, newScale);
     85                this->billboard_.getBillboardSet()->setDefaultDimensions(newScale, newScale);
     86            }
    8487        }
    8588
     
    145148        SUPER(Planet, XMLPort, xmlelement, mode);
    146149
    147         XMLPortParam(Planet, "atmosphere", setAtmosphere, getAtmosphere, xmlelement, mode).defaultValues("planet/Atmosphere");
    148         XMLPortParam(Planet, "atmospheresize", setAtmosphereSize, getAtmosphereSize, xmlelement,mode);     
    149         XMLPortParam(Planet, "imagesize", setImageSize, getImageSize, xmlelement,mode);         
    150         XMLPortParam(Planet, "mesh", setMeshSource, getMeshSource, xmlelement, mode);
    151         XMLPortParam(Planet, "shadow", setCastShadows, getCastShadows, xmlelement, mode).defaultValues(true);
     150        if (GameMode::showsGraphics())
     151        {
     152            XMLPortParam(Planet, "atmosphere", setAtmosphere, getAtmosphere, xmlelement, mode).defaultValues("planet/Atmosphere");
     153            XMLPortParam(Planet, "atmospheresize", setAtmosphereSize, getAtmosphereSize, xmlelement,mode);     
     154            XMLPortParam(Planet, "imagesize", setImageSize, getImageSize, xmlelement,mode);         
     155            XMLPortParam(Planet, "mesh", setMeshSource, getMeshSource, xmlelement, mode);
     156            XMLPortParam(Planet, "shadow", setCastShadows, getCastShadows, xmlelement, mode).defaultValues(true);
     157        }
    152158    }
    153159
Note: See TracChangeset for help on using the changeset viewer.