Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to build and run for Visual Studio 22 #2

Open
erichederstedt opened this issue Feb 16, 2024 · 0 comments
Open

How to build and run for Visual Studio 22 #2

erichederstedt opened this issue Feb 16, 2024 · 0 comments

Comments

@erichederstedt
Copy link

erichederstedt commented Feb 16, 2024

Requirements: CMake, Git, Python(3.12.2 worked for me)

  1. Open up cmd in the directory you want to download the project to.
  2. Execute these commands:
git clone --recursive https://github.com/diharaw/physx-ragdoll.git
cd physx-ragdoll
mkdir build
cd build
cmake -G "Visual Studio 17" ..
  1. Go down into "physx-ragdoll/external/PhysX/physx/buildtools/presets/public" and create a file called vc17win64.xml containing the following:
<?xml version="1.0" encoding="utf-8"?>
<preset name="vc17win64" comment="VC17 Win64 PhysX general settings">
  <platform targetPlatform="win64" compiler="vc17" />
  <CMakeSwitches>
    <cmakeSwitch name="PX_BUILDSNIPPETS" value="True" comment="Generate the snippets" />
    <cmakeSwitch name="PX_BUILDPUBLICSAMPLES" value="True" comment="Generate the samples projects" />
    <cmakeSwitch name="PX_GENERATE_STATIC_LIBRARIES" value="False" comment="Generate static libraries" />
    <cmakeSwitch name="NV_USE_STATIC_WINCRT" value="False" comment="Use the statically linked windows CRT" />
    <cmakeSwitch name="NV_USE_DEBUG_WINCRT" value="True" comment="Use the debug version of the CRT" />
    <cmakeSwitch name="PX_FLOAT_POINT_PRECISE_MATH" value="False" comment="Float point precise math" />
  </CMakeSwitches>
  <CMakeParams>
    <cmakeParam name="CMAKE_INSTALL_PREFIX" value="install/vc15win64/PhysX" comment="Install path relative to PhysX SDK root" />
  </CMakeParams>
</preset>
  1. Go back up to "physx-ragdoll/external/PhysX/physx" and run the generate_projects.bat file selecting vc17win64 which is the one we added.

  2. Open the physx solution in "physx-ragdoll/external/PhysX/physx/compiler/vc17win64" and build.

  3. If you get an error about typeinfo.h not existing just turn the #include <typeinfo.h> into #include <typeinfo> and compile again.

  4. Head into "physx-ragdoll/external/PhysX/physx/bin/win.x86_64.vc142.md/debug/" copy the DLLs into "physx-ragdoll/bin/Debug".

  5. Open up the "physx-ragdoll/build/PhysXRagdoll.sln" solution and set the PhysXRagdoll project as startup.

  6. In main.cpp add the following lines:

#pragma comment(lib, "INSERT_YOUR_ABSOLUTE_PATH_HERE/physx-ragdoll/external/PhysX/physx/bin/win.x86_64.vc142.md/debug/PhysX_64.lib")
#pragma comment(lib, "INSERT_YOUR_ABSOLUTE_PATH_HERE/physx-ragdoll/external/PhysX/physx/bin/win.x86_64.vc142.md/debug/PhysXCommon_64.lib")
#pragma comment(lib, "INSERT_YOUR_ABSOLUTE_PATH_HERE/physx-ragdoll/external/PhysX/physx/bin/win.x86_64.vc142.md/debug/PhysXCooking_64.lib")
#pragma comment(lib, "INSERT_YOUR_ABSOLUTE_PATH_HERE/physx-ragdoll/external/PhysX/physx/bin/win.x86_64.vc142.md/debug/PhysXFoundation_64.lib")
#pragma comment(lib, "INSERT_YOUR_ABSOLUTE_PATH_HERE/physx-ragdoll/external/PhysX/physx/bin/win.x86_64.vc142.md/debug/PhysXExtensions_static_64.lib")
#pragma comment(lib, "INSERT_YOUR_ABSOLUTE_PATH_HERE/physx-ragdoll/external/PhysX/physx/bin/win.x86_64.vc142.md/debug/PhysXPvdSDK_static_64.lib")
#pragma comment(lib, "INSERT_YOUR_ABSOLUTE_PATH_HERE/physx-ragdoll/external/PhysX/physx/bin/win.x86_64.vc142.md/debug/PhysXCharacterKinematic_static_64.lib")

(If you actually know how to use cmake you can probably add them to be linked properly)
10. You should be able to compile at this point.
11. Head over to mixamo and download the Paladin J Nordstrom character, rename it to paladin.fbx and move it into "physx-ragdoll/bin/Debug/mesh"

You should be good to run the physxragdoll project from there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant