Inheritance: IDisposable
Exemplo n.º 1
0
 public aiMatrix3x3(aiMatrix4x4 pMatrix) : this(AssimpPINVOKE.new_aiMatrix3x3__SWIG_2(aiMatrix4x4.getCPtr(pMatrix)), true)
 {
     if (AssimpPINVOKE.SWIGPendingException.Pending)
     {
         throw AssimpPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Exemplo n.º 2
0
 public void GetCameraMatrix(aiMatrix4x4 out_)
 {
     assimp_swigPINVOKE.aiCamera_GetCameraMatrix(swigCPtr, aiMatrix4x4.getCPtr(out_));
     if (assimp_swigPINVOKE.SWIGPendingException.Pending)
     {
         throw assimp_swigPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Exemplo n.º 3
0
 public void GetCameraMatrix(aiMatrix4x4 arg0)
 {
     AssimpPINVOKE.aiCamera_GetCameraMatrix(swigCPtr, aiMatrix4x4.getCPtr(arg0));
     if (AssimpPINVOKE.SWIGPendingException.Pending)
     {
         throw AssimpPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Exemplo n.º 4
0
        public aiVector3D op_mul_and_set(aiMatrix4x4 mat)
        {
            aiVector3D ret = new aiVector3D(assimp_swigPINVOKE.aiVector3D_op_mul_and_set__SWIG_2(swigCPtr, aiMatrix4x4.getCPtr(mat)), false);

            if (assimp_swigPINVOKE.SWIGPendingException.Pending)
            {
                throw assimp_swigPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
Exemplo n.º 5
0
    public static aiMatrix4x4 Rotation(float a, aiVector3D axis, aiMatrix4x4 arg2)
    {
        aiMatrix4x4 ret = new aiMatrix4x4(AssimpPINVOKE.aiMatrix4x4_Rotation(a, aiVector3D.getCPtr(axis), aiMatrix4x4.getCPtr(arg2)), false);

        if (AssimpPINVOKE.SWIGPendingException.Pending)
        {
            throw AssimpPINVOKE.SWIGPendingException.Retrieve();
        }
        return(ret);
    }
Exemplo n.º 6
0
        public bool op_not_equal(aiMatrix4x4 m)
        {
            bool ret = assimp_swigPINVOKE.aiMatrix3x3_op_not_equal(swigCPtr, aiMatrix4x4.getCPtr(m));

            if (assimp_swigPINVOKE.SWIGPendingException.Pending)
            {
                throw assimp_swigPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
Exemplo n.º 7
0
    public static aiMatrix4x4 Scaling(aiVector3D v, aiMatrix4x4 arg1)
    {
        aiMatrix4x4 ret = new aiMatrix4x4(AssimpPINVOKE.aiMatrix4x4_Scaling(aiVector3D.getCPtr(v), aiMatrix4x4.getCPtr(arg1)), false);

        if (AssimpPINVOKE.SWIGPendingException.Pending)
        {
            throw AssimpPINVOKE.SWIGPendingException.Retrieve();
        }
        return(ret);
    }
Exemplo n.º 8
0
    public static aiMatrix4x4 FromToMatrix(aiVector3D from, aiVector3D to, aiMatrix4x4 arg2)
    {
        aiMatrix4x4 ret = new aiMatrix4x4(AssimpPINVOKE.aiMatrix4x4_FromToMatrix(aiVector3D.getCPtr(from), aiVector3D.getCPtr(to), aiMatrix4x4.getCPtr(arg2)), false);

        if (AssimpPINVOKE.SWIGPendingException.Pending)
        {
            throw AssimpPINVOKE.SWIGPendingException.Retrieve();
        }
        return(ret);
    }
Exemplo n.º 9
0
    public aiMatrix4x4 FromEulerAnglesXYZ(aiVector3D blubb)
    {
        aiMatrix4x4 ret = new aiMatrix4x4(AssimpPINVOKE.aiMatrix4x4_FromEulerAnglesXYZ__SWIG_1(swigCPtr, aiVector3D.getCPtr(blubb)), false);

        if (AssimpPINVOKE.SWIGPendingException.Pending)
        {
            throw AssimpPINVOKE.SWIGPendingException.Retrieve();
        }
        return(ret);
    }
Exemplo n.º 10
0
        public bool Equal(aiMatrix4x4 m, float epsilon)
        {
            bool ret = assimp_swigPINVOKE.aiMatrix3x3_Equal__SWIG_0(swigCPtr, aiMatrix4x4.getCPtr(m), epsilon);

            if (assimp_swigPINVOKE.SWIGPendingException.Pending)
            {
                throw assimp_swigPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
Exemplo n.º 11
0
        public bool SetPropertyMatrix(string szName, aiMatrix4x4 sValue)
        {
            bool ret = assimp_swigPINVOKE.Importer_SetPropertyMatrix(swigCPtr, szName, aiMatrix4x4.getCPtr(sValue));

            if (assimp_swigPINVOKE.SWIGPendingException.Pending)
            {
                throw assimp_swigPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
Exemplo n.º 12
0
    public aiVector3D __mulnset__(aiMatrix4x4 mat)
    {
        aiVector3D ret = new aiVector3D(AssimpPINVOKE.aiVector3D___mulnset____SWIG_2(swigCPtr, aiMatrix4x4.getCPtr(mat)), false);

        if (AssimpPINVOKE.SWIGPendingException.Pending)
        {
            throw AssimpPINVOKE.SWIGPendingException.Retrieve();
        }
        return(ret);
    }
Exemplo n.º 13
0
        public aiMatrix4x4 GetPropertyMatrix(string szName, aiMatrix4x4 sErrorReturn)
        {
            aiMatrix4x4 ret = new aiMatrix4x4(assimp_swigPINVOKE.Importer_GetPropertyMatrix__SWIG_0(swigCPtr, szName, aiMatrix4x4.getCPtr(sErrorReturn)), true);

            if (assimp_swigPINVOKE.SWIGPendingException.Pending)
            {
                throw assimp_swigPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
Exemplo n.º 14
0
    public bool __nequal__(aiMatrix4x4 m)
    {
        bool ret = AssimpPINVOKE.aiMatrix4x4___nequal__(swigCPtr, aiMatrix4x4.getCPtr(m));

        if (AssimpPINVOKE.SWIGPendingException.Pending)
        {
            throw AssimpPINVOKE.SWIGPendingException.Retrieve();
        }
        return(ret);
    }
Exemplo n.º 15
0
    public aiMatrix4x4 __mulnset__(aiMatrix4x4 m)
    {
        aiMatrix4x4 ret = new aiMatrix4x4(AssimpPINVOKE.aiMatrix4x4___mulnset__(swigCPtr, aiMatrix4x4.getCPtr(m)), false);

        if (AssimpPINVOKE.SWIGPendingException.Pending)
        {
            throw AssimpPINVOKE.SWIGPendingException.Retrieve();
        }
        return(ret);
    }
Exemplo n.º 16
0
 public static Matrix ToMatrix(this aiMatrix4x4 m)
 {
     // Read and Transpose for DirectX
     return(new Matrix()
     {
         M11 = m.a1, M12 = m.b1, M13 = m.c1, M14 = m.d1,
         M21 = m.a2, M22 = m.b2, M23 = m.c2, M24 = m.d2,
         M31 = m.a3, M32 = m.b3, M33 = m.c3, M34 = m.d3,
         M41 = m.a4, M42 = m.b4, M43 = m.c4, M44 = m.d4,
     });
 }
Exemplo n.º 17
0
 public static void aiIdentityMatrix4(aiMatrix4x4 mat)
 {
     assimp_swigPINVOKE.aiIdentityMatrix4(aiMatrix4x4.getCPtr(mat));
 }
Exemplo n.º 18
0
 public aiVector3D __mulnset__(aiMatrix4x4 mat) {
   aiVector3D ret = new aiVector3D(AssimpPINVOKE.aiVector3D___mulnset____SWIG_2(swigCPtr, aiMatrix4x4.getCPtr(mat)), false);
   if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve();
   return ret;
 }
Exemplo n.º 19
0
 public static aiMatrix4x4 FromToMatrix(aiVector3D from, aiVector3D to, aiMatrix4x4 arg2) {
   aiMatrix4x4 ret = new aiMatrix4x4(AssimpPINVOKE.aiMatrix4x4_FromToMatrix(aiVector3D.getCPtr(from), aiVector3D.getCPtr(to), aiMatrix4x4.getCPtr(arg2)), false);
   if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve();
   return ret;
 }
Exemplo n.º 20
0
 public static aiMatrix4x4 Rotation(float a, aiVector3D axis, aiMatrix4x4 arg2) {
   aiMatrix4x4 ret = new aiMatrix4x4(AssimpPINVOKE.aiMatrix4x4_Rotation(a, aiVector3D.getCPtr(axis), aiMatrix4x4.getCPtr(arg2)), false);
   if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve();
   return ret;
 }
Exemplo n.º 21
0
 public aiMatrix4x4 FromEulerAnglesXYZ(float x, float y, float z) {
   aiMatrix4x4 ret = new aiMatrix4x4(AssimpPINVOKE.aiMatrix4x4_FromEulerAnglesXYZ__SWIG_0(swigCPtr, x, y, z), false);
   return ret;
 }
Exemplo n.º 22
0
    public aiMatrix4x4 Transpose()
    {
        aiMatrix4x4 ret = new aiMatrix4x4(AssimpPINVOKE.aiMatrix4x4_Transpose(swigCPtr), false);

        return(ret);
    }
Exemplo n.º 23
0
 public aiMatrix3x3(aiMatrix4x4 pMatrix) : this(AssimpPINVOKE.new_aiMatrix3x3__SWIG_2(aiMatrix4x4.getCPtr(pMatrix)), true) {
   if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve();
 }
Exemplo n.º 24
0
            private static System.Object InitValue(Importer importer, string key_name, Property.Type type, System.Object default_value)
            {
                if (PlayerPrefs.HasKey(key_name))
                {
                    return(PlayerPrefs.GetString(key_name));
                }
                else
                {
                    try
                    {
                        switch (type)
                        {
                        case Property.Type.FLAG:
                        case Property.Type.INT:
                            return(importer.Assimp.GetProperty <int>(key_name));

                        case Property.Type.BOOL:
                            // Do not check importer value because we can not determine if a value is present, so use default value instead.
                            //return importer.GetProperty<bool>(key_name);
                            return(default_value);

                        case Property.Type.FLOAT:
                            return(importer.Assimp.GetProperty <float>(key_name));

                        case Property.Type.STRING:
                            return(importer.Assimp.GetProperty <string>(key_name));

                        case Property.Type.MATRIX:
                            string value;

                            using (aiMatrix4x4 matrix = importer.Assimp.GetProperty <aiMatrix4x4>(key_name))
                            {
                                using (aiVector3D position = new aiVector3D())
                                {
                                    using (aiVector3D scaling = new aiVector3D())
                                    {
                                        using (aiQuaternion rot = new aiQuaternion())
                                        {
                                            matrix.Decompose(scaling, rot, position);

                                            Quaternion rotation = Model.Type.Assimp.Convert.AssimpToUnity.Quaternion(rot);
                                            Vector3    angles   = rotation.eulerAngles;

                                            value = UI.List.Serialize(new List <string> {
                                                position.x.ToString(), position.y.ToString(), position.z.ToString(),
                                                angles.x.ToString(), angles.y.ToString(), angles.z.ToString(),
                                                scaling.x.ToString(), scaling.y.ToString(), scaling.z.ToString()
                                            });
                                        }
                                    }
                                }
                            }

                            return(value);
                        }
                    }
                    catch (Module.Import.Assimp.NotDefinedException)
                    {
                        if (type == Property.Type.FLAG)
                        {
                            return((int)default_value);                             // Must be cast explicitely to int to avoid ToString conversion of enums
                        }
                        else
                        {
                            return(default_value);
                        }
                    }
                }

                Debug.LogWarning("Incorrect type of property (" + key_name + ", " + type + "): unable to initialize it.");

                return("");
            }
Exemplo n.º 25
0
 public void GetCameraMatrix(aiMatrix4x4 arg0) {
   AssimpPINVOKE.aiCamera_GetCameraMatrix(swigCPtr, aiMatrix4x4.getCPtr(arg0));
   if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve();
 }
Exemplo n.º 26
0
    public aiMatrix4x4 Inverse()
    {
        aiMatrix4x4 ret = new aiMatrix4x4(AssimpPINVOKE.aiMatrix4x4_Inverse(swigCPtr), false);

        return(ret);
    }
Exemplo n.º 27
0
    public aiMatrix4x4 FromEulerAnglesXYZ(float x, float y, float z)
    {
        aiMatrix4x4 ret = new aiMatrix4x4(AssimpPINVOKE.aiMatrix4x4_FromEulerAnglesXYZ__SWIG_0(swigCPtr, x, y, z), false);

        return(ret);
    }
Exemplo n.º 28
0
 public aiMatrix4x4 FromEulerAnglesXYZ(aiVector3D blubb) {
   aiMatrix4x4 ret = new aiMatrix4x4(AssimpPINVOKE.aiMatrix4x4_FromEulerAnglesXYZ__SWIG_1(swigCPtr, aiVector3D.getCPtr(blubb)), false);
   if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve();
   return ret;
 }
Exemplo n.º 29
0
 public bool __nequal__(aiMatrix4x4 m) {
   bool ret = AssimpPINVOKE.aiMatrix4x4___nequal__(swigCPtr, aiMatrix4x4.getCPtr(m));
   if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve();
   return ret;
 }
Exemplo n.º 30
0
 public static aiMatrix4x4 Scaling(aiVector3D v, aiMatrix4x4 arg1) {
   aiMatrix4x4 ret = new aiMatrix4x4(AssimpPINVOKE.aiMatrix4x4_Scaling(aiVector3D.getCPtr(v), aiMatrix4x4.getCPtr(arg1)), false);
   if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve();
   return ret;
 }
Exemplo n.º 31
0
 public aiMatrix4x4 Transpose() {
   aiMatrix4x4 ret = new aiMatrix4x4(AssimpPINVOKE.aiMatrix4x4_Transpose(swigCPtr), false);
   return ret;
 }
Exemplo n.º 32
0
 internal static HandleRef getCPtr(aiMatrix4x4 obj) {
   return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
 }
Exemplo n.º 33
0
        public aiNode ToAssimp(Module.Export.Assimp.Context context, Scene scene, aiNode parent)
        {
            uint index = 0;

            aiNode node_object = new aiNode(name);

            // Set parent
            node_object.mParent = parent;

            // Set transform
            using (aiVector3D assimp_scale = Assimp.Convert.UnityToAssimp.Vector3(scale))
            {
                using (aiQuaternion assimp_rotation = Assimp.Convert.UnityToAssimp.Quaternion(rotation))
                {
                    using (aiVector3D assimp_position = Assimp.Convert.UnityToAssimp.Vector3(position))
                    {
                        using (aiMatrix4x4 matrix = new aiMatrix4x4(assimp_scale, assimp_rotation, assimp_position))
                        {
                            node_object.mTransformation = matrix.Unmanaged();
                        }
                    }
                }
            }

            // Parse the children nodes
            if (children != null && children.Length > 0)
            {
                using (aiNodeArray assimp_children = node_object.Children)
                {
                    assimp_children.Reserve((uint)children.Length, true);

                    index = 0;

                    foreach (Node child in children)
                    {
                        using (aiNode assimp_child = child.ToAssimp(context, scene, node_object))
                        {
                            if (assimp_child != null)
                            {
                                assimp_children.Set(index++, assimp_child.Unmanaged());
                            }
                        }
                    }
                }
            }

            // Parse the mesh objects
            if (meshes != null && meshes.Length > 0)
            {
                using (aiUIntArray assimp_meshes = node_object.Meshes)
                {
                    assimp_meshes.Reserve((uint)meshes.Length, true);

                    index = 0;

                    foreach (GraphicMesh graphic_mesh in meshes)
                    {
                        Mesh mesh = scene.meshes[graphic_mesh.meshIndex];

                        int nb_materials = (graphic_mesh.materialsIndexes != null ? graphic_mesh.materialsIndexes.Length : 0);

                        // Handle unity submeshes by creating new meshes for each submesh
                        for (int i = 0; i < mesh.SubMeshesCount; i++)
                        {
                            // Assimp meshes can only have one material. Therefore, mutliple instances of one mesh
                            // using different materials must be detected and replaced by different output meshes.

                            uint assimp_mesh_index;

                            int mat_index = (i < nb_materials ? graphic_mesh.materialsIndexes[i] : 0 /*Assimp default*/);

                            Module.Export.Assimp.Mesh key = new Module.Export.Assimp.Mesh(graphic_mesh.meshIndex, i, mat_index);

                            if (!context.meshes.TryGetValue(key, out assimp_mesh_index))
                            {
                                assimp_mesh_index = (uint)context.meshes.Count;

                                context.meshes.Add(key, assimp_mesh_index);
                            }

                            assimp_meshes.Set(index++, assimp_mesh_index);
                        }
                    }
                }
            }

            // Parse the node metadata
            if (components != null)
            {
                foreach (UnityComponent component in components)
                {
                    aiMetadata assimp_meta = component.ToAssimpMetadata();

                    if (assimp_meta != null)
                    {
                        node_object.mMetaData = assimp_meta.Unmanaged();

                        break;
                    }
                }
            }

            context.progress.Update(ASSIMP_PROGRESS_FACTOR);

            return(node_object);
        }
Exemplo n.º 34
0
 public aiMatrix4x4 __mul__(aiMatrix4x4 m) {
   aiMatrix4x4 ret = new aiMatrix4x4(AssimpPINVOKE.aiMatrix4x4___mul__(swigCPtr, aiMatrix4x4.getCPtr(m)), true);
   if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve();
   return ret;
 }
Exemplo n.º 35
0
 public static void aiTransformVecByMatrix4(aiVector3D vec, aiMatrix4x4 mat)
 {
     assimp_swigPINVOKE.aiTransformVecByMatrix4(aiVector3D.getCPtr(vec), aiMatrix4x4.getCPtr(mat));
 }
Exemplo n.º 36
0
 public aiMatrix4x4 Inverse() {
   aiMatrix4x4 ret = new aiMatrix4x4(AssimpPINVOKE.aiMatrix4x4_Inverse(swigCPtr), false);
   return ret;
 }
Exemplo n.º 37
0
 internal static HandleRef getCPtr(aiMatrix4x4 obj)
 {
     return((obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr);
 }
Exemplo n.º 38
0
        public aiMatrix4x4 GetPropertyMatrix(string szName)
        {
            aiMatrix4x4 ret = new aiMatrix4x4(assimp_swigPINVOKE.Importer_GetPropertyMatrix__SWIG_1(swigCPtr, szName), true);

            return(ret);
        }
Exemplo n.º 39
0
        private void ApplyAssimpConfiguration(Importer importer, Property.Data data)
        {
            if (data.isStepFlag)
            {
                bool value_step;

                if (Boolean.TryParse(data.currentValue, out value_step))
                {
                    importer.Assimp.ChangeFlag(data.processStep, value_step);
                }
            }
            else
            {
                switch (data.propertyType)
                {
                case Property.Type.BOOL:
                    bool?value_bool = Property.Data.GetBool(data);

                    if (value_bool.HasValue)
                    {
                        importer.Assimp.SetProperty(data.propertyFlag, value_bool.Value);
                    }

                    break;

                case Property.Type.FLAG:
                case Property.Type.INT:
                    int?value_int = Property.Data.GetInt(data);

                    if (value_int.HasValue)
                    {
                        importer.Assimp.SetProperty(data.propertyFlag, value_int.Value);
                    }

                    break;

                case Property.Type.FLOAT:
                    float?value_float = Property.Data.GetFloat(data);

                    if (value_float.HasValue)
                    {
                        importer.Assimp.SetProperty(data.propertyFlag, value_float.Value);
                    }

                    break;

                case Property.Type.STRING:
                    importer.Assimp.SetProperty(data.propertyFlag, data.currentValue);

                    break;

                case Property.Type.MATRIX:
                    const int size = 9;

                    List <string> values_matrix_str = UI.List.Parse(data.currentValue);

                    if (values_matrix_str.Count == size)
                    {
                        float[] value_matrix = new float[size];

                        for (int i = 0; i < size; i++)
                        {
                            if (!float.TryParse(values_matrix_str[i], out value_matrix[i]))
                            {
                                Debug.LogWarning("Invalid value \"" + data.optionText + " = " + values_matrix_str[i] + "\": should be a float.");
                            }
                        }

                        Vector3    pos = new Vector3(value_matrix[0], value_matrix[1], value_matrix[2]);
                        Quaternion rot = new Quaternion();
                        rot.eulerAngles = new Vector3(value_matrix[3], value_matrix[4], value_matrix[5]);
                        Vector3 scale = new Vector3(value_matrix[6], value_matrix[7], value_matrix[8]);

                        using (aiVector3D scaling = Type.Assimp.Convert.UnityToAssimp.Vector3(scale))
                        {
                            using (aiQuaternion rotation = Type.Assimp.Convert.UnityToAssimp.Quaternion(rot))
                            {
                                using (aiVector3D position = Type.Assimp.Convert.UnityToAssimp.Vector3(pos))
                                {
                                    using (aiMatrix4x4 matrix = new aiMatrix4x4(scaling, rotation, position))
                                    {
                                        importer.Assimp.SetProperty(data.propertyFlag, matrix);
                                    }
                                }
                            }
                        }
                    }

                    break;

                default:
                    break;
                }
            }
        }
Exemplo n.º 40
0
 public static void aiMultiplyMatrix4(aiMatrix4x4 dst, aiMatrix4x4 src)
 {
     assimp_swigPINVOKE.aiMultiplyMatrix4(aiMatrix4x4.getCPtr(dst), aiMatrix4x4.getCPtr(src));
 }
Exemplo n.º 41
0
 /// <summary>
 /// Set a matrix property value.
 /// </summary>
 /// <param name="property">The name of the property to set.</param>
 /// <param name="value">The value of the property to set.</param>
 public void SetProperty(string property, aiMatrix4x4 value)
 {
     Importer.SetPropertyMatrix(property, value);
 }
Exemplo n.º 42
0
 public static void aiTransposeMatrix4(aiMatrix4x4 mat)
 {
     assimp_swigPINVOKE.aiTransposeMatrix4(aiMatrix4x4.getCPtr(mat));
 }
Exemplo n.º 43
0
 private Matrix tomatrix(aiMatrix4x4 m)
 {
     return(new Matrix(m.a1, m.a2, m.a3, m.a4, m.b1, m.b2, m.b3, m.b4, m.c1, m.c2, m.c3, m.c4, m.d1, m.d2, m.d3, m.d4));
 }