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

This commit is contained in:
rdb 2010-11-17 12:17:41 +00:00
parent 04e8fcecda
commit f05831d24d
5 changed files with 23 additions and 16 deletions

View File

@ -454,7 +454,6 @@ if (COMPILER=="MSVC"):
LibName(pkg, SDK[pkg] + '/lib/maxutil.lib') LibName(pkg, SDK[pkg] + '/lib/maxutil.lib')
LibName(pkg, SDK[pkg] + '/lib/paramblk2.lib') LibName(pkg, SDK[pkg] + '/lib/paramblk2.lib')
if (PkgSkip("PHYSX")==0): if (PkgSkip("PHYSX")==0):
DefSymbol("PHYSX", SDK["PHYSXVERSION"], "1")
LibName("PHYSX", SDK["PHYSX"] + "/lib/Win32/PhysXLoader.lib") LibName("PHYSX", SDK["PHYSX"] + "/lib/Win32/PhysXLoader.lib")
LibName("PHYSX", SDK["PHYSX"] + "/lib/Win32/NxCharacter.lib") LibName("PHYSX", SDK["PHYSX"] + "/lib/Win32/NxCharacter.lib")
IncDirectory("PHYSX", SDK["PHYSX"] + "/Physics/include") IncDirectory("PHYSX", SDK["PHYSX"] + "/Physics/include")
@ -630,7 +629,6 @@ if (COMPILER=="LINUX"):
if (sys.platform == "darwin"): 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") 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): if (PkgSkip("PHYSX")==0):
DefSymbol("PHYSX", SDK["PHYSXVERSION"], "1")
IncDirectory("PHYSX", SDK["PHYSX"] + "/Physics/include") IncDirectory("PHYSX", SDK["PHYSX"] + "/Physics/include")
IncDirectory("PHYSX", SDK["PHYSX"] + "/PhysXLoader/include") IncDirectory("PHYSX", SDK["PHYSX"] + "/PhysXLoader/include")
IncDirectory("PHYSX", SDK["PHYSX"] + "/NxCharacter/include") IncDirectory("PHYSX", SDK["PHYSX"] + "/NxCharacter/include")

View File

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

View File

@ -107,10 +107,10 @@
#define NX_FORCE_FIELD_CUSTOM_KERNEL_EPSILON 97 #define NX_FORCE_FIELD_CUSTOM_KERNEL_EPSILON 97
#define NX_IMPROVED_SPRING_SOLVER 98 #define NX_IMPROVED_SPRING_SOLVER 98
#ifndef PHYSX281 #if NX_SDK_VERSION_NUMBER > 281
#define NX_FAST_MASSIVE_BP_VOLUME_DELETION 99 #define NX_FAST_MASSIVE_BP_VOLUME_DELETION 99
#define NX_LEGACY_JOINT_DRIVE 100 #define NX_LEGACY_JOINT_DRIVE 100
#endif /* PHYSX281 */ #endif /* NX_SDK_VERSION_NUMBER > 281 */
// PhysxActorFlag // PhysxActorFlag
#define NX_AF_DISABLE_COLLISION 1<<0 #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_force_field_custom_kernel_epsilon = NX_FORCE_FIELD_CUSTOM_KERNEL_EPSILON,
P_improved_spring_solver = NX_IMPROVED_SPRING_SOLVER, 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_fast_massive_bp_volume_deletion = NX_FAST_MASSIVE_BP_VOLUME_DELETION,
P_legacy_joint_drive = NX_LEGACY_JOINT_DRIVE, P_legacy_joint_drive = NX_LEGACY_JOINT_DRIVE,
#endif #endif

View File

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

View File

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