Page 1 of 1

Trouble With MS3D Model

Posted: Fri Feb 09, 2007 7:07 am
by HondaDarrell
I am having trouble getting an MS3D Model to load as an IAnimatedMeshMS3D.
When I load my MS3D mesh as an IAnimatedMeshMS3D, I get an error about not being able to convert IAnimatedMesh to IAnimatedMeshMS3D.
Could the problem be the model or the code?

Posted: Fri Feb 09, 2007 8:28 am
by Luke
It would be your code,

you need to cast to IAnimatedMeshMS3D if you want the MS3d interface, but I can't see why you need it.

Posted: Fri Feb 09, 2007 1:56 pm
by Acki
Yes, a type cast will do the trick... ;)
But you don't need to load it as an IAnimatedMeshMS3D, you can use an IAnimatedMesh and Irrlicht should handle it as an MS3D mesh automatically...

Posted: Fri Feb 09, 2007 3:09 pm
by rogerborg
Luke wrote:It would be your code,

you need to cast to IAnimatedMeshMS3D if you want the MS3d interface, but I can't see why you need it.
getJointCount() / getMatrixOfJoint() or similar, which is why we really, really, really, really need to move the skeleton/animation system to IAnimatedMesh or a new interface, and get rid of the file-format-specific APIs altogether to stop this evil before it spreads any further.

Code: Select all

IAnimatedMesh * shipMesh = smgr->getMesh("z1.ms3d");
if(shipMesh && shipMesh->getMeshType() == EAMT_MS3D)
{
    IAnimatedMeshMS3D * actualMesh = static_cast<IAnimatedMeshMS3D*>(shipMesh);
    for(int joint = 0; joint < actualMesh->getJointCount(); ++joint)
    {
        matrix4 * matrix = actualMesh->getMatrixOfJoint(joint, 0);
        ....
    }
}