cant use class inheitance with the IAnimationEndCallback cla
-
- Posts: 38
- Joined: Tue Aug 21, 2007 6:54 pm
- Contact:
cant use class inheitance with the IAnimationEndCallback cla
every time I try to use the class IAnimationEndCallback class like this:
class Character : public IAnimationEndCallback
{
};
it never works. Is there a missing headfile or something im missing to be able to use this class in one of my classes?
or is there a way to find out what frame of animation my IAnimatedSceneNode is on?
________
Mercedes-benz sprinter history
class Character : public IAnimationEndCallback
{
};
it never works. Is there a missing headfile or something im missing to be able to use this class in one of my classes?
or is there a way to find out what frame of animation my IAnimatedSceneNode is on?
________
Mercedes-benz sprinter history
Last edited by wREAKAILDRON on Tue Feb 22, 2011 6:55 am, edited 1 time in total.
-
- Posts: 38
- Joined: Tue Aug 21, 2007 6:54 pm
- Contact:
to compute the amount of time the attack animation can accumulate, i want to know if i came up with the right formula. Im doing (accumulator) +=(constant number, divided by the frame rate) to add up time.
is that right? i came up with it in about 10 seconds, and im not concerned with being accurate with world time (hours and seconds). i just wanted some number to accumulate by, no matter what the frame reate is. If the only thing i did wrong is not sink up my measurement to clock time expanses, I dont watn to hear your answer. I just want some differing framerate worthy accumulation number of the amount of time my attack animatin takes.
so i did (attacktimeaccumulator) += (constant number, divided by the frame rate)
im guessing if my formula works, i could also come up with a clock that goes by this time measurement, that doesnt go by hours and seconds and miutes, no matter what the irrlicht frame rate is, and i might make a clock in the game becuase of my neat formula.
is it right? it seems simple.
and i could go on to guess that how clockmakers made clocks, from the amount of rotations a clock gear would rotate a minute, being powerd by a measured battery, to keep the first acurate and constant time measurement; how many times a gear could rotate a minute on a battery power, and thus defining a constant curent of electricity? rotating a gear per minute, defining a constant power given by an electricity source
________
Think Mill
is that right? i came up with it in about 10 seconds, and im not concerned with being accurate with world time (hours and seconds). i just wanted some number to accumulate by, no matter what the frame reate is. If the only thing i did wrong is not sink up my measurement to clock time expanses, I dont watn to hear your answer. I just want some differing framerate worthy accumulation number of the amount of time my attack animatin takes.
so i did (attacktimeaccumulator) += (constant number, divided by the frame rate)
im guessing if my formula works, i could also come up with a clock that goes by this time measurement, that doesnt go by hours and seconds and miutes, no matter what the irrlicht frame rate is, and i might make a clock in the game becuase of my neat formula.
is it right? it seems simple.
and i could go on to guess that how clockmakers made clocks, from the amount of rotations a clock gear would rotate a minute, being powerd by a measured battery, to keep the first acurate and constant time measurement; how many times a gear could rotate a minute on a battery power, and thus defining a constant curent of electricity? rotating a gear per minute, defining a constant power given by an electricity source
________
Think Mill
Last edited by wREAKAILDRON on Tue Feb 22, 2011 6:55 am, edited 4 times in total.
Never used that animation callback thingy but to use the callback classes I know you have to create/overload some special function within your custom class that's then called as a callback (pseudo code):
If you get compiler errors complaining about abstract methods etc. you have to implement those methods for your derived class too.
Code: Select all
class mycallbackclass : public icallbackclassbase
{
public:
mycallbackclass()
{
constructorthingies();
};
void callbackfunction(someparams, moreparams)
{
my_code_to_be_run_when_animation_is_done();
evenmorecode();
}
};
----------
mycallbackclass* cb=new mycallbackclass();
function_wanting_callback_parameter(..., cb);
wait_for_callback_and_animation_done();
delete mycallbackclass();
-
- Posts: 38
- Joined: Tue Aug 21, 2007 6:54 pm
- Contact:
am i right though?
(mommy where did electiricy come from?)
i mean is my formula right? at least the function is working.
im sorry, is it?
________
DRAGONBALL Z FORUMS
(mommy where did electiricy come from?)
i mean is my formula right? at least the function is working.
im sorry, is it?
________
DRAGONBALL Z FORUMS
Last edited by wREAKAILDRON on Tue Feb 22, 2011 6:55 am, edited 1 time in total.
I'd guess it won't work if your frame rate isn't constant. And that's something you can't have all the time. You can limit your frame rat to (i.e.) 60 fps but you'll still run into problems if you can't manage to render that many frames (getting stuck at 30 - 40 or so). Better try to get the callback working.
Code: Select all
class MyAnimationEndCallBack : public scene::IAnimationEndCallBack
{
public:
virtual void OnAnimationEnd(scene::IAnimatedMeshSceneNode* node)
{
// do something
}
};
// in main
scene::IAnimatedMeshSceneNode* msn =
smgr->addAnimatedMeshSceneNode(smgr->getMesh("../../media/dwarf.x"));
// add the animator
scene::IAnimationEndCallBack* cb = new MyAnimationEndCallBack;
msn->setAnimationEndCallBack(cb);
cb->drop();
-
- Posts: 38
- Joined: Tue Aug 21, 2007 6:54 pm
- Contact:
constant 1
c1 / 6fps = .16..................
c1 / 6fps * 6fps * 60secondsperminute = 60
c1 / 31fps = .032...............
c1 / 31fps * 31fps * 60secondperminute = 60
c1 / 6fps * 6fps * 30seconds = 30
c1 / 31fps * 31fps * 30seconds = 30
30 + 30 = 60?
________
Honda vtr1000
c1 / 6fps = .16..................
c1 / 6fps * 6fps * 60secondsperminute = 60
c1 / 31fps = .032...............
c1 / 31fps * 31fps * 60secondperminute = 60
c1 / 6fps * 6fps * 30seconds = 30
c1 / 31fps * 31fps * 30seconds = 30
30 + 30 = 60?
________
Honda vtr1000
Last edited by wREAKAILDRON on Tue Feb 22, 2011 6:55 am, edited 1 time in total.
-
- Posts: 38
- Joined: Tue Aug 21, 2007 6:54 pm
- Contact:
thats great!
i needed something else now, having to do with something that i forgot, and i now i think i can do "it" because of this formula being moderatly accurate.
________
FIND HEADSHOP
i needed something else now, having to do with something that i forgot, and i now i think i can do "it" because of this formula being moderatly accurate.
________
FIND HEADSHOP
Last edited by wREAKAILDRON on Tue Feb 22, 2011 6:56 am, edited 1 time in total.
-
- Posts: 38
- Joined: Tue Aug 21, 2007 6:54 pm
- Contact:
yeah i dont think my problem here got fixed because the driver->getFPS() function doesnt update by the millisecond, but it may be good enough for combo moves, possibly
________
GIRLFRIEND PIC
________
GIRLFRIEND PIC
Last edited by wREAKAILDRON on Tue Feb 22, 2011 6:56 am, edited 1 time in total.
-
- Competition winner
- Posts: 189
- Joined: Tue Oct 16, 2007 3:53 am
- Location: Indonesia
- Contact:
Hi there...
this is a sample of ordinary Object Oriented :
why all classes in irrlicht engine using pointer to call their methods? the answer is because they are abstract classes. what is abstract classes? a class with a pure virtual functions. an abstract class can't be use to inheritance, and equalize
(i'm indonesian). you can only use a pointer to point on it. why they use abstract classes? because they have to make sure that they share the same instantiated objects.
may be if u want to inherit them you should treat them as abstract class to. i think it will be better if you make a ondinary class with "that class" inside it. try to search with google, use the error code as the key word.
hope this helps
this is a sample of ordinary Object Oriented :
Code: Select all
class human{
......
.....
};
main(){
.....
human.walking();
.....
}
(i'm indonesian). you can only use a pointer to point on it. why they use abstract classes? because they have to make sure that they share the same instantiated objects.
may be if u want to inherit them you should treat them as abstract class to. i think it will be better if you make a ondinary class with "that class" inside it. try to search with google, use the error code as the key word.
hope this helps