Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //before conversion to sfml's vector class and should work anywhere
- public static double[] AngleToVector(double degreesangle)
- {
- double[] newvector = new double[2];
- newvector[0] = calcXOnlyVector(degreesangle % 360);
- newvector[1] = calcYOnlyVector(degreesangle % 360);
- return newvector;
- }
- public static double calcXOnlyVector(double angle)
- {
- return Math.Cos(ToRadians(angle));
- }
- public static double calcYOnlyVector(double angle)
- {
- return Math.Sin(ToRadians(angle));
- }
- //this line of code in the sprite class that is after the conversion to SFML Vector
- VectorDirection += (MissingMathFunctions.AngleToVectorSFML(angledirection % 360) * this.Acceleration);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement