Don't Understand "hprInterval" function

Hi ,

I’m a newbie to Panda and I don’t understand that instruction :
pandaTurn = self.panda.hprInterval(0.2,Vec3(self.panda.getH()-(10*dir),0,0))

What’s that hprInterval ??

Thank for helping the noobs ^^

Basically, an interval is a background job whose job is to update the position of an object. In the case of an hprInterval, the background job is updating the hpr (heading, pitch, and rotation) of an object.

In fact, if you want to move an object gradually over a period of time, you can do that without intervals just by writing a function that gets called every frame, and then adjusting the position a teeny bit each time the function gets called. (A function that gets called every frame is called a “Task.”) But this is such a common thing to want to do, that Panda provides this built-in mechanism (intervals) to do this for you.

I should also mention that method, “.hprInterval”, creates the interval in a paused state — ie, the object is not moving yet. The method returns a pointer to the interval. Later on, you’ll need to call ‘start’:

ival = object.hprInterval(…)

This causes the background job to start actually moving the object.

You might also want to check the following manual page: … _Intervals