In the part of "Interpolate Normals" smoothing the corners of the object is used, as I understood I had to used them in the function
btDefaultVehicleRaycaster:: castRay (const btVector3 & from, const btVector3 & to, btVehicleRaycasterResult & result) namely:
Code: Select all
void* btDefaultVehicleRaycaster::castRay(const btVector3& from,const btVector3& to, btVehicleRaycasterResult& result)
{
// RayResultCallback& resultCallback;
btCollisionWorld::ClosestRayResultCallback rayCallback(from,to);
m_dynamicsWorld->rayTest(from, to, rayCallback);
if (rayCallback.hasHit())
{
btRigidBody* body = btRigidBody::upcast(rayCallback.m_collisionObject);
if (body && body->hasContactResponse())
{
result.m_hitPointInWorld = InterpolateMeshNormal(
rayCallback.m_collisionObject->getWorldTransform(), // transform is the mesh shape's world transform
rayCallback.m_collisionObject->getCollisionShape(),
, //subpart
, //triangle
rayCallback.m_hitPointWorld); // position is the world space hit point of the ray
//result.m_hitPointInWorld = rayCallback.m_hitPointWorld;
result.m_hitNormalInWorld = rayCallback.m_hitNormalWorld;
result.m_hitNormalInWorld.normalize();
result.m_distFraction = rayCallback.m_closestHitFraction;
return body;
}
}
return 0;
}