public CapsuleCache(Capsule c)
        {
            capsule = c;
            Vec2 d = c.p1 - c.p0;

            length    = d.Len();
            invLength = Mathf.TryInvertPositive(length, out circle);
            normal    = d.Rot90() * invLength;
            center    = Vec2.Lerp(0.5f, c.p0, c.p1);
        }
        public static Transform RotationTranslation(float angle, Vec2 t)
        {
            Vec2 rot = Vec2.CosSin(angle);

            return(new Transform(rot, rot.Rot90(), t));
        }
Exemple #3
0
 public static Vec2 Cross(float a, Vec2 b)
 {
     return(b.Rot90() * a);
 }