NotCamelCase
19-10-2013 23:02:44
Hey guys,
Firstly, I'm using BtOgre wrapper, not OgreBullet but I hope I'll be able to get help from you. I'm trying to create vehicle simulation so I use the code below to add it to the world
Wheels are added to the vehicle but with wrong positions and orientations as in image. They must be added to the bigger box on right-most as wheels. Somehow I can rotate the wheels steeringly (you see front wheels rotated in image as vehicle wheels) and moving the vehicle's rigid body (the bigger box) moves the wheels accordingly weirdly..
Anyone have idea how can I attach the wheels to the vehicle in appropriate location ? Please note that every object seems correct when just rendered from .scene.
So any help is appreciated.
Thanks everyone for time in advance!
Firstly, I'm using BtOgre wrapper, not OgreBullet but I hope I'll be able to get help from you. I'm trying to create vehicle simulation so I use the code below to add it to the world
const StringVector wheelIds = StringUtil::split(params["wheels"], " ");
for (int i = 0; i < wheelIds.size(); ++i)
{
GameObject* go = Utils::getGameObjectByID(mGameObjects, wheelIds);
auto wheelProps = mPODLoader->getObjectDefinitionByTag(go->getTag() + "-" + go->getID())->getParameters();
bool isFront = StringConverter::parseBool(wheelProps["isFront"]);
SceneNode* node = go->getNode();
node->setPosition(node->getPosition() - Vector3(0, suspensionRestLength, 0));
vehicle->addWheel(Convert::toBullet(node->getPosition()), wheelDirectionCS0, wheelAxleCS,
suspensionRestLength, StringConverter::parseReal(wheelProps["radius"]), tuning, isFront); // vehicle is btRaycastVehicle
vehicleObj->getWheels().push_back(go);
}
Wheels are added to the vehicle but with wrong positions and orientations as in image. They must be added to the bigger box on right-most as wheels. Somehow I can rotate the wheels steeringly (you see front wheels rotated in image as vehicle wheels) and moving the vehicle's rigid body (the bigger box) moves the wheels accordingly weirdly..
Anyone have idea how can I attach the wheels to the vehicle in appropriate location ? Please note that every object seems correct when just rendered from .scene.
So any help is appreciated.
Thanks everyone for time in advance!