[need Help] IAnimationEndCallBack crash

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
serokon
Posts: 11
Joined: Wed Mar 27, 2013 1:43 am

[need Help] IAnimationEndCallBack crash

Post by serokon »

Hello Irrlicht com !
I just finished my 3rd Person cam and wanted to add some animations.
My Problem is that I dont want to create something like a new Thread who checks if the animation is at the end for each Monster/Player.
But the Irrlicht function "IAnimationEndCallBack" doenst seem to work for me.
(I hope you c++ guys can see what I did here)

My Code:

Code: Select all

 
[Class Declaration]
 AnimEnd = class(IAnimationEndCallBack)
   public
   procedure OnAnimationEnd(node : IAnimatedMeshSceneNode );
end;
[Var Declaration]
 myCallBack : AnimEnd;
[Procedure Dec after Var part]
 procedure AnimEnd.OnAnimationEnd(node: IAnimatedMeshSceneNode);
 begin
 writeln('he stopped!');
 end;
 
[And here I want to play a animation:]
 mychar.setLoopMode(false);
   myCallBack := AnimEnd.Create;
mychar.setAnimationEndCallback(myCallBack);
if ((mycharframe < 45) OR (mycharframe > 59)) then mychar.setFrameLoop(45,59);
 
The programm exits directly after pressing Left mouse to call the "play a animation" function.
If I set the AnimationEndCallBack to nil (I think for c++ also works 0) it doesnt crashes.
I also tried to create a object directly from IAnimationEndCallBack and it also crashes.
(Would makes sense if this directly method doenst work but why he doesnt accept objects who are from IAnimationEndCallBack?)

I hope you guys can give me a hint, I was not lucky with search function maybe their is also a way to solve the problem without irrlicht way ?
Thx and have a nice day :)
Post Reply