Panda3D Manual: Position, Rotation and Scale Intervals
  <<prev top next>>     

Panda3D can automatically generate intervals for position to a certain point or a rotation to a certain Hpr value. You can do this by calling the posInterval and hprInterval on the object.

#this lets the actor move to point 10,10,10
myInterval1=myActor.posInterval(1.0,Point3(10,10,10))

#twice as fast
myInterval2=myActor.posInterval(2.0,Point3(8,-5,10))

#you can specify a starting position, too.
myInterval3=myActor.posInterval(1.0,Point3(2,-3,8),startPos=Point3(2,4,1))

#rotate it
myInterval4=myActor.hprInterval(1.0,Vec3(180,90,0))

You can easily create Sequences and Parallels from these intervals:

mySequence=Sequence(myInterval2,myInterval4)
mySequence.start()
myParallel=Parallel(myInterval3,myInterval1)
myParallel.loop()

scaleInterval, posHprInterval, posScaleInterval, hprScaleInterval, and posHprScaleInterval work similar.

Note: The physics engine won't affect a Node that is moved using posInterval()!

  <<prev top next>>