Пример #1
0
        public static _Transform RotateAroundAxis(float angle, _float4 axis)
        {
            _Transform res = new _Transform();

            _tfmApi.cycles_tfm_rotate_around_axis(angle, axis, ref res);

            return(res);
        }
Пример #2
0
        public static _Transform LookAt(_float4 position, _float4 look, _float4 up)
        {
            _Transform res = new _Transform();

            _tfmApi.cycles_tfm_lookat(position, look, up, ref res);

            return(res);
        }
Пример #3
0
        public static _Transform Inverse(_Transform t)
        {
            _Transform res = new _Transform();

            _tfmApi.cycles_tfm_inverse(t, ref res);

            return(res);
        }
Пример #4
0
        public unsafe void TestTransformInverse(float a, float b, float c, float d)
        {
            _Transform _f4 = new _Transform(a, b, c, d, a, b, c, d, a, b, c, d, a, b, c, d);

            byte* addr = (byte*)&_f4;
            Console.WriteLine("Size:      {0}", sizeof(_Transform));
            Console.WriteLine("x Offset: {0}", (byte*)&_f4.x.x - addr);
            Console.WriteLine("y Offset: {0}", (byte*)&_f4.y.x - addr);
            Console.WriteLine("z Offset: {0}", (byte*)&_f4.z.x - addr);
            Console.WriteLine("w Offset: {0}", (byte*)&_f4.w.x - addr);

            Console.WriteLine("x.x:      {0}", _f4.x.x);
            Console.WriteLine("x.y:      {0}", _f4.x.y);
            Console.WriteLine("x.z:      {0}", _f4.x.z);
            Console.WriteLine("x.w:      {0}", _f4.x.w);

            _Transform _f4inv = _Transform.Inverse(_f4);

            Console.WriteLine("x.x:      {0}", _f4inv.x.x);
            Console.WriteLine("x.y:      {0}", _f4inv.x.y);
            Console.WriteLine("x.z:      {0}", _f4inv.x.z);
            Console.WriteLine("x.w:      {0}", _f4inv.x.w);
        }
Пример #5
0
        public static _Transform RotateAroundAxis(float angle, _float4 axis)
        {
            _Transform res = new _Transform();
            _tfmApi.cycles_tfm_rotate_around_axis(angle, axis, ref res);

            return res;
        }
Пример #6
0
        public static _Transform LookAt(_float4 position, _float4 look, _float4 up)
        {
            _Transform res = new _Transform();
            _tfmApi.cycles_tfm_lookat(position, look, up, ref res);

            return res;
        }
Пример #7
0
        public static _Transform Inverse(_Transform t)
        {
            _Transform res = new _Transform();
            _tfmApi.cycles_tfm_inverse(t, ref res);

            return res;
        }
Пример #8
0
 private void PrintTransform(_Transform xfm)
 {
     Console.WriteLine(" {0} {1} {2} {3}", xfm[0][0], xfm[0][1], xfm[0][2], xfm[0][3]);
     Console.WriteLine(" {0} {1} {2} {3}", xfm[1][0], xfm[1][1], xfm[1][2], xfm[1][3]);
     Console.WriteLine(" {0} {1} {2} {3}", xfm[2][0], xfm[2][1], xfm[2][2], xfm[2][3]);
     Console.WriteLine(" {0} {1} {2} {3}", xfm[3][0], xfm[3][1], xfm[3][2], xfm[3][3]);
 }
Пример #9
0
 static public extern void cycles_tfm_rotate_around_axis(float angle, [In, MarshalAs(UnmanagedType.Struct)] _float4 axis, [In, Out, MarshalAs(UnmanagedType.Struct)] ref _Transform res);
Пример #10
0
 static public extern void cycles_tfm_lookat([In, MarshalAs(UnmanagedType.Struct)] _float4 position, [In, MarshalAs(UnmanagedType.Struct)] _float4 look, [In, MarshalAs(UnmanagedType.Struct)] _float4 up, [In, Out, MarshalAs(UnmanagedType.Struct)] ref _Transform res);
Пример #11
0
 static public extern void cycles_tfm_inverse([In, MarshalAs(UnmanagedType.Struct)] _Transform t, [In, Out, MarshalAs(UnmanagedType.Struct)] ref _Transform res);