Avoiding the "ice-skating" effect when rotating wh

Hi,
I’m currently using posInterval and hprInterval to rotate and move my actor accordingly. The problem with this is what happens when you turn while the actor is already moving - while the actor is moving on a posInterval it will rotate, but the rotation made has no effect on the position the actor will move in, effectively making the actor seem as if he is sliding when he turns.
Disabling turning while the character is moving looks and feels very horrible, so that’s a no go.
This could probably be remedied by making the posIntervals a very short length and with a very short duration. Just wondering about performance issues - is this the right way to tackle this problem?

Thanks

The problem with intervals is that they’re designed to do something over a period of time, which can make it tricky to change them dynamically (it can be done, its just not so worthwhile in this case).

You would probably want to have a task that applies a force to your character. Ie


from direct.directbase import DirectStart
from pandac.PandaModules import *
from direct.task import Task

def moveTask(task):
   #get forward vector
   fvec=objectForward.getPos(render)-myObject.getPos(render)
   #also find the time since last frame
   dt=globalClock.getDt()

   #push the object in whatever direction its looking (getH)
   myObject.setPos(myObject.getPos()+fvec*dt)
   return Task.cont

def turn(val):
   myObject.setH(myObject.getH()+val)

myObject=loader.loadModel("models/panda-model")
objectForward=myObject.attachNewNode("forward")
#point it forward relative to the panda
objectForward.setPos(0,1,0)

taskMgr.add(moveTask,"move-panda")

#allow the character to turn
base.accept("a",turn,extraArgs=[-4])
base.accept("d",turn,extraArgs=[4])