Ignore:
Timestamp:
05/23/08 17:47:22 (16 years ago)
Author:
mattausch
Message:

implemented dynamic object placement / removal

File:
1 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp

    r2701 r2702  
    15911591 
    15921592 
    1593 SceneGraphLeaf *Preprocessor::RegisterDynamicGeometryWithRayCaster(SceneGraphLeaf *leaf) 
    1594 { 
     1593void Preprocessor::RegisterDynamicObject(SceneGraphLeaf *leaf) 
     1594{        
     1595        mDynamicObjects.push_back(leaf); 
     1596 
     1597        // add to scene graph 
     1598        mSceneGraph->GetRoot()->mChildren.push_back(leaf); 
     1599 
    15951600  if (mRayCaster) 
    15961601        mRayCaster->AddDynamicObjecs(leaf->mGeometry, leaf->GetTransformation()); 
     
    16021607SceneGraphLeaf *Preprocessor::LoadDynamicGeometry(const string &filename) 
    16031608{ 
    1604 #if DYNAMIC_OBJECTS_HACK 
    1605  
    16061609        const bool dynamic = true; 
    16071610        SceneGraphLeaf *leaf = new SceneGraphLeaf(dynamic); 
     
    16231626        if (parsed) 
    16241627        { 
    1625                 const float scale = 0.01f; 
    1626  
    16271628                ObjectContainer::const_iterator it, it_end = leaf->mGeometry.end(); 
    16281629 
     
    16331634                        Triangle3 t = tri->GetItem(); 
    16341635 
    1635                         // scale object appropriately 
     1636                        // hack: scale object appropriately 
     1637                        float scale = 0.01f; 
     1638 
    16361639                        t.mVertices[0] *= scale; 
    16371640                        t.mVertices[1] *= scale; 
     
    16411644                } 
    16421645 
    1643                 //leaf->ApplyTransform(ScaleMatrix(s, s, s)); 
    1644                 //leaf->ApplyTransform(TranslationMatrix(Vector3(0, 10, 0))); 
    1645  
    16461646                leaf->UpdateBox(); 
    1647                 mSceneGraph->GetRoot()->mChildren.push_back(leaf); 
    1648                 //mDynamicObjects.push_back(leaf); 
    1649  
    16501647                cout<<"Dynamic object loaded successfully: " << leaf->GetBox() << endl; 
    16511648 
     
    16541651                 
    16551652 
    1656 #endif 
    16571653        cout<<"Dynamic object loading failed."<<endl; 
    16581654        return NULL; 
Note: See TracChangeset for help on using the changeset viewer.