Networked Physics with PhysX

I’m just trying this for now. Most annoyingly, it seems like I can’t get the relevant headers for PhysX unless I compile the engine from source. Binary build fails because it cna’t find Px.h. Soo irritating.



	// Now Simulate the PhysX Scene
	FPhysScene* Scene = GetWorld()->GetPhysicsScene();
	if (Scene)
	{
		PxScene* WorldPxScene = Scene->GetPhysXScene(PST_Sync);

		// Scratch Buffers
		UPhysicsSettings* Settings = UPhysicsSettings::Get();
		ASSERTV(Settings != nullptr, TEXT("Invalid Physics Settings"));

		int32 SceneScratchBufferSize = Settings->SimulateScratchMemorySize;
		if (SceneScratchBufferSize > 0)
		{
			// Temporary Scratch Buffer
			uint8* Buffer = (uint8*)FMemory::Malloc(SceneScratchBufferSize, 16);

			WorldPxScene->simulate(InMove->MoveDeltaTime, nullptr, Buffer, SceneScratchBufferSize, true);
			WorldPxScene->fetchResults(true);

			// Free the Scratch Buffer
			FMemory::Free(Buffer);
		}
	}


really don’t want to switch to a non-launcher build for this…