closestraycallback

JohnBoyManbullet

22-07-2011 09:41:43

hello. I am trying to get the m_hitpointworld from closecallbackresult. I have read alot into the btdynamics world header. From what i have read, it seems that in order to calculate this i need to take these steps.


btCollisionWorld::ClosestRayResultCallback raycallback;


btCollisionWorld::LocalRayResult LocalRayResult( btCollisionObject* collisionObject,
LocalShapeInfo* localShapeInfo,
const btVector3& hitNormalLocal,
btScalar hitFraction ); // this is left unknown for me



raycallback.addSingleResult(LocalRayResult ,true );

raycallback.m_hitPointWorld; // this is what im after, but with no avail






I need the hit fraction supposivly for m hitpointworld to work. Either it was totally never developed, or it has and i just need the hitfraction. What is the hit fraction? Im so familiar with this. Also does anyone know a formula for calucluating the hit point out of the reflection direction and incident ray? Any word on this would be helpfull for this is a major part of ray casting that im missing in my code? thank alot.

JohnBoyManbullet

25-07-2011 11:12:21

This is how to get mHitpointworld working without doing some huge sweep test.



raycallback.m_hitPointWorld.setInterpolate3(rayTo,rayFrom,raycallback.m_closestHitFraction);