Trouble With MS3D Model

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
HondaDarrell
Posts: 20
Joined: Sun Aug 27, 2006 9:10 pm
Location: U.S.A.
Contact:

Trouble With MS3D Model

Post 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?
Luke
Admin
Posts: 449
Joined: Fri Jul 14, 2006 7:55 am
Location: Australia
Contact:

Post 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.
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post 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...
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post 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);
        ....
    }
}
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Post Reply