I’m making a Unity plugin to integrate some components of Nvidia Blast, and I’m running into trouble when initializing PhysX through the plugin. Essentially I’m using the same initialization code in the initPhysX method in Nvidia Blasts’s Authoring application:
gFoundation = PxCreateFoundation(PX_FOUNDATION_VERSION, NvBlastGetPxAllocatorCallback(), NvBlastGetPxErrorCallback());
if(!gFoundation) {
return false;
}
physx::PxTolerancesScale scale;
gPhysics = PxCreatePhysics(PX_PHYSICS_VERSION, *gFoundation, scale, true);
if(!gPhysics) {
return false;
}
physx::PxCookingParams cookingParams(scale);
cookingParams.buildGPUData = true;
gCooking = PxCreateCooking(PX_PHYSICS_VERSION, gPhysics->getFoundation(), cookingParams);
if(!gCooking) {
return false;
}
return true;
Here is the relavent stacktrace when it crashes (in Unity as a native plugin):
0x00007FFF4F543FB8 (KERNELBASE) RaiseException
0x00007FFEF1B1232C (PhysX3DEBUG_x64) physx::PxCreateSpatialIndex
0x00007FFEF1B10710 (PhysX3DEBUG_x64) physx::PxCreateSpatialIndex
0x00007FFEF17BECC4 (PhysX3DEBUG_x64) physx::PxCreateSpatialIndex
0x00007FFEF17BF60D (PhysX3DEBUG_x64) physx::PxCreateSpatialIndex
0x00007FFEF17E8B31 (PhysX3DEBUG_x64) physx::PxCreateSpatialIndex
0x00007FFEF17E81BA (PhysX3DEBUG_x64) physx::PxCreateSpatialIndex
0x00007FFF22B92A05 (Fractre) [c:\nvidia\packman-repo\physx-vc14win64\3.4.23426887\physx_3.4\include\pxphysics.h:828] PxCreatePhysics
0x00007FFF22B93209 (Fractre) [c:\users\jesse\documents\github\blast\compiler\fractre\fractre.cpp:53] Initialize
0x0000000038A7155E (Mono JIT Code) (wrapper managed-to-native) JesseStiller.FractrePlugin.Fractre:Initialize ()
0x0000000038A702C3 (Mono JIT Code) [C:\Users\Jesse\Documents\GitHub\MarbleDepths\Assets\Fractre\Editor\FractreWindow.cs:68] JesseStiller.FractrePlugin.FractreWindow:OnEnable ()
Any ideas what must be going on? For all I can see I am initializing everything the same way the Blast authoring app, so I am not sure what’s wrong.