Browse Source

Improvements. Too lazy to describe them (pay me enough and I'll write a book about these changes)

rdb 15 years ago
parent
commit
f05831d24d

+ 0 - 2
makepanda/makepanda.py

@@ -454,7 +454,6 @@ if (COMPILER=="MSVC"):
             LibName(pkg, SDK[pkg] +  '/lib/maxutil.lib')
             LibName(pkg, SDK[pkg] +  '/lib/paramblk2.lib')
     if (PkgSkip("PHYSX")==0):
-        DefSymbol("PHYSX", SDK["PHYSXVERSION"], "1")
         LibName("PHYSX",      SDK["PHYSX"] + "/lib/Win32/PhysXLoader.lib")
         LibName("PHYSX",      SDK["PHYSX"] + "/lib/Win32/NxCharacter.lib")
         IncDirectory("PHYSX", SDK["PHYSX"] + "/Physics/include")
@@ -630,7 +629,6 @@ if (COMPILER=="LINUX"):
             if (sys.platform == "darwin"):
                 LibName(pkg, "-dylib_file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib")
     if (PkgSkip("PHYSX")==0):
-        DefSymbol("PHYSX", SDK["PHYSXVERSION"], "1")
         IncDirectory("PHYSX", SDK["PHYSX"] + "/Physics/include")
         IncDirectory("PHYSX", SDK["PHYSX"] + "/PhysXLoader/include")
         IncDirectory("PHYSX", SDK["PHYSX"] + "/NxCharacter/include")

+ 16 - 7
makepanda/makepandacore.py

@@ -1263,7 +1263,7 @@ def GetSdkDir(sdkname, sdkkey = None):
     sdir += "/" + sdkname
 
     # If it does not exist, try the old location.
-    if (sdkkey and not os.path.isdir(sdir)):
+    if (not os.path.isdir(sdir)):
         sdir = "sdks/" + sdir
         if (sys.platform.startswith("linux")):
             sdir += "-linux"
@@ -1271,7 +1271,7 @@ def GetSdkDir(sdkname, sdkkey = None):
         elif (sys.platform == "darwin"):
             sdir += "-osx"
 
-    if (os.path.isdir(sdir)):
+    if (sdkkey and os.path.isdir(sdir)):
         SDK[sdkkey] = sdir
 
     return sdir
@@ -1467,28 +1467,37 @@ def SdkLocateMacOSX(osxtarget=None):
     else:
         SDK["MACOSX"] = ""
 
+# Latest first
 PHYSXVERSIONINFO=[
-    ("PHYSX281","v2.8.1"),
-    ("PHYSX283","v2.8.3"),
     ("PHYSX284","v2.8.4"),
+    ("PHYSX283","v2.8.3"),
+    ("PHYSX281","v2.8.1"),
 ]
 
 def SdkLocatePhysX():
-    for (ver,key) in PHYSXVERSIONINFO:
+    # First check for a physx directory in sdks.
+    dir = GetSdkDir("physx")
+    if (dir and os.path.isdir(dir)):
+        SDK["PHYSX"] = dir
+        SDK["PHYSXLIBS"] = dir + "/lib"
+        return
+    
+    # Try to find a PhysX installation on the system.
+    for (ver, key) in PHYSXVERSIONINFO:
         if (sys.platform == "win32"):
             folders = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Installer\\Folders"
             for folder in ListRegistryValues(folders):
                 if folder.endswith("NVIDIA PhysX SDK\\%s\\SDKs\\" % key) or \
                    folder.endswith("NVIDIA PhysX SDK\\%s_win\\SDKs\\" % key):
                     SDK["PHYSX"] = folder
-                    SDK["PHYSXVERSION"] = ver
+                    return
         elif (sys.platform.startswith("linux")):
             incpath = "/usr/include/PhysX/%s/SDKs" % key
             libpath = "/usr/lib/PhysX/%s" % key
             if (os.path.isdir(incpath) and os.path.isdir(libpath)):
                 SDK["PHYSX"] = incpath
-                SDK["PHYSXVERSION"] = ver
                 SDK["PHYSXLIBS"] = libpath
+                return
 
 def SdkLocateSpeedTree():
     # Look for all of the SpeedTree SDK directories within the

+ 3 - 3
panda/src/physx/physxEnums.h

@@ -107,10 +107,10 @@
 #define NX_FORCE_FIELD_CUSTOM_KERNEL_EPSILON 97
 #define NX_IMPROVED_SPRING_SOLVER 98
 
-#ifndef PHYSX281
+#if NX_SDK_VERSION_NUMBER > 281
 #define NX_FAST_MASSIVE_BP_VOLUME_DELETION 99
 #define NX_LEGACY_JOINT_DRIVE 100
-#endif /* PHYSX281 */
+#endif /* NX_SDK_VERSION_NUMBER > 281 */
 
 // PhysxActorFlag
 #define NX_AF_DISABLE_COLLISION 1<<0
@@ -383,7 +383,7 @@ PUBLISHED:
     P_force_field_custom_kernel_epsilon     = NX_FORCE_FIELD_CUSTOM_KERNEL_EPSILON,
     P_improved_spring_solver                = NX_IMPROVED_SPRING_SOLVER,
 
-#ifndef PHYSX281
+#if NX_SDK_VERSION_NUMBER > 281
     P_fast_massive_bp_volume_deletion       = NX_FAST_MASSIVE_BP_VOLUME_DELETION,
     P_legacy_joint_drive                    = NX_LEGACY_JOINT_DRIVE,
 #endif

+ 2 - 2
panda/src/physx/physxSoftBody.cxx

@@ -591,7 +591,7 @@ get_sleep_linear_velocity() const {
   return _ptr->getSleepLinearVelocity();
 }
 
-#ifndef PHYSX281
+#if NX_SDK_VERSION_NUMBER > 281
 ////////////////////////////////////////////////////////////////////
 //     Function: PhysxSoftBody::set_self_collision_thickness
 //       Access: Published
@@ -641,7 +641,7 @@ get_hard_stretch_limitation_factor() const {
   nassertr(_error_type == ET_ok, 0.0f);
   return ptr()->getHardStretchLimitationFactor();
 }
-#endif // PHYSX281
+#endif // NX_SDK_VERSION_NUMBER > 281
 
 
 

+ 2 - 2
panda/src/physx/physxSoftBody.h

@@ -48,7 +48,7 @@ PUBLISHED:
   void set_group(unsigned int group);
   void set_solver_iterations(unsigned int iterations);
   void set_particle_radius(float radius);
-#ifndef PHYSX281
+#if NX_SDK_VERSION_NUMBER > 281
   void set_self_collision_thickness(float thickness);
   void set_hard_stretch_limitation_factor(float factor);
 #endif
@@ -68,7 +68,7 @@ PUBLISHED:
   float get_particle_radius() const;
   float get_density() const;
   float get_relative_grid_spacing() const;
-#ifndef PHYSX281
+#if NX_SDK_VERSION_NUMBER > 281
   float get_self_collision_thickness() const;
   float get_hard_stretch_limitation_factor() const;
 #endif