sim: Remove "continue physics" code
[blender.git] / source / blender / blenkernel / intern / booleanops_mesh.c
index 4e8a3b33827eaa3b9e302b3cfb57f9fd7c5117f3..f53a89fccfdd6ac04658b71126d23487d27f0e02 100644 (file)
@@ -1,8 +1,5 @@
 #if 0
-
 /*
- * $Id$
- *
  * ***** BEGIN GPL LICENSE BLOCK *****
  *
  * This program is free software; you can redistribute it and/or
        void
 CSG_DestroyMeshDescriptor(
        CSG_MeshDescriptor *mesh
-){
-       // Call mesh descriptors destroy function....
+) {
+       /* Call mesh descriptors destroy function.... */
        mesh->m_destroy_func(mesh);
 }
-       
-// Destroy function for blender mesh internals.
+
+/* Destroy function for blender mesh internals. */
 
 static
        void
 CSG_DestroyBlenderMeshInternals(
        CSG_MeshDescriptor *mesh
 ) {
-       // Free face and vertex iterators.
-       FreeMeshDescriptors(&(mesh->m_face_iterator),&(mesh->m_vertex_iterator));               
+       /* Free face and vertex iterators. */
+       FreeMeshDescriptors(&(mesh->m_face_iterator), &(mesh->m_vertex_iterator));
 }
 
 
@@ -67,7 +64,7 @@ static
        void
 CSG_DestroyCSGMeshInternals(
        CSG_MeshDescriptor *mesh
-){
+) {
        CSG_FreeVertexDescriptor(&(mesh->m_vertex_iterator));
        CSG_FreeFaceDescriptor(&(mesh->m_face_iterator));
 }
@@ -81,7 +78,7 @@ MakeCSGMeshFromBlenderBase(
        Mesh *me;
        if (output == NULL || base == NULL) return 0;
 
-       me = get_mesh(base->object);
+       me = BKE_mesh_from_object(base->object);
                
        output->m_descriptor.user_face_vertex_data_size = 0;
        output->m_descriptor.user_data_size = sizeof(FaceData);
@@ -103,12 +100,12 @@ MakeCSGMeshFromBlenderBase(
 CSG_LoadBlenderMesh(
        Object * obj,
        CSG_MeshDescriptor *output
-){
+) {
 
        Mesh *me;
        if (output == NULL || obj == NULL) return 0;
 
-       me = get_mesh(obj);
+       me = BKE_mesh_from_object(obj);
                
        output->m_descriptor.user_face_vertex_data_size = 0;
        output->m_descriptor.user_data_size = sizeof(FaceData);
@@ -133,7 +130,7 @@ CSG_LoadBlenderMesh(
        int
 CSG_AddMeshToBlender(
        CSG_MeshDescriptor *mesh
-){
+) {
        Mesh *me_new = NULL;
        Object *ob_new = NULL;
        float inv_mat[4][4];
@@ -141,20 +138,20 @@ CSG_AddMeshToBlender(
        if (mesh == NULL) return 0;
        if (mesh->base == NULL) return 0;
 
-       invert_m4_m4(inv_mat,mesh->base->object->obmat);
+       invert_m4_m4(inv_mat, mesh->base->object->obmat);
 
-       // Create a new blender mesh object - using 'base' as 
-       // a template for the new object.
-       ob_new=  AddNewBlenderMesh(mesh->base);
+       /* Create a new blender mesh object - using 'base' as
+        * a template for the new object. */
+       ob_new =  AddNewBlenderMesh(mesh->base);
 
        me_new = ob_new->data;
 
-       // make sure the iterators are reset.
+       /* make sure the iterators are reset. */
        mesh->m_face_iterator.Reset(mesh->m_face_iterator.it);
        mesh->m_vertex_iterator.Reset(mesh->m_vertex_iterator.it);
 
-       // iterate through results of operation and insert into new object
-       // see subsurf.c 
+       /* iterate through results of operation and insert into new object
+        * see subsurf.c */
 
        ConvertCSGDescriptorsToMeshObject(
                ob_new,
@@ -173,7 +170,7 @@ CSG_PerformOp(
        CSG_MeshDescriptor *mesh2,
        int int_op_type,
        CSG_MeshDescriptor *output
-){
+) {
 
        CSG_OperationType op_type;
        CSG_BooleanOperation * bool_op = CSG_NewBooleanFunction();
@@ -183,7 +180,7 @@ CSG_PerformOp(
 
        if ((mesh1 == NULL) || (mesh2 == NULL) || (output == NULL)) {
                return 0;
-       }       
+       }
        if ((int_op_type < 1) || (int_op_type > 3)) return 0;
 
        switch (int_op_type) {
@@ -194,22 +191,23 @@ CSG_PerformOp(
                default : op_type = e_csg_intersection;
        }
        
-       output->m_descriptor = CSG_DescibeOperands(bool_op,mesh1->m_descriptor,mesh2->m_descriptor);
+       output->m_descriptor = CSG_DescibeOperands(bool_op, mesh1->m_descriptor, mesh2->m_descriptor);
        output->base = mesh1->base;
 
        if (output->m_descriptor.user_face_vertex_data_size) {
-               // Then use the only interp function supported 
-               success = 
+               /* Then use the only interp function supported */
+               success =
                CSG_PerformBooleanOperation(
                        bool_op,
                        op_type,
                        mesh1->m_face_iterator,
                        mesh1->m_vertex_iterator,
                        mesh2->m_face_iterator,
-                       mesh2->m_vertex_iterator,               
-                       InterpFaceVertexData    
+                       mesh2->m_vertex_iterator,
+                       InterpFaceVertexData
                );
-       } else {
+       }
+       else {
                success = 
                CSG_PerformBooleanOperation(
                        bool_op,
@@ -217,8 +215,8 @@ CSG_PerformOp(
                        mesh1->m_face_iterator,
                        mesh1->m_vertex_iterator,
                        mesh2->m_face_iterator,
-                       mesh2->m_vertex_iterator,               
-                       InterpNoUserData        
+                       mesh2->m_vertex_iterator,
+                       InterpNoUserData
                );
        }
 
@@ -227,11 +225,11 @@ CSG_PerformOp(
                bool_op = NULL;
                return 0;
        }
-               
-       // get the ouput mesh descriptors.
 
-       CSG_OutputFaceDescriptor(bool_op,&(output->m_face_iterator));
-       CSG_OutputVertexDescriptor(bool_op,&(output->m_vertex_iterator));
+       /* get the ouput mesh descriptors. */
+
+       CSG_OutputFaceDescriptor(bool_op, &(output->m_face_iterator));
+       CSG_OutputVertexDescriptor(bool_op, &(output->m_vertex_iterator));
        output->m_destroy_func = CSG_DestroyCSGMeshInternals;
 
        return 1;
@@ -242,22 +240,22 @@ NewBooleanMeshTest(
        struct Base * base,
        struct Base * base_select,
        int op_type
-){
+) {
 
-       CSG_MeshDescriptor m1,m2,output;
-       CSG_MeshDescriptor output2,output3;
+       CSG_MeshDescriptor m1, m2, output;
+       CSG_MeshDescriptor output2, output3;
        
-       if (!MakeCSGMeshFromBlenderBase(base,&m1)) {
+       if (!MakeCSGMeshFromBlenderBase(base, &m1)) {
                return 0;
        }
        
-       if (!MakeCSGMeshFromBlenderBase(base_select,&m2)) {
+       if (!MakeCSGMeshFromBlenderBase(base_select, &m2)) {
                return 0;
        }
        
-       CSG_PerformOp(&m1,&m2,1,&output);
-       CSG_PerformOp(&m1,&m2,2,&output2);
-       CSG_PerformOp(&m1,&m2,3,&output3);
+       CSG_PerformOp(&m1, &m2, 1, &output);
+       CSG_PerformOp(&m1, &m2, 2, &output2);
+       CSG_PerformOp(&m1, &m2, 3, &output3);
 
        if (!CSG_AddMeshToBlender(&output)) {
                return 0;