hector
03-08-2011 13:31:48
Hi , I am new with NxOgre. I am having problems destroying animated characters, the aplication crash. I use BuggySwires/Sparked commit. I have the following code:
The error trace is as follow:
Player(Critter::RenderSystem* mRender,NxOgre::Scene* mScene)
{
mRenderSystem=mRender;
// Setup Animations.
mRenderSystem->addAnimation("sinbad.mesh", SinbadLower, Critter::Enums::StockAnimationID_Idle, "IdleBase");
mRenderSystem->addAnimation("sinbad.mesh", SinbadUpper, Critter::Enums::StockAnimationID_Idle, "IdleTop");
mRenderSystem->addAnimation("sinbad.mesh", SinbadLower, Critter::Enums::StockAnimationID_Forward, "RunBase");
mRenderSystem->addAnimation("sinbad.mesh", SinbadUpper, Critter::Enums::StockAnimationID_Forward, "RunTop");
mRenderSystem->addAnimation("sinbad.mesh", SinbadLower, Critter::Enums::StockAnimationID_Jump, "JumpStart", 5.0, false);
mRenderSystem->addAnimation("sinbad.mesh", SinbadLower, Critter::Enums::StockAnimationID_Fall, "JumpLoop");
mRenderSystem->addAnimation("sinbad.mesh", SinbadLower, Critter::Enums::StockAnimationID_Land, "JumpEnd", 5.0, false);
mRenderSystem->addAnimation("sinbad.mesh", SinbadLower, 100, "Dance", 5.0, false);
Critter::AnimatedCharacterDescription desc;
desc.mShape = NxOgre::SimpleCapsule(5+0.5+0.1,2);
desc.mCollisionMask = (Walls << 1) | (Objects << 1);
desc.mMaxGroundSpeed = 17.0f;
desc.setJumpVelocityFromMaxHeight(mScene->getGravity().y, 0.75f);
mSinbad = mRenderSystem->createAnimatedCharacter(Ogre::Vector3(0,500,0), Ogre::Radian(0), "sinbad.mesh", desc);
mRenderSystem->destroyAnimatedCharacter(mSinbad); //crash here
}
The error trace is as follow: