lundi 24 avril 2017

c++ estimate new position

I have a position and direction vectors and a delta T double. I want to calculate the estimated position based on those values; however, I cannot multiply a vector by a double. Speed is constant at 1 m/s.

Vector oldPosition; // (x, y, z)
Vector directionOfMove; // (x, y, z)
double deltaT; // currentTime - oldPositionTime

newPosition = (directionOfMove * deltaT) + oldPosition;

The methods I've seen so far were a bit confusing to me, since I'm new to C++.

Thank you

Aucun commentaire:

Enregistrer un commentaire