fix for issue 1400
use default output name for VHACD test binary
This commit is contained in:
@@ -38,6 +38,14 @@
|
|||||||
using namespace VHACD;
|
using namespace VHACD;
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
|
bool replace(std::string& str, const std::string& from, const std::string& to) {
|
||||||
|
size_t start_pos = str.find(from);
|
||||||
|
if(start_pos == std::string::npos)
|
||||||
|
return false;
|
||||||
|
str.replace(start_pos, from.length(), to);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
class MyCallback : public IVHACD::IUserCallback {
|
class MyCallback : public IVHACD::IUserCallback {
|
||||||
public:
|
public:
|
||||||
MyCallback(void) {}
|
MyCallback(void) {}
|
||||||
@@ -293,7 +301,16 @@ void ParseParameters(int argc, char* argv[], Parameters& params)
|
|||||||
for (int i = 1; i < argc; ++i) {
|
for (int i = 1; i < argc; ++i) {
|
||||||
if (!strcmp(argv[i], "--input")) {
|
if (!strcmp(argv[i], "--input")) {
|
||||||
if (++i < argc)
|
if (++i < argc)
|
||||||
|
{
|
||||||
params.m_fileNameIn = argv[i];
|
params.m_fileNameIn = argv[i];
|
||||||
|
//come up with some default output name, if not provided
|
||||||
|
if (params.m_fileNameOut.length()==0)
|
||||||
|
{
|
||||||
|
string tmp = argv[i];
|
||||||
|
replace(tmp,".obj",".vhacd.obj");
|
||||||
|
params.m_fileNameOut = tmp;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (!strcmp(argv[i], "--output")) {
|
else if (!strcmp(argv[i], "--output")) {
|
||||||
if (++i < argc)
|
if (++i < argc)
|
||||||
|
|||||||
@@ -615,7 +615,7 @@ void btRaycastVehicle::updateFriction(btScalar timeStep)
|
|||||||
btScalar defaultRollingFrictionImpulse = 0.f;
|
btScalar defaultRollingFrictionImpulse = 0.f;
|
||||||
btScalar maxImpulse = wheelInfo.m_brake ? wheelInfo.m_brake : defaultRollingFrictionImpulse;
|
btScalar maxImpulse = wheelInfo.m_brake ? wheelInfo.m_brake : defaultRollingFrictionImpulse;
|
||||||
btWheelContactPoint contactPt(m_chassisBody,groundObject,wheelInfo.m_raycastInfo.m_contactPointWS,m_forwardWS[wheel],maxImpulse);
|
btWheelContactPoint contactPt(m_chassisBody,groundObject,wheelInfo.m_raycastInfo.m_contactPointWS,m_forwardWS[wheel],maxImpulse);
|
||||||
rollingFriction = calcRollingFriction(contactPt);
|
rollingFriction = calcRollingFriction(contactPt)/btScalar(getNumWheels());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user