magura
26-04-2006 04:38:56
Hey, I'm unable to get appropriate acceleration and deceleration.
The Simulation im working on is for a mobility scooter, which are limited to 10km/h, and I have set the gearbox pretty faithfully i think. Its an electric motor and I think they're pretty much on/off throttle
Honestly, acceleration/speed seems fine, though it seems rev limited, and the top speed flag doesnt seem to do much.
My real problem is in braking - whether I roll to a stop, or apply the brakes, it slows down at the same rate almost.
Again, it does stop, but not quickly heh.
I suspect it may be something to do with global and/or tyre friction? I have set the default material to 1 in both dynamic and static friction, though tbh im not sure exactly which one applies here, as it's between a dynamic body(the wheel) and a static body(the world mesh).
Any suggestions?
Cheers, Geoff
The Simulation im working on is for a mobility scooter, which are limited to 10km/h, and I have set the gearbox pretty faithfully i think. Its an electric motor and I think they're pretty much on/off throttle
void CGameObjectScooter::InitMotor()
{
/*
Initialise the scooter's motor - The nxOgre motor class is designed around a traditional
gearbox/engine, but we are setting it up for a more digital/electrical motor as in a
mobility scooter
*/
// Construct the torque curve
m_nxoVehicle->mMotor->_torqueCurve.insert(0, 0);
m_nxoVehicle->mMotor->_torqueCurve.insert(1, 500); // 1 Gear setting at 500rpm - an estimate
// The rev limits - we want these close together as we want on/off throttle control.
m_nxoVehicle->mMotor->_minRpm = 450.0f;
m_nxoVehicle->mMotor->_maxRpm = 500.f; // A slight curve - barest acceleration.
// Differential Ratio is the size of the main cog in the gearbox compared to the gears.
m_nxoVehicle->_differentialRatio = 1;
m_nxoVehicle->_transmissionEfficiency = 1.0f;
m_nxoVehicle->mGear[0] = 2; // Gear cog is half as big as the main cog.
m_nxoVehicle->mGearCount = 1;
m_nxoVehicle->mReverseGear = -2;
m_nxoVehicle->_maxVelocity = 10;
}
Honestly, acceleration/speed seems fine, though it seems rev limited, and the top speed flag doesnt seem to do much.
My real problem is in braking - whether I roll to a stop, or apply the brakes, it slows down at the same rate almost.
// We process explicit braking first because it brakes harder than just "letting go"
// Explicit braking
if (m_inputreader->isKeyDown(KC_DOWN))
{
m_objScooter->GetVehicle()->drive(0, 1);
}
if (m_inputreader->isKeyDown(KC_UP))
{
m_objScooter->GetVehicle()->mCurrentGear = 0;
m_objScooter->GetVehicle()->drive(1, 0);
}
else
{
// Implicit braking
m_objScooter->GetVehicle()->drive(0, 0.5);
}
// Reverse
if (m_inputreader->isKeyDown(KC_R))
{
m_objScooter->GetVehicle()->drive(-1, 0);
}
Again, it does stop, but not quickly heh.
I suspect it may be something to do with global and/or tyre friction? I have set the default material to 1 in both dynamic and static friction, though tbh im not sure exactly which one applies here, as it's between a dynamic body(the wheel) and a static body(the world mesh).
Any suggestions?
Cheers, Geoff