Interpolators

Hi,

I’m using distance and angle interpolators to make the doors on my game open and close. When a door is first picked it start the increase of the interpolators like this


pAI1e.startIncreasing(0);
pDI1e.startIncreasing(0);

When this door is picked again it starts the drecrease of the interpolators


pAI1e.startDecreasing(0);
pDI1e.startDecreasing(0);

The first time i click he door it increase the value fine, when i click the door again to close and again to open, it does not create the intermediary values for the interpolator.
Did i miss something?

Rafael

AFAIK, the interpolators don’t use marvin’s timing code, which is not really good. I don’t know if there are similar classes which do a similar job taking that into account. In any case, that would be real easy to implement it.

Interfaces:
org.xith3d.behaviors.Animatable

Classes:
org.xith3d.behaviors.impl.AnimatableGroup
org.xith3d.behaviors.impl.Bullet
org.xith3d.behaviors.impl.GroupAnimator
org.xith3d.behaviors.impl.GroupRotator
org.xith3d.behaviors.impl.GroupTranslator
org.xith3d.behaviors.impl.RotatableGroup
org.xith3d.behaviors.impl.TranslatableGroup

Please to a fresh SVN checkout, since there was a misspelling of GroupRotator which was named GroupRotater.

See org.xith3d.test.animation.RotatableGroupTest for an example.

But as an easy fix you should use the following for all you startIncreasing() calls.


pAI1e.startIncreasing( this.getGameTime() ); // I assume "this" is your RenderLoop

You’ll certainly call pAI1e.getValue( gameTime );. And this won’t work, if you don’t start with the current gameTime.

Marvin

That fixed the problem ;D

Thanks Marvin

Rafael

By the way, rafa_es, did you applied my pieces of advices on your code? If you want I can send you my local (corrected) version.

Yes Amos, all that was posted that needed to be fixed in the game was done
If you think that you forgot to post some fix, you can send me

Thanks for the help too ;D

Rafael

Well there’s something I didn’t commented cause I took as granted that you knew what you were doing.

But listing all doors in your level as local variables is just plain ugly and really inconvenient. If you haven’t any reason to keep it like this, then we could easily find a better solution. Real easy, and 1000x more elegant.

I saw that It’s preety ugly this way. I’ll build a class for that when i finish a homework that i have to do for tomorrow.

It’s already in my TO-DO list.

Rafael

OK, perfect then.

Good luck,

Amos

Fixed ;D

Good.

I don’t know if you planned it but making red objects which are targeted would be a really good idea. With the distance (minDist < 3000) thing it’s really hard to know if you can get/open/close the object or not.

Also for the encoding of your classes I see lots of strange characters in the “instructions” strings. If it’s not UTF-8 (which I suspect) you’d better use that.

I didn’t get this part? Can you post a example of that?

I don’t see that here.

Rafael

Well from what I observed of the game you can “pick” some objects, is that right? And you can only pick them, when you are near enough (less than 3000, it’s in your code). So it would be cool if when you can pick an object, this object is highlited in red (e.g. appearance.setColor(new Color3f(Color.red)); )

do you use Eclipse ? in the file properties you can see the file encoding.

I got it, but i don’t have a clue of how can i do that.

I use NetBeans but i checked and it’s UTF-8

Rafael

how you can do what ?

well you know how to detect when an object is picked. now you just have to pick every frame.
and to highlight an object in red just use as I said : appearance.setColor(new Color3f(Color.red))