Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 30, 2010, 10:21:41 PM (14 years ago)
Author:
rgrieder
Message:

Fixed M_PI problem (not C++).
Note: For the future, we should define pi in Math.h, but we all don't like recompiles before the presentation…

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation3/src/modules/designtools/CreateStars.cc

    r7022 r7028  
    2929#include "CreateStars.h"
    3030
    31 #include "core/ConsoleCommand.h"
     31#include <OgreVector3.h>
     32
    3233#include "core/CoreIncludes.h"
    33 #include "core/ConfigValueIncludes.h"
    34 #include "core/ScopedSingletonManager.h"
    35 #include "core/BaseObject.h"
    36 
    37 
    3834#include "core/XMLPort.h"
    39 
    4035#include "graphics/Billboard.h"
    41 
    42 #include <OgreVector3.h>
    43 #include "util/Math.h"
    4436 
    4537namespace orxonox
    4638{
    47 
    4839    CreateFactory(CreateStars);
    4940
     41    static const float pi = 3.14159265359f;
     42
    5043    CreateStars::CreateStars(BaseObject* creator) : BaseObject(creator)
    51 
    5244    {
    5345        RegisterObject(CreateStars);
    5446        this->material_ = "Examples/Flare";
    55         this->alpha_ = 0.7;
    56         this->alphaDiff_ = 0.5;
    57         this->radiusDiff_ = 0.9;
     47        this->alpha_ = 0.7f;
     48        this->alphaDiff_ = 0.5f;
     49        this->radiusDiff_ = 0.9f;
    5850        this->colour_.r = 1;
    5951        this->colour_.g = 1;
    6052        this->colour_.b = 1;
    61         this->colourDiff_ = 0.1;
     53        this->colourDiff_ = 0.1f;
    6254    }
    6355
     
    9890            while(1)
    9991            {
    100                 phi = rnd(2*M_PI);
    101                 teta = rnd(M_PI);
     92                phi = rnd(2*pi);
     93                teta = rnd(pi);
    10294                float random = rnd(1);
    10395                if(sin(teta)>random) break;
Note: See TracChangeset for help on using the changeset viewer.