reflection direction and hit normals

JohnBoyManbullet

19-07-2011 14:15:53

Hello all. I have made my own character controller . In order for it to work ive taken this from on of the bullet controllers.




btVector3 pp::computeReflectionDirection (const btVector3& direction, const btVector3& normal)
{
return direction - (btScalar(2.0) * direction.dot(normal)) * normal;
}




I use it like this



btVector3 reflectionDirection = computeReflectionDirection( movementDirectionForRay , rayCallback.m_hitNormalWorld );


In my later code i use the reflection direction to figure out the slope of something to make a long story short. My problem is im not too sure about rayCallback.m_hitNormalWorld.

I know what a reflection normal is. I hope that this function is the ray hit normal. If this is not the normal created by a reflection of the rays surface i read deep but i cant assume ,you know?, what would the proper code to access this be. thank you. :?: