Building the engine with Physx Enabled

Hi,

Unfortunately, I am having trouble with Chaos, just to give a small feedback, it seems not ready, not using things like CCD, having not so good performance and for the love of god, I can’t understand Epic removing features from the engine when there are no better alternatives or no alternatives at all (Looking at Physx, looking at Tesselation).

Back to the topic, I am trying to build UE5 with Physx which the code is still contained in the engine and can be opted in with macros.

The only tip I could find in this regard is a tutorial to build UE4.26 with Chaos, which is about adding bUseChaos in the EditorTarget. However doing this left me with some compilation errors which all seem like modules still trying to target Physx for what they do.

So the short question is, how do I build the engine, using Physx as the Physics Engine?

Below are the compilation errors that I have:

  SQAccelerator.cpp(342): [C2065] 'FSweepHit': undeclared identifier
  SQAccelerator.cpp(179): [C2065] see reference to function template instantiation 'bool TSQVisitor<Chaos::TSphere<Chaos::FReal,3>,Chaos::FAccelerationStructureHandle,ChaosInterface::FRaycastHit>::Visit<TSQVisitor<Chaos::TSphere<Chaos::FReal,3>,Chaos::FAccelerationStructureHandle,ChaosInterface::FRaycastHit>::ESQType::Overlap>(const Chaos::TSpatialVisitorData<Chaos::FAccelerationStructureHandle> &,Chaos::FQueryFastData *)' being compiled
  SQAccelerator.cpp(179): [C2065] see reference to function template instantiation 'bool TSQVisitor<Chaos::TSphere<Chaos::FReal,3>,Chaos::FAccelerationStructureHandle,ChaosInterface::FRaycastHit>::Visit<TSQVisitor<Chaos::TSphere<Chaos::FReal,3>,Chaos::FAccelerationStructureHandle,ChaosInterface::FRaycastHit>::ESQType::Overlap>(const Chaos::TSpatialVisitorData<Chaos::FAccelerationStructureHandle> &,Chaos::FQueryFastData *)' being compiled
  SQAccelerator.cpp(178): [C2065] while compiling class template member function 'bool TSQVisitor<Chaos::TSphere<Chaos::FReal,3>,Chaos::FAccelerationStructureHandle,ChaosInterface::FRaycastHit>::Overlap(const Chaos::TSpatialVisitorData<Chaos::FAccelerationStructureHandle> &)'
  SQAccelerator.cpp(592): [C2065] see reference to class template instantiation 'TSQVisitor<Chaos::TSphere<Chaos::FReal,3>,Chaos::FAccelerationStructureHandle,ChaosInterface::FRaycastHit>' being compiled

And these are the Editor settings:

public class UnrealEditorTarget : TargetRules
{
	public UnrealEditorTarget( TargetInfo Target ) : base(Target)
	{
		Type = TargetType.Editor;
		BuildEnvironment = TargetBuildEnvironment.Shared;
		bUseChaos = false;
		bCompileChaos = false;
		bCompilePhysX = true;
		bBuildAllModules = true;
		ExtraModuleNames.Add("UnrealGame");
	}
}

1 Like

Hi. Had you found the solution? If so, could you share how i should build 4.27 with PhysX?

I gave up shortly after. Sorry.

Yeah, i remember when ue 5 with the Nanite technology arrived, i were willing to make cool cinematic simulation, but found out that PhysX became depricated.

Anyway I asked because i want to build ue 4.27, as i had read on forums it is possible to do so, but i’m not sure if PhysX is enabled by default.

For now just debugging some errors to successful build. Had some issues with dependencies.

Nice to see people are active here. Didn’t expect you to answer so quickly.