Original Post
🔒 Locked
Object Velocity
Advertisement
Quote:It should probably look more like this:
Original post by Bluseed
CAn someone tell me if this equation looks right.
Im moving a ball on an x any y axis like this.
Ball.x += cosf(BallAngle * PI / 180) * Ball.xv / 60;
Is there anything fishy about this?
Ball.x += cos(BallAngle * PI / 180.0f) * Ball.speed * timeStep;Ball.y += sin(BallAngle * PI / 180.0f) * Ball.speed * timeStep;There are other improvements that could be made as well, such as using vector rather than per-component notation.
Quote:It's generally easier to work with geometric vectors as a class or struct of which the vector components are member variables, rather than individual variables as you're doing. Check out the articles section here for some introductory articles on vector and matrix math (you should be able to find some example code as well).
Original post by Bluseed
Vector instead of pre-component notation? Can you explain a little more?
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement