Use consistent rayFrom/rayTo API for rayTest for btDbvt and btSoftBody, instead of rayCast/collideRAY(origin,direction). This means RayFromToCaster has a fraction [0..1] instead of distance [0..INF]

Renamed collideRay -> rayTest to reflect change to (rayFrom,rayTo) interface.
Re-use btRayAabb2 function from src/LinearMath/btAabbUtil2.h in btDbvt instead of duplicated implementation.
This commit is contained in:
erwin.coumans
2008-10-15 18:30:35 +00:00
parent 81fcd03af5
commit cac172d422
8 changed files with 157 additions and 142 deletions

View File

@@ -397,7 +397,7 @@ void DemoApplication::keyboardCallback(unsigned char key, int x, int y)
case '.':
{
shootBox(getCameraTargetPosition());
shootBox(getRayTo(x,y));//getCameraTargetPosition());
break;
}
@@ -530,7 +530,7 @@ void DemoApplication::shootBox(const btVector3& destination)
btConvexShape* childShape = new btBoxShape(btVector3(1.f,1.f,1.f));
m_shootBoxShape = new btUniformScalingShape(childShape,0.5f);
#else
m_shootBoxShape = new btBoxShape(btVector3(1.f,1.f,1.f));
m_shootBoxShape = new btSphereShape(1.f);//BoxShape(btVector3(1.f,1.f,1.f));
#endif//
}