コード例 #1
0
ファイル: Transform2D.cs プロジェクト: gnomicstudios/GGJ13
 public static void Compose(ref Transform2D key1, ref Transform2D key2, ref Vector2 flipping, out Transform2D result)
 {
     result.Pos = key1.TransformPoint(key2.Pos, flipping);
     result.Rot = key1.Rot + key2.Rot;
     result.Scale = key1.Scale * key2.Scale;
     result.Origin = key2.Origin;
 }
コード例 #2
0
 public static void Compose(ref Transform2D key1, ref Transform2D key2, out Transform2D result)
 {
     Vector2 transformedPos = key1.TransformPoint(key2.Pos);
     result.Pos = transformedPos;
     result.Rot = key1.Rot + key2.Rot;
     result.Scale = key1.Scale * key2.Scale;
 }
コード例 #3
0
 public static void Compose(ref Transform2D key1, ref Transform2D key2, ref Vector2 flipping, out Transform2D result)
 {
     result.Pos    = key1.TransformPoint(key2.Pos, flipping);
     result.Rot    = key1.Rot + key2.Rot;
     result.Scale  = key1.Scale * key2.Scale;
     result.Origin = key2.Origin;
 }
コード例 #4
0
        public static void Compose(ref Transform2D key1, ref Transform2D key2, out Transform2D result)
        {
            Vector2 transformedPos = key1.TransformPoint(key2.Pos);

            result.Pos   = transformedPos;
            result.Rot   = key1.Rot + key2.Rot;
            result.Scale = key1.Scale * key2.Scale;
        }
コード例 #5
0
ファイル: Transform2D.cs プロジェクト: gnomicstudios/throng
 public static void Compose(ref Transform2D key1, ref Transform2D key2, out Transform2D result)
 {
     Vector2 key2Origin = key2.Pos - key2.Origin;
     Vector2 transformedPos = key1.TransformPoint(key2Origin);
     result.Pos = transformedPos + key2.Origin * key1.Scale;
     result.Rot = key1.Rot + key2.Rot;
     result.Scale = key1.Scale * key2.Scale;
     result.Origin = key2.Origin;
 }
コード例 #6
0
 public static Transform2D Compose(Transform2D key1, Transform2D key2)
 {
     Transform2D result = new Transform2D();
     Vector2 transformedPos = key1.TransformPoint(key2.Pos);
     result.Pos = transformedPos;
     result.Rot = key1.Rot + key2.Rot;
     result.Scale = key1.Scale * key2.Scale;
     return result;
 }
コード例 #7
0
        public static void Compose(ref Transform2D key1, ref Transform2D key2, out Transform2D result)
        {
            Vector2 key2Origin     = key2.Pos - key2.Origin;
            Vector2 transformedPos = key1.TransformPoint(key2Origin);

            result.Pos    = transformedPos + key2.Origin * key1.Scale;
            result.Rot    = key1.Rot + key2.Rot;
            result.Scale  = key1.Scale * key2.Scale;
            result.Origin = key2.Origin;
        }
コード例 #8
0
        public static Transform2D Compose(Transform2D key1, Transform2D key2)
        {
            Transform2D result         = new Transform2D();
            Vector2     transformedPos = key1.TransformPoint(key2.Pos);

            result.Pos   = transformedPos;
            result.Rot   = key1.Rot + key2.Rot;
            result.Scale = key1.Scale * key2.Scale;
            return(result);
        }
コード例 #9
0
ファイル: Transform2D.cs プロジェクト: gnomicstudios/throng
        public static Transform2D Compose(Transform2D key1, Transform2D key2)
        {
            Transform2D result = new Transform2D();
            Vector2 key2Origin = key2.Pos - key2.Origin;
            Vector2 transformedPos = key1.TransformPoint(key2Origin);
            result.Pos = transformedPos + key2.Origin * key1.Scale;
            result.Rot = key1.Rot + key2.Rot;
            result.Scale = key1.Scale * key2.Scale;
            result.Origin = key2.Origin;
            return result;

            // Old way that didn't take origin into account
            //Vector2 transformedPos = key1.TransformPoint(key2.Pos);
            //result.Pos = transformedPos;
            //result.Rot = key1.Rot + key2.Rot;
            //result.Scale = key1.Scale * key2.Scale;
        }
コード例 #10
0
        public static Transform2D Compose(Transform2D key1, Transform2D key2)
        {
            Transform2D result         = new Transform2D();
            Vector2     key2Origin     = key2.Pos - key2.Origin;
            Vector2     transformedPos = key1.TransformPoint(key2Origin);

            result.Pos    = transformedPos + key2.Origin * key1.Scale;
            result.Rot    = key1.Rot + key2.Rot;
            result.Scale  = key1.Scale * key2.Scale;
            result.Origin = key2.Origin;
            return(result);


            // Old way that didn't take origin into account
            //Vector2 transformedPos = key1.TransformPoint(key2.Pos);
            //result.Pos = transformedPos;
            //result.Rot = key1.Rot + key2.Rot;
            //result.Scale = key1.Scale * key2.Scale;
        }