Esempio n. 1
0
        public Fusee.Math.Core.float3[] /* Vector32*PolygonObject::CreatePhongNormals_cstype */ CreatePhongNormals() /* <Vector32*PolygonObject::CreatePhongNormals_csout> */
        {
            global::System.IntPtr p_ret = C4dApiPINVOKE.PolygonObject_CreatePhongNormals(swigCPtr);
            if (p_ret == global::System.IntPtr.Zero)
            {
                return(null);
            }
            int nNormals = this.GetPolygonCount() * 4;

            Fusee.Math.Core.float3[] ret = new Fusee.Math.Core.float3[nNormals];
            unsafe
            {
                for (int i = 0; i < nNormals; i++)
                {
                    ret[i] = Fusee.Math.ArrayConvert.ArrayFloatTofloat3(((float *)(p_ret)) + 3 * i);
                }
            }
            C4dApi.DeleteMemPtr(p_ret);
            return(ret);
        } /* </Vector32*PolygonObject::CreatePhongNormals_csout> */
Esempio n. 2
0
 /// <summary>
 /// Copys a <see cref="Fusee.Math.Core.float3"/> to an existing double array.
 /// </summary>
 /// <param name="value">The source vector to convert.</param>
 /// <param name="pDst">A pointer to the destination double array [x, y, z]</param>
 public static unsafe void float3ToArrayDouble(Fusee.Math.Core.float3 value, double *pDst)
 {
     pDst[0] = value.x;
     pDst[1] = value.y;
     pDst[2] = value.z;
 }
Esempio n. 3
0
 /// <summary>
 /// Converts a <see cref="Fusee.Math.Core.float3"/> to  a double array.
 /// </summary>
 /// <param name="value">The vector to convert.</param>
 /// <returns>A double array containing three values [x, y, z]</returns>
 public static double[] float3ToArrayDouble(Fusee.Math.Core.float3 value)
 {
     return(new double[] { value.x, value.y, value.z });
 }
Esempio n. 4
0
        // TODO: add all the other FromMatrix methods
        // TODO: add all 16 from and to methods for all the other matrix types
        #endregion

        #region Vector2 Conversion
        // TODO:
        #endregion

        #region Vector3 Conversion
        /// <summary>
        /// Converts a <see cref="Fusee.Math.Core.float3"/> to  a float array.
        /// </summary>
        /// <param name="value">The vector to convert.</param>
        /// <returns>A float array containing three values [x, y, z]</returns>
        public static float[] float3ToArrayFloat(Fusee.Math.Core.float3 value)
        {
            return(new float[] { value.x, value.y, value.z });
        }