build system changes to eltopo, re-applied.
authorCampbell Barton <ideasman42@gmail.com>
Mon, 2 May 2011 03:44:02 +0000 (03:44 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 2 May 2011 03:44:02 +0000 (03:44 +0000)
CMakeLists.txt
extern/CMakeLists.txt
source/blender/blenkernel/BKE_collision.h
source/blender/blenkernel/CMakeLists.txt
source/blender/blenkernel/SConscript
source/blender/blenkernel/intern/collision.c
source/blender/blenkernel/intern/implicit.c
source/creator/CMakeLists.txt

index f96f223c97db2ea5648311fdeb00ecedc6a5f000..a3baf582b9f36a1fafca89141d65e49db435bf4c 100644 (file)
@@ -114,7 +114,6 @@ option(WITH_BUILDINFO     "Include extra build details (only disable for develop
 option(WITH_IK_ITASC      "Enable ITASC IK solver (only disable for development & for incompatible C++ compilers)" ON)
 option(WITH_FFTW3         "Enable FFTW3 support (Used for smoke and audio effects)" OFF)
 option(WITH_BULLET        "Enable Bullet (Physics Engine)" ON)
-option(WITH_ELTOPO        "Enable Eltopo Continuous Collision Engine" OFF)
 option(WITH_GAMEENGINE    "Enable Game Engine" ON)
 option(WITH_PLAYER        "Build Player" OFF)
 # (unix defaults to OpenMP On)
index c146d6dba83bd77886e1e5f61a38f5fabd67c01c..3990d132757f62e7696de42aa025faa8ae940319 100644 (file)
@@ -31,7 +31,7 @@ if(WITH_BULLET)
        add_subdirectory(bullet2)
 endif()
 
-if(WITH_ELTOPO)
+if(WITH_MOD_CLOTH_ELTOPO)
        add_subdirectory(eltopo)
 endif()
 
index 7018a638831c7a3abca20b488425f205aaa1de26..4048ee2f457e6bf5cc7f60eb0f09c6c9806afa2a 100644 (file)
@@ -64,7 +64,7 @@ struct LinkNode;
 typedef enum
 {
        COLLISION_IN_FUTURE =           (1 << 1),
-#ifdef USE_ELTOPO
+#ifdef WITH_ELTOPO
        COLLISION_USE_COLLFACE =        (1 << 2),
        COLLISION_IS_EDGES =            (1 << 3),
 #endif
@@ -85,7 +85,7 @@ typedef struct CollPair
        float pa[3], pb[3]; // collision point p1 on face1, p2 on face2
        int flag;
        float time; // collision time, from 0 up to 1
-#ifdef USE_ELTOPO /*either ap* or bp* can be set, but not both*/
+#ifdef WITH_ELTOPO /*either ap* or bp* can be set, but not both*/
        float bary[3];
        int ap1, ap2, ap3, collp, bp1, bp2, bp3;
        int collface;
index 4b36b714548228ee36779d784cd5332fe83966dd..ca551e1634a6d6cb0ebd28c2d503086e6a410085 100644 (file)
@@ -240,9 +240,9 @@ if(WITH_BULLET)
        add_definitions(-DUSE_BULLET)
 endif()
 
-if(WITH_ELTOPO)
+if(WITH_MOD_CLOTH_ELTOPO)
        list(APPEND INC ../../../extern/eltopo)
-       add_definitions(-DUSE_ELTOPO)
+       add_definitions(-DWITH_ELTOPO)
 endif()
 
 if(WITH_IMAGE_OPENEXR)
index 66011c4f3962ea767d3b51886f1a7f1cf05bae95..dc327abd3adbb01c9c516394cf271d7ae7c48510 100644 (file)
@@ -29,7 +29,7 @@ if env['WITH_BF_PYTHON']:
 
 if env['WITH_BF_ELTOPO']:
     incs += ' ../../../extern/eltopo'
-    defs.append('USE_ELTOPO')
+    defs.append('WITH_ELTOPO')
         
 if env['WITH_BF_QUICKTIME']:
     incs += ' ../quicktime'
index 064f805d0467565b291ce71b0fabe42e75efde9f..e2a1b0dfb33e1277b3c10ae913ea75d57dd18bf4 100644 (file)
@@ -66,7 +66,7 @@
 #include "BLI_kdopbvh.h"
 #include "BKE_collision.h"
 
-#ifdef USE_ELTOPO
+#ifdef WITH_ELTOPO
 #include "eltopo-capi.h"
 #endif
 
@@ -493,7 +493,7 @@ DO_INLINE void collision_interpolateOnTriangle ( float to[3], float v1[3], float
        VECADDMUL ( to, v3, w3 );
 }
 
-#ifndef USE_ELTOPO
+#ifndef WITH_ELTOPO
 static int cloth_collision_response_static ( ClothModifierData *clmd, CollisionModifierData *collmd, CollPair *collpair, CollPair *collision_end )
 {
        int result = 0;
@@ -608,9 +608,9 @@ static int cloth_collision_response_static ( ClothModifierData *clmd, CollisionM
        }
        return result;
 }
-#endif
+#endif /* !WITH_ELTOPO */
 
-#ifdef USE_ELTOPO
+#ifdef WITH_ELTOPO
 typedef struct edgepairkey {
        int a1, a2, b1, b2;
 } edgepairkey;
@@ -1392,7 +1392,7 @@ static void machine_epsilon_offset(Cloth *cloth) {
        }
 }
 
-#else
+#else /* !WITH_ELTOPO */
 
 //Determines collisions on overlap, collisions are written to collpair[i] and collision+number_collision_found is returned
 static CollPair* cloth_collision ( ModifierData *md1, ModifierData *md2, 
@@ -1557,7 +1557,7 @@ static CollPair* cloth_collision ( ModifierData *md1, ModifierData *md2,
        }
        return collpair;
 }
-#endif
+#endif /* WITH_ELTOPO */
 
 
 #if 0
@@ -2269,7 +2269,7 @@ static void cloth_bvh_objcollisions_nearcheck ( ClothModifierData * clmd, Collis
        CollPair **collisions, CollPair **collisions_index, int numresult, BVHTreeOverlap *overlap, double dt)
 {
        int i;
-#ifdef USE_ELTOPO
+#ifdef WITH_ELTOPO
        GHash *visithash = BLI_ghash_new(edgepair_hash, edgepair_cmp, "visthash, collision.c");
        GHash *tri_visithash = BLI_ghash_new(tripair_hash, tripair_cmp, "tri_visthash, collision.c");
        MemArena *arena = BLI_memarena_new(1<<16, "edge hash arena, collision.c");
@@ -2278,7 +2278,7 @@ static void cloth_bvh_objcollisions_nearcheck ( ClothModifierData * clmd, Collis
        *collisions = ( CollPair* ) MEM_mallocN ( sizeof ( CollPair ) * numresult * 64, "collision array" ); //*4 since cloth_collision_static can return more than 1 collision
        *collisions_index = *collisions;
        
-#ifdef USE_ELTOPO
+#ifdef WITH_ELTOPO
        machine_epsilon_offset(clmd->clothObject);
 
        for ( i = 0; i < numresult; i++ )
@@ -2295,13 +2295,13 @@ static void cloth_bvh_objcollisions_nearcheck ( ClothModifierData * clmd, Collis
        BLI_ghash_free(visithash, NULL, NULL);
        BLI_ghash_free(tri_visithash, NULL, NULL);
        BLI_memarena_free(arena);
-#else
+#else /* WITH_ELTOPO */
        for ( i = 0; i < numresult; i++ )
        {
                *collisions_index = cloth_collision ( ( ModifierData * ) clmd, ( ModifierData * ) collmd,
                                                                                          overlap+i, *collisions_index, dt );
        }
-#endif 
+#endif /* WITH_ELTOPO */
 
 }
 
@@ -2327,13 +2327,13 @@ static int cloth_bvh_objcollisions_resolve ( ClothModifierData * clmd, Collision
 
                if ( collmd->bvhtree )
                {
-#ifdef USE_ELTOPO
+#ifdef WITH_ELTOPO
                        result += cloth_collision_response_moving(clmd, collmd, collisions, collisions_index);
                        result += cloth_edge_collision_response_moving(clmd, collmd, collisions, collisions_index);
 #else
                        result += cloth_collision_response_static ( clmd, collmd, collisions, collisions_index );
 #endif
-#ifdef USE_ELTOPO
+#ifdef WITH_ELTOPO
                        {
 #else
                        // apply impulses in parallel
index c3a7b6b204d09bbc4c6e7ceb24c0cbe0da555324..099661f791436a464681c6e9d2340f81aee8f296 100644 (file)
@@ -1753,7 +1753,7 @@ static void simulate_implicit_euler(lfVector *Vnew, lfVector *UNUSED(lX), lfVect
   (edge distance constraints) in a lagrangian solver.  then add forces to help
   guide the implicit solver to that state.  this function is called after
   collisions*/
-int cloth_calc_helper_forces(Object *ob, ClothModifierData * clmd, float (*initial_cos)[3], float step, float dt)
+int cloth_calc_helper_forces(Object *UNUSED(ob), ClothModifierData * clmd, float (*initial_cos)[3], float UNUSED(step), float dt)
 {
        Cloth *cloth= clmd->clothObject;
        float (*cos)[3] = MEM_callocN(sizeof(float)*3*cloth->numverts, "cos cloth_calc_helper_forces");
index d8114ce9537a271121e526165d0276b875e586fa..a039dca208e2a3c59d247eca93c6cc5994dc97ac 100644 (file)
@@ -816,7 +816,7 @@ endif()
                bf_intern_mikktspace
        )
 
-    if(WITH_ELTOPO)
+    if(WITH_MOD_CLOTH_ELTOPO)
                list(APPEND BLENDER_SORTED_LIBS extern_eltopo)
     endif()