ship turns...

I’m trying to make a ship turn (viewed from a fixed cam above it) but I cant get it to do so realisticly.I want it to make a broad turn, then move to where I clicked the mouse. The movement or mouse stuff isnt the problem, just the turning. A hprInterval would just make it spin, which isnt what I want.

I’ve tried to orbit it around a dummy node, which wont work out since the ship would have to move independly of that node aswell, also tried to put it together with the posInterval in Parallel, but that wont work either…

any ideas on this one?

I would use a tasking function. In this tasking function, turn the ship by some constant amount until it is facing the point that you selected. While this is happening, use trigonometry and the current rotation of the ship to move the ship in the direction that it is facing in world coordinates. this way it turns and moves at the same time, and when it is pointing towards its final destination, it would fly straight. The task would end when the ship reaches the final destination (give or take some amont of error). You might need some other checks in case someone selected a point to the side of the ship inside the turning radius, resulting in the ship flying in an endless circle.

I’ve tried exactly this, but then using a while loop instead of a task. Seems panda3d doesnt like while loops though ^^. Anyway, this seems abit messy to me, since it would take alot of resources and wouldnt be exactly acurate.
I’ll give it a shot, it might be better then I envision in my pesimistic mind.
Thanks for the sugestion :slight_smile: