diff --git a/CMakeFiles/3.13.2/CMakeSystem.cmake b/CMakeFiles/3.13.2/CMakeSystem.cmake new file mode 100644 index 000000000..bdd1e31f8 --- /dev/null +++ b/CMakeFiles/3.13.2/CMakeSystem.cmake @@ -0,0 +1,15 @@ +set(CMAKE_HOST_SYSTEM "Windows-10.0.17134") +set(CMAKE_HOST_SYSTEM_NAME "Windows") +set(CMAKE_HOST_SYSTEM_VERSION "10.0.17134") +set(CMAKE_HOST_SYSTEM_PROCESSOR "AMD64") + + + +set(CMAKE_SYSTEM "Windows-10.0.17134") +set(CMAKE_SYSTEM_NAME "Windows") +set(CMAKE_SYSTEM_VERSION "10.0.17134") +set(CMAKE_SYSTEM_PROCESSOR "AMD64") + +set(CMAKE_CROSSCOMPILING "FALSE") + +set(CMAKE_SYSTEM_LOADED 1) diff --git a/CMakeFiles/3.13.2/VCTargetsPath.vcxproj b/CMakeFiles/3.13.2/VCTargetsPath.vcxproj new file mode 100644 index 000000000..811d5245a --- /dev/null +++ b/CMakeFiles/3.13.2/VCTargetsPath.vcxproj @@ -0,0 +1,28 @@ + + + + + Debug + x64 + + + + {F3FC6D86-508D-3FB1-96D2-995F08B142EC} + Win32Proj + x64 + 10.0.17134.0 + + + + Utility + MultiByte + v141 + + + + + echo VCTargetsPath=$(VCTargetsPath) + + + + diff --git a/CMakeFiles/CMakeOutput.log b/CMakeFiles/CMakeOutput.log new file mode 100644 index 000000000..950a48024 --- /dev/null +++ b/CMakeFiles/CMakeOutput.log @@ -0,0 +1 @@ +The system is: Windows - 10.0.17134 - AMD64 diff --git a/Source/CMake/Modules/FindPhysX.cmake b/Source/CMake/Modules/FindPhysX.cmake index 180897b04..4d36af006 100644 --- a/Source/CMake/Modules/FindPhysX.cmake +++ b/Source/CMake/Modules/FindPhysX.cmake @@ -13,27 +13,27 @@ gen_default_lib_search_dirs(PhysX) if(NOT APPLE) if(BS_64BIT) - set(BS_PHYSX_SUFFIX _x64) + set(BS_PHYSX_SUFFIX _64) else() - set(BS_PHYSX_SUFFIX _x86) + set(BS_PHYSX_SUFFIX _86) endif() endif() find_imported_includes(PhysX PxPhysics.h) if(NOT APPLE) - find_imported_library_shared2(PhysX PhysX3${BS_PHYSX_SUFFIX} PhysX3CHECKED${BS_PHYSX_SUFFIX}) - find_imported_library_shared2(PhysX PhysX3Common${BS_PHYSX_SUFFIX} PhysX3CommonCHECKED${BS_PHYSX_SUFFIX}) - find_imported_library_shared2(PhysX PhysX3Cooking${BS_PHYSX_SUFFIX} PhysX3CookingCHECKED${BS_PHYSX_SUFFIX}) - find_imported_library_shared2(PhysX PhysX3CharacterKinematic${BS_PHYSX_SUFFIX} PhysX3CharacterKinematicCHECKED${BS_PHYSX_SUFFIX}) - find_imported_library2(PhysX PhysX3Extensions PhysX3ExtensionsCHECKED) + find_imported_library_shared2(PhysX PhysX${BS_PHYSX_SUFFIX} PhysXCHECKED${BS_PHYSX_SUFFIX}) + find_imported_library_shared2(PhysX PhysXCommon${BS_PHYSX_SUFFIX} PhysXCommonCHECKED${BS_PHYSX_SUFFIX}) + find_imported_library_shared2(PhysX PhysXCooking${BS_PHYSX_SUFFIX} PhysXCookingCHECKED${BS_PHYSX_SUFFIX}) + find_imported_library_shared2(PhysX PhysXCharacterKinematic_static${BS_PHYSX_SUFFIX} PhysXCharacterKinematicCHECKED_static${BS_PHYSX_SUFFIX}) + find_imported_library2(PhysX PhysXExtensions_static${BS_PHYSX_SUFFIX} PhysXExtensionsCHECKED_static${BS_PHYSX_SUFFIX}) else() find_imported_library(PhysX LowLevel) find_imported_library(PhysX LowLevelCloth) - find_imported_library(PhysX PhysX3) - find_imported_library(PhysX PhysX3Common) - find_imported_library(PhysX PhysX3Cooking) - find_imported_library(PhysX PhysX3CharacterKinematic) - find_imported_library(PhysX PhysX3Extensions) + find_imported_library(PhysX PhysX) + find_imported_library(PhysX PhysXCommon) + find_imported_library(PhysX PhysXCooking) + find_imported_library(PhysX PhysXCharacterKinematic) + find_imported_library(PhysX PhysXExtensions) find_imported_library(PhysX PhysXProfileSDK) find_imported_library(PhysX PvdRuntime) find_imported_library(PhysX PxTask) @@ -43,4 +43,4 @@ endif() install_dependency_binaries(PhysX) -end_find_package(PhysX PhysX3${BS_PHYSX_SUFFIX}) +end_find_package(PhysX PhysX${BS_PHYSX_SUFFIX}) diff --git a/Source/Plugins/bsfPhysX/BsPhysX.cpp b/Source/Plugins/bsfPhysX/BsPhysX.cpp index 932874d89..e6f0b645c 100644 --- a/Source/Plugins/bsfPhysX/BsPhysX.cpp +++ b/Source/Plugins/bsfPhysX/BsPhysX.cpp @@ -128,6 +128,7 @@ namespace bs { void onWake(PxActor** actors, PxU32 count) override { /* Do nothing */ } void onSleep(PxActor** actors, PxU32 count) override { /* Do nothing */ } + void onAdvance(const PxRigidBody *const *bodyBuffer, const PxTransform *poseBuffer, const PxU32 count) override { /* Do nothing */ } void onTrigger(PxTriggerPair* pairs, PxU32 count) override { @@ -191,6 +192,9 @@ namespace bs void onContact(const PxContactPairHeader& pairHeader, const PxContactPair* pairs, PxU32 count) override { + const PxU32 bufferSize = 64; + PxContactPairPoint contacts[bufferSize]; + for (PxU32 i = 0; i < count; i++) { const PxContactPair& pair = pairs[i]; @@ -220,17 +224,19 @@ namespace bs event.type = type; PxU32 contactCount = pair.contactCount; - const PxU8* stream = pair.contactStream; + //const PxU8* stream = pair.contactStream; + const PxU32 stream = pair.extractContacts(contacts, bufferSize); PxU16 streamSize = pair.contactStreamSize; if (contactCount > 0 && streamSize > 0) { PxU32 contactIdx = 0; - PxContactStreamIterator iter((PxU8*)stream, streamSize); + PxContactStreamIterator iter(pair.contactPatches,pair.contactPoints, pair.getInternalFaceIndices(), pair.patchCount, pair.contactCount); - stream += ((streamSize + 15) & ~15); + //stream += ((streamSize + 15) & ~15); - const PxReal* impulses = reinterpret_cast(stream); + const PxReal* impulses = pair.contactImpulses; + PxU32 flippedContacts = (pair.flags & PxContactPairFlag::eINTERNAL_CONTACTS_ARE_FLIPPED); PxU32 hasImpulses = (pair.flags & PxContactPairFlag::eINTERNAL_HAS_IMPULSES); while (iter.hasNextPatch()) @@ -240,15 +246,14 @@ namespace bs { iter.nextContact(); + PxVec3 pointIter = iter.getContactPoint(); + ContactPoint point; point.position = fromPxVector(iter.getContactPoint()); point.separation = iter.getSeparation(); point.normal = fromPxVector(iter.getContactNormal()); - if (hasImpulses) - point.impulse = impulses[contactIdx]; - else - point.impulse = 0.0f; + point.impulse = hasImpulses ? impulses[contactIdx] : 0.0f; event.points.push_back(point); @@ -491,7 +496,7 @@ namespace bs sceneDesc.broadPhaseCallback = &gPhysXBroadphaseCallback; // Optionally: eENABLE_KINEMATIC_STATIC_PAIRS, eENABLE_KINEMATIC_PAIRS, eENABLE_PCM - sceneDesc.flags = PxSceneFlag::eENABLE_ACTIVETRANSFORMS; + sceneDesc.flags = PxSceneFlag::eENABLE_ACTIVE_ACTORS; if (input.flags.isSet(PhysicsFlag::CCD_Enable)) sceneDesc.flags |= PxSceneFlag::eENABLE_CCD; @@ -542,19 +547,20 @@ namespace bs // Update rigidbodies with new transforms PxU32 numActiveTransforms; - const PxActiveTransform* activeTransforms = mScene->getActiveTransforms(numActiveTransforms); + PxActor** activeActors = mScene->getActiveActors(numActiveTransforms); for (PxU32 i = 0; i < numActiveTransforms; i++) { - Rigidbody* rigidbody = static_cast(activeTransforms[i].userData); + Rigidbody* rigidbody = static_cast(activeActors[i]->userData); // Note: This should never happen, as actors gets their userData set to null when they're destroyed. However // in some cases PhysX seems to keep those actors alive for a frame or few, and reports their state here. Until // I find out why I need to perform this check. - if(activeTransforms[i].actor->userData == nullptr) + if(activeActors[i]->userData == nullptr) continue; - const PxTransform& transform = activeTransforms[i].actor2World; + //const PxTransform& transform = activeActors[i]->getGlobalPose(); + const PxTransform& transform = (PxTransform&)activeActors[i]->userData; // Note: Make this faster, avoid dereferencing Rigidbody and attempt to access pos/rot destination directly, // use non-temporal writes @@ -1059,10 +1065,10 @@ namespace bs PxRaycastHit hitInfo; PxU32 maxHits = 1; bool anyHit = false; - PxHitFlags hitFlags = PxHitFlag::eDEFAULT | PxHitFlag::eUV; + PxHitFlags hitFlags = PxHitFlag::eDEFAULT | PxHitFlag::eUV | PxHitFlag::eMESH_ANY; PxU32 hitCount = PxGeometryQuery::raycast(toPxVector(origin), toPxVector(unitDir), shape->getGeometry().any(), transform, - maxDist, hitFlags, maxHits, &hitInfo, anyHit); + maxDist, hitFlags, maxHits, &hitInfo); if(hitCount > 0) parseHit(hitInfo, hit); diff --git a/Source/Plugins/bsfPhysX/BsPhysXCharacterController.cpp b/Source/Plugins/bsfPhysX/BsPhysXCharacterController.cpp index 55b4126ea..64540ecb1 100644 --- a/Source/Plugins/bsfPhysX/BsPhysXCharacterController.cpp +++ b/Source/Plugins/bsfPhysX/BsPhysXCharacterController.cpp @@ -258,15 +258,15 @@ namespace bs bool canCollide = gPhysics().isCollisionEnabled(colliderLayer, getLayer()); if(canCollide) - return PxSceneQueryHitType::eBLOCK; + return PxQueryHitType::eBLOCK; - return PxSceneQueryHitType::eNONE; + return PxQueryHitType::eNONE; } PxQueryHitType::Enum PhysXCharacterController::postFilter(const PxFilterData& filterData, const PxQueryHit& hit) { - return PxSceneQueryHitType::eBLOCK; + return PxQueryHitType::eBLOCK; } bool PhysXCharacterController::filter(const PxController& a, const PxController& b) diff --git a/Source/Plugins/bsfPhysX/BsPhysXMesh.cpp b/Source/Plugins/bsfPhysX/BsPhysXMesh.cpp index 8b3048750..6c9824b1a 100644 --- a/Source/Plugins/bsfPhysX/BsPhysXMesh.cpp +++ b/Source/Plugins/bsfPhysX/BsPhysXMesh.cpp @@ -44,7 +44,7 @@ namespace bs } // Try inflating the convex mesh - convexDesc.flags |= PxConvexFlag::eINFLATE_CONVEX; + //convexDesc.flags |= PxConvexFlag::eINFLATE_CONVEX; // TODO: Add this back once issue is solved if (cooking->cookConvexMesh(convexDesc, output)) { size = output.getSize(); @@ -78,7 +78,7 @@ namespace bs convexDesc.points.count = 8; convexDesc.points.stride = sizeof(Vector3); convexDesc.points.data = &aabbVerts[0]; - convexDesc.flags &= ~PxConvexFlag::eINFLATE_CONVEX; + //convexDesc.flags &= ~PxConvexFlag::eINFLATE_CONVEX; // TODO: Add this back once issue is solved if (cooking->cookConvexMesh(convexDesc, output)) {