diff options
Diffstat (limited to 'PhysX_3.4/Source/PhysX')
6 files changed, 36 insertions, 10 deletions
diff --git a/PhysX_3.4/Source/PhysX/src/buffering/ScbArticulationJoint.h b/PhysX_3.4/Source/PhysX/src/buffering/ScbArticulationJoint.h index 9c8b66b4..1366812b 100644 --- a/PhysX_3.4/Source/PhysX/src/buffering/ScbArticulationJoint.h +++ b/PhysX_3.4/Source/PhysX/src/buffering/ScbArticulationJoint.h @@ -257,6 +257,7 @@ PX_INLINE void ArticulationJoint::syncState() flush<Buf::BF_TwistLimitEnabled>(buffer); flush<Buf::BF_TangentialStiffness>(buffer); flush<Buf::BF_TangentialDamping>(buffer); + flush<Buf::BF_DriveType>(buffer); if(isBuffered(Buf::BF_SwingLimit)) mJoint.setSwingLimit(buffer.mSwingLimitY, buffer.mSwingLimitZ); diff --git a/PhysX_3.4/Source/PhysX/src/buffering/ScbBody.h b/PhysX_3.4/Source/PhysX/src/buffering/ScbBody.h index fb7f8387..e1ed5f7a 100644 --- a/PhysX_3.4/Source/PhysX/src/buffering/ScbBody.h +++ b/PhysX_3.4/Source/PhysX/src/buffering/ScbBody.h @@ -955,6 +955,7 @@ PX_INLINE void Body::syncState() flush<Buf::BF_FreezeThreshold>(buffer); flush<Buf::BF_MaxPenetrationBias>(buffer); flush<Buf::BF_MaxContactImpulse>(buffer); + flush<Buf::BF_CCDAdvanceCoefficient>(buffer); if(bufferFlags & Buf::BF_RigidBodyFlags) mBodyCore.setFlags(getScbScene()->getScScene().getSimStateDataPool(), buffer.mRigidBodyFlags); } diff --git a/PhysX_3.4/Source/PhysX/src/buffering/ScbShape.cpp b/PhysX_3.4/Source/PhysX/src/buffering/ScbShape.cpp index 445557ec..9814e4ba 100644 --- a/PhysX_3.4/Source/PhysX/src/buffering/ScbShape.cpp +++ b/PhysX_3.4/Source/PhysX/src/buffering/ScbShape.cpp @@ -118,10 +118,7 @@ void Scb::Shape::syncState() flush<Buf::BF_Shape2Actor>(buffer); flush<Buf::BF_SimulationFilterData>(buffer); - - if(isBuffered(Buf::BF_ContactOffset)) - mShape.setContactOffset(buffer.mContactOffset); - + flush<Buf::BF_ContactOffset>(buffer); flush<Buf::BF_RestOffset>(buffer); flush<Buf::BF_Flags>(buffer); diff --git a/PhysX_3.4/Source/PhysX/src/buffering/ScbShape.h b/PhysX_3.4/Source/PhysX/src/buffering/ScbShape.h index acadd163..1bcbb6ca 100644 --- a/PhysX_3.4/Source/PhysX/src/buffering/ScbShape.h +++ b/PhysX_3.4/Source/PhysX/src/buffering/ScbShape.h @@ -229,7 +229,6 @@ PX_INLINE Shape::Shape(const PxGeometry& geometry, PX_COMPILE_TIME_ASSERT(PxU32(ShapeBuffer::BF_ContactOffset) == PxU32(Sc::ShapeChangeNotifyFlag::eCONTACTOFFSET)); PX_COMPILE_TIME_ASSERT(PxU32(ShapeBuffer::BF_RestOffset) == PxU32(Sc::ShapeChangeNotifyFlag::eRESTOFFSET)); PX_COMPILE_TIME_ASSERT(PxU32(ShapeBuffer::BF_Flags) == PxU32(Sc::ShapeChangeNotifyFlag::eFLAGS)); - PX_COMPILE_TIME_ASSERT(PxU32(ShapeBuffer::BF_Geometry) == PxU32(Sc::ShapeChangeNotifyFlag::eGEOMETRY)); if(isExclusive) setScbType(ScbType::eSHAPE_EXCLUSIVE); diff --git a/PhysX_3.4/Source/PhysX/src/gpu/PxPhysXGpuModuleLoader.cpp b/PhysX_3.4/Source/PhysX/src/gpu/PxPhysXGpuModuleLoader.cpp index 9ac8a523..bef80e14 100644 --- a/PhysX_3.4/Source/PhysX/src/gpu/PxPhysXGpuModuleLoader.cpp +++ b/PhysX_3.4/Source/PhysX/src/gpu/PxPhysXGpuModuleLoader.cpp @@ -60,9 +60,15 @@ namespace physx #if PX_WINDOWS #include "windows/PsWindowsInclude.h" +#include "windows/PxWindowsDelayLoadHook.h" #include "windows/CmWindowsModuleUpdateLoader.h" static const char* gPhysXGpuLibraryName = "PhysX3Gpu" CONFIG_SUB_STR "_" PLATFORM_SUB_STR ".dll"; +namespace physx +{ + const PxDelayLoadHook* PxGetPhysXDelayLoadHook(); +} + #elif PX_LINUX #include <dlfcn.h> @@ -115,6 +121,9 @@ namespace physx #if PX_WINDOWS + typedef void (PxSetPhysXGpuDelayLoadHook_FUNC)(const PxDelayLoadHook* delayLoadHook); + PxSetPhysXGpuDelayLoadHook_FUNC* g_PxSetPhysXGpuDelayLoadHook_Func = NULL; + #define DEFAULT_PHYSX_GPU_GUID "D79FA4BF-177C-4841-8091-4375D311D6A3" void PxLoadPhysxGPUModule(const char* appGUID) @@ -132,6 +141,7 @@ namespace physx if (s_library) { + g_PxSetPhysXGpuDelayLoadHook_Func = (PxSetPhysXGpuDelayLoadHook_FUNC*)GetProcAddress(s_library, "PxSetPhysXGpuDelayLoadHook"); g_PxCreatePhysXGpu_Func = (PxCreatePhysXGpu_FUNC*)GetProcAddress(s_library, "PxCreatePhysXGpu"); g_PxCreateCudaContextManager_Func = (PxCreateCudaContextManager_FUNC*)GetProcAddress(s_library, "PxCreateCudaContextManager"); g_PxGetSuggestedCudaDeviceOrdinal_Func = (PxGetSuggestedCudaDeviceOrdinal_FUNC*)GetProcAddress(s_library, "PxGetSuggestedCudaDeviceOrdinal"); @@ -139,9 +149,19 @@ namespace physx // Check for errors if (s_library == NULL) + { Ps::getFoundation().error(PxErrorCode::eINTERNAL_ERROR, __FILE__, __LINE__, "Failed to load PhysXGpu dll!"); - if (g_PxCreatePhysXGpu_Func == NULL || g_PxCreateCudaContextManager_Func == NULL || g_PxGetSuggestedCudaDeviceOrdinal_Func == NULL) + return; + } + + if (g_PxSetPhysXGpuDelayLoadHook_Func == NULL || g_PxCreatePhysXGpu_Func == NULL || g_PxCreateCudaContextManager_Func == NULL || g_PxGetSuggestedCudaDeviceOrdinal_Func == NULL) + { Ps::getFoundation().error(PxErrorCode::eINTERNAL_ERROR, __FILE__, __LINE__, "PhysXGpu dll is incompatible with this version of PhysX!"); + return; + } + + g_PxSetPhysXGpuDelayLoadHook_Func(PxGetPhysXDelayLoadHook()); + } #elif PX_LINUX diff --git a/PhysX_3.4/Source/PhysX/src/windows/NpWindowsDelayLoadHook.cpp b/PhysX_3.4/Source/PhysX/src/windows/NpWindowsDelayLoadHook.cpp index 0f6c495f..b1e04f27 100644 --- a/PhysX_3.4/Source/PhysX/src/windows/NpWindowsDelayLoadHook.cpp +++ b/PhysX_3.4/Source/PhysX/src/windows/NpWindowsDelayLoadHook.cpp @@ -36,11 +36,19 @@ #define DELAYIMP_INSECURE_WRITABLE_HOOKS #include <delayimp.h> -static const physx::PxDelayLoadHook* gDelayLoadHook = NULL; - -void physx::PxSetPhysXDelayLoadHook(const physx::PxDelayLoadHook* hook) +namespace physx { - gDelayLoadHook = hook; + static const PxDelayLoadHook* gDelayLoadHook = NULL; + + void PxSetPhysXDelayLoadHook(const PxDelayLoadHook* hook) + { + gDelayLoadHook = hook; + } + + const PxDelayLoadHook* PxGetPhysXDelayLoadHook() + { + return gDelayLoadHook; + } } using namespace physx; |