mirror of
https://github.com/Xevion/Boids.git
synced 2025-12-14 16:11:05 -06:00
More cleanup making code cleaner, made Rectangle Boundaries automatically size to camera's view, automatic random boid placement, value tweaking
This commit is contained in:
11
Assets/Util.cs
Normal file
11
Assets/Util.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class Util {
|
||||
public static Vector2 RotateBy(Vector2 v, float a) {
|
||||
var ca = Mathf.Cos(a);
|
||||
var sa = Mathf.Sin(a);
|
||||
var rx = v.x * ca - v.y * sa;
|
||||
|
||||
return new Vector2((float) rx, (float) (v.x * sa + v.y * ca));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user