btx2397
21-02-2011 01:49:40
HI,betajaen when i create an Critter::AnimatedCharacter* mSinbad with interface createAnimatedCharacter is success,buf if i release the Pointer manual with interface destroyAnimatedCharacter the applications was crash .Is something i miss ? Here is my code.
/////=================================================================
mWorld = NxOgre::World::createWorld();
NxOgre::SceneDescription scene_desc;
scene_desc.mGravity = NxOgre::Constants::MEAN_EARTH_GRAVITY;
mScene = mWorld->createScene(scene_desc);
mRenderSystem = new Critter::RenderSystem(mScene, mSceneMgr);
mRenderSystem->createVisualDebugger();
// Fake Floor
BoxDescription fake_floor_desc(250,1,250);
fake_floor_desc.mGroup = Walls;
mScene->createSceneGeometry(fake_floor_desc, Vec3(0,-0.5,0));
// 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,5,0), Ogre::Radian(0), "sinbad.mesh", desc);
mRenderSystem->destroyAnimatedCharacter(mSinbad); //crash at here.
//================================================================================================
i find when i use destroyCharacterController it will crash too.
my condition:
1.VS2008
2.Ogre 1.7
3.buggyswires
sorry for my bad english.
/////=================================================================
mWorld = NxOgre::World::createWorld();
NxOgre::SceneDescription scene_desc;
scene_desc.mGravity = NxOgre::Constants::MEAN_EARTH_GRAVITY;
mScene = mWorld->createScene(scene_desc);
mRenderSystem = new Critter::RenderSystem(mScene, mSceneMgr);
mRenderSystem->createVisualDebugger();
// Fake Floor
BoxDescription fake_floor_desc(250,1,250);
fake_floor_desc.mGroup = Walls;
mScene->createSceneGeometry(fake_floor_desc, Vec3(0,-0.5,0));
// 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,5,0), Ogre::Radian(0), "sinbad.mesh", desc);
mRenderSystem->destroyAnimatedCharacter(mSinbad); //crash at here.
//================================================================================================
i find when i use destroyCharacterController it will crash too.
my condition:
1.VS2008
2.Ogre 1.7
3.buggyswires
sorry for my bad english.