Langhole
09-05-2007 18:06:29
Hi,
I originally posted this in the main forum, but was told to move it here. I'll just clarify now that this is a vector problem, not an OgreNewt specific problem, I apologize if i'm posting in the wrong area still.
I'm trying to implement a gearbox into my OgreNewt vehicle, using 2 vectors to hold the torque curve, and gear ratio.
They are created fine, but when I loop through n gears, and push_back the rpm, torque, and ratio for that gear. The problem then is, they don't seem to want to store the values... I'm confused as to why, and I've been looking for possible ways to work around it, like:
So far, all I get is a crash, and it breaks when trying to get a value for the current gear ratio.
I'm stuck, if there's any help out there, I'd appreciate a bit
Thx.
I originally posted this in the main forum, but was told to move it here. I'll just clarify now that this is a vector problem, not an OgreNewt specific problem, I apologize if i'm posting in the wrong area still.
I'm trying to implement a gearbox into my OgreNewt vehicle, using 2 vectors to hold the torque curve, and gear ratio.
struct TorquePoint {
Ogre::Real rpm;
Ogre::Real torque;
}
std::vector<Ogre::Real> mGears;
std::vector<TorquePoint> mTorqueCurve;
They are created fine, but when I loop through n gears, and push_back the rpm, torque, and ratio for that gear. The problem then is, they don't seem to want to store the values... I'm confused as to why, and I've been looking for possible ways to work around it, like:
Ogre::Real aRPM[5];
Ogre::Real aTorque[5];
Ogre::Real mGears[5];
// is this even possible for what I'm doing? instead of std::vector<_Ty>?? //
So far, all I get is a crash, and it breaks when trying to get a value for the current gear ratio.
I'm stuck, if there's any help out there, I'd appreciate a bit
Thx.