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:
@@ -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//
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user