Changeset 734

Show
Ignore:
Timestamp:
06/18/09 23:58:32 (9 months ago)
Author:
hagish
Message:

Bugfix: wrong trail implementation

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/lugre/src/lugre_gfx3D.cpp

    r657 r734  
    578578    if (mpManualObject)                 { mpManualObject; mpManualObject = 0; } 
    579579        if (mpRadar)                            { delete mpRadar; mpRadar = 0; } 
    580         if (mpTrail)                            { delete mpTrail; mpTrail = 0; } 
     580        if (mpTrail)                            { cOgreWrapper::GetSingleton().mSceneMgr->getRootSceneNode()->detachObject(mpTrail); 
     581                                      delete mpTrail; mpTrail = 0; } 
    581582        if (mpBeam)                             { delete mpBeam; mpBeam = 0; } 
    582583        if (mpFastBatch)                        { delete mpFastBatch; mpFastBatch = 0; } 
     
    996997                                                const Real fW,const Real fDeltaW) { PROFILE 
    997998        if (!mpSceneNode) return; 
     999        if(mpTrail)Clear(); 
    9981000         
    9991001        mpTrail = cOgreWrapper::GetSingleton().mSceneMgr->createRibbonTrail(strprintf("ribbontrail%d",++giLastRibbonID)); 
    10001002 
    1001         mpSceneNode->setPosition(vPos); 
     1003        // set scene node to root because its not needed for trails 
     1004        mpSceneNode->setPosition(Ogre::Vector3()); 
    10021005 
    10031006        mpTrail->setNumberOfChains(1); 
     
    10071010 
    10081011        // TODO : this won't work in a nonstandard sceneman, determine the scenemanager from scenenode 
    1009         cOgreWrapper::GetSingleton().mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(mpTrail); 
     1012        cOgreWrapper::GetSingleton().mSceneMgr->getRootSceneNode()->attachObject(mpTrail); 
    10101013 
    10111014        mpTrail->setInitialColour(0, fR,fG,fB,fA); 
     
    10151018 
    10161019        mpTrail->addNode(mpSceneNode); 
    1017  
    10181020} 
    10191021