Linking Bullet Physics with Unreal Engine 4

I’m trying to insert Bullet Physics engine in UE, but I’ve encoutered your same problems, Now I’ve found this thread and after some tests I’ve few questions.

As you described, I’m importing the Bullet’s source code (/bullet3/src) to engine source code third party library path: /UnrealEngine/Engine/Source/ThirdParty/Bullet/bullet3/src

then I’ve created Bullet.Build.cs file that is:


using System.IO;
using System;
using UnrealBuildTool;

public class Bullet : ModuleRules
{

    public Bullet(ReadOnlyTargetRules Target) : base(Target)
    {

        string BulletBaseDir = UEBuildConfiguration.UEThirdPartySourceDirectory + "Bullet/";


            string IncludePath = BulletBaseDir + "bullet3/src/";

            PublicIncludePaths.AddRange(new string] { IncludePath + "Bullet3Common", IncludePath + "etc..." });
    }
}

When I try to build UE4 I get this error for each cpp file:
>D:\WorkSpace\GitHubProjects\UE_4.16\UnrealEngine\Engine\Source\ThirdParty\Bullet\bullet3\src\BulletSoftBody\btSoftBody.cpp(1): error : Expected btSoftBody.h to be first header included.

I’ve tryed to include in each cpp file #include “ProjectsPrecompiledHeader.h” as you written above, but it return always the same error.

How do you have resolved this problem?

However thanks for this thread!!

1 Like