Changeset 454

Show
Ignore:
Timestamp:
12/16/06 06:34:08 (2 years ago)
Author:
cneumann
Message:

changed: reenabled IntersectAction? callback.

fixes ticket:115 and ticket:113

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/Source/System/NodeCores/Drawables/Geometry/Base/WS/OSGGeometry.cpp

    r436 r454  
    426426} 
    427427 
    428 /*! Complete intersection test. 
    429 * \todo: Implement geometry intersection test. 
     428/*! The IntersectAction callback for Geometry. It computes if the ray used in 
     429    the IntersectAction \a action hits this object and if that is the case, 
     430    which triangle is hit. 
     431 
     432    \param[in] action IntersectAction performing the intersect test. 
     433    \return Action result code, \see OSG::Action. 
     434 
     435    \note This method is registered with the IntersectAction and automatically 
     436    called from there, you probably never have to call it manually. 
    430437*/ 
    431438Action::ResultE Geometry::intersect(Action * action) 
    432439{ 
    433 /* 
    434     IntersectAction     * ia = dynamic_cast<IntersectAction*>(action); 
    435     const DynamicVolume  &dv = ia->getActNode()->getVolume(true); 
     440    IntersectAction      *ia = dynamic_cast<IntersectAction*>(action); 
     441    ia->getActNode()->updateVolume(); 
     442    const DynamicVolume  &dv = ia->getActNode()->getVolume(); 
    436443 
    437444    if(dv.isValid() && !dv.intersect(ia->getLine())) 
     
    442449    TriangleIterator it  = this->beginTriangles(); 
    443450    TriangleIterator end = this->endTriangles  (); 
    444     Real32 t; 
    445     Vec3f norm; 
     451    Real32           t; 
     452    Vec3f            norm; 
    446453 
    447454    for(; it != end; ++it) 
    448455    { 
    449456        if(ia->getLine().intersect(it.getPosition(0), 
    450                                      it.getPosition(1), 
    451                                      it.getPosition(2), t, &norm)) 
     457                                   it.getPosition(1), 
     458                                   it.getPosition(2), t, &norm)) 
    452459        { 
    453460            ia->setHit(t, ia->getActNode(), it.getIndex(), norm); 
    454461        } 
    455462    } 
    456 */ 
    457463 
    458464    return Action::Continue;