Changeset 454
- Timestamp:
- 12/16/06 06:34:08 (2 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/Source/System/NodeCores/Drawables/Geometry/Base/WS/OSGGeometry.cpp
r436 r454 426 426 } 427 427 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. 430 437 */ 431 438 Action::ResultE Geometry::intersect(Action * action) 432 439 { 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(); 436 443 437 444 if(dv.isValid() && !dv.intersect(ia->getLine())) … … 442 449 TriangleIterator it = this->beginTriangles(); 443 450 TriangleIterator end = this->endTriangles (); 444 Real32 t;445 Vec3f norm;451 Real32 t; 452 Vec3f norm; 446 453 447 454 for(; it != end; ++it) 448 455 { 449 456 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)) 452 459 { 453 460 ia->setHit(t, ia->getActNode(), it.getIndex(), norm); 454 461 } 455 462 } 456 */457 463 458 464 return Action::Continue;
