Skip to content

Commit 4030361

Browse files
committed
JPHPVD File Manager
1 parent d597d04 commit 4030361

File tree

4 files changed

+80
-6
lines changed

4 files changed

+80
-6
lines changed

Code/InspectorPlugin/CMakeLists.txt

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
ns_cmake_init()
22

3-
4-
53
# Get the name of this folder as the project name
64
get_filename_component(PROJECT_NAME ${CMAKE_CURRENT_SOURCE_DIR} NAME_WE)
75

Code/InspectorPlugin/JoltInterface/Internal/Implementation/JPHPCDFileManager.cpp

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
/*
2+
* Copyright (c) 2024-present Mikael K. Aboagye & WD Studios L.L.C.
3+
* All rights reserved.
4+
* This Project & Code is Licensed under the MIT License.
5+
*/
6+
7+
/*
8+
* JPHPVDFileManager.h
9+
*
10+
* JPHPVDFileManager is responsible for managing and writing data to a file.
11+
* It provides functions to write body, character, constraint, and soft body shape data.
12+
*/
13+
14+
#pragma once
15+
#include <InspectorPlugin/InspectorPluginDLL.h>
16+
#include <Foundation/Math/Math.h>
17+
#include <Jolt/Jolt.h>
18+
19+
class nsOSFile;
20+
class nsAbstractObjectGraph;
21+
22+
namespace JPH
23+
{
24+
class Body;
25+
class Character;
26+
class Constraint;
27+
class SoftBodyShape;
28+
}
29+
30+
namespace JDebug::API::IO
31+
{
32+
class NS_INSPECTORPLUGIN_DLL JPHPVDFileManager
33+
{
34+
public:
35+
/**
36+
* @brief Default constructor.
37+
*/
38+
JPHPVDFileManager() = default;
39+
40+
/**
41+
* @brief Constructor.
42+
* @param in_file The file to manage and write data to.
43+
*/
44+
explicit JPHPVDFileManager(const nsOSFile& in_file);
45+
46+
/**
47+
* @brief Destructor.
48+
*/
49+
virtual ~JPHPVDFileManager();
50+
51+
/**
52+
* @brief Writes body data to the file.
53+
* @param in_data The body data to write.
54+
*/
55+
void WriteBodyData(const JPH::Body& in_data);
56+
57+
/**
58+
* @brief Writes character data to the file.
59+
* @param in_data The character data to write.
60+
*/
61+
void WriteCharacterData(const JPH::Character& in_data);
62+
63+
/**
64+
* @brief Writes constraint data to the file.
65+
* @param in_data The constraint data to write.
66+
*/
67+
void WriteConstraintData(const JPH::Constraint& in_data);
68+
69+
/**
70+
* @brief Writes soft body shape data to the file.
71+
* @param in_data The soft body shape data to write.
72+
*/
73+
void WriteSoftBodyShapeData(const JPH::SoftBodyShape& in_data);
74+
private:
75+
nsAbstractObjectGraph* m_pGraph; ///< The object graph. this is used to write data to the file.
76+
};
77+
}

Code/ThirdParty/Jolt/CMakeLists.txt

+3-4
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,13 @@ ns_requires(NS_3RDPARTY_JOLT_SUPPORT)
55
# Get the name of this folder as the project name
66
get_filename_component(PROJECT_NAME ${CMAKE_CURRENT_SOURCE_DIR} NAME_WE)
77

8-
ns_create_target(LIBRARY ${PROJECT_NAME} NO_NS_PREFIX)
8+
ns_create_target(STATIC_LIBRARY ${PROJECT_NAME} NO_NS_PREFIX)
9+
910
if (NS_COMPILE_ENGINE_AS_DLL)
1011
target_compile_definitions(${PROJECT_NAME} PUBLIC JPH_SHARED_LIBRARY)
1112
target_compile_definitions(${PROJECT_NAME} PRIVATE JPH_BUILD_SHARED_LIBRARY)
1213
endif()
13-
if(NS_CMAKE_PLATFORM_PLAYSTATION_5)
14-
target_compile_definitions(${PROJECT_NAME} PUBLIC JPH_PLATFORM_BLUE)
15-
endif()
14+
1615
target_compile_definitions(${PROJECT_NAME} PUBLIC BUILDSYSTEM_ENABLE_JOLT_SUPPORT JPH_DEBUG_RENDERER)
1716

1817
target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_LIST_DIR})

0 commit comments

Comments
 (0)