Hi,
Ok, true. I didn’t know it was the default behavior. Last time, when reducing the code, I ended up to surround this setConstraintFlag() with my getFilterData/setFilterData – it fixed my problem – I wrongly supposed it was because of this.
I commented this line and the behavior is the same: same problem without my dirty ‘fix’.
std::vector<PxFilterData> fd = getFilterData(actor);
//joint->setConstraintFlag( PxConstraintFlag::eCOLLISION_ENABLED, false );
setFilterData(actor, fd);
(Thus I still need these dirty get/setFilterData to make it work :s)
Then I did some tests:
- Compiling PhysX SDK and my test project with clang (I installed version 3.9) and the mentioned flags.
Result: Failed.
Note: I am not 100% sure of what I did, not sure if it’s correct. I commented most of original flags (for all projects)…
#PhysX_release_common_cflags += -m64
#PhysX_release_common_cflags += -Werror -m64 -fPIC -msse2 -mfpmath=sse -ffast-math -fno-exceptions -fno-rtti -fvisibility=hidden -fvisibility-inlines-hidden
#PhysX_release_common_cflags += -Wall -Wextra -Wstrict-aliasing=2 -fdiagnostics-show-option
#PhysX_release_common_cflags += -Wno-long-long
#PhysX_release_common_cflags += -Wno-unknown-pragmas -Wno-invalid-offsetof -Wno-uninitialized -Wno-attributes -Wno-unused-local-typedefs
#PhysX_release_common_cflags += -Wno-unused-parameter -Wno-missing-field-initializers -Wno-ignored-qualifiers
#PhysX_release_common_cflags += -O3 -fno-strict-aliasing
…so that they are not added to the mentioned ones (+ it seems this is mainly about optimisation flags)
and added the new ones as follow:
(MakeFile)
#default defines
[...]
CCLD = /usr/bin/clang++-3.9
CXX = /usr/bin/clang++-3.9
CC = /usr/bin/clang-3.9
[...]
PhysX_custom_cflags = -std=c++11 -fno-rtti -fno-exceptions -ffunction-sections -fdata-sections -Werror -ferror-limit=0 -Wall -Wextra -fstrict-aliasing -Wstrict-aliasing=2 -Weverything -Wno-documentation-deprecated-sync -Wno-documentation-unknown-command -Wno-float-equal -Wno-padded -Wno-weak-vtables -Wno-cast-align -Wno-conversion -Wno-missing-noreturn -Wno-missing-variable-declarations -Wno-shift-sign-overflow -Wno-covered-switch-default -Wno-exit-time-destructors -Wno-global-constructors -Wno-missing-prototypes -Wno-unreachable-code -Wno-unused-macros -Wno-unused-member-function -Wno-used-but-marked-unused -Wno-weak-template-vtables -Wno-deprecated -Wno-non-virtual-dtor -Wno-invalid-noreturn -Wno-return-type-c-linkage -Wno-reserved-id-macro -Wno-c++98-compat-pedantic -Wno-unused-local-typedef -Wno-old-style-cast -Wno-newline-eof -Wno-unused-private-field -Wno-undefined-func-template -Wno-format-nonliteral -Wno-implicit-fallthrough -Wno-undefined-reinterpret-cast -Wno-disabled-macro-expansion
# !!! Note I had to add these flags to make it compile !!!
PhysX_custom_cflags += -Wno-double-promotion -Wno-comma -Wno-documentation -Wno-unknown-pragmas -Wno-unused-parameter -Wno-undef -Wno-invalid-offsetof -Wno-extended-offsetof -Wno-header-hygiene -fPIC -Wno-expansion-to-defined -Wno-switch-enum -Wno-shadow-field-in-constructor
LowLevel_custom_cflags = ${PhysX_custom_cflags}
LowLevelCloth_custom_cflags = ${PhysX_custom_cflags}
PhysXCharacterKinematic_custom_cflags = ${PhysX_custom_cflags}
PhysXCommon_custom_cflags = ${PhysX_custom_cflags}
PhysXCooking_custom_cflags = ${PhysX_custom_cflags}
PhysXExtensions_custom_cflags = ${PhysX_custom_cflags}
PhysXProfileSDK_custom_cflags = ${PhysX_custom_cflags}
PhysXVehicle_custom_cflags = ${PhysX_custom_cflags}
PhysXVisualDebuggerSDK_custom_cflags = ${PhysX_custom_cflags}
PvdRuntime_custom_cflags = ${PhysX_custom_cflags}
PxTask_custom_cflags = ${PhysX_custom_cflags}
SceneQuery_custom_cflags = ${PhysX_custom_cflags}
SimulationController_custom_cflags = ${PhysX_custom_cflags}
But more interesting:
- Compiling PhysX SDK and my test project with GCC
Result: Failed.
- Compiling PhysX SDK and my test project with MSVC 2015 - Win 10, 64-bit (both Debug)
Result: Failed.
- Compiling PhysX SDK and my test project with MSVC 2015 - Win 10, 64-bit (both Release)
Result: Failed.
(I used PhysX 3.3.4 from the github repository)
In all cases it failed (with the exact same behavior – see screenshots) and I need this little tricks get/setFilterData…
Since it’s working on your side, I am a bit lost. Now I tested it on MSVC 2015, I see only few differences with your test:
- the graphics part
- the object behavior itself (In my case, A falls down on B, bounces, and stabilizes itself until ‘sleep’)
For the graphics part, I need to check again. I already found some errors (the biggest one was default rotation quat(0, 0, 0, 1) instead of quat(1, 0, 0, 0)) but nothing has resolved the issue. I will be available again next week, if you want I test something.
Thanks,
Lokfry