Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- public class Program
- {
- public static void Main()
- {
- Vector2 pos = new Vector2(34.44f, 43.122244f);
- Vector2 move = new Vector2(4.5f, -4.5f);
- float speed = 4f;
- float deltaTime = 0.244355521f;
- for (int i = 0; i < 100000000; i++)
- {
- Vector2 res = pos + (speed * deltaTime * move);
- //Vector2 res = pos + (move * speed * deltaTime);
- }
- }
- }
- public struct Vector2
- {
- public float x;
- public float y;
- public Vector2(float xx, float yy)
- {
- x = xx;
- y = yy;
- }
- public static Vector2 operator +(Vector2 left, Vector2 right) => new Vector2(left.x + right.x, left.y + right.y);
- public static Vector2 operator *(Vector2 left, float right) => new Vector2(left.x * right, left.y * right);
- public static Vector2 operator *(float left, Vector2 right) => new Vector2(left * right.x, left * right.y);
- }
Advertisement
Add Comment
Please, Sign In to add comment