[Opal-commits] opal/src/ODE ODESimulator.cpp,1.87,1.88 ODESimulator.h,1.60,1.61
Status: Inactive
Brought to you by:
tylerstreeter
|
From: Andres R. <ar...@us...> - 2005-03-10 21:13:03
|
Update of /cvsroot/opal/opal/src/ODE In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3815/src/ODE Modified Files: ODESimulator.cpp ODESimulator.h Log Message: added a raycast that takes ray length separately for optimization Index: ODESimulator.h =================================================================== RCS file: /cvsroot/opal/opal/src/ODE/ODESimulator.h,v retrieving revision 1.60 retrieving revision 1.61 diff -C2 -d -r1.60 -r1.61 *** ODESimulator.h 9 Mar 2005 02:09:50 -0000 1.60 --- ODESimulator.h 10 Mar 2005 21:12:53 -0000 1.61 *************** *** 97,102 **** void OPAL_CALL internal_addCollidedSolid(Solid* solid); ! virtual const RaycastResult& OPAL_CALL internal_fireRay( ! const Rayr& r); /// Helper function used for ray casting. --- 97,103 ---- void OPAL_CALL internal_addCollidedSolid(Solid* solid); ! virtual const RaycastResult& OPAL_CALL internal_fireRay( const Rayr& r); ! ! virtual const RaycastResult& OPAL_CALL internal_fireRay( const Rayr& r, real length ); /// Helper function used for ray casting. Index: ODESimulator.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/ODE/ODESimulator.cpp,v retrieving revision 1.87 retrieving revision 1.88 diff -C2 -d -r1.87 -r1.88 *** ODESimulator.cpp 9 Mar 2005 02:09:50 -0000 1.87 --- ODESimulator.cpp 10 Mar 2005 21:12:53 -0000 1.88 *************** *** 854,861 **** const RaycastResult& ODESimulator::internal_fireRay(const Rayr& r) { - Point3r origin = r.getOrigin(); real length = r.getLength(); Vec3r dir = r.getDir(); // Normalized the vector if possible. if (0 != length) --- 854,868 ---- const RaycastResult& ODESimulator::internal_fireRay(const Rayr& r) { real length = r.getLength(); + mRaycastResult = internal_fireRay( r, length ); + return mRaycastResult; + } + + const RaycastResult& ODESimulator::internal_fireRay( const Rayr& r, real length ) + { + Point3r origin = r.getOrigin(); Vec3r dir = r.getDir(); + /* I don't think ODE requires this since ray length is separate from the direction -- Andres // Normalized the vector if possible. if (0 != length) *************** *** 863,866 **** --- 870,874 ---- dir.normalize(); } + */ mRaycastResult.solid = NULL; *************** *** 880,884 **** // Finished with ODE ray, so destroy it. dGeomDestroy(rayGeomID); - return mRaycastResult; } --- 888,891 ---- |