Hi, thanks for your reply!
First I am not sure at all about my “the internal buffer in ScbShape is corrupted”. I didn’t dig into physx’s code, I don’t know how it works.
Because the simulation filter data where exactly the same before and after the call to “setConstraintFlag” (I displayed each bit), I wanted to know where these data were stored and I found the mentioned buffer in ScbShape. And this buffer seems shared. So I did a quick supposition that someone was misreading/mis-writing into this buffer.
I just uploaded my minimal code project if you need:
(just have to change the link to PhysX in the CMakeLists.txt)
There are also two screenshots showing what happens when the workaround is on/off.
My version is: PhysX 3.3(.4)
It comes from the ‘master’ branch, last commit is:
commit 3aeffc35b32ce175b7d19b1bace53ad9d8f84242
Author: sschirm <sschirm@nvidia.com>
Date: Thu Feb 11 18:09:48 2016 +0100
I did the following modifications in order to compile:
lokfry ~/Projects/echoes/extlibs/PhysX-3.3$ git diff
diff --git a/PhysXSDK/Include/foundation/unix/PxUnixIntrinsics.h b/PhysXSDK/Include/foundation/unix/PxUnixIntrinsics.h
index 5b95710..f3f0c0a 100644
--- a/PhysXSDK/Include/foundation/unix/PxUnixIntrinsics.h
+++ b/PhysXSDK/Include/foundation/unix/PxUnixIntrinsics.h
@@ -21,8 +21,10 @@
#error "This file should only be included by Unix builds!!"
#endif
-#include <math.h>
-#include <float.h>
+#include <cmath>
+#include <cfloat>
+//#include <math.h>
+//#include <float.h>
namespace physx
{
@@ -72,13 +74,13 @@ namespace physx
//! \brief platform-specific finiteness check (not INF or NAN)
PX_FORCE_INLINE bool isFinite(float a)
{
- return isfinite(a);
+ return std::isfinite(a);
}
//! \brief platform-specific finiteness check (not INF or NAN)
PX_FORCE_INLINE bool isFinite(double a)
{
- return isfinite(a);
+ return std::isfinite(a);
}
/*!
diff --git a/PhysXSDK/Source/SimulationController/src/ScScene.cpp b/PhysXSDK/Source/SimulationController/src/ScScene.cpp
index b1cbf85..2063b5c 100644
--- a/PhysXSDK/Source/SimulationController/src/ScScene.cpp
+++ b/PhysXSDK/Source/SimulationController/src/ScScene.cpp
@@ -3419,7 +3419,7 @@ PX_FORCE_INLINE void buildActiveTransform(Sc::Actor*const PX_RESTRICT activeActo
PX_ASSERT(activeActor->isDynamicRigid());
Sc::BodySim* body = static_cast<Sc::BodySim*>(activeActor);
- if(!body->getBodyCore().getCore().mInternalFlags & PxsRigidCore::eFROZEN)
+ if(!(body->getBodyCore().getCore().mInternalFlags & PxsRigidCore::eFROZEN))
{
PxRigidActor* ra = static_cast<PxRigidActor*>(body->getPxActor());
PX_ASSERT(ra != NULL);
My compiler (clang++) was complaining about:
lokfry ~/Projects/echoes/extlibs/PhysX-3.3/PhysXSDK/Source/compiler/linux64$ make
SimulationController: compiling checked ./../../SimulationController/src/ScScene.cpp...
./../../SimulationController/src/ScScene.cpp: In function ‘void buildActiveTransform(physx::Sc::Actor*, physx::Sc::Client**, physx::PxU32)’:
./../../SimulationController/src/ScScene.cpp:3422:36: error: suggest parentheses around operand of ‘!’ or change ‘&’ to ‘&&’ or ‘!’ to ‘~’ [-Werror=parentheses]
if(!body->getBodyCore().getCore().mInternalFlags & PxsRigidCore::eFROZEN)
^
cc1plus: all warnings being treated as errors
Makefile.SimulationController.mk:286: recipe for target 'build/SimulationController_checked/SimulationController/src/ScScene.cpp.o' failed
make: *** [build/SimulationController_checked/SimulationController/src/ScScene.cpp.o] Error 1
By the way,
lokfry ~/Projects/echoes/lab/bug_mcjointcoll/git/bug_mcjointcoll$ uname --all
Linux Farore 4.4.0-78-generic #99-Ubuntu SMP Thu Apr 27 15:29:09 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
lokfry ~/Projects/echoes/lab/bug_mcjointcoll/git/bug_mcjointcoll$ clang++ -v
clang version 3.8.0-2ubuntu4 (tags/RELEASE_380/final)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Found candidate GCC installation: /usr/bin/../lib/gcc/i686-linux-gnu/6.0.0
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.0
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/6.0.0
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/6.0.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.4.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6.0.0
Selected GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.0
Candidate multilib: .;@m64
Selected multilib: .;@m64