Code: Select all
class MySceneNodeAnimator : public ISceneNodeAnimator {
void animateNode(ISceneNode node, timeMs) {
// animation stuff here
}
}
Has anyone come up with any workarounds?
Code: Select all
class MySceneNodeAnimator : public ISceneNodeAnimator {
void animateNode(ISceneNode node, timeMs) {
// animation stuff here
}
}
Code: Select all
class MySceneNodeAnimator {
private ISceneNode nodeToAnimate;
MySceneNodeAnimator(ISceneNode nodeToAnimate) {
this.node = nodeToAnimate;
}
public void animate() {
/* do animation stuff on scene node here */
}
}
class MainClass {
// keep a reference to the timer so it doesn't get garbage collected
private System.Threading.Timer timer;
MainClass() {
ISceneNode node; // get from SceneManager
MySceneNodeAnimator myanim = new MySceneNodeAnimator(node);
// create a TimerCallBack, a delegate (function pointer) to the function
// you want called (animated)
System.Threading.TimerCallback cb = new System.Threading.TimerCallback(myanim.animate);
// create a timer
long howLongToWaitBeforeExecuting = 0;
long executeEveryXMilliseconds = 100;
timer = new System.Threading.Timer(cb, null, howLongToWaitBeforeExecuting, executeEveryXMilliseconds);
}
}