I'm wondering if it would be possible for me to hack my copy of Irrlicht to make it right-handed.
Other tools and libraries that I'm using are right-handed, and RH + Z-up makes more sense for my application. Having to switch my brain between systems is becoming tiresome.
So, how far-reaching is the LH convention? Could I tweak the camera and culling code and get a RH system? I'm using Collada and .X importers -- I can presumably just comment the FlipAxis assignment for Collada. I'm not sure about .X.
Advice, anyone?
How hard to make the engine right-handed?
In bsp files, data is stored as RH (after a loong compile),
so either irrlicht has to change, or your application must adapt.
You can make the application Right-Handed.
When loading a model, parent it to an empty scene node and keep a pointer to its mesh.
Later, transform this node, and flip all faces:
so either irrlicht has to change, or your application must adapt.
You can make the application Right-Handed.
When loading a model, parent it to an empty scene node and keep a pointer to its mesh.
Later, transform this node, and flip all faces:
Code: Select all
node->setRotation(vector3df(-90.f,0.f,0.f));
node->setScale(vector3df(1.f,-1.f,1.f));
// negative scale (for right -> left hand coordinates system)
// will place models at their right locations, but this will flip normals
// so flip them now
IMeshManipulator* manip = smgr->getMeshManipulator();
for (u16 n=0; n<miscmodelsmeshes.size(); n++)
{
IAnimatedMesh* mesh = miscmodelsmeshes[n];
manip->flipSurfaces(mesh->getMesh(0));
manip->recalculateNormals(mesh);
mesh->drop();
}
miscmodelsmeshes.clear();