PxConvexFlags;
+PX_FLAGS_OPERATORS(PxConvexFlag::Enum,PxU16)
+
+/**
+\brief Descriptor class for #PxConvexMesh.
+\note The number of vertices and the number of convex polygons in a cooked convex mesh is limited to 256.
+\note The number of vertices and the number of convex polygons in a GPU compatible convex mesh is limited to 64,
+and the number of faces per vertex is limited to 32.
+
+\see PxConvexMesh PxConvexMeshGeometry PxShape PxPhysics.createConvexMesh()
+
+*/
+class PxConvexMeshDesc
+{
+public:
+
+ /**
+ \brief Vertex positions data in PxBoundedData format.
+
+ Default: NULL
+ */
+ PxBoundedData points;
+
+ /**
+ \brief Polygons data in PxBoundedData format.
+ Pointer to first polygon.
+
+ Default: NULL
+
+ \see PxHullPolygon
+ */
+ PxBoundedData polygons;
+
+ /**
+ \brief Polygon indices data in PxBoundedData format.
+ Pointer to first index.
+
+ Default: NULL
+
+ This is declared as a void pointer because it is actually either an PxU16 or a PxU32 pointer.
+
+ \see PxHullPolygon PxConvexFlag::e16_BIT_INDICES
+ */
+ PxBoundedData indices;
+
+ /**
+ \brief Flags bits, combined from values of the enum ::PxConvexFlag
+
+ Default: 0
+ */
+ PxConvexFlags flags;
+
+ /**
+ \brief Limits the number of vertices of the result convex mesh. Hard maximum limit is 255
+ and minimum limit is 4 if PxConvexFlag::ePLANE_SHIFTING is used, otherwise the minimum
+ limit is 8.
+
+ \note The please see PxConvexFlag::ePLANE_SHIFTING for algorithm explanation
+ \note The maximum limit for GPU compatible convex meshes is 64.
+
+ \see PxConvexFlag::ePLANE_SHIFTING
+
+ Range: [4, 255]
+ Default: 255
+ */
+ PxU16 vertexLimit;
+
+ /**
+ \brief Limits the number of polygons of the result convex mesh. Hard maximum limit is 255
+ and minimum limit is 4.
+
+ \note The maximum limit for GPU compatible convex meshes is 64.
+
+ Range: [4, 255]
+ Default: 255
+ */
+ PxU16 polygonLimit;
+
+ /**
+ \brief Maximum number of vertices after quantization. The quantization is done during the vertex cleaning phase.
+ The quantization is applied when PxConvexFlag::eQUANTIZE_INPUT is specified.
+
+ \see PxConvexFlag::eQUANTIZE_INPUT
+
+ Range: [4, 65535]
+ Default: 255
+ */
+ PxU16 quantizedCount;
+
+ /**
+ \brief SDF descriptor. When this descriptor is set, signed distance field is calculated for this convex mesh.
+
+ Default: NULL
+ */
+ PxSDFDesc* sdfDesc;
+
+ /**
+ \brief constructor sets to default.
+ */
+ PX_INLINE PxConvexMeshDesc();
+ /**
+ \brief (re)sets the structure to the default.
+ */
+ PX_INLINE void setToDefault();
+
+
+ /**
+ \brief Returns true if the descriptor is valid.
+
+ \return True if the current settings are valid
+ */
+ PX_INLINE bool isValid() const;
+};
+
+PX_INLINE PxConvexMeshDesc::PxConvexMeshDesc() //constructor sets to default
+: vertexLimit(255), polygonLimit(255), quantizedCount(255), sdfDesc(NULL)
+{
+
+}
+
+PX_INLINE void PxConvexMeshDesc::setToDefault()
+{
+ *this = PxConvexMeshDesc();
+}
+
+PX_INLINE bool PxConvexMeshDesc::isValid() const
+{
+ // Check geometry
+ if(points.count < 3 || //at least 1 trig's worth of points
+ (points.count > 0xffff && flags & PxConvexFlag::e16_BIT_INDICES))
+ return false;
+ if(!points.data)
+ return false;
+ if(points.stride < sizeof(PxVec3)) //should be at least one point's worth of data
+ return false;
+ if (quantizedCount < 4)
+ return false;
+
+ // Check topology
+ if(polygons.data)
+ {
+ if(polygons.count < 4) // we require 2 neighbors for each vertex - 4 polygons at least
+ return false;
+
+ if(!indices.data) // indices must be provided together with polygons
+ return false;
+
+ PxU32 limit = (flags & PxConvexFlag::e16_BIT_INDICES) ? sizeof(PxU16) : sizeof(PxU32);
+ if(indices.stride < limit)
+ return false;
+
+ limit = sizeof(PxHullPolygon);
+ if(polygons.stride < limit)
+ return false;
+ }
+ else
+ {
+ // We can compute the hull from the vertices
+ if(!(flags & PxConvexFlag::eCOMPUTE_CONVEX))
+ return false; // If the mesh is convex and we're not allowed to compute the hull,
+ // you have to provide it completely (geometry & topology).
+ }
+
+ if((flags & PxConvexFlag::ePLANE_SHIFTING) && vertexLimit < 4)
+ {
+ return false;
+ }
+
+ if (!(flags & PxConvexFlag::ePLANE_SHIFTING) && vertexLimit < 8)
+ {
+ return false;
+ }
+
+ if(vertexLimit > 255)
+ {
+ return false;
+ }
+
+ if (polygonLimit < 4)
+ {
+ return false;
+ }
+
+ if (polygonLimit > 255)
+ {
+ return false;
+ }
+
+ if (sdfDesc && !sdfDesc->isValid())
+ {
+ return false;
+ }
+
+ return true;
+}
+
+#if !PX_DOXYGEN
+} // namespace physx
+#endif
+
+#endif
diff --git a/Jusin154_Team3D/Engine/Public/PhysX/cooking/PxCooking.h b/Jusin154_Team3D/Engine/Public/PhysX/cooking/PxCooking.h
new file mode 100644
index 000000000..4bfef7c9c
--- /dev/null
+++ b/Jusin154_Team3D/Engine/Public/PhysX/cooking/PxCooking.h
@@ -0,0 +1,908 @@
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// * Neither the name of NVIDIA CORPORATION nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
+// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// Copyright (c) 2008-2025 NVIDIA Corporation. All rights reserved.
+// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
+// Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
+
+#ifndef PX_COOKING_H
+#define PX_COOKING_H
+#include "common/PxPhysXCommonConfig.h"
+#include "common/PxTolerancesScale.h"
+#include "cooking/Pxc.h"
+
+#include "cooking/PxConvexMeshDesc.h"
+#include "cooking/PxTriangleMeshDesc.h"
+#include "cooking/PxTetrahedronMeshDesc.h"
+#include "cooking/PxMidphaseDesc.h"
+#include "cooking/PxBVHDesc.h"
+#include "geometry/PxTriangleMesh.h"
+#include "geometry/PxTetrahedronMesh.h"
+#include "geometry/PxBVH.h"
+
+#if !PX_DOXYGEN
+namespace physx
+{
+#endif
+
+class PxInsertionCallback;
+class PxFoundation;
+class PxAllocatorCallback;
+class PxHeightFieldDesc;
+
+/**
+\brief Result from convex cooking.
+*/
+struct PxConvexMeshCookingResult
+{
+ enum Enum
+ {
+ /**
+ \brief Convex mesh cooking succeeded.
+ */
+ eSUCCESS,
+
+ /**
+ \brief Convex mesh cooking failed, algorithm couldn't find 4 initial vertices without a small triangle.
+
+ \see PxCookingParams::areaTestEpsilon PxConvexFlag::eCHECK_ZERO_AREA_TRIANGLES
+ */
+ eZERO_AREA_TEST_FAILED,
+
+ /**
+ \brief Convex mesh cooking succeeded, but the algorithm has reached the 255 polygons limit.
+ The produced hull does not contain all input vertices. Try to simplify the input vertices
+ or try to use the eINFLATE_CONVEX or the eQUANTIZE_INPUT flags.
+
+ \see PxConvexFlag::eINFLATE_CONVEX PxConvexFlag::eQUANTIZE_INPUT
+ */
+ ePOLYGONS_LIMIT_REACHED,
+
+ /**
+ \brief Something unrecoverable happened. Check the error stream to find out what.
+ */
+ eFAILURE,
+
+ /**
+ \brief Convex mesh cooking succeeded, but the algorithm could not make the mesh GPU compatible because the
+ in-sphere radius is more than 100x smaller than the largest extent. Collision detection for any pair involving
+ this convex mesh will fall back to CPU.
+ */
+ eNON_GPU_COMPATIBLE
+ };
+};
+
+/** \brief Enumeration for convex mesh cooking algorithms. */
+struct PxConvexMeshCookingType
+{
+ enum Enum
+ {
+ /**
+ \brief The Quickhull algorithm constructs the hull from the given input points. The resulting hull
+ will only contain a subset of the input points.
+
+ */
+ eQUICKHULL
+ };
+};
+
+/**
+\brief Result from triangle mesh cooking
+*/
+struct PxTriangleMeshCookingResult
+{
+ enum Enum
+ {
+ /**
+ \brief Everything is A-OK.
+ */
+ eSUCCESS = 0,
+
+ /**
+ \brief A triangle is too large for well-conditioned results. Tessellate the mesh for better behavior, see the user guide section on cooking for more details.
+ */
+ eLARGE_TRIANGLE,
+
+ /**
+ \brief The mesh cleaning operation removed all triangles, resulting in an empty mesh.
+ */
+ eEMPTY_MESH,
+
+ /**
+ \brief Something unrecoverable happened. Check the error stream to find out what.
+ */
+ eFAILURE
+ };
+};
+
+/**
+\brief Enum for the set of mesh pre-processing parameters.
+*/
+struct PxMeshPreprocessingFlag
+{
+ enum Enum
+ {
+ /**
+ \brief When set, mesh welding is performed. See PxCookingParams::meshWeldTolerance. Mesh cleaning must be enabled.
+ */
+ eWELD_VERTICES = 1 << 0,
+
+ /**
+ \brief When set, mesh cleaning is disabled. This makes cooking faster.
+
+ When mesh cleaning is disabled, mesh welding is also disabled.
+
+ It is recommended to use only meshes that passed during validateTriangleMesh.
+ */
+ eDISABLE_CLEAN_MESH = 1 << 1,
+
+ /**
+ \brief When set, active edges are not computed and just enabled for all edges. This makes cooking faster but contact generation slower.
+ */
+ eDISABLE_ACTIVE_EDGES_PRECOMPUTE = 1 << 2,
+
+ /**
+ \brief When set, 32-bit indices will always be created regardless of triangle count.
+
+ \note By default mesh will be created with 16-bit indices for triangle count <= 0xFFFF and 32-bit otherwise.
+ */
+ eFORCE_32BIT_INDICES = 1 << 3,
+
+ /**
+ \brief When set, a list of triangles will be created for each associated vertex in the mesh.
+ */
+ eENABLE_VERT_MAPPING = 1 << 4,
+
+ /**
+ \brief When set, inertia data is calculated for the mesh, assuming unit density.
+ */
+ eENABLE_INERTIA = 1 << 5
+ };
+};
+
+typedef PxFlags PxMeshPreprocessingFlags;
+
+/**
+\brief Structure describing parameters affecting mesh cooking.
+
+\see PxSetCookingParams() PxGetCookingParams()
+*/
+struct PxCookingParams
+{
+ /**
+ \brief Zero-size area epsilon used in convex hull computation.
+
+ If the area of a triangle of the hull is below this value, the triangle will be rejected. This test
+ is done only if PxConvexFlag::eCHECK_ZERO_AREA_TRIANGLES is used.
+
+ \see PxConvexFlag::eCHECK_ZERO_AREA_TRIANGLES
+
+ Default value: 0.06f*PxTolerancesScale.length*PxTolerancesScale.length
+
+ Range: (0.0f, PX_MAX_F32)
+ */
+ float areaTestEpsilon;
+
+ /**
+ \brief Plane tolerance used in convex hull computation.
+
+ The value is used during hull construction. When a new point is about to be added to the hull it
+ gets dropped when the point is closer to the hull than the planeTolerance. The planeTolerance
+ is increased according to the hull size.
+
+ If 0.0f is set all points are accepted when the convex hull is created. This may lead to edge cases
+ where the new points may be merged into an existing polygon and the polygons plane equation might
+ slightly change therefore. This might lead to failures during polygon merging phase in the hull computation.
+
+ It is recommended to use the default value, however if it is required that all points needs to be
+ accepted or huge thin convexes are created, it might be required to lower the default value.
+
+ \note The plane tolerance is used only within PxConvexMeshCookingType::eQUICKHULL algorithm.
+
+ Default value: 0.0007f
+
+ Range: <0.0f, PX_MAX_F32)
+ */
+ float planeTolerance;
+
+ /**
+ \brief Convex hull creation algorithm.
+
+ Default value: PxConvexMeshCookingType::eQUICKHULL
+
+ \see PxConvexMeshCookingType
+ */
+ PxConvexMeshCookingType::Enum convexMeshCookingType;
+
+ /**
+ \brief When true, the face remap table is not created. This saves a significant amount of memory, but the SDK will
+ not be able to provide the remap information for internal mesh triangles returned by collisions,
+ sweeps or raycasts hits.
+
+ Default value: false
+ */
+ bool suppressTriangleMeshRemapTable;
+
+ /**
+ \brief When true, the triangle adjacency information is created. You can get the adjacency triangles
+ for a given triangle from getTriangle.
+
+ Default value: false
+ */
+ bool buildTriangleAdjacencies;
+
+ /**
+ \brief When true, additional information required for GPU-accelerated rigid body simulation is created. This can increase memory usage and cooking times for convex meshes and triangle meshes.
+
+ Default value: false
+ */
+ bool buildGPUData;
+
+ /**
+ \brief Tolerance scale is used to check if cooked triangles are not too huge. This check will help with simulation stability.
+
+ \note The PxTolerancesScale values have to match the values used when creating a PxPhysics or PxScene instance.
+
+ \see PxTolerancesScale
+ */
+ PxTolerancesScale scale;
+
+ /**
+ \brief Mesh pre-processing parameters. Used to control options like whether the mesh cooking performs vertex welding before cooking.
+
+ Default value: 0
+ */
+ PxMeshPreprocessingFlags meshPreprocessParams;
+
+ /**
+ \brief Mesh weld tolerance. If mesh welding is enabled, this controls the distance at which vertices are welded.
+ If mesh welding is not enabled, this value defines the acceptance distance for mesh validation. Provided no two vertices are within this distance, the mesh is considered to be
+ clean. If not, a warning will be emitted. Having a clean, welded mesh is required to achieve the best possible performance.
+
+ The default vertex welding uses a snap-to-grid approach. This approach effectively truncates each vertex to integer values using meshWeldTolerance.
+ Once these snapped vertices are produced, all vertices that snap to a given vertex on the grid are remapped to reference a single vertex. Following this,
+ all triangles' indices are remapped to reference this subset of clean vertices. It should be noted that the vertices that we do not alter the
+ position of the vertices; the snap-to-grid is only performed to identify nearby vertices.
+
+ The mesh validation approach also uses the same snap-to-grid approach to identify nearby vertices. If more than one vertex snaps to a given grid coordinate,
+ we ensure that the distance between the vertices is at least meshWeldTolerance. If this is not the case, a warning is emitted.
+
+ Default value: 0.0
+ */
+ PxReal meshWeldTolerance;
+
+ /**
+ \brief "Zero-area" epsilon used in mesh cleaning.
+
+ This is similar to areaTestEpsilon, but for the mesh cleaning operation.
+
+ If the area of a triangle is below this value, the triangle will be removed. This is only done when mesh cleaning is enabled,
+ i.e. when PxMeshPreprocessingFlag::eDISABLE_CLEAN_MESH is not set.
+
+ Default value is 0.0f to be consistent with previous PhysX versions, which only removed triangles whose area
+ was exactly zero.
+
+ \see PxMeshPreprocessingFlag::eDISABLE_CLEAN_MESH
+
+ Default value: 0.0f
+
+ Range: (0.0f, PX_MAX_F32)
+ */
+ PxReal meshAreaMinLimit;
+
+ /**
+ \brief Maximum edge length.
+
+ If an edge of a triangle is above this value, a warning is sent to the error stream. This is only a check,
+ corresponding triangles are not removed.
+
+ This is only done when mesh cleaning is enabled, i.e. when PxMeshPreprocessingFlag::eDISABLE_CLEAN_MESH is not set.
+
+ Default value is 500.0f to be consistent with previous PhysX versions. This value is internally multiplied by
+ PxTolerancesScale::length before being used. Use 0.0f to disable the checks.
+
+ \see PxMeshPreprocessingFlag::eDISABLE_CLEAN_MESH
+
+ Default value: 500.0f
+
+ Range: (0.0f, PX_MAX_F32)
+ */
+ PxReal meshEdgeLengthMaxLimit;
+
+ /**
+ \brief Controls the desired midphase desc structure for triangle meshes.
+
+ \see PxBVH33MidphaseDesc, PxBVH34MidphaseDesc, PxMidphaseDesc
+
+ Default value: PxMeshMidPhase::eBVH34
+ */
+ PxMidphaseDesc midphaseDesc;
+
+ /**
+ \brief Vertex limit beyond which additional acceleration structures are computed for each convex mesh. Increase that limit to reduce memory usage.
+ Computing the extra structures all the time does not guarantee optimal performance. There is a per-platform break-even point below which the
+ extra structures actually hurt performance.
+
+ Default value: 32
+ */
+ PxU32 gaussMapLimit;
+
+ /**
+ \brief Maximum mass ratio allowed on vertices touched by a single tet. If a any tetrahedron exceeds the mass ratio, the masses will get smoothed locally
+ until the maximum mass ratio is matched. Value should not be below 1. Smoothing might not fully converge for values <1.5. The smaller the maximum
+ allowed ratio, the better the stability during simulation.
+
+ Default value: FLT_MAX
+ */
+ PxReal maxWeightRatioInTet;
+
+ PxCookingParams(const PxTolerancesScale& sc):
+ areaTestEpsilon (0.06f*sc.length*sc.length),
+ planeTolerance (0.0007f),
+ convexMeshCookingType (PxConvexMeshCookingType::eQUICKHULL),
+ suppressTriangleMeshRemapTable (false),
+ buildTriangleAdjacencies (false),
+ buildGPUData (false),
+ scale (sc),
+ meshPreprocessParams (0),
+ meshWeldTolerance (0.0f),
+ meshAreaMinLimit (0.0f),
+ meshEdgeLengthMaxLimit (500.0f),
+ gaussMapLimit (32),
+ maxWeightRatioInTet (FLT_MAX)
+ {
+ }
+};
+
+#if !PX_DOXYGEN
+} // namespace physx
+#endif
+
+// Immediate cooking
+
+/**
+\brief Gets standalone object insertion interface.
+
+This interface allows the creation of standalone objects that can exist without a PxPhysics or PxScene object.
+
+\see PxCreateTriangleMesh PxCreateHeightfield PxCreateTetrahedronMesh PxCreateBVH
+*/
+PX_C_EXPORT PX_PHYSX_COOKING_API physx::PxInsertionCallback* PxGetStandaloneInsertionCallback();
+
+// ==== BVH ====
+
+/**
+\brief Cooks a bounding volume hierarchy. The results are written to the stream.
+
+PxCookBVH() allows a BVH description to be cooked into a binary stream
+suitable for loading and performing BVH detection at runtime.
+
+\param[in] desc The BVH descriptor.
+\param[in] stream User stream to output the cooked data.
+\return true on success.
+
+\see PxBVH PxRigidActorExt::getRigidActorShapeLocalBoundsList
+*/
+PX_C_EXPORT PX_PHYSX_COOKING_API bool PxCookBVH(const physx::PxBVHDesc& desc, physx::PxOutputStream& stream);
+
+/**
+\brief Cooks and creates a bounding volume hierarchy without going through a stream.
+
+\note This method does the same as PxCookBVH, but the produced BVH is not stored
+into a stream but is either directly inserted in PxPhysics, or created as a standalone
+object. Use this method if you are unable to cook offline.
+
+\note PxInsertionCallback can be obtained through PxPhysics::getPhysicsInsertionCallback()
+or PxGetStandaloneInsertionCallback().
+
+\param[in] desc The BVH descriptor.
+\param[in] insertionCallback The insertion interface.
+\return PxBVH pointer on success
+
+\see PxCookBVH() PxInsertionCallback
+*/
+PX_C_EXPORT PX_PHYSX_COOKING_API physx::PxBVH* PxCreateBVH(const physx::PxBVHDesc& desc, physx::PxInsertionCallback& insertionCallback);
+
+/**
+\brief Cooks and creates a bounding volume hierarchy without going through a stream. Convenience function for standalone objects.
+
+\note This method does the same as PxCookBVH, but the produced BVH is not stored
+into a stream but is either directly inserted in PxPhysics, or created as a standalone
+object. Use this method if you are unable to cook offline.
+
+\param[in] desc The BVH descriptor.
+\return PxBVH pointer on success
+
+\see PxCookBVH() PxInsertionCallback
+*/
+PX_FORCE_INLINE physx::PxBVH* PxCreateBVH(const physx::PxBVHDesc& desc)
+{
+ return PxCreateBVH(desc, *PxGetStandaloneInsertionCallback());
+}
+
+// ==== Heightfield ====
+
+/**
+\brief Cooks a heightfield. The results are written to the stream.
+
+To create a heightfield object there is an option to precompute some of calculations done while loading the heightfield data.
+
+PxCookHeightField() allows a heightfield description to be cooked into a binary stream
+suitable for loading and performing collision detection at runtime.
+
+\param[in] desc The heightfield descriptor to read the HF from.
+\param[in] stream User stream to output the cooked data.
+\return true on success
+
+\see PxPhysics.createHeightField()
+*/
+PX_C_EXPORT PX_PHYSX_COOKING_API bool PxCookHeightField(const physx::PxHeightFieldDesc& desc, physx::PxOutputStream& stream);
+
+/**
+\brief Cooks and creates a heightfield mesh and inserts it into PxPhysics.
+
+\param[in] desc The heightfield descriptor to read the HF from.
+\param[in] insertionCallback The insertion interface from PxPhysics.
+\return PxHeightField pointer on success
+
+\see PxCookHeightField() PxPhysics.createHeightField() PxInsertionCallback
+*/
+PX_C_EXPORT PX_PHYSX_COOKING_API physx::PxHeightField* PxCreateHeightField(const physx::PxHeightFieldDesc& desc, physx::PxInsertionCallback& insertionCallback);
+
+/**
+\brief Cooks and creates a heightfield mesh and inserts it into PxPhysics. Convenience function for standalone objects.
+
+\param[in] desc The heightfield descriptor to read the HF from.
+\return PxHeightField pointer on success
+
+\see PxCookHeightField() PxPhysics.createHeightField() PxInsertionCallback
+*/
+PX_FORCE_INLINE physx::PxHeightField* PxCreateHeightField(const physx::PxHeightFieldDesc& desc)
+{
+ return PxCreateHeightField(desc, *PxGetStandaloneInsertionCallback());
+}
+
+// ==== Convex meshes ====
+
+/**
+\brief Cooks a convex mesh. The results are written to the stream.
+
+To create a triangle mesh object it is necessary to first 'cook' the mesh data into
+a form which allows the SDK to perform efficient collision detection.
+
+PxCookConvexMesh() allows a mesh description to be cooked into a binary stream
+suitable for loading and performing collision detection at runtime.
+
+\note The number of vertices and the number of convex polygons in a cooked convex mesh is limited to 255.
+\note If those limits are exceeded in either the user-provided data or the final cooked mesh, an error is reported.
+
+\param[in] params The cooking parameters
+\param[in] desc The convex mesh descriptor to read the mesh from.
+\param[in] stream User stream to output the cooked data.
+\param[out] condition Result from convex mesh cooking.
+\return true on success.
+
+\see PxCookTriangleMesh() PxConvexMeshCookingResult::Enum
+*/
+PX_C_EXPORT PX_PHYSX_COOKING_API bool PxCookConvexMesh(const physx::PxCookingParams& params, const physx::PxConvexMeshDesc& desc, physx::PxOutputStream& stream, physx::PxConvexMeshCookingResult::Enum* condition=NULL);
+
+/**
+\brief Cooks and creates a convex mesh without going through a stream.
+
+\note This method does the same as PxCookConvexMesh, but the produced mesh is not stored
+into a stream but is either directly inserted in PxPhysics, or created as a standalone
+object. Use this method if you are unable to cook offline.
+
+\note PxInsertionCallback can be obtained through PxPhysics::getPhysicsInsertionCallback()
+or PxGetStandaloneInsertionCallback().
+
+\param[in] params The cooking parameters
+\param[in] desc The convex mesh descriptor to read the mesh from.
+\param[in] insertionCallback The insertion interface from PxPhysics.
+\param[out] condition Result from convex mesh cooking.
+\return PxConvexMesh pointer on success
+
+\see PxCookConvexMesh() PxInsertionCallback
+*/
+PX_C_EXPORT PX_PHYSX_COOKING_API physx::PxConvexMesh* PxCreateConvexMesh(const physx::PxCookingParams& params, const physx::PxConvexMeshDesc& desc, physx::PxInsertionCallback& insertionCallback, physx::PxConvexMeshCookingResult::Enum* condition=NULL);
+
+/**
+\brief Cooks and creates a convex mesh without going through a stream. Convenience function for standalone objects.
+
+\note This method does the same as cookConvexMesh, but the produced mesh is not stored
+into a stream but is either directly inserted in PxPhysics, or created as a standalone
+object. Use this method if you are unable to cook offline.
+
+\param[in] params The cooking parameters
+\param[in] desc The convex mesh descriptor to read the mesh from.
+\return PxConvexMesh pointer on success
+
+\see PxCookConvexMesh() PxInsertionCallback
+*/
+PX_FORCE_INLINE physx::PxConvexMesh* PxCreateConvexMesh(const physx::PxCookingParams& params, const physx::PxConvexMeshDesc& desc)
+{
+ return PxCreateConvexMesh(params, desc, *PxGetStandaloneInsertionCallback());
+}
+
+/**
+\brief Verifies if the convex mesh is valid. Prints an error message for each inconsistency found.
+
+The convex mesh descriptor must contain an already created convex mesh - the vertices, indices and polygons must be provided.
+
+\note This function should be used if PxConvexFlag::eDISABLE_MESH_VALIDATION is planned to be used in release builds.
+
+\param[in] params The cooking parameters
+\param[in] desc The convex mesh descriptor to read the mesh from.
+
+\return true if all the validity conditions hold, false otherwise.
+
+\see PxCookConvexMesh()
+*/
+PX_C_EXPORT PX_PHYSX_COOKING_API bool PxValidateConvexMesh(const physx::PxCookingParams& params, const physx::PxConvexMeshDesc& desc);
+
+/**
+\brief Compute hull polygons from given vertices and triangles. Polygons are needed for PxConvexMeshDesc rather than triangles.
+
+Please note that the resulting polygons may have different number of vertices. Some vertices may be removed.
+The output vertices, indices and polygons must be used to construct a hull.
+
+The provided PxAllocatorCallback does allocate the out arrays. It is the user responsibility to deallocated those arrays.
+
+\param[in] params The cooking parameters
+\param[in] mesh Simple triangle mesh containing vertices and triangles used to compute polygons.
+\param[in] inCallback Memory allocator for out array allocations.
+\param[out] nbVerts Number of vertices used by polygons.
+\param[out] vertices Vertices array used by polygons.
+\param[out] nbIndices Number of indices used by polygons.
+\param[out] indices Indices array used by polygons.
+\param[out] nbPolygons Number of created polygons.
+\param[out] hullPolygons Polygons array.
+\return true on success
+
+\see PxCookConvexMesh() PxConvexFlags PxConvexMeshDesc PxSimpleTriangleMesh
+*/
+PX_C_EXPORT PX_PHYSX_COOKING_API bool PxComputeHullPolygons(const physx::PxCookingParams& params, const physx::PxSimpleTriangleMesh& mesh, physx::PxAllocatorCallback& inCallback, physx::PxU32& nbVerts, physx::PxVec3*& vertices,
+ physx::PxU32& nbIndices, physx::PxU32*& indices, physx::PxU32& nbPolygons, physx::PxHullPolygon*& hullPolygons);
+
+// ==== Triangle meshes ====
+
+/**
+\brief Verifies if the triangle mesh is valid. Prints an error message for each inconsistency found.
+
+The following conditions are true for a valid triangle mesh:
+1. There are no duplicate vertices (within specified vertexWeldTolerance. See PxCookingParams::meshWeldTolerance)
+2. There are no large triangles (within specified PxTolerancesScale.)
+
+\param[in] params The cooking parameters
+\param[in] desc The triangle mesh descriptor to read the mesh from.
+
+\return true if all the validity conditions hold, false otherwise.
+
+\see PxCookTriangleMesh()
+*/
+PX_C_EXPORT PX_PHYSX_COOKING_API bool PxValidateTriangleMesh(const physx::PxCookingParams& params, const physx::PxTriangleMeshDesc& desc);
+
+/**
+\brief Cooks a triangle mesh. The results are written to the stream.
+
+To create a triangle mesh object it is necessary to first 'cook' the mesh data into
+a form which allows the SDK to perform efficient collision detection.
+
+PxCookTriangleMesh() allows a mesh description to be cooked into a binary stream
+suitable for loading and performing collision detection at runtime.
+
+\param[in] params The cooking parameters
+\param[in] desc The triangle mesh descriptor to read the mesh from.
+\param[in] stream User stream to output the cooked data.
+\param[out] condition Result from triangle mesh cooking.
+\return true on success
+
+\see PxCookConvexMesh() PxPhysics.createTriangleMesh() PxTriangleMeshCookingResult::Enum
+*/
+PX_C_EXPORT PX_PHYSX_COOKING_API bool PxCookTriangleMesh(const physx::PxCookingParams& params, const physx::PxTriangleMeshDesc& desc, physx::PxOutputStream& stream, physx::PxTriangleMeshCookingResult::Enum* condition=NULL);
+
+/**
+\brief Cooks and creates a triangle mesh without going through a stream.
+
+\note This method does the same as PxCookTriangleMesh, but the produced mesh is not stored
+into a stream but is either directly inserted in PxPhysics, or created as a standalone
+object. Use this method if you are unable to cook offline.
+
+\note PxInsertionCallback can be obtained through PxPhysics::getPhysicsInsertionCallback()
+or PxGetStandaloneInsertionCallback().
+
+\param[in] params The cooking parameters
+\param[in] desc The triangle mesh descriptor to read the mesh from.
+\param[in] insertionCallback The insertion interface from PxPhysics.
+\param[out] condition Result from triangle mesh cooking.
+\return PxTriangleMesh pointer on success.
+
+\see PxCookTriangleMesh() PxPhysics.createTriangleMesh() PxInsertionCallback
+*/
+PX_C_EXPORT PX_PHYSX_COOKING_API physx::PxTriangleMesh* PxCreateTriangleMesh(const physx::PxCookingParams& params, const physx::PxTriangleMeshDesc& desc, physx::PxInsertionCallback& insertionCallback, physx::PxTriangleMeshCookingResult::Enum* condition=NULL);
+
+/**
+\brief Cooks and creates a triangle mesh without going through a stream. Convenience function for standalone objects.
+
+\note This method does the same as cookTriangleMesh, but the produced mesh is not stored
+into a stream but is either directly inserted in PxPhysics, or created as a standalone
+object. Use this method if you are unable to cook offline.
+\return PxTriangleMesh pointer on success.
+
+\param[in] params The cooking parameters
+\param[in] desc The triangle mesh descriptor to read the mesh from.
+
+\see PxCookTriangleMesh() PxPhysics.createTriangleMesh() PxInsertionCallback
+*/
+PX_FORCE_INLINE physx::PxTriangleMesh* PxCreateTriangleMesh(const physx::PxCookingParams& params, const physx::PxTriangleMeshDesc& desc)
+{
+ return PxCreateTriangleMesh(params, desc, *PxGetStandaloneInsertionCallback());
+}
+
+// ==== Tetrahedron & deformable volume meshes ====
+
+/**
+\brief Cooks a tetrahedron mesh. The results are written to the stream.
+
+To create a tetrahedron mesh object it is necessary to first 'cook' the mesh data into
+a form which allows the SDK to perform efficient collision detection.
+
+PxCookTetrahedronMesh() allows a mesh description to be cooked into a binary stream
+suitable for loading and performing collision detection at runtime.
+
+\param[in] params The cooking parameters
+\param[in] meshDesc The tetrahedron mesh descriptor to read the mesh from.
+\param[in] stream User stream to output the cooked data.
+\return true on success
+
+\see PxCookConvexMesh() PxPhysics.createTetrahedronMesh()
+*/
+PX_C_EXPORT PX_PHYSX_COOKING_API bool PxCookTetrahedronMesh(const physx::PxCookingParams& params, const physx::PxTetrahedronMeshDesc& meshDesc, physx::PxOutputStream& stream);
+
+/**
+\brief Cooks and creates a tetrahedron mesh without going through a stream.
+
+\note This method does the same as PxCookTetrahedronMesh, but the produced mesh is not stored
+into a stream but is either directly inserted in PxPhysics, or created as a standalone
+object. Use this method if you are unable to cook offline.
+
+\note PxInsertionCallback can be obtained through PxPhysics::getPhysicsInsertionCallback()
+or PxGetStandaloneInsertionCallback().
+
+\param[in] params The cooking parameters
+\param[in] meshDesc The tetrahedron mesh descriptor to read the mesh from.
+\param[in] insertionCallback The insertion interface from PxPhysics.
+\return PxTetrahedronMesh pointer on success.
+
+\see PxCookTetrahedronMesh() PxInsertionCallback
+*/
+PX_C_EXPORT PX_PHYSX_COOKING_API physx::PxTetrahedronMesh* PxCreateTetrahedronMesh(const physx::PxCookingParams& params, const physx::PxTetrahedronMeshDesc& meshDesc, physx::PxInsertionCallback& insertionCallback);
+
+/**
+\brief Cooks and creates a tetrahedron mesh without going through a stream. Convenience function for standalone objects.
+
+\note This method does the same as PxCookTetrahedronMesh, but the produced mesh is not stored
+into a stream but is either directly inserted in PxPhysics, or created as a standalone
+object. Use this method if you are unable to cook offline.
+
+\param[in] params The cooking parameters
+\param[in] meshDesc The tetrahedron mesh descriptor to read the mesh from.
+\return PxTetrahedronMesh pointer on success.
+
+\see PxCookTetrahedronMesh() PxInsertionCallback
+*/
+PX_FORCE_INLINE physx::PxTetrahedronMesh* PxCreateTetrahedronMesh(const physx::PxCookingParams& params, const physx::PxTetrahedronMeshDesc& meshDesc)
+{
+ return PxCreateTetrahedronMesh(params, meshDesc, *PxGetStandaloneInsertionCallback());
+}
+
+/**
+\brief Cooks a deformable volume mesh. The results are written to the stream.
+
+To create a deformable volume mesh object it is necessary to first 'cook' the mesh data into
+a form which allows the SDK to perform efficient collision detection and to store data
+used during the FEM calculations.
+
+PxCookDeformableVolumeMesh() allows a mesh description to be cooked into a binary stream
+suitable for loading and performing collision detection at runtime.
+
+\param[in] params The cooking parameters
+\param[in] simulationMeshDesc The tetrahedron mesh descriptor to read the simulation mesh from.
+\param[in] collisionMeshDesc The tetrahedron mesh descriptor to read the collision mesh from.
+\param[in] simulationDataDesc The deformable volume data descriptor to read mapping information from.
+\param[in] stream User stream to output the cooked data.
+\return true on success
+
+\see PxCookConvexMesh() PxPhysics.createTriangleMesh() PxTriangleMeshCookingResult::Enum
+*/
+PX_C_EXPORT PX_PHYSX_COOKING_API bool PxCookDeformableVolumeMesh(const physx::PxCookingParams& params,
+ const physx::PxTetrahedronMeshDesc& simulationMeshDesc, const physx::PxTetrahedronMeshDesc& collisionMeshDesc,
+ const physx::PxDeformableVolumeSimulationDataDesc& simulationDataDesc, physx::PxOutputStream& stream);
+
+/**
+\brief Deprecated
+\see PxCookDeformableVolumeMesh
+*/
+PX_DEPRECATED PX_FORCE_INLINE bool PxCookSoftBodyMesh(const physx::PxCookingParams& params,
+ const physx::PxTetrahedronMeshDesc& simulationMeshDesc, const physx::PxTetrahedronMeshDesc& collisionMeshDesc,
+ const physx::PxDeformableVolumeSimulationDataDesc& simulationDataDesc, physx::PxOutputStream& stream)
+{
+ return PxCookDeformableVolumeMesh(params, simulationMeshDesc, collisionMeshDesc, simulationDataDesc, stream);
+}
+
+/**
+\brief Cooks and creates a deformable volume mesh without going through a stream.
+
+\note This method does the same as PxCookDeformableVolumeMesh, but the produced mesh is not stored
+into a stream but is either directly inserted in PxPhysics, or created as a standalone
+object. Use this method if you are unable to cook offline.
+
+\note PxInsertionCallback can be obtained through PxPhysics::getPhysicsInsertionCallback()
+or PxGetStandaloneInsertionCallback().
+
+\param[in] params The cooking parameters
+\param[in] simulationMeshDesc The tetrahedron mesh descriptor to read the simulation mesh from.
+\param[in] collisionMeshDesc The tetrahedron mesh descriptor to read the collision mesh from.
+\param[in] simulationDataDesc The deformable volume data descriptor to read mapping information from.
+\param[in] insertionCallback The insertion interface from PxPhysics.
+\return PxDeformableVolumeMesh pointer on success.
+
+\see PxCookTriangleMesh() PxPhysics.createTriangleMesh() PxInsertionCallback
+*/
+PX_C_EXPORT PX_PHYSX_COOKING_API physx::PxDeformableVolumeMesh* PxCreateDeformableVolumeMesh(const physx::PxCookingParams& params,
+ const physx::PxTetrahedronMeshDesc& simulationMeshDesc, const physx::PxTetrahedronMeshDesc& collisionMeshDesc,
+ const physx::PxDeformableVolumeSimulationDataDesc& simulationDataDesc, physx::PxInsertionCallback& insertionCallback);
+
+/**
+\brief Deprecated
+\see PxCreateDeformableVolumeMesh
+*/
+PX_DEPRECATED PX_FORCE_INLINE physx::PxDeformableVolumeMesh* PxCreateSoftBodyMesh(const physx::PxCookingParams& params,
+ const physx::PxTetrahedronMeshDesc& simulationMeshDesc, const physx::PxTetrahedronMeshDesc& collisionMeshDesc,
+ const physx::PxDeformableVolumeSimulationDataDesc& simulationDataDesc, physx::PxInsertionCallback& insertionCallback)
+{
+ return PxCreateDeformableVolumeMesh(params, simulationMeshDesc, collisionMeshDesc, simulationDataDesc, insertionCallback);
+}
+
+/**
+\brief Cooks and creates a deformable volume mesh without going through a stream. Convenience function for standalone objects.
+
+\note This method does the same as PxCreateDeformableVolumeMesh, but the produced mesh is not stored
+into a stream but is either directly inserted in PxPhysics, or created as a standalone
+object. Use this method if you are unable to cook offline.
+
+\param[in] params The cooking parameters
+\param[in] simulationMeshDesc The tetrahedron mesh descriptor to read the simulation mesh from.
+\param[in] collisionMeshDesc The tetrahedron mesh descriptor to read the collision mesh from.
+\param[in] simulationDataDesc The deformable volume data descriptor to read mapping information from.
+\return PxDeformableVolumeMesh pointer on success.
+
+\see PxCookTriangleMesh() PxPhysics.createTriangleMesh() PxInsertionCallback
+*/
+PX_FORCE_INLINE physx::PxDeformableVolumeMesh* PxCreateDeformableVolumeMesh(const physx::PxCookingParams& params,
+ const physx::PxTetrahedronMeshDesc& simulationMeshDesc, const physx::PxTetrahedronMeshDesc& collisionMeshDesc,
+ const physx::PxDeformableVolumeSimulationDataDesc& simulationDataDesc)
+{
+ return PxCreateDeformableVolumeMesh(params, simulationMeshDesc, collisionMeshDesc, simulationDataDesc, *PxGetStandaloneInsertionCallback());
+}
+
+/**
+\brief Deprecated
+\see PxCreateDeformableVolumeMesh
+*/
+PX_DEPRECATED PX_FORCE_INLINE physx::PxDeformableVolumeMesh* PxCreateSoftBodyMesh(const physx::PxCookingParams& params,
+ const physx::PxTetrahedronMeshDesc& simulationMeshDesc, const physx::PxTetrahedronMeshDesc& collisionMeshDesc,
+ const physx::PxDeformableVolumeSimulationDataDesc& simulationDataDesc)
+{
+ return PxCreateDeformableVolumeMesh(params, simulationMeshDesc, collisionMeshDesc, simulationDataDesc, *PxGetStandaloneInsertionCallback());
+}
+
+/**
+\brief Computes the mapping between collision and simulation mesh
+
+The deformable volume deformation is computed on the simulation mesh. To deform the collision mesh accordingly
+it needs to be specified how its vertices need to be placed and updated inside the deformation mesh.
+This method computes that embedding information.
+
+\param[in] params The cooking parameters
+\param[in] simulationMesh A tetrahedral mesh that defines the shape of the simulation mesh which is used to compute the body's deformation
+\param[in] collisionMesh A tetrahedral mesh that defines the shape of the collision mesh which is used for collision detection
+\param[in] collisionData A data container that contains acceleration structures and surface information of the collision mesh
+\param[in] vertexToTet Optional indices (array of integers) that specifies the index of the tetrahedron in the simulation mesh that
+ contains a collision mesh vertex. If not provided, the embedding will be computed internally. If the simulation mesh is obtained from
+ PxTetMaker::createVoxelTetrahedronMesh, then the vertexToTet map createVoxelTetrahedronMesh returned should be used here.
+\return PxCollisionMeshMappingData pointer that describes how the collision mesh is embedded into the simulation mesh
+
+\see PxTetMaker::createVoxelTetrahedronMesh
+*/
+PX_C_EXPORT PX_PHYSX_COOKING_API physx::PxCollisionMeshMappingData* PxComputeModelsMapping(const physx::PxCookingParams& params,
+ physx::PxTetrahedronMeshData& simulationMesh, const physx::PxTetrahedronMeshData& collisionMesh,
+ const physx::PxDeformableVolumeCollisionData& collisionData, const physx::PxBoundedData* vertexToTet = NULL);
+
+/**
+\brief Computes data to accelerate collision detection of tetrahedral meshes
+
+Computes data structures to speed up collision detection with tetrahedral meshes.
+
+\param[in] params The cooking parameters
+\param[in] collisionMeshDesc Raw tetrahedral mesh descriptor which will be used for collision detection
+\return PxCollisionTetrahedronMeshData pointer that describes the collision mesh
+*/
+PX_C_EXPORT PX_PHYSX_COOKING_API physx::PxCollisionTetrahedronMeshData* PxComputeCollisionData(const physx::PxCookingParams& params,
+ const physx::PxTetrahedronMeshDesc& collisionMeshDesc);
+
+/**
+\brief Computes data to accelerate collision detection of tetrahedral meshes
+
+Computes data to compute and store a deformable volume's deformation using FEM.
+
+\param[in] params The cooking parameters
+\param[in] simulationMeshDesc Raw tetrahedral mesh descriptor which will be used for FEM simulation
+\return PxSimulationTetrahedronMeshData pointer that describes the simulation mesh
+*/
+PX_C_EXPORT PX_PHYSX_COOKING_API physx::PxSimulationTetrahedronMeshData* PxComputeSimulationData(const physx::PxCookingParams& params,
+ const physx::PxTetrahedronMeshDesc& simulationMeshDesc);
+
+/**
+\brief Bundles all data required for deformable volume simulation
+
+Creates a container that provides everything to create a PxDeformableVolume
+
+\param[in] simulationMesh The geometry (tetrahedral mesh) to be used as simulation mesh
+\param[in] simulationData Additional non-tetmesh data that contains mass information etc. for the simulation mesh
+\param[in] collisionMesh The geometry (tetrahedral mesh) to be used for collision detection
+\param[in] collisionData Additional non-tetmesh data that contains surface information, acceleration structures etc. for the simulation mesh
+\param[in] mappingData Mapping that describes how the collision mesh's vertices are embedded into the simulation mesh
+\param[in] insertionCallback The insertion interface from PxPhysics.
+\return PxDeformableVolumeMesh pointer that represents a deformable volume mesh bundling all data (simulation mesh, collision mesh etc.)
+
+\see PxDeformableVolume createDeformableVolume()
+*/
+PX_C_EXPORT PX_PHYSX_COOKING_API physx::PxDeformableVolumeMesh* PxAssembleDeformableVolumeMesh(physx::PxTetrahedronMeshData& simulationMesh,
+ physx::PxDeformableVolumeSimulationData& simulationData, physx::PxTetrahedronMeshData& collisionMesh, physx::PxDeformableVolumeCollisionData& collisionData,
+ physx::PxCollisionMeshMappingData& mappingData, physx::PxInsertionCallback& insertionCallback);
+
+/**
+\brief Deprecated
+\see PxAssembleDeformableVolumeMesh
+*/
+PX_DEPRECATED PX_FORCE_INLINE physx::PxDeformableVolumeMesh* PxAssembleSoftBodyMesh(physx::PxTetrahedronMeshData& simulationMesh,
+ physx::PxDeformableVolumeSimulationData& simulationData, physx::PxTetrahedronMeshData& collisionMesh, physx::PxDeformableVolumeCollisionData& collisionData,
+ physx::PxCollisionMeshMappingData& mappingData, physx::PxInsertionCallback& insertionCallback)
+{
+ return PxAssembleDeformableVolumeMesh(simulationMesh, simulationData, collisionMesh, collisionData, mappingData, insertionCallback);
+}
+
+/**
+\brief Deprecated
+\see PxAssembleDeformableVolumeMesh
+*/
+PX_DEPRECATED PX_FORCE_INLINE physx::PxDeformableVolumeMesh* PxAssembleSoftBodyMesh_Sim(physx::PxSimulationTetrahedronMeshData& simulationMesh,
+ physx::PxCollisionTetrahedronMeshData& collisionMesh, physx::PxCollisionMeshMappingData& mappingData, physx::PxInsertionCallback& insertionCallback)
+{
+ return PxAssembleDeformableVolumeMesh(*simulationMesh.getMesh(), *simulationMesh.getData(),
+ *collisionMesh.getMesh(), *collisionMesh.getData(), mappingData, insertionCallback);
+}
+
+#endif
diff --git a/Jusin154_Team3D/Engine/Public/PhysX/cooking/PxCookingInternal.h b/Jusin154_Team3D/Engine/Public/PhysX/cooking/PxCookingInternal.h
new file mode 100644
index 000000000..27c20ff71
--- /dev/null
+++ b/Jusin154_Team3D/Engine/Public/PhysX/cooking/PxCookingInternal.h
@@ -0,0 +1,52 @@
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// * Neither the name of NVIDIA CORPORATION nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
+// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// Copyright (c) 2008-2025 NVIDIA Corporation. All rights reserved.
+// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
+// Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
+
+#ifndef PX_COOKING_INTERNAL_H
+#define PX_COOKING_INTERNAL_H
+
+#include "cooking/PxCooking.h"
+
+#if !PX_DOXYGEN
+namespace physx
+{
+#endif
+
+ struct PxTriangleMeshInternalData;
+ struct PxBVHInternalData;
+ class PxTriangleMesh;
+ class PxBVH;
+
+#if !PX_DOXYGEN
+} // namespace physx
+#endif
+
+ PX_C_EXPORT PX_PHYSX_COOKING_API physx::PxTriangleMesh* PX_CALL_CONV PxCreateTriangleMeshInternal(const physx::PxTriangleMeshInternalData& data);
+
+ PX_C_EXPORT PX_PHYSX_COOKING_API physx::PxBVH* PX_CALL_CONV PxCreateBVHInternal(const physx::PxBVHInternalData& data);
+
+#endif
diff --git a/Jusin154_Team3D/Engine/Public/PhysX/cooking/PxMidphaseDesc.h b/Jusin154_Team3D/Engine/Public/PhysX/cooking/PxMidphaseDesc.h
new file mode 100644
index 000000000..27741cfae
--- /dev/null
+++ b/Jusin154_Team3D/Engine/Public/PhysX/cooking/PxMidphaseDesc.h
@@ -0,0 +1,118 @@
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// * Neither the name of NVIDIA CORPORATION nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
+// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// Copyright (c) 2008-2025 NVIDIA Corporation. All rights reserved.
+// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
+// Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
+
+#ifndef PX_MIDPHASE_DESC_H
+#define PX_MIDPHASE_DESC_H
+
+#include "geometry/PxTriangleMesh.h"
+#include "cooking/PxBVH33MidphaseDesc.h"
+#include "cooking/PxBVH34MidphaseDesc.h"
+
+#if !PX_DOXYGEN
+namespace physx
+{
+#endif
+
+/**
+
+\brief Structure describing parameters affecting midphase mesh structure.
+
+\see PxCookingParams, PxBVH33MidphaseDesc, PxBVH34MidphaseDesc
+*/
+class PxMidphaseDesc
+{
+public:
+ PX_FORCE_INLINE PxMidphaseDesc() { setToDefault(PxMeshMidPhase::eBVH34); }
+
+ /**
+ \brief Returns type of midphase mesh structure.
+ \return PxMeshMidPhase::Enum
+
+ \see PxMeshMidPhase::Enum
+ */
+ PX_FORCE_INLINE PxMeshMidPhase::Enum getType() const { return mType; }
+
+ /**
+ \brief Midphase descriptors union
+
+ \see PxBV33MidphaseDesc, PxBV34MidphaseDesc
+ */
+ union {
+ PxBVH33MidphaseDesc mBVH33Desc;
+ PxBVH34MidphaseDesc mBVH34Desc;
+ };
+
+ /**
+ \brief Initialize the midphase mesh structure descriptor
+ \param[in] type Midphase mesh structure descriptor
+
+ \see PxBV33MidphaseDesc, PxBV34MidphaseDesc
+ */
+ void setToDefault(PxMeshMidPhase::Enum type)
+ {
+ mType = type;
+ if(type==PxMeshMidPhase::eBVH33)
+ mBVH33Desc.setToDefault();
+ else if(type==PxMeshMidPhase::eBVH34)
+ mBVH34Desc.setToDefault();
+ }
+
+ /**
+ \brief Returns true if the descriptor is valid.
+ \return true if the current settings are valid.
+ */
+ bool isValid() const
+ {
+ if(mType==PxMeshMidPhase::eBVH33)
+ return mBVH33Desc.isValid();
+ else if(mType==PxMeshMidPhase::eBVH34)
+ return mBVH34Desc.isValid();
+ return false;
+ }
+
+ /**
+ \brief Assignment operator
+ \return this
+ */
+ PX_FORCE_INLINE PxMidphaseDesc& operator=(PxMeshMidPhase::Enum descType)
+ {
+ setToDefault(descType);
+ return *this;
+ }
+
+protected:
+ PxMeshMidPhase::Enum mType;
+};
+
+#if !PX_DOXYGEN
+} // namespace physx
+#endif
+
+
+#endif
+
diff --git a/Jusin154_Team3D/Engine/Public/PhysX/cooking/PxSDFDesc.h b/Jusin154_Team3D/Engine/Public/PhysX/cooking/PxSDFDesc.h
new file mode 100644
index 000000000..36e0ce3da
--- /dev/null
+++ b/Jusin154_Team3D/Engine/Public/PhysX/cooking/PxSDFDesc.h
@@ -0,0 +1,207 @@
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// * Neither the name of NVIDIA CORPORATION nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
+// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// Copyright (c) 2008-2025 NVIDIA Corporation. All rights reserved.
+// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
+// Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
+
+#ifndef PX_SDF_DESC_H
+#define PX_SDF_DESC_H
+
+#include "PxPhysXConfig.h"
+#include "geometry/PxSimpleTriangleMesh.h"
+#include "foundation/PxBounds3.h"
+
+#if !PX_DOXYGEN
+namespace physx
+{
+#endif
+ class PxSDFBuilder;
+
+ /**
+ \brief A helper structure to define dimensions in 3D
+ */
+ struct PxDim3
+ {
+ PxU32 x, y, z;
+ };
+
+ /**
+ \brief Defines the number of bits per subgrid pixel
+ */
+ class PxSdfBitsPerSubgridPixel
+ {
+ public:
+ enum Enum
+ {
+ e8_BIT_PER_PIXEL = 1, //!< 8 bit per subgrid pixel (values will be stored as normalized integers)
+ e16_BIT_PER_PIXEL = 2, //!< 16 bit per subgrid pixel (values will be stored as normalized integers)
+ e32_BIT_PER_PIXEL = 4 //!< 32 bit per subgrid pixel (values will be stored as floats in world scale units)
+ };
+ };
+
+ /**
+ \brief A structure describing signed distance fields (SDF) for triangle meshes. SDF colliders only work when the GPU solver is
+ used to run the simulation. The GPU solver is enabled by setting the flag PxSceneFlag::eENABLE_GPU_DYNAMICS in the scene description.
+ */
+ class PxSDFDesc
+ {
+ public:
+
+ /**
+ \brief Pointer to first sdf array element.
+ */
+ PxBoundedData sdf;
+
+ /**
+ \brief Dimensions of sdf
+ */
+ PxDim3 dims;
+
+ /**
+ \brief The Lower bound of the original mesh
+ */
+ PxVec3 meshLower;
+
+ /**
+ \brief The spacing of each sdf voxel
+ */
+ PxReal spacing;
+
+
+ /**
+ \brief The number of cells in a sparse subgrid block (full block has subgridSize^3 cells and (subgridSize+1)^3 samples). If set to zero, this indicates that only a dense background grid SDF is used without sparse blocks
+ */
+ PxU32 subgridSize;
+
+ /**
+ \brief Enumeration that defines the number of bits per subgrid pixel (either 32, 16 or 8bits)
+ */
+ PxSdfBitsPerSubgridPixel::Enum bitsPerSubgridPixel;
+
+ /**
+ \brief Number of subgrid blocks in the 3d texture. The full texture dimension will be sdfSubgrids3DTexBlockDim*(subgridSize+1).
+ */
+ PxDim3 sdfSubgrids3DTexBlockDim;
+
+ /**
+ \brief The data to create the 3d texture containg the packed subgrid blocks. Stored as PxU8 to support multiple formats (8, 16 and 32 bits per pixel)
+ */
+ PxBoundedData sdfSubgrids;
+
+ /**
+ \brief Array with start indices into the subgrid texture for every subgrid block. 10bits for z coordinate, 10bits for y and 10bits for x. Encoding is as follows: slot = (z << 20) | (y << 10) | x
+ */
+ PxBoundedData sdfStartSlots;
+
+ /**
+ \brief The minimum value over all subgrid blocks. Used if normalized textures are used which is the case for 8 and 16bit formats
+ */
+ PxReal subgridsMinSdfValue;
+
+ /**
+ \brief The maximum value over all subgrid blocks. Used if normalized textures are used which is the case for 8 and 16bit formats
+ */
+ PxReal subgridsMaxSdfValue;
+
+ /**
+ \brief The bounds of the sdf. If left unassigned (empty), the bounds of the mesh will be used
+ */
+ PxBounds3 sdfBounds;
+
+ /**
+ \brief Narrow band thickness as a fraction of the bounds diagonal length. Every subgrid block that
+ overlaps with the narrow band around the mesh surface will be kept providing high resolution around the mesh surface.
+ The valid range of this parameter is (0, 1). The higher the value, the more subgrids will get created, the more memory will be required.
+ */
+ PxReal narrowBandThicknessRelativeToSdfBoundsDiagonal;
+
+ /**
+ \brief The number of threads that are launched to compute the signed distance field
+ */
+ PxU32 numThreadsForSdfConstruction;
+
+ /**
+ \brief Optional pointer to the geometry of the mesh that is used to compute the SDF. If it is not set, the geometry of the mesh, that this descriptor is passed to during cooking, will be taken.
+ The mesh data must only be available during cooking. It can be released once cooking completed.
+ */
+ PxSimpleTriangleMesh baseMesh;
+
+ /**
+ \brief Optional pointer to an instance of a SDF builder. This significantly speeds up the construction of the SDF since the default SDF builder will do almost all computations directly on the GPU.
+ The user must release the instance of the SDF builder once cooking completed.
+ */
+ PxSDFBuilder* sdfBuilder;
+
+ /**
+ \brief Constructor
+ */
+ PX_INLINE PxSDFDesc();
+
+ /**
+ \brief Returns true if the descriptor is valid.
+ \return true if the current settings are valid
+ */
+ PX_INLINE bool isValid() const;
+ };
+
+ PX_INLINE PxSDFDesc::PxSDFDesc()
+ {
+ sdf.data = NULL;
+ dims.x = 0;
+ dims.y = 0;
+ dims.z = 0;
+ spacing = 0;
+ meshLower = PxVec3(PxZero);
+ subgridSize = 0;
+ subgridsMinSdfValue = 0.0f;
+ subgridsMaxSdfValue = 0.0f;
+ sdfBounds = PxBounds3::empty();
+ bitsPerSubgridPixel = PxSdfBitsPerSubgridPixel::e16_BIT_PER_PIXEL;
+ narrowBandThicknessRelativeToSdfBoundsDiagonal = 0.01f;
+ numThreadsForSdfConstruction = 1;
+ sdfBuilder = NULL;
+ }
+
+ PX_INLINE bool PxSDFDesc::isValid() const
+ {
+ // Check validity of user's input(if any)
+ if (sdf.data)
+ {
+ if (dims.x < 1 || dims.y < 1 || dims.z < 1)
+ return false;
+ if (!meshLower.isFinite())
+ return false;
+ if (spacing <= 0)
+ return false;
+ }
+
+ return true;
+ }
+
+#if !PX_DOXYGEN
+} // namespace physx
+#endif
+
+#endif
diff --git a/Jusin154_Team3D/Engine/Public/PhysX/cooking/PxTetrahedronMeshDesc.h b/Jusin154_Team3D/Engine/Public/PhysX/cooking/PxTetrahedronMeshDesc.h
new file mode 100644
index 000000000..15a426025
--- /dev/null
+++ b/Jusin154_Team3D/Engine/Public/PhysX/cooking/PxTetrahedronMeshDesc.h
@@ -0,0 +1,232 @@
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// * Neither the name of NVIDIA CORPORATION nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
+// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// Copyright (c) 2008-2025 NVIDIA Corporation. All rights reserved.
+// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
+// Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
+
+#ifndef PX_TETRAHEDRON_MESH_DESC_H
+#define PX_TETRAHEDRON_MESH_DESC_H
+
+#include "PxPhysXConfig.h"
+#include "foundation/PxVec3.h"
+#include "foundation/PxFlags.h"
+#include "common/PxCoreUtilityTypes.h"
+#include "geometry/PxSimpleTriangleMesh.h"
+#include "foundation/PxArray.h"
+
+#if !PX_DOXYGEN
+namespace physx
+{
+#endif
+ /**
+ \brief Descriptor class for #PxTetrahedronMesh (contains only pure geometric data).
+
+ \see PxTetrahedronMesh PxShape
+ */
+ class PxTetrahedronMeshDesc
+ {
+ public:
+
+ /**
+ \brief Defines the tetrahedron structure of a mesh.
+ */
+ enum PxMeshFormat
+ {
+ eTET_MESH, //!< Normal tetmesh with arbitrary tetrahedra
+ eHEX_MESH //!< 5 or 6 tetrahedra in a row will form a hexahedron
+ };
+
+
+ /**
+ Optional pointer to first material index, or NULL. There are PxTetrahedronMesh::numTriangles indices in total.
+ Caller may add materialIndexStride bytes to the pointer to access the next triangle.
+
+ When a tetrahedron mesh collides with another object, a material is required at the collision point.
+ If materialIndices is NULL, then the material of the PxShape instance is used.
+ Otherwise, if the point of contact is on a tetrahedron with index i, then the material index is determined as:
+ PxDeformableMaterialTableIndex index = *(PxDeformableMaterialTableIndex *)(((PxU8*)materialIndices) + materialIndexStride * i);
+
+ If the contact point falls on a vertex or an edge, a tetrahedron adjacent to the vertex or edge is selected, and its index
+ used to look up a material. The selection is arbitrary but consistent over time.
+
+ Default: NULL
+
+ \see materialIndexStride
+ */
+ PxTypedBoundedData materialIndices;
+
+ /**
+ \brief Pointer to first vertex point.
+ */
+ PxBoundedData points;
+
+ /**
+ \brief Pointer to first tetrahedron.
+
+ Caller may add tetrhedronStrideBytes bytes to the pointer to access the next tetrahedron.
+
+ These are quadruplets of 0 based indices:
+ vert0 vert1 vert2 vert3
+ vert0 vert1 vert2 vert3
+ vert0 vert1 vert2 vert3
+ ...
+
+ where vertex is either a 32 or 16 bit unsigned integer. There are numTetrahedrons*4 indices.
+
+ This is declared as a void pointer because it is actually either an PxU16 or a PxU32 pointer.
+ */
+ PxBoundedData tetrahedrons;
+
+
+ /**
+ \brief Flags bits, combined from values of the enum ::PxMeshFlag
+ */
+ PxMeshFlags flags;
+
+ /**
+ \brief Used for simulation meshes only. Defines if this tet mesh should be simulated as a tet mesh,
+ or if a set of tetrahedra should be used to represent another shape, e.g. a hexahedral mesh constructed
+ from 5 or 6 elements.
+ */
+ PxU16 tetsPerElement;
+
+ /**
+ \brief Constructor to build an empty tetmesh description
+ */
+ PxTetrahedronMeshDesc()
+ {
+ points.count = 0;
+ points.stride = 0;
+ points.data = NULL;
+
+ tetrahedrons.count = 0;
+ tetrahedrons.stride = 0;
+ tetrahedrons.data = NULL;
+
+ tetsPerElement = 1;
+ }
+
+ /**
+ \brief Constructor to build a tetmeshdescription that links to the vertices and indices provided
+ */
+ PxTetrahedronMeshDesc(physx::PxArray& meshVertices, physx::PxArray& meshTetIndices,
+ const PxTetrahedronMeshDesc::PxMeshFormat meshFormat = eTET_MESH, PxU16 numberOfTetsPerHexElement = 5)
+ {
+ points.count = meshVertices.size();
+ points.stride = sizeof(float) * 3;
+ points.data = meshVertices.begin();
+
+ tetrahedrons.count = meshTetIndices.size() / 4;
+ tetrahedrons.stride = sizeof(int) * 4;
+ tetrahedrons.data = meshTetIndices.begin();
+
+ if (meshFormat == eTET_MESH)
+ tetsPerElement = 1;
+ else
+ tetsPerElement = numberOfTetsPerHexElement;
+ }
+
+ PX_INLINE bool isValid() const
+ {
+ // Check geometry of the collision mesh
+ if (points.count < 4) //at least 1 tetrahedron's worth of points
+ return false;
+ if ((!tetrahedrons.data) && (points.count % 4)) // Non-indexed mesh => we must ensure the geometry defines an implicit number of tetrahedrons // i.e. numVertices can't be divided by 4
+ return false;
+ if (points.count > 0xffff && flags & PxMeshFlag::e16_BIT_INDICES)
+ return false;
+ if (!points.data)
+ return false;
+ if (points.stride < sizeof(PxVec3)) //should be at least one point's worth of data
+ return false;
+
+ //add more validity checks here
+ if (materialIndices.data && materialIndices.stride < sizeof(PxDeformableMaterialTableIndex))
+ return false;
+
+ // The tetrahedrons pointer is not mandatory
+ if (tetrahedrons.data)
+ {
+ // Indexed collision mesh
+ PxU32 limit = (flags & PxMeshFlag::e16_BIT_INDICES) ? sizeof(PxU16) * 4 : sizeof(PxU32) * 4;
+ if (tetrahedrons.stride < limit)
+ return false;
+ }
+
+ //The model can only be either a tetmesh (1 tet per element), or have 5 or 6 tets per hex element, otherwise invalid.
+ if (tetsPerElement != 1 && tetsPerElement != 5 && tetsPerElement != 6)
+ return false;
+
+ return true;
+ }
+ };
+
+ /**
+ \brief Descriptor class for #PxDeformableVolumeMesh (contains only additional data used for deformable volume simulation).
+
+ \see PxDeformableVolumeMesh PxShape
+ */
+ class PxDeformableVolumeSimulationDataDesc
+ {
+ public:
+ /**
+ \brief Pointer to first index of tetrahedron that contains the vertex at the same location in the vertex buffer.
+ if left unassigned it will be computed automatically. If a point is inside multiple tetrahedra (ambiguous case), the frist one found will be taken.
+ */
+ PxBoundedData vertexToTet;
+
+ /**
+ \brief Constructor to build an empty simulation description
+ */
+ PxDeformableVolumeSimulationDataDesc()
+ {
+ vertexToTet.count = 0;
+ vertexToTet.stride = 0;
+ vertexToTet.data = NULL;
+ }
+
+ /**
+ \brief Constructor to build a simulation description with a defined vertex to tetrahedron mapping
+ */
+ PxDeformableVolumeSimulationDataDesc(physx::PxArray& vertToTet)
+ {
+ vertexToTet.count = vertToTet.size();
+ vertexToTet.stride = sizeof(PxI32);
+ vertexToTet.data = vertToTet.begin();
+ }
+
+ PX_INLINE bool isValid() const
+ {
+ return true;
+ }
+ };
+
+ typedef PX_DEPRECATED PxDeformableVolumeSimulationDataDesc PxSoftBodySimulationDataDesc;
+
+#if !PX_DOXYGEN
+} // namespace physx
+#endif
+
+#endif
diff --git a/Jusin154_Team3D/Engine/Public/PhysX/cooking/PxTriangleMeshDesc.h b/Jusin154_Team3D/Engine/Public/PhysX/cooking/PxTriangleMeshDesc.h
new file mode 100644
index 000000000..68beb7e74
--- /dev/null
+++ b/Jusin154_Team3D/Engine/Public/PhysX/cooking/PxTriangleMeshDesc.h
@@ -0,0 +1,131 @@
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// * Neither the name of NVIDIA CORPORATION nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
+// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// Copyright (c) 2008-2025 NVIDIA Corporation. All rights reserved.
+// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
+// Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
+
+#ifndef PX_TRIANGLE_MESH_DESC_H
+#define PX_TRIANGLE_MESH_DESC_H
+
+#include "PxPhysXConfig.h"
+#include "geometry/PxSimpleTriangleMesh.h"
+#include "PxSDFDesc.h"
+
+#if !PX_DOXYGEN
+namespace physx
+{
+#endif
+
+
+/**
+\brief Descriptor class for #PxTriangleMesh.
+
+Note that this class is derived from PxSimpleTriangleMesh which contains the members that describe the basic mesh.
+The mesh data is *copied* when an PxTriangleMesh object is created from this descriptor. After the call the
+user may discard the triangle data.
+
+\see PxTriangleMesh PxTriangleMeshGeometry PxShape
+*/
+class PxTriangleMeshDesc : public PxSimpleTriangleMesh
+{
+public:
+
+ /**
+ Optional pointer to first material index, or NULL. There are PxSimpleTriangleMesh::numTriangles indices in total.
+ Caller may add materialIndexStride bytes to the pointer to access the next triangle.
+
+ When a triangle mesh collides with another object, a material is required at the collision point.
+ If materialIndices is NULL, then the material of the PxShape instance is used.
+ Otherwise, if the point of contact is on a triangle with index i, then the material index is determined as:
+ PxMaterialTableIndex index = *(PxMaterialTableIndex *)(((PxU8*)materialIndices) + materialIndexStride * i);
+
+ If the contact point falls on a vertex or an edge, a triangle adjacent to the vertex or edge is selected, and its index
+ used to look up a material. The selection is arbitrary but consistent over time.
+
+ Default: NULL
+
+ \see materialIndexStride
+ */
+ PxTypedBoundedData materialIndices;
+
+ /**
+ \brief SDF descriptor. When this descriptor is set, a signed distance field (SDF) is calculated. SDF collisions only
+ work when the GPU solver is used to run the simulation. The GPU solver is enabled by setting the flag PxSceneFlag::eENABLE_GPU_DYNAMICS in the scene description.
+
+ Default: NULL
+ */
+ PxSDFDesc* sdfDesc;
+
+ /**
+ \brief Constructor sets to default.
+ */
+ PX_INLINE PxTriangleMeshDesc();
+
+ /**
+ \brief (re)sets the structure to the default.
+ */
+ PX_INLINE void setToDefault();
+
+ /**
+ \brief Returns true if the descriptor is valid.
+ \return true if the current settings are valid
+ */
+ PX_INLINE bool isValid() const;
+};
+
+
+PX_INLINE PxTriangleMeshDesc::PxTriangleMeshDesc() //constructor sets to default
+{
+ PxSimpleTriangleMesh::setToDefault();
+ sdfDesc = NULL;
+}
+
+PX_INLINE void PxTriangleMeshDesc::setToDefault()
+{
+ *this = PxTriangleMeshDesc();
+}
+
+PX_INLINE bool PxTriangleMeshDesc::isValid() const
+{
+ if(points.count < 3) //at least 1 trig's worth of points
+ return false;
+ if ((!triangles.data) && (points.count%3)) // Non-indexed mesh => we must ensure the geometry defines an implicit number of triangles // i.e. numVertices can't be divided by 3
+ return false;
+ //add more validity checks here
+ if (materialIndices.data && materialIndices.stride < sizeof(PxMaterialTableIndex))
+ return false;
+
+ if (sdfDesc && !sdfDesc->isValid())
+ return false;
+
+ return PxSimpleTriangleMesh::isValid();
+}
+
+
+#if !PX_DOXYGEN
+} // namespace physx
+#endif
+
+#endif
diff --git a/Jusin154_Team3D/Engine/Public/PhysX/cooking/Pxc.h b/Jusin154_Team3D/Engine/Public/PhysX/cooking/Pxc.h
new file mode 100644
index 000000000..d0866ca5c
--- /dev/null
+++ b/Jusin154_Team3D/Engine/Public/PhysX/cooking/Pxc.h
@@ -0,0 +1,55 @@
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// * Neither the name of NVIDIA CORPORATION nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
+// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// Copyright (c) 2008-2025 NVIDIA Corporation. All rights reserved.
+// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
+// Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
+
+#ifndef PXC_H
+#define PXC_H
+
+#include "foundation/PxPreprocessor.h"
+
+// define API function declaration
+#if !defined PX_PHYSX_STATIC_LIB
+ #if PX_WINDOWS_FAMILY
+ #if defined PX_PHYSX_COOKING_EXPORTS
+ #define PX_PHYSX_COOKING_API __declspec(dllexport)
+ #else
+ #define PX_PHYSX_COOKING_API __declspec(dllimport)
+ #endif
+ #elif PX_UNIX_FAMILY
+ #define PX_PHYSX_COOKING_API PX_UNIX_EXPORT
+ #endif
+#endif
+
+#if !defined(PX_PHYSX_COOKING_API)
+ #define PX_PHYSX_COOKING_API
+#endif
+
+#ifndef PX_C_EXPORT
+ #define PX_C_EXPORT extern "C"
+#endif
+
+#endif
diff --git a/Jusin154_Team3D/Engine/Public/PhysX/cudamanager/PxCudaContext.h b/Jusin154_Team3D/Engine/Public/PhysX/cudamanager/PxCudaContext.h
new file mode 100644
index 000000000..fcceea444
--- /dev/null
+++ b/Jusin154_Team3D/Engine/Public/PhysX/cudamanager/PxCudaContext.h
@@ -0,0 +1,192 @@
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// * Neither the name of NVIDIA CORPORATION nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
+// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// Copyright (c) 2008-2025 NVIDIA Corporation. All rights reserved.
+
+#ifndef PX_CUDA_CONTEX_H
+#define PX_CUDA_CONTEX_H
+
+#include "foundation/PxPreprocessor.h"
+
+#if PX_SUPPORT_GPU_PHYSX
+
+#include "PxCudaTypes.h"
+
+#if !PX_DOXYGEN
+namespace physx
+{
+#endif
+ struct PxCudaKernelParam
+ {
+ void* data;
+ size_t size;
+ };
+
+ // workaround for not being able to forward declare enums in PxCudaTypes.h.
+ // provides different automatic casting depending on whether cuda.h was included beforehand or not.
+ template
+ struct PxCUenum
+ {
+ PxU32 value;
+
+ PxCUenum(CUenum e) { value = PxU32(e); }
+ operator CUenum() const { return CUenum(value); }
+ };
+
+#ifdef CUDA_VERSION
+ typedef PxCUenum PxCUjit_option;
+ typedef PxCUenum PxCUresult;
+#else
+ typedef PxCUenum PxCUjit_option;
+ typedef PxCUenum PxCUresult;
+#endif
+
+#define PX_CUDA_KERNEL_PARAM(X) { (void*)&X, sizeof(X) }
+#define PX_CUDA_KERNEL_PARAM2(X) (void*)&X
+
+ class PxDeviceAllocatorCallback;
+ /**
+ Cuda Context
+ */
+ class PxCudaContext
+ {
+ protected:
+ virtual ~PxCudaContext() {}
+
+ PxDeviceAllocatorCallback* mAllocatorCallback;
+
+ public:
+ virtual void release() = 0;
+
+ virtual PxCUresult memAlloc(CUdeviceptr *dptr, size_t bytesize) = 0;
+
+ virtual PxCUresult memFree(CUdeviceptr dptr) = 0;
+
+ virtual PxCUresult memHostAlloc(void **pp, size_t bytesize, unsigned int Flags) = 0;
+
+ virtual PxCUresult memFreeHost(void *p) = 0;
+
+ virtual PxCUresult memHostGetDevicePointer(CUdeviceptr *pdptr, void *p, unsigned int Flags) = 0;
+
+ virtual PxCUresult moduleLoadDataEx(CUmodule *module, const void *image, unsigned int numOptions, PxCUjit_option *options, void **optionValues) = 0;
+
+ virtual PxCUresult moduleGetFunction(CUfunction *hfunc, CUmodule hmod, const char *name) = 0;
+
+ virtual PxCUresult moduleUnload(CUmodule hmod) = 0;
+
+ virtual PxCUresult streamCreate(CUstream *phStream, unsigned int Flags) = 0;
+
+ virtual PxCUresult streamCreateWithPriority(CUstream *phStream, unsigned int flags, int priority) = 0;
+
+ virtual PxCUresult streamFlush(CUstream hStream) = 0;
+
+ virtual PxCUresult streamWaitEvent(CUstream hStream, CUevent hEvent, unsigned int Flags) = 0;
+
+ virtual PxCUresult streamWaitEvent(CUstream hStream, CUevent hEvent) = 0;
+
+ virtual PxCUresult streamDestroy(CUstream hStream) = 0;
+
+ virtual PxCUresult streamSynchronize(CUstream hStream) = 0;
+
+ virtual PxCUresult eventCreate(CUevent *phEvent, unsigned int Flags) = 0;
+
+ virtual PxCUresult eventRecord(CUevent hEvent, CUstream hStream) = 0;
+
+ virtual PxCUresult eventQuery(CUevent hEvent) = 0;
+
+ virtual PxCUresult eventSynchronize(CUevent hEvent) = 0;
+
+ virtual PxCUresult eventDestroy(CUevent hEvent) = 0;
+
+ virtual PxCUresult launchKernel(
+ CUfunction f,
+ unsigned int gridDimX,
+ unsigned int gridDimY,
+ unsigned int gridDimZ,
+ unsigned int blockDimX,
+ unsigned int blockDimY,
+ unsigned int blockDimZ,
+ unsigned int sharedMemBytes,
+ CUstream hStream,
+ PxCudaKernelParam* kernelParams,
+ size_t kernelParamsSizeInBytes,
+ void** extra,
+ const char* file,
+ int line
+ ) = 0;
+
+ // PT: same as above but without copying the kernel params to a local stack before the launch
+ // i.e. the kernelParams data is passed directly to the kernel.
+ virtual PxCUresult launchKernel(
+ CUfunction f,
+ PxU32 gridDimX, PxU32 gridDimY, PxU32 gridDimZ,
+ PxU32 blockDimX, PxU32 blockDimY, PxU32 blockDimZ,
+ PxU32 sharedMemBytes,
+ CUstream hStream,
+ void** kernelParams,
+ void** extra,
+ const char* file,
+ int line
+ ) = 0;
+
+ virtual PxCUresult memcpyDtoH(void *dstHost, CUdeviceptr srcDevice, size_t ByteCount) = 0;
+
+ virtual PxCUresult memcpyDtoHAsync(void* dstHost, CUdeviceptr srcDevice, size_t ByteCount, CUstream hStream) = 0;
+
+ virtual PxCUresult memcpyHtoD(CUdeviceptr dstDevice, const void *srcHost, size_t ByteCount) = 0;
+
+ virtual PxCUresult memcpyHtoDAsync(CUdeviceptr dstDevice, const void *srcHost, size_t ByteCount, CUstream hStream) = 0;
+
+ virtual PxCUresult memcpyDtoDAsync(CUdeviceptr dstDevice, CUdeviceptr srcDevice, size_t ByteCount, CUstream hStream) = 0;
+
+ virtual PxCUresult memcpyDtoD(CUdeviceptr dstDevice, CUdeviceptr srcDevice, size_t ByteCount) = 0;
+
+ virtual PxCUresult memcpyPeerAsync(CUdeviceptr dstDevice, CUcontext dstContext, CUdeviceptr srcDevice, CUcontext srcContext, size_t ByteCount, CUstream hStream) = 0;
+
+ virtual PxCUresult memsetD32Async(CUdeviceptr dstDevice, unsigned int ui, size_t N, CUstream hStream) = 0;
+
+ virtual PxCUresult memsetD8Async(CUdeviceptr dstDevice, unsigned char uc, size_t N, CUstream hStream) = 0;
+
+ virtual PxCUresult memsetD32(CUdeviceptr dstDevice, unsigned int ui, size_t N) = 0;
+
+ virtual PxCUresult memsetD16(CUdeviceptr dstDevice, unsigned short uh, size_t N) = 0;
+
+ virtual PxCUresult memsetD8(CUdeviceptr dstDevice, unsigned char uc, size_t N) = 0;
+
+ virtual PxCUresult getLastError() = 0;
+
+ PxDeviceAllocatorCallback* getAllocatorCallback() { return mAllocatorCallback; }
+
+ virtual void setAbortMode(bool abort) = 0;
+
+ virtual bool isInAbortMode() = 0;
+ };
+
+#if !PX_DOXYGEN
+} // namespace physx
+#endif
+
+#endif // PX_SUPPORT_GPU_PHYSX
+#endif
+
diff --git a/Jusin154_Team3D/Engine/Public/PhysX/cudamanager/PxCudaContextManager.h b/Jusin154_Team3D/Engine/Public/PhysX/cudamanager/PxCudaContextManager.h
new file mode 100644
index 000000000..90d7d70f7
--- /dev/null
+++ b/Jusin154_Team3D/Engine/Public/PhysX/cudamanager/PxCudaContextManager.h
@@ -0,0 +1,554 @@
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// * Neither the name of NVIDIA CORPORATION nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
+// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// Copyright (c) 2008-2025 NVIDIA Corporation. All rights reserved.
+
+#ifndef PX_CUDA_CONTEXT_MANAGER_H
+#define PX_CUDA_CONTEXT_MANAGER_H
+
+#include "foundation/PxPreprocessor.h"
+
+#if PX_SUPPORT_GPU_PHYSX
+
+#include "foundation/PxSimpleTypes.h"
+#include "foundation/PxErrorCallback.h"
+#include "foundation/PxFlags.h"
+
+#include "PxCudaTypes.h"
+
+#if !PX_DOXYGEN
+namespace physx
+{
+#endif
+
+class PxCudaContext;
+
+struct PxCudaInteropRegisterFlag
+{
+ enum Enum
+ {
+ eNONE = 0x00,
+ eREAD_ONLY = 0x01,
+ eWRITE_DISCARD = 0x02,
+ eSURFACE_LDST = 0x04,
+ eTEXTURE_GATHER = 0x08
+ };
+};
+
+/**
+\brief An interface class that the user can implement in order for PhysX to use a user-defined device memory allocator.
+*/
+class PxDeviceAllocatorCallback
+{
+public:
+
+ /**
+ \brief Allocated device memory.
+ \param[in] ptr Pointer to store the allocated address
+ \param[in] size The amount of memory required
+ \return A boolean indicates the operation succeed or fail
+ */
+ virtual bool memAlloc(void** ptr, size_t size) = 0;
+
+ /**
+ \brief Frees device memory.
+ \param[in] ptr The memory to free
+ \return A boolean indicates the operation succeed or fail
+ */
+ virtual bool memFree(void* ptr) = 0;
+
+protected:
+ virtual ~PxDeviceAllocatorCallback() {}
+};
+/**
+\brief collection of set bits defined in NxCudaInteropRegisterFlag.
+
+\see NxCudaInteropRegisterFlag
+*/
+typedef PxFlags PxCudaInteropRegisterFlags;
+PX_FLAGS_OPERATORS(PxCudaInteropRegisterFlag::Enum, uint32_t)
+
+//! \brief Descriptor used to create a PxCudaContextManager
+class PxCudaContextManagerDesc
+{
+public:
+ /**
+ * \brief The CUDA context to manage
+ *
+ * If left NULL, the PxCudaContextManager will create a new context. If
+ * graphicsDevice is also not NULL, this new CUDA context will be bound to
+ * that graphics device, enabling the use of CUDA/Graphics interop features.
+ *
+ * If ctx is not NULL, the specified context must be applied to the thread
+ * that is allocating the PxCudaContextManager at creation time (aka, it
+ * cannot be popped). The PxCudaContextManager will take ownership of the
+ * context until the manager is released. All access to the context must be
+ * gated by lock acquisition.
+ *
+ * If the user provides a context for the PxCudaContextManager, the context
+ * _must_ have either been created on the GPU ordinal returned by
+ * PxGetSuggestedCudaDeviceOrdinal() or on your graphics device.
+ */
+ CUcontext* ctx;
+
+ /**
+ * \brief D3D device pointer or OpenGl context handle
+ *
+ * Only applicable when ctx is NULL, thus forcing a new context to be
+ * created. In that case, the created context will be bound to this
+ * graphics device.
+ */
+ void* graphicsDevice;
+
+ /**
+ * \brief CUDA device ordinal
+ *
+ * Only applicable when ctx is NULL, thus forcing a new context to be created based on the CUDA device ordinal.
+ * The first CUDA device will have an ordinal value of 0 and so on.
+ * If the CUDA device ordinal is -1, the device selected will be queried from the environment variable PHYSX_GPU_DEVICE.
+ * \note If the environment variable PHYSX_GPU_DEVICE is not found, the CUDA device ordinal will default to 0.
+ */
+ PxI32 deviceOrdinal;
+
+ /**
+ * \brief Application-specific GUID
+ *
+ * If your application employs PhysX modules that use CUDA you need to use a GUID
+ * so that patches for new architectures can be released for your game.You can obtain a GUID for your
+ * application from Nvidia.
+ */
+ const char* appGUID;
+
+ /**
+ * \brief Application-specific device memory allocator
+ *
+ * the application can implement an device memory allocator, which inherites PxDeviceAllocatorCallback, and
+ * pass that to the PxCudaContextManagerDesc. The SDK will use that allocator to allocate device memory instead of
+ * using the defaul CUDA device memory allocator.
+ */
+ PxDeviceAllocatorCallback* deviceAllocator;
+
+ PX_INLINE PxCudaContextManagerDesc() :
+ ctx (NULL),
+ graphicsDevice (NULL),
+ deviceOrdinal (-1),
+ appGUID (NULL),
+ deviceAllocator (NULL)
+ {
+ }
+};
+
+/**
+\brief A cuda kernel index providing an index to the cuda module and the function name
+*/
+struct PxKernelIndex
+{
+ PxU32 moduleIndex;
+ const char* functionName;
+};
+
+/**
+ * \brief Manages thread locks, and task scheduling for a CUDA context
+ *
+ * A PxCudaContextManager manages access to a single CUDA context, allowing it to
+ * be shared between multiple scenes.
+ * The context must be acquired from the manager before using any CUDA APIs unless stated differently.
+ *
+ * The PxCudaContextManager is based on the CUDA driver API and explicitly does not
+ * support the CUDA runtime API (aka, CUDART).
+ */
+class PxCudaContextManager
+{
+public:
+ /**
+ * \brief Schedules clear operation for a device memory buffer on the specified stream
+ *
+ * The cuda context will get acquired automatically
+ * \deprecated The replacement is PxCudaHelpersExt::memsetAsync.
+ */
+ template
+ PX_DEPRECATED void clearDeviceBufferAsync(T* deviceBuffer, PxU32 numElements, CUstream stream, PxI32 value = 0)
+ {
+ clearDeviceBufferAsyncInternal(deviceBuffer, numElements * sizeof(T), stream, value);
+ }
+
+ /**
+ * \brief Copies a device buffer to the host
+ *
+ * The cuda context will get acquired automatically
+ * \deprecated The replacement is PxCudaHelpersExt::copyDToH.
+ */
+ template
+ PX_DEPRECATED void copyDToH(T* hostBuffer, const T* deviceBuffer, PxU32 numElements)
+ {
+ copyDToHInternal(hostBuffer, deviceBuffer, numElements * sizeof(T));
+ }
+
+ /**
+ * \brief Copies a host buffer to the device
+ *
+ * The cuda context will get acquired automatically
+ * \deprecated The replacement is PxCudaHelpersExt::copyHtoD
+ */
+ template
+ PX_DEPRECATED void copyHToD(T* deviceBuffer, const T* hostBuffer, PxU32 numElements)
+ {
+ copyHToDInternal(deviceBuffer, hostBuffer, numElements * sizeof(T));
+ }
+
+ /**
+ * \brief Schedules device to host copy operation on the specified stream
+ *
+ * The cuda context will get acquired automatically
+ * \deprecated Use PxCudaHelpersExt::copyDToHAsync instead.
+ */
+ template
+ PX_DEPRECATED void copyDToHAsync(T* hostBuffer, const T* deviceBuffer, PxU32 numElements, CUstream stream)
+ {
+ copyDToHAsyncInternal(hostBuffer, deviceBuffer, numElements * sizeof(T), stream);
+ }
+
+ /**
+ * \brief Schedules host to device copy operation on the specified stream
+ *
+ * The cuda context will get acquired automatically
+ * \deprecated Use PxCudaHelpersExt::copyHToDAsync instead.
+ */
+ template
+ PX_DEPRECATED void copyHToDAsync(T* deviceBuffer, const T* hostBuffer, PxU32 numElements, CUstream stream)
+ {
+ copyHToDAsyncInternal(deviceBuffer, hostBuffer, numElements * sizeof(T), stream);
+ }
+
+ /**
+ * \brief Schedules device to device copy operation on the specified stream
+ *
+ * The cuda context will get acquired automatically
+ * \deprecated Use PxCudaHelpersExt::copyDToDAsync instead.
+ */
+ template
+ PX_DEPRECATED void copyDToDAsync(T* dstDeviceBuffer, const T* srcDeviceBuffer, PxU32 numElements, CUstream stream)
+ {
+ copyDToDAsyncInternal(dstDeviceBuffer, srcDeviceBuffer, numElements * sizeof(T), stream);
+ }
+
+ /**
+ * \brief Schedules a memset operation on the device on the specified stream. Only supported for 1 byte or 4 byte data types.
+ *
+ * The cuda context will get acquired automatically
+ * \deprecated Use PxCudaHelpersExt::memsetAsync instead.
+ */
+ template
+ PX_DEPRECATED void memsetAsync(T* dstDeviceBuffer, const T& value, PxU32 numElements, CUstream stream)
+ {
+ PX_COMPILE_TIME_ASSERT(sizeof(value) == sizeof(PxU32) || sizeof(value) == sizeof(PxU8));
+
+ if (sizeof(value) == sizeof(PxU32))
+ memsetD32AsyncInternal(dstDeviceBuffer, reinterpret_cast(value), numElements, stream);
+ else
+ memsetD8AsyncInternal(dstDeviceBuffer, reinterpret_cast(value), numElements, stream);
+ }
+
+ /**
+ * \brief Allocates a device buffer
+ *
+ * The cuda context will get acquired automatically
+ * \deprecated - use PxCudaHelpersExt::allocDeviceBuffer instead.
+ */
+ template
+ PX_DEPRECATED void allocDeviceBuffer(T*& deviceBuffer, PxU32 numElements, const char* filename = __FILE__, PxI32 line = __LINE__)
+ {
+ void* ptr = allocDeviceBufferInternal(PxU64(numElements) * sizeof(T), filename, line);
+ deviceBuffer = reinterpret_cast(ptr);
+ }
+
+ /**
+ * \brief Allocates a device buffer and returns the pointer to the memory
+ *
+ * The cuda context will get acquired automatically
+ * \deprecated - use PxCudaHelpersExt::allocDeviceBuffer instead.
+ */
+ template
+ PX_DEPRECATED T* allocDeviceBuffer(PxU32 numElements, const char* filename = __FILE__, PxI32 line = __LINE__)
+ {
+ void* ptr = allocDeviceBufferInternal(PxU64(numElements) * sizeof(T), filename, line);
+ return reinterpret_cast(ptr);
+ }
+
+ /**
+ * \brief Frees a device buffer
+ *
+ * The cuda context will get acquired automatically
+ * \deprecated - use PxCudaHelpersExt::freeDeviceBuffer instead.
+ */
+ template
+ PX_DEPRECATED void freeDeviceBuffer(T*& deviceBuffer)
+ {
+ freeDeviceBufferInternal(deviceBuffer);
+ deviceBuffer = NULL;
+ }
+
+ /**
+ * \brief Allocates a pinned host buffer
+ *
+ * A pinned host buffer can be used on the gpu after getting a mapped device pointer from the pinned host buffer pointer, see getMappedDevicePtr
+ * The cuda context will get acquired automatically
+ * \see getMappedDevicePtr
+ * \deprecated - use PxCudaHelpersExt::allocPinnedHostBuffer instead.
+ */
+ template
+ PX_DEPRECATED void allocPinnedHostBuffer(T*& pinnedHostBuffer, PxU32 numElements, const char* filename = __FILE__, PxI32 line = __LINE__)
+ {
+ void* ptr = allocPinnedHostBufferInternal(PxU64(numElements) * sizeof(T), filename, line);
+ pinnedHostBuffer = reinterpret_cast(ptr);
+ }
+
+ /**
+ * \brief Allocates a pinned host buffer and returns the pointer to the memory
+ *
+ * A pinned host buffer can be used on the gpu after getting a mapped device pointer from the pinned host buffer pointer, see getMappedDevicePtr
+ * The cuda context will get acquired automatically
+ * \deprecated - use PxCudaHelpersExt::allocPinnedHostBuffer instead.
+ * \see getMappedDevicePtr
+ */
+ template
+ PX_DEPRECATED T* allocPinnedHostBuffer(PxU32 numElements, const char* filename = __FILE__, PxI32 line = __LINE__)
+ {
+ void* ptr = allocPinnedHostBufferInternal(PxU64(numElements) * sizeof(T), filename, line);
+ return reinterpret_cast(ptr);
+ }
+
+ /**
+ * \brief Frees a pinned host buffer
+ *
+ * The cuda context will get acquired automatically
+ * \deprecated - use PxCudaHelpersExt::freePinnedHostBuffer instead.
+ */
+ template
+ PX_DEPRECATED void freePinnedHostBuffer(T*& pinnedHostBuffer)
+ {
+ freePinnedHostBufferInternal(pinnedHostBuffer);
+ pinnedHostBuffer = NULL;
+ }
+
+ /**
+ * \brief Gets a mapped pointer from a pinned host buffer that can be used in cuda kernels directly
+ *
+ * Data access performance with a mapped pinned host pointer will be slower than using a device pointer directly
+ * but the changes done in the kernel will be available on the host immediately.
+ * The cuda context will get acquired automatically
+ */
+ virtual CUdeviceptr getMappedDevicePtr(void* pinnedHostBuffer) = 0;
+
+ /**
+ * \brief Acquire the CUDA context for the current thread
+ *
+ * Acquisitions are allowed to be recursive within a single thread.
+ * You can acquire the context multiple times so long as you release
+ * it the same count.
+ *
+ * The context must be acquired before using most CUDA functions.
+ */
+ virtual void acquireContext() = 0;
+
+ /**
+ * \brief Acquire the CUDA context for the current thread
+ *
+ * Acquisitions are allowed to be recursive within a single thread.
+ * You can acquire the context multiple times so long as you release
+ * it the same count.
+ *
+ * The context must be acquired before using most CUDA functions.
+ * The function will return false if context aquisition fails for some reason
+ */
+ virtual bool tryAcquireContext() = 0;
+
+ /**
+ * \brief Release the CUDA context from the current thread
+ *
+ * The CUDA context should be released as soon as practically
+ * possible, to allow other CPU threads to work efficiently.
+ */
+ virtual void releaseContext() = 0;
+
+ /**
+ * \brief Return the CUcontext
+ */
+ virtual CUcontext getContext() = 0;
+
+ /**
+ * \brief Return the CudaContext
+ */
+ virtual PxCudaContext* getCudaContext() = 0;
+
+ /**
+ * \brief Context manager has a valid CUDA context
+ *
+ * This method should be called after creating a PxCudaContextManager,
+ * especially if the manager was responsible for allocating its own
+ * CUDA context (desc.ctx == NULL).
+ */
+ virtual bool contextIsValid() const = 0;
+
+ /* Query CUDA context and device properties, without acquiring context */
+
+ virtual bool supportsArchSM10() const = 0; //!< G80
+ virtual bool supportsArchSM11() const = 0; //!< G92
+ virtual bool supportsArchSM12() const = 0; //!< GT200
+ virtual bool supportsArchSM13() const = 0; //!< GT260
+ virtual bool supportsArchSM20() const = 0; //!< GF100
+ virtual bool supportsArchSM30() const = 0; //!< GK100
+ virtual bool supportsArchSM35() const = 0; //!< GK110
+ virtual bool supportsArchSM50() const = 0; //!< GM100
+ virtual bool supportsArchSM52() const = 0; //!< GM200
+ virtual bool supportsArchSM60() const = 0; //!< GP100
+ virtual bool isIntegrated() const = 0; //!< true if GPU is an integrated (MCP) part
+ virtual bool canMapHostMemory() const = 0; //!< true if GPU map host memory to GPU (0-copy)
+ virtual int getDriverVersion() const = 0; //!< returns cached value of cuGetDriverVersion()
+ virtual size_t getDeviceTotalMemBytes() const = 0; //!< returns cached value of device memory size
+ virtual int getMultiprocessorCount() const = 0; //!< returns cache value of SM unit count
+ virtual unsigned int getClockRate() const = 0; //!< returns cached value of SM clock frequency
+ virtual int getSharedMemPerBlock() const = 0; //!< returns total amount of shared memory available per block in bytes
+ virtual int getSharedMemPerMultiprocessor() const = 0; //!< returns total amount of shared memory available per multiprocessor in bytes
+ virtual unsigned int getMaxThreadsPerBlock() const = 0; //!< returns the maximum number of threads per block
+ virtual const char *getDeviceName() const = 0; //!< returns device name retrieved from driver
+ virtual CUdevice getDevice() const = 0; //!< returns device handle retrieved from driver
+
+ virtual void setUsingConcurrentStreams(bool) = 0; //!< turn on/off using concurrent streams for GPU work
+ virtual bool getUsingConcurrentStreams() const = 0; //!< true if GPU work can run in concurrent streams
+ /* End query methods that don't require context to be acquired */
+
+ virtual void getDeviceMemoryInfo(size_t& free, size_t& total) const = 0; //!< get currently available and total memory
+
+ /**
+ * \brief Get the cuda modules that have been loaded into this context on construction
+ * \return Pointer to the cuda modules
+ */
+ virtual CUmodule* getCuModules() = 0;
+
+ /**
+ * \brief Release the PxCudaContextManager
+ *
+ * If the PxCudaContextManager created the CUDA context it was
+ * responsible for, it also frees that context.
+ *
+ * Do not release the PxCudaContextManager if there are any scenes
+ * using it. Those scenes must be released first.
+ *
+ */
+ virtual void release() = 0;
+
+protected:
+
+ /**
+ * \brief protected destructor, use release() method
+ */
+ virtual ~PxCudaContextManager() {}
+
+ PX_DEPRECATED virtual void* allocDeviceBufferInternal(PxU64 numBytes, const char* filename = NULL, PxI32 line = -1) = 0;
+ PX_DEPRECATED virtual void* allocPinnedHostBufferInternal(PxU64 numBytes, const char* filename = NULL, PxI32 line = -1) = 0;
+
+ PX_DEPRECATED virtual void freeDeviceBufferInternal(void* deviceBuffer) = 0;
+ PX_DEPRECATED virtual void freePinnedHostBufferInternal(void* pinnedHostBuffer) = 0;
+
+ PX_DEPRECATED virtual void clearDeviceBufferAsyncInternal(void* deviceBuffer, PxU32 numBytes, CUstream stream, PxI32 value) = 0;
+
+ PX_DEPRECATED virtual void copyDToHAsyncInternal(void* hostBuffer, const void* deviceBuffer, PxU32 numBytes, CUstream stream) = 0;
+ PX_DEPRECATED virtual void copyHToDAsyncInternal(void* deviceBuffer, const void* hostBuffer, PxU32 numBytes, CUstream stream) = 0;
+ PX_DEPRECATED virtual void copyDToDAsyncInternal(void* dstDeviceBuffer, const void* srcDeviceBuffer, PxU32 numBytes, CUstream stream) = 0;
+
+ PX_DEPRECATED virtual void copyDToHInternal(void* hostBuffer, const void* deviceBuffer, PxU32 numBytes) = 0;
+ PX_DEPRECATED virtual void copyHToDInternal(void* deviceBuffer, const void* hostBuffer, PxU32 numBytes) = 0;
+
+ PX_DEPRECATED virtual void memsetD8AsyncInternal(void* dstDeviceBuffer, const PxU8& value, PxU32 numBytes, CUstream stream) = 0;
+ PX_DEPRECATED virtual void memsetD32AsyncInternal(void* dstDeviceBuffer, const PxU32& value, PxU32 numIntegers, CUstream stream) = 0;
+};
+
+// These macros are deprecated. Please use the functions in extensions/PxCudaHelpersExt.h
+/**
+ \deprecated Please use the functions in extensions/PxCudaHelpersExt.h
+ */
+#define PX_DEVICE_ALLOC(cudaContextManager, deviceBuffer, numElements) cudaContextManager->allocDeviceBuffer(deviceBuffer, numElements, PX_FL)
+
+/**
+ \deprecated Please use the functions in extensions/PxCudaHelpersExt.h
+ */
+#define PX_DEVICE_ALLOC_T(T, cudaContextManager, numElements) cudaContextManager->allocDeviceBuffer(numElements, PX_FL)
+
+/**
+ \deprecated Please use the functions in extensions/PxCudaHelpersExt.h
+ */
+#define PX_DEVICE_FREE(cudaContextManager, deviceBuffer) cudaContextManager->freeDeviceBuffer(deviceBuffer);
+
+/**
+ \deprecated Please use the functions in extensions/PxCudaHelpersExt.h
+ */
+#define PX_PINNED_HOST_ALLOC(cudaContextManager, pinnedHostBuffer, numElements) cudaContextManager->allocPinnedHostBuffer(pinnedHostBuffer, numElements, PX_FL)
+
+/**
+ \deprecated Please use the functions in extensions/PxCudaHelpersExt.h
+ */
+#define PX_PINNED_HOST_ALLOC_T(T, cudaContextManager, numElements) cudaContextManager->allocPinnedHostBuffer(numElements, PX_FL)
+
+/**
+ \deprecated Please use the functions in extensions/PxCudaHelpersExt.h
+ */
+#define PX_PINNED_HOST_FREE(cudaContextManager, pinnedHostBuffer) cudaContextManager->freePinnedHostBuffer(pinnedHostBuffer);
+
+/**
+ * \brief Convenience class for holding CUDA lock within a scope
+ */
+class PxScopedCudaLock
+{
+public:
+ /**
+ * \brief ScopedCudaLock constructor
+ */
+ PxScopedCudaLock(PxCudaContextManager& ctx) : mCtx(&ctx)
+ {
+ mCtx->acquireContext();
+ }
+
+ /**
+ * \brief ScopedCudaLock destructor
+ */
+ ~PxScopedCudaLock()
+ {
+ mCtx->releaseContext();
+ }
+
+protected:
+
+ /**
+ * \brief CUDA context manager pointer (initialized in the constructor)
+ */
+ PxCudaContextManager* mCtx;
+};
+
+#if !PX_DOXYGEN
+} // namespace physx
+#endif
+
+#endif // PX_SUPPORT_GPU_PHYSX
+#endif
diff --git a/Jusin154_Team3D/Engine/Public/PhysX/cudamanager/PxCudaTypes.h b/Jusin154_Team3D/Engine/Public/PhysX/cudamanager/PxCudaTypes.h
new file mode 100644
index 000000000..73959a310
--- /dev/null
+++ b/Jusin154_Team3D/Engine/Public/PhysX/cudamanager/PxCudaTypes.h
@@ -0,0 +1,71 @@
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// * Neither the name of NVIDIA CORPORATION nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
+// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// Copyright (c) 2008-2025 NVIDIA Corporation. All rights reserved.
+
+#ifndef PX_CUDA_TYPES_H
+#define PX_CUDA_TYPES_H
+
+//type definitions to avoid forced inclusion of cuda.h
+//if cuda.h is needed anyway, please include it before PxCudaContextManager.h, PxCudaContext.h or PxCudaTypes.h
+
+#include "foundation/PxPreprocessor.h"
+
+#if PX_SUPPORT_GPU_PHYSX
+#ifndef CUDA_VERSION
+
+#include "foundation/PxSimpleTypes.h"
+
+#if PX_CLANG
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++98-compat-pedantic"
+#endif
+
+#if PX_P64_FAMILY
+typedef unsigned long long CUdeviceptr;
+#else
+typedef unsigned int CUdeviceptr;
+#endif
+
+#if PX_CLANG
+#pragma clang diagnostic pop
+#endif
+
+typedef int CUdevice;
+
+typedef struct CUctx_st* CUcontext;
+typedef struct CUmod_st* CUmodule;
+typedef struct CUfunc_st* CUfunction;
+typedef struct CUstream_st* CUstream;
+typedef struct CUevent_st* CUevent;
+typedef struct CUgraphicsResource_st* CUgraphicsResource;
+
+#endif
+
+#else
+typedef struct CUstream_st* CUstream; // We declare some callbacks taking CUstream as an argument even when building with PX_SUPPORT_GPU_PHYSX = 0.
+typedef struct CUevent_st* CUevent;
+#endif // PX_SUPPORT_GPU_PHYSX
+#endif
+
diff --git a/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxBroadPhaseExt.h b/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxBroadPhaseExt.h
new file mode 100644
index 000000000..82ad54a8e
--- /dev/null
+++ b/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxBroadPhaseExt.h
@@ -0,0 +1,70 @@
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// * Neither the name of NVIDIA CORPORATION nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
+// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// Copyright (c) 2008-2025 NVIDIA Corporation. All rights reserved.
+// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
+// Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
+
+#ifndef PX_BROAD_PHASE_EXT_H
+#define PX_BROAD_PHASE_EXT_H
+
+#include "PxPhysXConfig.h"
+#include "common/PxPhysXCommonConfig.h"
+
+#if !PX_DOXYGEN
+namespace physx
+{
+class PxBounds3;
+#endif
+
+class PxBroadPhaseExt
+{
+public:
+
+ /**
+ \brief Creates regions for PxSceneDesc, from a global box.
+
+ This helper simply subdivides the given global box into a 2D grid of smaller boxes. Each one of those smaller boxes
+ is a region of interest for the broadphase. There are nbSubdiv*nbSubdiv regions in the 2D grid. The function does not
+ subdivide along the given up axis.
+
+ This is the simplest setup one can use with PxBroadPhaseType::eMBP. A more sophisticated setup would try to cover
+ the game world with a non-uniform set of regions (i.e. not just a grid).
+
+ \param[out] regions Regions computed from the input global box
+ \param[in] globalBounds World-space box covering the game world
+ \param[in] nbSubdiv Grid subdivision level. The function will create nbSubdiv*nbSubdiv regions.
+ \param[in] upAxis Up axis (0 for X, 1 for Y, 2 for Z).
+ \return number of regions written out to the 'regions' array
+
+ \see PxSceneDesc PxBroadPhaseType
+ */
+ static PxU32 createRegionsFromWorldBounds(PxBounds3* regions, const PxBounds3& globalBounds, PxU32 nbSubdiv, PxU32 upAxis=1);
+};
+
+#if !PX_DOXYGEN
+} // namespace physx
+#endif
+
+#endif
diff --git a/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxCollectionExt.h b/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxCollectionExt.h
new file mode 100644
index 000000000..e29140abb
--- /dev/null
+++ b/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxCollectionExt.h
@@ -0,0 +1,115 @@
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// * Neither the name of NVIDIA CORPORATION nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
+// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// Copyright (c) 2008-2025 NVIDIA Corporation. All rights reserved.
+// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
+// Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
+
+#ifndef PX_COLLECTION_EXT_H
+#define PX_COLLECTION_EXT_H
+
+#include "PxPhysXConfig.h"
+#include "common/PxCollection.h"
+
+#if !PX_DOXYGEN
+namespace physx
+{
+#endif
+
+ class PxCollection;
+ class PxScene;
+
+ class PxCollectionExt
+ {
+ public:
+ /**
+ \brief Removes and releases all object from a collection.
+
+ The Collection itself is not released.
+
+ If the releaseExclusiveShapes flag is not set to true, release() will not be called on exclusive shapes.
+
+ It is assumed that the application holds a reference to each of the objects in the collection, with the exception of objects that are not releasable
+ (PxBase::isReleasable()). In general, objects that violate this assumption need to be removed from the collection prior to calling releaseObjects.
+
+ \note when a shape is created with PxRigidActorExt::createExclusiveShape(), the only counted reference is held by the actor.
+ If such a shape and its actor are present in the collection, the reference count will be decremented once when the actor is released, and once when the
+ shape is released, resulting in undefined behavior. Shape reference counts can be incremented with PxShape::acquireReference().
+
+ \param[in] collection to remove and release all object from.
+ \param[in] releaseExclusiveShapes if this parameter is set to false, release() will not be called on exclusive shapes.
+ */
+ static void releaseObjects(PxCollection& collection, bool releaseExclusiveShapes = true);
+
+ /**
+ \brief Removes objects of a given type from a collection, potentially adding them to another collection.
+
+ \param[in,out] collection Collection from which objects are removed
+ \param[in] concreteType PxConcreteType of sdk objects that should be removed
+ \param[in,out] to Optional collection to which the removed objects are added
+
+ \see PxCollection, PxConcreteType
+ */
+ static void remove(PxCollection& collection, PxType concreteType, PxCollection* to = NULL);
+
+ /**
+ \brief Collects all objects in PxPhysics that are shareable across multiple scenes.
+
+ This function creates a new collection from all objects that are shareable across multiple
+ scenes. Instances of the following types are included: PxConvexMesh, PxTriangleMesh,
+ PxHeightField, PxShape and PxMaterial.
+
+ This is a helper function to ease the creation of collections for serialization.
+
+ \param[in] physics The physics SDK instance from which objects are collected. See #PxPhysics
+ \return Collection to which objects are added. See #PxCollection
+
+ \see PxCollection, PxPhysics
+ */
+ static PxCollection* createCollection(PxPhysics& physics);
+
+ /**
+ \brief Collects all objects from a PxScene.
+
+ This function creates a new collection from all objects that were added to the specified
+ PxScene. Instances of the following types are included: PxActor, PxAggregate,
+ PxArticulationReducedCoordinate and PxJoint (other PxConstraint types are not included).
+
+ This is a helper function to ease the creation of collections for serialization.
+ The function PxSerialization.complete() can be used to complete the collection with required objects prior to
+ serialization.
+
+ \param[in] scene The PxScene instance from which objects are collected. See #PxScene
+ \return Collection to which objects are added. See #PxCollection
+
+ \see PxCollection, PxScene, PxSerialization.complete()
+ */
+ static PxCollection* createCollection(PxScene& scene);
+ };
+
+#if !PX_DOXYGEN
+} // namespace physx
+#endif
+
+#endif
diff --git a/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxConstraintExt.h b/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxConstraintExt.h
new file mode 100644
index 000000000..7a63a062e
--- /dev/null
+++ b/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxConstraintExt.h
@@ -0,0 +1,63 @@
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// * Neither the name of NVIDIA CORPORATION nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
+// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// Copyright (c) 2008-2025 NVIDIA Corporation. All rights reserved.
+// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
+// Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
+
+#ifndef PX_CONSTRAINT_EXT_H
+#define PX_CONSTRAINT_EXT_H
+
+#include "foundation/PxPreprocessor.h"
+
+
+#if !PX_DOXYGEN
+namespace physx
+{
+#endif
+
+/**
+\brief Unique identifiers for extensions classes which implement a constraint based on PxConstraint.
+
+\note Users which want to create their own custom constraint types should choose an ID larger or equal to eNEXT_FREE_ID
+and not eINVALID_ID.
+
+\see PxConstraint PxSimulationEventCallback.onConstraintBreak()
+*/
+struct PxConstraintExtIDs
+{
+ enum Enum
+ {
+ eJOINT,
+ eVEHICLE_JOINT,
+ eNEXT_FREE_ID,
+ eINVALID_ID = 0x7fffffff
+ };
+};
+
+#if !PX_DOXYGEN
+} // namespace physx
+#endif
+
+#endif
diff --git a/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxConvexCoreExt.h b/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxConvexCoreExt.h
new file mode 100644
index 000000000..0b84e3cd7
--- /dev/null
+++ b/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxConvexCoreExt.h
@@ -0,0 +1,76 @@
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// * Neither the name of NVIDIA CORPORATION nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
+// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// Copyright (c) 2008-2025 NVIDIA Corporation. All rights reserved.
+// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
+// Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
+
+#ifndef PX_CONVEX_GEOMETRY_EXT_H
+#define PX_CONVEX_GEOMETRY_EXT_H
+
+#include "foundation/PxMat33.h"
+#include "foundation/PxTransform.h"
+#include "geometry/PxConvexCoreGeometry.h"
+
+#if !PX_DOXYGEN
+namespace physx
+{
+#endif
+
+class PxBounds3;
+class PxRenderOutput;
+
+/**
+\brief Convex geometry helpers
+*/
+class PxConvexCoreExt
+{
+public:
+
+ /**
+ \brief Compute mass properties of the convex core geometry.
+ \param convex The convex geometry.
+ \param[out] density1Mass The mass of the geometry assuming unit density.
+ \param[out] inertiaTensor The inertia tensor of the geometry.
+ \param[out] centerOfMass The center of mass of the geometry.
+ */
+ static void computeMassInfo(const PxConvexCoreGeometry& convex, PxReal& density1Mass, PxMat33& inertiaTensor, PxVec3& centerOfMass);
+
+ /**
+ \brief Visualize the convex core geometry
+ \param convex The convex geometry.
+ \param pose The pose of the geometry in world space
+ \param drawCore If true, draw the core inside the full convex geometry including the margin
+ \param cullbox The culling box for visualization
+ \param out The render output object to use for visualization
+ */
+ static void visualize(const PxConvexCoreGeometry& convex, const PxTransform& pose, bool drawCore, const PxBounds3& cullbox, PxRenderOutput& out);
+
+};
+
+#if !PX_DOXYGEN
+}
+#endif
+
+#endif
diff --git a/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxConvexMeshExt.h b/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxConvexMeshExt.h
new file mode 100644
index 000000000..907e1d9b8
--- /dev/null
+++ b/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxConvexMeshExt.h
@@ -0,0 +1,68 @@
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// * Neither the name of NVIDIA CORPORATION nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
+// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// Copyright (c) 2008-2025 NVIDIA Corporation. All rights reserved.
+// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
+// Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
+
+#ifndef PX_CONVEX_MESH_EXT_H
+#define PX_CONVEX_MESH_EXT_H
+
+#include "PxPhysXConfig.h"
+#include "common/PxPhysXCommonConfig.h"
+#include "foundation/PxTransform.h"
+
+#if !PX_DOXYGEN
+namespace physx
+{
+#endif
+
+ class PxConvexMeshGeometry;
+
+ /**
+ \brief Computes closest polygon of the convex hull geometry for a given impact point
+ and impact direction. When doing sweeps against a scene, one might want to delay
+ the rather expensive computation of the hit face index for convexes until it is clear
+ the information is really needed and then use this method to get the corresponding
+ face index.
+
+ \param[in] convexGeom The convex mesh geometry.
+ \param[in] geomPose Pose for the geometry object.
+ \param[in] impactPos Impact position.
+ \param[in] unitDir Normalized impact direction.
+
+ \return Closest face index of the convex geometry.
+
+ \see PxTransform PxConvexMeshGeometry
+ */
+ PxU32 PxFindFaceIndex(const PxConvexMeshGeometry& convexGeom,
+ const PxTransform& geomPose,
+ const PxVec3& impactPos,
+ const PxVec3& unitDir);
+
+#if !PX_DOXYGEN
+} // namespace physx
+#endif
+
+#endif
diff --git a/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxCudaHelpersExt.h b/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxCudaHelpersExt.h
new file mode 100644
index 000000000..03734be7a
--- /dev/null
+++ b/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxCudaHelpersExt.h
@@ -0,0 +1,317 @@
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// * Neither the name of NVIDIA CORPORATION nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
+// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// Copyright (c) 2008-2025 NVIDIA Corporation. All rights reserved.
+// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
+// Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
+
+#ifndef PX_CUDA_HELPERS_EXT_H
+#define PX_CUDA_HELPERS_EXT_H
+
+
+#include "foundation/PxPreprocessor.h"
+
+#if PX_SUPPORT_GPU_PHYSX
+#include "foundation/PxSimpleTypes.h"
+#include "foundation/PxAssert.h"
+#include "foundation/PxFoundation.h"
+#include "cudamanager/PxCudaContextManager.h"
+#include "cudamanager/PxCudaContext.h"
+#include "cudamanager/PxCudaTypes.h"
+
+
+namespace physx
+{
+namespace Ext
+{
+
+class PxCudaHelpersExt
+{
+public:
+
+/**
+* \brief Allocates a device buffer and returns the pointer to the memory
+*
+* The cuda context will get acquired automatically
+*
+* \param[in] cudaContextManager the PxCudaContextManager managing the CUDA context the allocation should be attributed to.
+* \param[in] numElements the number of elements of type T to allocate.
+*
+* \return a pointer to the allocated memory.
+*/
+template
+static T* allocDeviceBuffer(PxCudaContextManager& cudaContextManager, PxU64 numElements)
+{
+ PxScopedCudaLock lock(cudaContextManager);
+
+ CUdeviceptr ptr = 0;
+ PxCUresult result = cudaContextManager.getCudaContext()->memAlloc(&ptr, numElements * sizeof(T));
+ if (result != 0)
+ PxGetFoundation().error(PxErrorCode::eINTERNAL_ERROR, PX_FL, "allocDeviceBuffer failed with error code %i!\n", PxI32(result));
+
+ return reinterpret_cast(ptr);
+}
+
+/**
+* \brief Frees a device buffer
+*
+* The cuda context will get acquired automatically
+*
+* \param[in] cudaContextManager the PxCudaContextManager managing the CUDA context the device buffer is attributed to.
+* \param[in] deviceBuffer reference to a pointer pointing to the device memory buffer.
+*/
+template
+static void freeDeviceBuffer(PxCudaContextManager& cudaContextManager, T*& deviceBuffer)
+{
+ if (deviceBuffer)
+ {
+ PxScopedCudaLock lock(cudaContextManager);
+ PxCUresult result = cudaContextManager.getCudaContext()->memFree(reinterpret_cast(deviceBuffer));
+ if (result != 0)
+ PxGetFoundation().error(PxErrorCode::eINTERNAL_ERROR, PX_FL, "freeDeviceBuffer failed with error code %i!\n", PxI32(result));
+
+ deviceBuffer = NULL;
+ }
+}
+
+/**
+* \brief Allocates a pinned host buffer and returns the pointer to the memory
+*
+* A pinned host buffer can be used on the gpu after getting a mapped device pointer from the pinned host buffer pointer, see getMappedDevicePtr
+* The cuda context will get acquired automatically
+*
+* \param[in] cudaContextManager the PxCudaContextManager managing the CUDA context the allocation should be attributed to.
+* \param[in] numElements the number of elements of type T to allocate.
+*
+* \return a pointer to the allocated memory.
+*/
+template
+static T* allocPinnedHostBuffer(PxCudaContextManager& cudaContextManager, PxU64 numElements)
+{
+ PxScopedCudaLock lock(cudaContextManager);
+
+ void* ptr = NULL;
+ const unsigned int cuMemhostallocDevicemap = 0x02;
+ const unsigned int cuMemhostallocPortable = 0x01;
+ PxCUresult result = cudaContextManager.getCudaContext()->memHostAlloc(&ptr, numElements * sizeof(T), cuMemhostallocDevicemap | cuMemhostallocPortable);
+ if (result != 0)
+ PxGetFoundation().error(PxErrorCode::eINTERNAL_ERROR, PX_FL, "allocPinnedHostBuffer failed with error code %i!\n", PxI32(result));
+
+ return reinterpret_cast(ptr);
+}
+
+/**
+* \brief Frees a pinned host buffer
+*
+* The cuda context will get acquired automatically
+*
+* \param[in] cudaContextManager the PxCudaContextManager managing the CUDA context the pinned memory buffer is attributed to.
+* \param[in] pinnedHostBuffer reference to a pointer pointing to the pinned memory buffer.
+*/
+template
+static void freePinnedHostBuffer(PxCudaContextManager& cudaContextManager, T*& pinnedHostBuffer)
+{
+ if (pinnedHostBuffer)
+ {
+ PxScopedCudaLock lock(cudaContextManager);
+ PxCUresult result = cudaContextManager.getCudaContext()->memFreeHost(pinnedHostBuffer);
+ if (result != 0)
+ PxGetFoundation().error(PxErrorCode::eINTERNAL_ERROR, PX_FL, "freePinnedHostBuffer failed with error code %i!\n", PxI32(result));
+
+ pinnedHostBuffer = NULL;
+ }
+}
+
+/**
+* \brief Copies a device buffer to the host
+*
+* The cuda context will get acquired automatically
+*
+* \param[in] cudaContextManager the PxCudaContextManager managing the CUDA context executing the operation.
+* \param[in] hostBuffer pointer to the destination (pinned) host memory buffer.
+* \param[in] deviceBuffer pointer to the source device buffer.
+* \param[in] numElements the number of elements of type T to copy.
+*/
+template
+static void copyDToH(PxCudaContextManager& cudaContextManager, T* hostBuffer, const T* deviceBuffer, PxU64 numElements)
+{
+ if (!deviceBuffer || !hostBuffer)
+ return;
+
+ PxScopedCudaLock lock(cudaContextManager);
+ PxU64 numBytes = numElements * sizeof(T);
+
+ PxCUresult result = cudaContextManager.getCudaContext()->memcpyDtoH(hostBuffer, CUdeviceptr(deviceBuffer), numBytes);
+ if (result != 0)
+ PxGetFoundation().error(PxErrorCode::eINTERNAL_ERROR, PX_FL, "copyDToH failed with error code %i!\n", PxI32(result));
+}
+
+/**
+* \brief Copies a host buffer to the device
+*
+* The cuda context will get acquired automatically
+*
+* \param[in] cudaContextManager the PxCudaContextManager managing the CUDA context executing the operation.
+* \param[in] deviceBuffer pointer to the destination device buffer.
+* \param[in] hostBuffer pointer to the source (pinned) host memory buffer.
+* \param[in] numElements the number of elements of type T to copy.
+*/
+template
+static void copyHToD(PxCudaContextManager& cudaContextManager, T* deviceBuffer, const T* hostBuffer, PxU64 numElements)
+{
+ if (!deviceBuffer || !hostBuffer)
+ return;
+
+ PxScopedCudaLock lock(cudaContextManager);
+ PxU64 numBytes = numElements * sizeof(T);
+
+ PxCUresult result = cudaContextManager.getCudaContext()->memcpyHtoD(CUdeviceptr(deviceBuffer), hostBuffer, numBytes);
+ if (result != 0)
+ PxGetFoundation().error(PxErrorCode::eINTERNAL_ERROR, PX_FL, "copyHtoD failed with error code %i!\n", PxI32(result));
+}
+
+/**
+* \brief Schedules device to host copy operation on the specified stream
+*
+* The cuda context will get acquired automatically
+*
+* \param[in] cudaContextManager the PxCudaContextManager managing the CUDA context executing the operation.
+* \param[in] hostBuffer pointer to the destination (pinned) host memory buffer.
+* \param[in] deviceBuffer pointer to the source device buffer.
+* \param[in] numElements the number of elements of type T to copy.
+* \param[in] stream the CUDA stream to perform the operation on.
+*/
+template
+static void copyDToHAsync(PxCudaContextManager& cudaContextManager, T* hostBuffer, const T* deviceBuffer, PxU64 numElements, CUstream stream)
+{
+ if (!deviceBuffer || !hostBuffer)
+ return;
+
+ PxScopedCudaLock lock(cudaContextManager);
+ PxU64 numBytes = numElements * sizeof(T);
+
+ PxCUresult result = cudaContextManager.getCudaContext()->memcpyDtoHAsync(hostBuffer, CUdeviceptr(deviceBuffer), numBytes, stream);
+ if (result != 0)
+ PxGetFoundation().error(PxErrorCode::eINTERNAL_ERROR, PX_FL, "copyDtoHAsync failed with error code %i!\n", PxI32(result));
+}
+
+/**
+* \brief Schedules host to device copy operation on the specified stream
+*
+* The cuda context will get acquired automatically
+*
+* \param[in] cudaContextManager the PxCudaContextManager managing the CUDA context executing the operation.
+* \param[in] deviceBuffer pointer to the destination device buffer.
+* \param[in] hostBuffer pointer to the source (pinned) host memory buffer.
+* \param[in] numElements the number of elements of type T to copy.
+* \param[in] stream the CUDA stream to perform the operation on.
+*/
+template
+static void copyHToDAsync(PxCudaContextManager& cudaContextManager, T* deviceBuffer, const T* hostBuffer, PxU64 numElements, CUstream stream)
+{
+ if (!deviceBuffer || !hostBuffer)
+ return;
+
+ PxScopedCudaLock lock(cudaContextManager);
+ PxU64 numBytes = numElements * sizeof(T);
+
+ PxCUresult result = cudaContextManager.getCudaContext()->memcpyHtoDAsync(CUdeviceptr(deviceBuffer), hostBuffer, numBytes, stream);
+ if (result != 0)
+ PxGetFoundation().error(PxErrorCode::eINTERNAL_ERROR, PX_FL, "copyHtoDAsync failed with error code %i!\n", PxI32(result));
+}
+
+/**
+* \brief Schedules device to device copy operation on the specified stream
+*
+* The cuda context will get acquired automatically
+*
+* \param[in] cudaContextManager the PxCudaContextManager managing the CUDA context executing the operation.
+* \param[in] dstDeviceBuffer pointer to the destination device buffer.
+* \param[in] srcDeviceBuffer pointer to the source device buffer.
+* \param[in] numElements the number of elements of type T to copy.
+* \param[in] stream the CUDA stream to perform the operation on.
+*/
+template
+static void copyDToDAsync(PxCudaContextManager& cudaContextManager, T* dstDeviceBuffer, const T* srcDeviceBuffer, PxU64 numElements, CUstream stream)
+{
+ if (!srcDeviceBuffer || !dstDeviceBuffer)
+ return;
+
+ PxScopedCudaLock lock(cudaContextManager);
+ PxU64 numBytes = numElements * sizeof(T);
+
+ PxCUresult result = cudaContextManager.getCudaContext()->memcpyDtoDAsync(CUdeviceptr(dstDeviceBuffer), CUdeviceptr(srcDeviceBuffer), numBytes, stream);
+ if (result != 0)
+ PxGetFoundation().error(PxErrorCode::eINTERNAL_ERROR, PX_FL, "copyDtoDAsync failed with error code %i!\n", PxI32(result));
+}
+
+/**
+* \brief Schedules a memset operation on the device on the specified stream. Only supported for 1 bytes or 4 byte data types.
+*
+* The cuda context will get acquired automatically
+*
+* \param[in] cudaContextManager the PxCudaContextManager managing the CUDA context executing the operation.
+* \param[in] dstDeviceBuffer pointer to the destination device buffer.
+* \param[in] value the value to set the memory to.
+* \param[in] numElements the number of elements of type T to set.
+* \param[in] stream the CUDA stream to perform the operation on.
+*/
+template
+static void memsetAsync(PxCudaContextManager& cudaContextManager, T* dstDeviceBuffer, const T& value, PxU64 numElements, CUstream stream)
+{
+ PX_COMPILE_TIME_ASSERT(sizeof(T) == sizeof(PxU32) || sizeof(T) == sizeof(PxU8));
+
+ if (!dstDeviceBuffer)
+ return;
+
+ PxScopedCudaLock lock(cudaContextManager);
+ PxU64 numBytes = numElements * sizeof(T);
+
+ if (sizeof(T) == sizeof(PxU32))
+ {
+ PxCUresult result = cudaContextManager.getCudaContext()->memsetD32Async(CUdeviceptr(dstDeviceBuffer), reinterpret_cast(value), numBytes >> 2, stream);
+ if (result != 0)
+ PxGetFoundation().error(PxErrorCode::eINTERNAL_ERROR, PX_FL, "memsetAsync failed with error code %i!\n", PxI32(result));
+ }
+ else
+ {
+ PxCUresult result = cudaContextManager.getCudaContext()->memsetD8Async(CUdeviceptr(dstDeviceBuffer), reinterpret_cast(value), numBytes, stream);
+ if (result != 0)
+ PxGetFoundation().error(PxErrorCode::eINTERNAL_ERROR, PX_FL, "memsetAsync failed with error code %i!\n", PxI32(result));
+ }
+}
+};
+
+#define PX_EXT_DEVICE_MEMORY_ALLOC(T, cudaContextManager, numElements) physx::Ext::PxCudaHelpersExt::allocDeviceBuffer(cudaContextManager, numElements)
+#define PX_EXT_DEVICE_MEMORY_FREE(cudaContextManager, deviceBuffer) physx::Ext::PxCudaHelpersExt::freeDeviceBuffer(cudaContextManager, deviceBuffer);
+
+#define PX_EXT_PINNED_MEMORY_ALLOC(T, cudaContextManager, numElements) physx::Ext::PxCudaHelpersExt::allocPinnedHostBuffer(cudaContextManager, numElements)
+#define PX_EXT_PINNED_MEMORY_FREE(cudaContextManager, pinnedHostBuffer) physx::Ext::PxCudaHelpersExt::freePinnedHostBuffer(cudaContextManager, pinnedHostBuffer);
+
+}
+}
+
+#endif
+
+#endif
diff --git a/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxCustomGeometryExt.h b/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxCustomGeometryExt.h
new file mode 100644
index 000000000..0598c9ab4
--- /dev/null
+++ b/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxCustomGeometryExt.h
@@ -0,0 +1,221 @@
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// * Neither the name of NVIDIA CORPORATION nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
+// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// Copyright (c) 2008-2025 NVIDIA Corporation. All rights reserved.
+// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
+// Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
+
+#ifndef PX_CUSTOM_GEOMETRY_EXT_H
+#define PX_CUSTOM_GEOMETRY_EXT_H
+
+#include "geometry/PxCustomGeometry.h"
+#include "geometry/PxGjkQuery.h"
+
+#if !PX_DOXYGEN
+namespace physx
+{
+#endif
+
+class PxGeometry;
+class PxMassProperties;
+class PxGeometryHolder;
+struct PxContactPoint;
+
+/**
+\brief Pre-made custom geometry callbacks implementations.
+*/
+class PxCustomGeometryExt
+{
+public:
+
+ /// \cond PRIVATE
+ struct BaseConvexCallbacks : PxCustomGeometry::Callbacks, PxGjkQuery::Support
+ {
+ BaseConvexCallbacks(float _margin) : margin(_margin) {}
+
+ // override PxCustomGeometry::Callbacks
+ virtual PxBounds3 getLocalBounds(const PxGeometry& geometry) const;
+ virtual bool generateContacts(const PxGeometry& geom0, const PxGeometry& geom1, const PxTransform& pose0, const PxTransform& pose1,
+ const PxReal contactDistance, const PxReal meshContactMargin, const PxReal toleranceLength,
+ PxContactBuffer& contactBuffer) const;
+ virtual PxU32 raycast(const PxVec3& origin, const PxVec3& unitDir, const PxGeometry& geom, const PxTransform& pose,
+ PxReal maxDist, PxHitFlags hitFlags, PxU32 maxHits, PxGeomRaycastHit* rayHits, PxU32 stride, PxRaycastThreadContext*) const;
+ virtual bool overlap(const PxGeometry& geom0, const PxTransform& pose0, const PxGeometry& geom1, const PxTransform& pose1, PxOverlapThreadContext*) const;
+ virtual bool sweep(const PxVec3& unitDir, const PxReal maxDist,
+ const PxGeometry& geom0, const PxTransform& pose0, const PxGeometry& geom1, const PxTransform& pose1,
+ PxGeomSweepHit& sweepHit, PxHitFlags hitFlags, const PxReal inflation, PxSweepThreadContext*) const;
+ virtual bool usePersistentContactManifold(const PxGeometry& geometry, PxReal& breakingThreshold) const;
+
+ // override PxGjkQuery::Support
+ virtual PxReal getMargin() const { return margin; }
+ // set margin
+ void setMargin(float m);
+
+ protected:
+
+ // Shape margin
+ float margin;
+
+ // Substitute geometry
+ virtual bool useSubstituteGeometry(PxGeometryHolder& geom, PxTransform& preTransform, const PxContactPoint& p, const PxTransform& pose0) const = 0;
+ };
+ /// \endcond
+
+ /**
+ \brief Cylinder geometry callbacks
+ */
+ struct CylinderCallbacks : BaseConvexCallbacks
+ {
+ /**
+ \brief Construct cylinder geometry callbacks object
+
+ \param[in] height The cylinder height.
+ \param[in] radius The cylinder radius.
+ \param[in] axis The cylinder axis (0 - X, 1 - Y, 2 - Z).
+ \param[in] margin The cylinder margin.
+ */
+ CylinderCallbacks(float height, float radius, int axis = 0, float margin = 0);
+
+ /// \brief Set cylinder height
+ /// \param[in] h The cylinder height
+ void setHeight(float h);
+ /// \brief Get cylinder height
+ /// \return The cylinder height
+ float getHeight() const { return height; }
+
+ /// \brief Set cylinder radius
+ /// \param[in] r The cylinder radius.
+ void setRadius(float r);
+ /// \brief Get cylinder radius
+ /// \return The cylinder radius
+ float getRadius() const { return radius; }
+
+ /// \brief Set cylinder axis
+ /// \param[in] a The cylinder axis (0 - X, 1 - Y, 2 - Z).
+ void setAxis(int a);
+ /// \brief Get cylinder axis
+ /// \return The cylinder axis
+ int getAxis() const { return axis; }
+
+ /// \cond PRIVATE
+ // override PxCustomGeometry::Callbacks
+ DECLARE_CUSTOM_GEOMETRY_TYPE
+ virtual void visualize(const PxGeometry&, PxRenderOutput&, const PxTransform&, const PxBounds3&) const;
+ virtual void computeMassProperties(const PxGeometry& geometry, PxMassProperties& massProperties) const;
+
+ // override PxGjkQuery::Support
+ virtual PxVec3 supportLocal(const PxVec3& dir) const;
+
+ protected:
+
+ // Cylinder height
+ float height;
+ // Cylinder radius
+ float radius;
+ // Cylinder axis
+ int axis;
+
+ // Substitute geometry
+ virtual bool useSubstituteGeometry(PxGeometryHolder& geom, PxTransform& preTransform, const PxContactPoint& p, const PxTransform& pose0) const;
+
+ // Radius at height
+ float getRadiusAtHeight(float height) const;
+ /// \endcond
+ };
+
+ /**
+ \brief Cone geometry callbacks
+ */
+ struct ConeCallbacks : BaseConvexCallbacks
+ {
+ /**
+ \brief Construct cone geometry callbacks object
+
+ \param[in] height The cylinder height.
+ \param[in] radius The cylinder radius.
+ \param[in] axis The cylinder axis (0 - X, 1 - Y, 2 - Z).
+ \param[in] margin The cylinder margin.
+ */
+ ConeCallbacks(float height, float radius, int axis = 0, float margin = 0);
+
+ /// \brief Set cone height
+ /// \param[in] h The cone height
+ void setHeight(float h);
+ /// \brief Get cone height
+ /// \return The cone height
+ float getHeight() const { return height; }
+
+ /// \brief Set cone radius
+ /// \param[in] r The cone radius
+ void setRadius(float r);
+ /// \brief Get cone radius
+ /// \return The cone radius
+ float getRadius() const { return radius; }
+
+ /// \brief Set cone axis
+ /// \param[in] a The cone axis
+ void setAxis(int a);
+ /// \brief Get cone axis
+ /// \return The cone axis
+ int getAxis() const { return axis; }
+
+ /// \cond PRIVATE
+ // override PxCustomGeometry::Callbacks
+ DECLARE_CUSTOM_GEOMETRY_TYPE
+ virtual void visualize(const PxGeometry&, PxRenderOutput&, const PxTransform&, const PxBounds3&) const;
+ virtual void computeMassProperties(const PxGeometry& geometry, PxMassProperties& massProperties) const;
+
+ // override PxGjkQuery::Support
+ virtual PxVec3 supportLocal(const PxVec3& dir) const;
+
+ protected:
+
+ // Cone height
+ float height;
+ // Cone radius
+ float radius;
+ // Cone axis
+ int axis;
+
+ // Substitute geometry
+ virtual bool useSubstituteGeometry(PxGeometryHolder& geom, PxTransform& preTransform, const PxContactPoint& p, const PxTransform& pose0) const;
+
+ // Radius at height
+ float getRadiusAtHeight(float height) const;
+ /// \endcond
+ };
+};
+
+/// \cond PRIVATE
+// OmniPVD friendly aliases
+typedef PxCustomGeometryExt::BaseConvexCallbacks PxCustomGeometryExtBaseConvexCallbacks;
+typedef PxCustomGeometryExt::CylinderCallbacks PxCustomGeometryExtCylinderCallbacks;
+typedef PxCustomGeometryExt::ConeCallbacks PxCustomGeometryExtConeCallbacks;
+/// \endcond
+
+#if !PX_DOXYGEN
+}
+#endif
+
+#endif
diff --git a/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxCustomSceneQuerySystem.h b/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxCustomSceneQuerySystem.h
new file mode 100644
index 000000000..77ef6fe80
--- /dev/null
+++ b/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxCustomSceneQuerySystem.h
@@ -0,0 +1,187 @@
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// * Neither the name of NVIDIA CORPORATION nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
+// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// Copyright (c) 2008-2025 NVIDIA Corporation. All rights reserved.
+// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
+// Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
+
+#ifndef PX_NEW_SCENE_QUERY_SYSTEM_H
+#define PX_NEW_SCENE_QUERY_SYSTEM_H
+
+#include "PxSceneQuerySystem.h"
+
+#if !PX_DOXYGEN
+namespace physx
+{
+#endif
+
+ /**
+ \brief A custom scene query system.
+
+ This is an example of a custom scene query system. It augments the PxSceneQuerySystem API to support an arbitrary number
+ of "pruners", instead of the usual hardcoded two.
+
+ It might not be possible to support the whole PxSceneQuerySystem API in this context. See the source code for details.
+
+ \see PxSceneQuerySystem
+ */
+ class PxCustomSceneQuerySystem : public PxSceneQuerySystem
+ {
+ public:
+ PxCustomSceneQuerySystem() {}
+ virtual ~PxCustomSceneQuerySystem() {}
+
+ /**
+ \brief Adds a pruner to the system.
+
+ The internal PhysX scene-query system uses two regular pruners (one for static shapes, one for dynamic shapes) and an optional
+ compound pruner. Our custom scene query system supports an arbitrary number of regular pruners.
+
+ This can be useful to reduce the load on each pruner, in particular during updates, when internal trees are rebuilt in the
+ background. On the other hand this implementation simply iterates over all created pruners to perform queries, so their cost
+ might increase if a large number of pruners is used.
+
+ In any case this serves as an example of how the PxSceneQuerySystem API can be used to customize scene queries.
+
+ \param[in] primaryType Desired primary (main) type for the new pruner
+ \param[in] secondaryType Secondary type when primary type is PxPruningStructureType::eDYNAMIC_AABB_TREE.
+ \param[in] preallocated Optional number of preallocated shapes in the new pruner
+
+ \return A pruner index
+
+ \see PxCustomSceneQuerySystem PxSceneQueryUpdateMode PxCustomSceneQuerySystemAdapter PxSceneDesc::sceneQuerySystem
+ */
+ virtual PxU32 addPruner(PxPruningStructureType::Enum primaryType, PxDynamicTreeSecondaryPruner::Enum secondaryType, PxU32 preallocated=0) = 0;
+
+ /**
+ \brief Start custom build-steps for all pruners
+
+ This function is used in combination with customBuildstep() and finishCustomBuildstep() to let users take control
+ of the pruners' build-step & commit calls - basically the pruners' update functions. These functions should be used
+ with the PxSceneQueryUpdateMode::eBUILD_DISABLED_COMMIT_DISABLED update mode, otherwise the build-steps will happen
+ automatically in fetchResults. For N pruners it can be more efficient to use these custom build-step functions to
+ perform the updates in parallel:
+
+ - call startCustomBuildstep() first (one synchronous call)
+ - for each pruner, call customBuildstep() (asynchronous calls from multiple threads)
+ - once it is done, call finishCustomBuildstep() to finish the update (synchronous call)
+
+ The multi-threaded update is more efficient here than what it is in PxScene, because the "flushShapes()" call is
+ also multi-threaded (while it is not in PxScene).
+
+ Note that users are responsible for locks here, and these calls should not overlap with other SQ calls. In particular
+ one should not add new objects to the SQ system or perform queries while these calls are happening.
+
+ \return The number of pruners in the system.
+
+ \see customBuildstep finishCustomBuildstep PxSceneQueryUpdateMode
+ */
+ virtual PxU32 startCustomBuildstep() = 0;
+
+ /**
+ \brief Perform a custom build-step for a given pruner.
+
+ \param[in] index Pruner index (should be between 0 and the number returned by startCustomBuildstep)
+
+ \see startCustomBuildstep finishCustomBuildstep
+ */
+ virtual void customBuildstep(PxU32 index) = 0;
+
+ /**
+ \brief Finish custom build-steps
+
+ Call this function once after all the customBuildstep() calls are done.
+
+ \see startCustomBuildstep customBuildstep
+ */
+ virtual void finishCustomBuildstep() = 0;
+ };
+
+ /**
+ \brief An adapter class to customize the object-to-pruner mapping.
+
+ In the regular PhysX code static shapes went to the static pruner, and dynamic shapes went to the
+ dynamic pruner.
+
+ This class is a replacement for this mapping when N user-defined pruners are involved.
+ */
+ class PxCustomSceneQuerySystemAdapter
+ {
+ public:
+ PxCustomSceneQuerySystemAdapter() {}
+ virtual ~PxCustomSceneQuerySystemAdapter() {}
+
+ /**
+ \brief Gets a pruner index for an actor/shape.
+
+ This user-defined function tells the system in which pruner a given actor/shape should go.
+
+ \note The returned index must be valid, i.e. it must have been previously returned to users by PxCustomSceneQuerySystem::addPruner.
+
+ \param[in] actor The actor
+ \param[in] shape The shape
+
+ \return A pruner index for this actor/shape.
+
+ \see PxRigidActor PxShape PxCustomSceneQuerySystem::addPruner
+ */
+ virtual PxU32 getPrunerIndex(const PxRigidActor& actor, const PxShape& shape) const = 0;
+
+ /**
+ \brief Pruner filtering callback.
+
+ This will be called for each query to validate whether it should process a given pruner.
+
+ \param[in] prunerIndex The index of currently processed pruner
+ \param[in] context The query context
+ \param[in] filterData The query's filter data
+ \param[in] filterCall The query's filter callback
+
+ \return True to process the pruner, false to skip it entirely
+ */
+ virtual bool processPruner(PxU32 prunerIndex, const PxQueryThreadContext* context, const PxQueryFilterData& filterData, PxQueryFilterCallback* filterCall) const = 0;
+ };
+
+ /**
+ \brief Creates a custom scene query system.
+
+ This is similar to PxCreateExternalSceneQuerySystem, except this function creates a PxCustomSceneQuerySystem object.
+ It can be plugged to PxScene the same way, via PxSceneDesc::sceneQuerySystem.
+
+ \param[in] sceneQueryUpdateMode Desired update mode
+ \param[in] contextID Context ID parameter, sent to the profiler
+ \param[in] adapter Adapter class implementing our extended API
+ \param[in] usesTreeOfPruners True to keep pruners themselves in a BVH, which might increase query performance if a lot of pruners are involved
+
+ \return A custom SQ system instance
+
+ \see PxCustomSceneQuerySystem PxSceneQueryUpdateMode PxCustomSceneQuerySystemAdapter PxSceneDesc::sceneQuerySystem
+ */
+ PxCustomSceneQuerySystem* PxCreateCustomSceneQuerySystem(PxSceneQueryUpdateMode::Enum sceneQueryUpdateMode, PxU64 contextID, const PxCustomSceneQuerySystemAdapter& adapter, bool usesTreeOfPruners=false);
+
+#if !PX_DOXYGEN
+} // namespace physx
+#endif
+
+#endif
diff --git a/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxD6Joint.h b/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxD6Joint.h
new file mode 100644
index 000000000..12e7014b5
--- /dev/null
+++ b/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxD6Joint.h
@@ -0,0 +1,632 @@
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// * Neither the name of NVIDIA CORPORATION nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
+// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// Copyright (c) 2008-2025 NVIDIA Corporation. All rights reserved.
+// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
+// Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
+
+#ifndef PX_D6_JOINT_H
+#define PX_D6_JOINT_H
+
+#include "extensions/PxJoint.h"
+#include "extensions/PxJointLimit.h"
+#include "foundation/PxFlags.h"
+
+#if !PX_DOXYGEN
+namespace physx
+{
+#endif
+
+class PxD6Joint;
+
+/**
+\brief Create a D6 joint.
+
+ \param[in] physics The physics SDK
+ \param[in] actor0 An actor to which the joint is attached. NULL may be used to attach the joint to a specific point in the world frame
+ \param[in] localFrame0 The position and orientation of the joint relative to actor0
+ \param[in] actor1 An actor to which the joint is attached. NULL may be used to attach the joint to a specific point in the world frame
+ \param[in] localFrame1 The position and orientation of the joint relative to actor1
+
+\see PxD6Joint
+*/
+PxD6Joint* PxD6JointCreate(PxPhysics& physics, PxRigidActor* actor0, const PxTransform& localFrame0, PxRigidActor* actor1, const PxTransform& localFrame1);
+
+/**
+\brief Used to specify one of the degrees of freedom of a D6 joint.
+
+\see PxD6Joint
+*/
+struct PxD6Axis
+{
+ enum Enum
+ {
+ eX = 0, //!< motion along the X axis
+ eY = 1, //!< motion along the Y axis
+ eZ = 2, //!< motion along the Z axis
+ eTWIST = 3, //!< motion around the X axis
+ eSWING1 = 4, //!< motion around the Y axis
+ eSWING2 = 5, //!< motion around the Z axis
+ eCOUNT = 6
+ };
+};
+
+
+/**
+\brief Used to specify the range of motions allowed for a degree of freedom in a D6 joint.
+
+\see PxD6Joint
+*/
+struct PxD6Motion
+{
+ enum Enum
+ {
+ eLOCKED, //!< The DOF is locked, it does not allow relative motion.
+ eLIMITED, //!< The DOF is limited, it only allows motion within a specific range.
+ eFREE //!< The DOF is free and has its full range of motion.
+ };
+};
+
+
+/**
+\brief The configuration to use for driving to the angular component of a target pose or velocity.
+
+\see PxD6Joint::setAngularDriveConfig() PxD6Drive PxD6Joint::setDrive()
+*/
+struct PxD6AngularDriveConfig
+{
+ enum Enum
+ {
+ /**
+ \brief The joint tries to reach the angular drive target by separately driving along each angular degree of freedom.
+
+ Each angular degree of freedom can have its own set of drive parameters. The degrees of freedom are covered by a twist and two swing axes.
+ As a consequence, only the following options are available when setting the drive parameters: PxD6Drive::eSWING1, PxD6Drive::eSWING2,
+ PxD6Drive::eTWIST (see #PxD6Joint::setDrive()).
+ */
+ eSWING_TWIST,
+
+ /**
+ \brief The joint tries to reach the angular drive target by following a spherical linear interpolation (SLERP) based path.
+
+ A single set of drive parameters will be used for all angular degrees of freedom and PxD6Drive::eSLERP is the only valid option to set
+ those parameters (see #PxD6Joint::setDrive()).
+ */
+ eSLERP,
+
+ /**
+ \deprecated
+
+ \brief Legacy mode that uses a precedence system to either use the slerp or swing/twist angular drive model.
+
+ \note In this config it is not possible to set separate drive parameters for the two swing axes.
+
+ For compatibility with previous versions of PhysX, drive parameters for PxD6Drive::eTWIST, PxD6Drive::eSWING and PxD6Drive::eSLERP
+ can be set alltogether with ::eSLERP taking precedence (see #PxD6Joint::setDrive()). Use of PxD6Drive::eSWING1 and PxD6Drive::eSWING2
+ is not allowed.
+ */
+ eLEGACY PX_DEPRECATED
+ };
+};
+
+
+/**
+\brief Used to specify which axes of a D6 joint are driven.
+
+Each drive is an implicit force-limited damped spring:
+
+force = spring * (target position - position) + damping * (targetVelocity - velocity)
+
+Alternatively, the spring may be configured to generate a specified acceleration instead of a force.
+
+A linear axis is affected by drive only if the corresponding drive flag is set. There are two possible models
+for angular drive: swing/twist, which may be used to drive one or more angular degrees of freedom, or slerp,
+which may only be used to drive all three angular degrees simultaneously. Please use #PxD6AngularDriveConfig
+to configure the angular drive model.
+
+\see PxD6Joint PxD6AngularDriveConfig
+*/
+struct PxD6Drive
+{
+ enum Enum
+ {
+ eX = 0, //!< drive along the X-axis
+ eY = 1, //!< drive along the Y-axis
+ eZ = 2, //!< drive along the Z-axis
+
+ /**
+ \deprecated
+
+ \brief rotational drive around the Y- and Z-axis
+
+ \note Only allowed if the angular drive configuration is set to PxD6AngularDriveConfig::eLEGACY.
+ */
+ eSWING PX_DEPRECATED = 3,
+
+ /**
+ \brief rotational drive around the X-axis
+
+ \note Only allowed if the angular drive configuration is set to PxD6AngularDriveConfig::eLEGACY or
+ PxD6AngularDriveConfig::eSWING_TWIST.
+ */
+ eTWIST = 4,
+
+ /**
+ \brief drive of all three angular degrees along a SLERP-path
+
+ \note Only allowed if the angular drive configuration is set to PxD6AngularDriveConfig::eSLERP or
+ PxD6AngularDriveConfig::eLEGACY.
+
+ \note If the angular drive configuration is set to PxD6AngularDriveConfig::eLEGACY, then eSLERP takes
+ precedence over eSWING/eTWIST
+ */
+ eSLERP = 5,
+
+ /**
+ \brief rotational drive around the Y-axis
+
+ \note Only allowed if the angular drive configuration is set to PxD6AngularDriveConfig::eSWING_TWIST.
+ */
+ eSWING1 = 6,
+
+ /**
+ \brief rotational drive around the Z-axis
+
+ \note Only allowed if the angular drive configuration is set to PxD6AngularDriveConfig::eSWING_TWIST.
+ */
+ eSWING2 = 7,
+
+ eCOUNT = 8
+ };
+};
+
+/**
+\brief flags for configuring the drive model of a PxD6Joint
+
+\see PxD6JointDrive PxD6Joint
+*/
+struct PxD6JointDriveFlag
+{
+ enum Enum
+ {
+ eACCELERATION = (1 << 0), //!< drive spring is for the acceleration at the joint (rather than the force)
+
+ /**
+ \brief Add drive force/torque to the joint force/torque total.
+
+ If this flag is raised, the force/torque value from this drive constraint will be accumulated
+ in the force/torque total that is reported for the underlying PxConstraint object. Note that
+ because the force/torque total changes, the joint break behavior will change too.
+
+ Default: False
+
+ \see PxConstraint::getForce()
+ */
+ eOUTPUT_FORCE = (1 << 1)
+ };
+};
+typedef PxFlags PxD6JointDriveFlags;
+PX_FLAGS_OPERATORS(PxD6JointDriveFlag::Enum, PxU32)
+
+/**
+\brief parameters for configuring the drive model of a PxD6Joint
+
+\see PxD6Joint
+*/
+class PxD6JointDrive : public PxSpring
+{
+public:
+ PxReal forceLimit; //!< the force limit of the drive - may be an impulse or a force depending on PxConstraintFlag::eDRIVE_LIMITS_ARE_FORCES
+ PxD6JointDriveFlags flags; //!< the joint drive flags
+
+ /**
+ \brief default constructor for PxD6JointDrive.
+ */
+ PxD6JointDrive(): PxSpring(0,0), forceLimit(PX_MAX_F32), flags(0) {}
+
+ /**
+ \brief constructor a PxD6JointDrive.
+
+ \param[in] driveStiffness The stiffness of the drive spring.
+ \param[in] driveDamping The damping of the drive spring
+ \param[in] driveForceLimit The maximum impulse or force that can be exerted by the drive
+ \param[in] isAcceleration Whether the drive is an acceleration drive or a force drive
+ */
+ PxD6JointDrive(PxReal driveStiffness, PxReal driveDamping, PxReal driveForceLimit, bool isAcceleration = false)
+ : PxSpring(driveStiffness, driveDamping)
+ , forceLimit(driveForceLimit)
+ , flags(isAcceleration?PxU32(PxD6JointDriveFlag::eACCELERATION) : 0)
+ {}
+
+ /**
+ \brief returns true if the drive is valid
+ */
+ bool isValid() const
+ {
+ return PxIsFinite(stiffness) && stiffness>=0 &&
+ PxIsFinite(damping) && damping >=0 &&
+ PxIsFinite(forceLimit) && forceLimit >=0;
+ }
+};
+
+
+/**
+ \brief A D6 joint is a general constraint between two actors.
+
+ It allows the application to individually define the linear and rotational degrees of freedom,
+ and also to configure a variety of limits and driven degrees of freedom.
+
+ By default all degrees of freedom are locked. So to create a prismatic joint with free motion
+ along the x-axis:
+
+ \code
+ ...
+ joint->setMotion(PxD6Axis::eX, PxD6JointMotion::eFREE);
+ ...
+ \endcode
+
+ Or a Revolute joint with motion free allowed around the x-axis:
+
+ \code
+ ...
+ joint->setMotion(PxD6Axis::eTWIST, PxD6JointMotion::eFREE);
+ ...
+ \endcode
+
+ Degrees of freedom may also be set to limited instead of locked.
+
+ There are two different kinds of linear limits available. The first kind is a single limit value
+ for all linear degrees of freedom, which may act as a linear, circular, or spherical limit depending
+ on which degrees of freedom are limited. This is similar to a distance limit. Then, the second kind
+ supports a pair of limit values for each linear axis, which can be used to implement a traditional
+ prismatic joint for example.
+
+ If the twist degree of freedom is limited, is supports upper and lower limits. The two swing degrees
+ of freedom are limited with a cone limit.
+\see PxD6JointCreate() PxJoint
+*/
+class PxD6Joint : public PxJoint
+{
+public:
+
+ /**
+ \brief Set the motion type around the specified axis.
+
+ Each axis may independently specify that the degree of freedom is locked (blocking relative movement
+ along or around this axis), limited by the corresponding limit, or free.
+
+ \param[in] axis the axis around which motion is specified
+ \param[in] type the motion type around the specified axis
+
+ Default: all degrees of freedom are locked
+
+ \see getMotion() PxD6Axis PxD6Motion
+ */
+ virtual void setMotion(PxD6Axis::Enum axis, PxD6Motion::Enum type) = 0;
+
+ /**
+ \brief Get the motion type around the specified axis.
+
+ \see setMotion() PxD6Axis PxD6Motion
+
+ \param[in] axis the degree of freedom around which the motion type is specified
+ \return the motion type around the specified axis
+ */
+ virtual PxD6Motion::Enum getMotion(PxD6Axis::Enum axis) const = 0;
+
+ /**
+ \brief get the twist angle of the joint, in the range (-2*Pi, 2*Pi]
+ */
+ virtual PxReal getTwistAngle() const = 0;
+
+ /**
+ \brief get the twist angle of the joint
+
+ \deprecated Use getTwistAngle instead. Deprecated since PhysX version 4.0
+ */
+ PX_DEPRECATED PX_FORCE_INLINE PxReal getTwist() const { return getTwistAngle(); }
+
+ /**
+ \brief get the swing angle of the joint from the Y axis
+ */
+ virtual PxReal getSwingYAngle() const = 0;
+
+ /**
+ \brief get the swing angle of the joint from the Z axis
+ */
+ virtual PxReal getSwingZAngle() const = 0;
+
+ /**
+ \brief Set the distance limit for the joint.
+
+ A single limit constraints all linear limited degrees of freedom, forming a linear, circular
+ or spherical constraint on motion depending on the number of limited degrees. This is similar
+ to a distance limit.
+
+ \param[in] limit the distance limit structure
+
+ \see getDistanceLimit() PxJointLinearLimit
+ */
+ virtual void setDistanceLimit(const PxJointLinearLimit& limit) = 0;
+
+ /**
+ \brief Get the distance limit for the joint.
+
+ \return the distance limit structure
+
+ \see setDistanceLimit() PxJointLinearLimit
+ */
+ virtual PxJointLinearLimit getDistanceLimit() const = 0;
+
+ /**
+ \deprecated Use setDistanceLimit instead. Deprecated since PhysX version 4.0
+ */
+ PX_DEPRECATED PX_FORCE_INLINE void setLinearLimit(const PxJointLinearLimit& limit) { setDistanceLimit(limit); }
+
+ /**
+ \deprecated Use getDistanceLimit instead. Deprecated since PhysX version 4.0
+ */
+ PX_DEPRECATED PX_FORCE_INLINE PxJointLinearLimit getLinearLimit() const { return getDistanceLimit(); }
+
+ /**
+ \brief Set the linear limit for a given linear axis.
+
+ This function extends the previous setDistanceLimit call with the following features:
+ - there can be a different limit for each linear axis
+ - each limit is defined by two values, i.e. it can now be asymmetric
+
+ This can be used to create prismatic joints similar to PxPrismaticJoint, or point-in-quad joints,
+ or point-in-box joints.
+
+ \param[in] axis The limited linear axis (must be PxD6Axis::eX, PxD6Axis::eY or PxD6Axis::eZ)
+ \param[in] limit The linear limit pair structure
+
+ \see getLinearLimit()
+ */
+ virtual void setLinearLimit(PxD6Axis::Enum axis, const PxJointLinearLimitPair& limit) = 0;
+
+ /**
+ \brief Get the linear limit for a given linear axis.
+
+ \param[in] axis The limited linear axis (must be PxD6Axis::eX, PxD6Axis::eY or PxD6Axis::eZ)
+
+ \return the linear limit pair structure from desired axis
+
+ \see setLinearLimit() PxJointLinearLimit
+ */
+ virtual PxJointLinearLimitPair getLinearLimit(PxD6Axis::Enum axis) const = 0;
+
+ /**
+ \brief Set the twist limit for the joint.
+
+ The twist limit controls the range of motion around the twist axis.
+
+ The limit angle range is (-2*Pi, 2*Pi).
+
+ \param[in] limit the twist limit structure
+
+ \see getTwistLimit() PxJointAngularLimitPair
+ */
+ virtual void setTwistLimit(const PxJointAngularLimitPair& limit) = 0;
+
+ /**
+ \brief Get the twist limit for the joint.
+
+ \return the twist limit structure
+
+ \see setTwistLimit() PxJointAngularLimitPair
+ */
+ virtual PxJointAngularLimitPair getTwistLimit() const = 0;
+
+ /**
+ \brief Set the swing cone limit for the joint.
+
+ The cone limit is used if either or both swing axes are limited. The extents are
+ symmetrical and measured in the frame of the parent. If only one swing degree of freedom
+ is limited, the corresponding value from the cone limit defines the limit range.
+
+ \param[in] limit the cone limit structure
+
+ \see getLimitCone() PxJointLimitCone
+ */
+ virtual void setSwingLimit(const PxJointLimitCone& limit) = 0;
+
+ /**
+ \brief Get the cone limit for the joint.
+
+ \return the swing limit structure
+
+ \see setLimitCone() PxJointLimitCone
+ */
+ virtual PxJointLimitCone getSwingLimit() const = 0;
+
+ /**
+ \brief Set a pyramidal swing limit for the joint.
+
+ The pyramid limits will only be used in the following cases:
+ - both swing Y and Z are limited. The limit shape is then a pyramid.
+ - Y is limited and Z is locked, or vice versa. The limit shape is an asymmetric angular section, similar to
+ what is supported for the twist axis.
+ The remaining cases (Y limited and Z is free, or vice versa) are not supported.
+
+ \param[in] limit the cone limit structure
+
+ \see getLimitCone() PxJointLimitPyramid
+ */
+ virtual void setPyramidSwingLimit(const PxJointLimitPyramid& limit) = 0;
+
+ /**
+ \brief Get the pyramidal swing limit for the joint.
+
+ \return the swing limit structure
+
+ \see setLimitCone() PxJointLimitPyramid
+ */
+ virtual PxJointLimitPyramid getPyramidSwingLimit() const = 0;
+
+ /**
+ \brief Set the drive parameters for the specified drive type.
+
+ \note The angular drive configuration (see #PxD6AngularDriveConfig) defines what type of
+ angular drives will be accepted.
+
+ \param[in] index the type of drive being specified
+ \param[in] drive the drive parameters
+
+ \see getDrive() PxD6JointDrive PxD6AngularDriveConfig
+
+ Default The default drive spring and damping values are zero, the force limit is PX_MAX_F32, and no flags are set.
+ */
+ virtual void setDrive(PxD6Drive::Enum index, const PxD6JointDrive& drive) = 0;
+
+ /**
+ \brief Get the drive parameters for the specified drive type.
+
+ \note The angular drive configuration (see #PxD6AngularDriveConfig) defines what type of
+ angular drives will be accepted.
+
+ \param[in] index the specified drive type
+
+ \see setDrive() PxD6JointDrive PxD6AngularDriveConfig
+ */
+ virtual PxD6JointDrive getDrive(PxD6Drive::Enum index) const = 0;
+
+ /**
+ \brief Set the drive goal pose
+
+ The goal is relative to the constraint frame of actor[0]
+
+ Default the identity transform
+
+ \param[in] pose The goal drive pose if positional drive is in use.
+ \param[in] autowake If true and the attached actors are in a scene, this call wakes them up and increases their
+ wake counters to #PxSceneDesc::wakeCounterResetValue if the counter value is below the reset value.
+
+ \see setDrivePosition()
+ */
+ virtual void setDrivePosition(const PxTransform& pose, bool autowake = true) = 0;
+
+ /**
+ \brief Get the drive goal pose.
+
+ \see getDrivePosition()
+ */
+ virtual PxTransform getDrivePosition() const = 0;
+
+ /**
+ \brief Set the target goal velocity for drive.
+
+ The velocity is measured in the constraint frame of actor[0]
+
+ \param[in] linear The goal velocity for linear drive
+ \param[in] angular The goal velocity for angular drive
+ \param[in] autowake If true and the attached actors are in a scene, this call wakes them up and increases their
+ wake counters to #PxSceneDesc::wakeCounterResetValue if the counter value is below the reset value.
+
+ \see getDriveVelocity()
+ */
+ virtual void setDriveVelocity(const PxVec3& linear, const PxVec3& angular, bool autowake = true) = 0;
+
+ /**
+ \brief Get the target goal velocity for joint drive.
+
+ \param[in] linear The goal velocity for linear drive
+ \param[in] angular The goal velocity for angular drive
+
+ \see setDriveVelocity()
+ */
+ virtual void getDriveVelocity(PxVec3& linear, PxVec3& angular) const = 0;
+
+ /**
+ \brief Returns string name of PxD6Joint, used for serialization
+ */
+ virtual const char* getConcreteTypeName() const PX_OVERRIDE { return "PxD6Joint"; }
+
+protected:
+
+ //serialization
+
+ /**
+ \brief Constructor
+ */
+ PX_INLINE PxD6Joint(PxType concreteType, PxBaseFlags baseFlags) : PxJoint(concreteType, baseFlags) {}
+
+ /**
+ \brief Deserialization constructor
+ */
+ PX_INLINE PxD6Joint(PxBaseFlags baseFlags) : PxJoint(baseFlags) {}
+
+ /**
+ \brief Returns whether a given type name matches with the type of this instance
+ */
+ virtual bool isKindOf(const char* name) const { PX_IS_KIND_OF(name, "PxD6Joint", PxJoint); }
+
+ //~serialization
+
+public:
+ /**
+ \brief Returns the GPU D6 joint index.
+
+ \note Only use in combination with enabled GPU dynamics and enabled direct GPU API
+ (see #PxSceneFlag::eENABLE_GPU_DYNAMICS, #PxSceneFlag::eENABLE_DIRECT_GPU_API,
+ #PxBroadPhaseType::eGPU)
+
+ \return The GPU index, or PX_INVALID_D6_JOINT_GPU_INDEX if the joint is not part of a PxScene.
+
+ \see PxDirectGPUAPI::getD6JointData()
+ */
+ virtual PxD6JointGPUIndex getGPUIndex() const = 0;
+
+ /**
+ \brief Set the angular drive model to apply.
+
+ \note The configuration will limit the allowed set of angular drive types (see #PxD6Drive) to use
+ when calling #PxD6Joint::setDrive().
+
+ \note Changing the angular drive model, will reset all the parameters for the angular drives to
+ their default values (see #PxD6Joint::setDrive() for information on the default values).
+
+ \param[in] config The angular drive model to apply.
+
+ \see PxD6AngularDriveConfig getAngularDriveConfig()
+
+ Default PxD6AngularDriveConfig::eLEGACY but will soon change to PxD6AngularDriveConfig::eSWING_TWIST
+ */
+ virtual void setAngularDriveConfig(PxD6AngularDriveConfig::Enum config) = 0;
+
+ /**
+ \brief Get the angular drive model to apply.
+
+ \return The angular drive model to apply.
+
+ \see PxD6AngularDriveConfig setAngularDriveConfig()
+ */
+ virtual PxD6AngularDriveConfig::Enum getAngularDriveConfig() const = 0;
+};
+
+#if !PX_DOXYGEN
+} // namespace physx
+#endif
+
+#endif
diff --git a/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxD6JointCreate.h b/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxD6JointCreate.h
new file mode 100644
index 000000000..0aa43d85f
--- /dev/null
+++ b/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxD6JointCreate.h
@@ -0,0 +1,251 @@
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// * Neither the name of NVIDIA CORPORATION nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
+// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// Copyright (c) 2008-2025 NVIDIA Corporation. All rights reserved.
+// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
+// Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
+
+#ifndef PX_D6_JOINT_CREATE_H
+#define PX_D6_JOINT_CREATE_H
+
+#include "common/PxPhysXCommonConfig.h"
+#include "foundation/PxVec3.h"
+
+
+#if !PX_DOXYGEN
+namespace physx
+{
+#endif
+
+class PxPhysics;
+class PxRigidActor;
+class PxJoint;
+
+/**
+ \brief Helper function to create a fixed joint, using either a PxD6Joint or PxFixedJoint.
+
+ For fixed joints it is important that the joint frames have the same orientation. This helper function uses an identity rotation for both.
+ It is also important that the joint frames have an equivalent position in world space. The function does not check this, so it is up to users
+ to ensure that this is the case.
+
+ \param[in] physics The physics SDK
+ \param[in] actor0 An actor to which the joint is attached. NULL may be used to attach the joint to a specific point in the world frame
+ \param[in] localPos0 The position of the joint relative to actor0
+ \param[in] actor1 An actor to which the joint is attached. NULL may be used to attach the joint to a specific point in the world frame
+ \param[in] localPos1 The position of the joint relative to actor1
+ \param[in] useD6 True to use a PxD6Joint, false to use a PxFixedJoint;
+
+ \return The created joint.
+
+ \see PxD6Joint PxFixedJoint
+*/
+PxJoint* PxD6JointCreate_Fixed(PxPhysics& physics, PxRigidActor* actor0, const PxVec3& localPos0, PxRigidActor* actor1, const PxVec3& localPos1, bool useD6);
+
+/**
+ \brief Helper function to create a distance joint, using either a PxD6Joint or PxDistanceJoint.
+
+ This helper function only supports a maximum distance constraint, because PxD6Joint does not support a minimum distance constraint (contrary
+ to PxDistanceJoint).
+
+ The distance is computed between the joint frames' world-space positions. The joint frames' orientations are irrelevant here so the function
+ sets them to identity.
+
+ \param[in] physics The physics SDK
+ \param[in] actor0 An actor to which the joint is attached. NULL may be used to attach the joint to a specific point in the world frame
+ \param[in] localPos0 The position of the joint relative to actor0
+ \param[in] actor1 An actor to which the joint is attached. NULL may be used to attach the joint to a specific point in the world frame
+ \param[in] localPos1 The position of the joint relative to actor1
+ \param[in] maxDist The maximum allowed distance
+ \param[in] useD6 True to use a PxD6Joint, false to use a PxDistanceJoint;
+
+ \return The created joint.
+
+ \see PxD6Joint PxDistanceJoint
+*/
+PxJoint* PxD6JointCreate_Distance(PxPhysics& physics, PxRigidActor* actor0, const PxVec3& localPos0, PxRigidActor* actor1, const PxVec3& localPos1, float maxDist, bool useD6);
+
+/**
+ \brief Helper function to create a prismatic joint, using either a PxD6Joint or PxPrismaticJoint.
+
+ This function enforces that the joint frames have the same orientation, which is a local frame whose X is the desired translation axis.
+ This orientation is computed by the function, so users only have to define the desired translation axis (typically 1;0;0 or 0;1;0 or 0;0;1).
+
+ The translation can be limited. Limits are enforced if minLimitmaxLimit the
+ limits are not enforced and the axis is free. The limit values are computed relative to the position of actor0's joint frame.
+
+ The function creates hard limits, and uses PhysX's default contact distance parameter.
+
+ \param[in] physics The physics SDK
+ \param[in] actor0 An actor to which the joint is attached. NULL may be used to attach the joint to a specific point in the world frame
+ \param[in] localPos0 The position of the joint relative to actor0
+ \param[in] actor1 An actor to which the joint is attached. NULL may be used to attach the joint to a specific point in the world frame
+ \param[in] localPos1 The position of the joint relative to actor1
+ \param[in] axis The axis along which objects are allowed to move, expressed in the actors' local space
+ \param[in] minLimit The minimum allowed position along the axis
+ \param[in] maxLimit The maximum allowed position along the axis
+ \param[in] useD6 True to use a PxD6Joint, false to use a PxPrismaticJoint;
+
+ \return The created joint.
+
+ \see PxD6Joint PxPrismaticJoint
+*/
+PxJoint* PxD6JointCreate_Prismatic(PxPhysics& physics, PxRigidActor* actor0, const PxVec3& localPos0, PxRigidActor* actor1, const PxVec3& localPos1, const PxVec3& axis, float minLimit, float maxLimit, bool useD6);
+
+/**
+ \brief Helper function to create a revolute joint, using either a PxD6Joint or PxRevoluteJoint.
+
+ This function enforces that the joint frames have the same orientation, which is a local frame whose X is the desired rotation axis.
+ This orientation is computed by the function, so users only have to define the desired rotation axis (typically 1;0;0 or 0;1;0 or 0;0;1).
+
+ The rotation can be limited. Limits are enforced if minLimitmaxLimit the
+ limits are not enforced and the axis is free. The limit values are computed relative to the rotation of actor0's joint frame.
+
+ The function creates hard limits, and uses PhysX's default contact distance parameter.
+
+ Limits are expressed in radians. Allowed range is ]-2*PI;+2*PI[
+
+ \param[in] physics The physics SDK
+ \param[in] actor0 An actor to which the joint is attached. NULL may be used to attach the joint to a specific point in the world frame
+ \param[in] localPos0 The position of the joint relative to actor0
+ \param[in] actor1 An actor to which the joint is attached. NULL may be used to attach the joint to a specific point in the world frame
+ \param[in] localPos1 The position of the joint relative to actor1
+ \param[in] axis The axis around which objects are allowed to move, expressed in the actors' local space
+ \param[in] minLimit The minimum allowed rotation along the axis
+ \param[in] maxLimit The maximum allowed rotation along the axis
+ \param[in] useD6 True to use a PxD6Joint, false to use a PxRevoluteJoint;
+
+ \return The created joint.
+
+ \see PxD6Joint PxRevoluteJoint
+*/
+PxJoint* PxD6JointCreate_Revolute(PxPhysics& physics, PxRigidActor* actor0, const PxVec3& localPos0, PxRigidActor* actor1, const PxVec3& localPos1, const PxVec3& axis, float minLimit, float maxLimit, bool useD6);
+
+/**
+ \brief Helper function to create a spherical joint, using either a PxD6Joint or PxSphericalJoint.
+
+ This function supports a cone limit shape, defined by a cone axis and two angular limit values.
+
+ This function enforces that the joint frames have the same orientation, which is a local frame whose X is the desired cone axis.
+ This orientation is computed by the function, so users only have to define the desired cone axis (typically 1;0;0 or 0;1;0 or 0;0;1).
+
+ The rotations can be limited. Limits are enforced if limit1>0 and limit2>0. Otherwise the motion is free. The limit values define an ellipse,
+ which is the cross-section of the cone limit shape.
+
+ The function creates hard limits, and uses PhysX's default contact distance parameter.
+
+ Limits are expressed in radians. Allowed range is ]0;PI[. Limits are symmetric around the cone axis.
+
+ The cone axis is equivalent to the twist axis for the D6 joint. The twist motion is not limited.
+
+ \param[in] physics The physics SDK
+ \param[in] actor0 An actor to which the joint is attached. NULL may be used to attach the joint to a specific point in the world frame
+ \param[in] localPos0 The position of the joint relative to actor0
+ \param[in] actor1 An actor to which the joint is attached. NULL may be used to attach the joint to a specific point in the world frame
+ \param[in] localPos1 The position of the joint relative to actor1
+ \param[in] axis The cone axis, expressed in the actors' local space
+ \param[in] limit1 Max angular limit for the ellipse along the joint frame's second axis (first axis = cone axis)
+ \param[in] limit2 Max angular limit for the ellipse along the joint frame's third axis (first axis = cone axis)
+ \param[in] useD6 True to use a PxD6Joint, false to use a PxSphericalJoint;
+
+ \return The created joint.
+
+ \see PxD6Joint PxSphericalJoint
+*/
+PxJoint* PxD6JointCreate_Spherical(PxPhysics& physics, PxRigidActor* actor0, const PxVec3& localPos0, PxRigidActor* actor1, const PxVec3& localPos1, const PxVec3& axis, float limit1, float limit2, bool useD6);
+
+/**
+ \brief Helper function to create a spherical joint, using either a PxD6Joint or PxSphericalJoint.
+
+ This function supports a cone limit shape, defined by two pairs of angular limit values. This can be used to create an asymmetric cone. If the
+ angular limit values are symmetric (i.e. minLimit1=-maxLimit1 and minLimit2=-maxLimit2) then the cone axis is the X axis in actor0's space.
+ If the limits are not symmetric, the function rotates the cone axis accordingly so that limits remain symmetric for PhysX. If this happens,
+ the initial joint frames will be different for both actors. By default minLimit1/maxLimit1 are limits around the joint's Y axis, and
+ minLimit2/maxLimit2 are limits around the joint's Z axis.
+
+ The function creates hard limits, and uses PhysX's default contact distance parameter.
+
+ Limits are expressed in radians. Allowed range is ]-PI;PI[.
+
+ The cone axis is equivalent to the twist axis for the D6 joint. The twist motion is not limited.
+
+ The returned apiroty and apirotz values can later be added to retrieved Y and Z swing angle values (from the joint), to remap
+ angle values to the given input range.
+
+ \param[out] apiroty Amount of rotation around Y used to setup actor0's joint frame
+ \param[out] apirotz Amount of rotation around Z used to setup actor0's joint frame
+ \param[in] physics The physics SDK
+ \param[in] actor0 An actor to which the joint is attached. NULL may be used to attach the joint to a specific point in the world frame
+ \param[in] localPos0 The position of the joint relative to actor0
+ \param[in] actor1 An actor to which the joint is attached. NULL may be used to attach the joint to a specific point in the world frame
+ \param[in] localPos1 The position of the joint relative to actor1
+ \param[in] minLimit1 Min angular limit along the joint frame's second axis (first axis = cone axis)
+ \param[in] maxLimit1 Max angular limit along the joint frame's second axis (first axis = cone axis)
+ \param[in] minLimit2 Min angular limit along the joint frame's third axis (first axis = cone axis)
+ \param[in] maxLimit2 Max angular limit along the joint frame's third axis (first axis = cone axis)
+ \param[in] useD6 True to use a PxD6Joint, false to use a PxSphericalJoint;
+
+ \return The created joint.
+
+ \see PxD6Joint PxSphericalJoint
+*/
+PxJoint* PxD6JointCreate_GenericCone(float& apiroty, float& apirotz, PxPhysics& physics, PxRigidActor* actor0, const PxVec3& localPos0, PxRigidActor* actor1, const PxVec3& localPos1, float minLimit1, float maxLimit1, float minLimit2, float maxLimit2, bool useD6);
+
+
+/**
+ \brief Helper function to create a D6 joint with pyramidal swing limits.
+
+ This function supports a pyramid limit shape, defined by two pairs of angular limit values. This can be used to create an asymmetric pyramid. If the
+ angular limit values are symmetric (i.e. minLimit1=-maxLimit1 and minLimit2=-maxLimit2) then the pyramid axis is the X axis in actor0's space.
+ By default minLimit1/maxLimit1 are limits around the joint's Y axis, and minLimit2/maxLimit2 are limits around the joint's Z axis.
+
+ The function creates hard limits, and uses PhysX's default contact distance parameter.
+
+ Limits are expressed in radians. Allowed range is ]-PI;PI[.
+
+ The pyramid axis is equivalent to the twist axis for the D6 joint. The twist motion is not limited.
+
+ \param[in] physics The physics SDK
+ \param[in] actor0 An actor to which the joint is attached. NULL may be used to attach the joint to a specific point in the world frame
+ \param[in] localPos0 The position of the joint relative to actor0
+ \param[in] actor1 An actor to which the joint is attached. NULL may be used to attach the joint to a specific point in the world frame
+ \param[in] localPos1 The position of the joint relative to actor1
+ \param[in] axis The pyramid axis, expressed in the actors' local space
+ \param[in] minLimit1 Min angular limit along the joint frame's second axis (first axis = pyramid axis)
+ \param[in] maxLimit1 Max angular limit along the joint frame's second axis (first axis = pyramid axis)
+ \param[in] minLimit2 Min angular limit along the joint frame's third axis (first axis = pyramid axis)
+ \param[in] maxLimit2 Max angular limit along the joint frame's third axis (first axis = pyramid axis)
+
+ \return The created joint.
+
+ \see PxD6Joint
+*/
+PxJoint* PxD6JointCreate_Pyramid(PxPhysics& physics, PxRigidActor* actor0, const PxVec3& localPos0, PxRigidActor* actor1, const PxVec3& localPos1, const PxVec3& axis,
+ float minLimit1, float maxLimit1, float minLimit2, float maxLimit2);
+
+
+#if !PX_DOXYGEN
+} // namespace physx
+#endif
+
+#endif
diff --git a/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxDefaultAllocator.h b/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxDefaultAllocator.h
new file mode 100644
index 000000000..c3039c3c4
--- /dev/null
+++ b/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxDefaultAllocator.h
@@ -0,0 +1,111 @@
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// * Neither the name of NVIDIA CORPORATION nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
+// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// Copyright (c) 2008-2025 NVIDIA Corporation. All rights reserved.
+// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
+// Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
+
+#ifndef PX_DEFAULT_ALLOCATOR_H
+#define PX_DEFAULT_ALLOCATOR_H
+
+#include "foundation/PxAllocatorCallback.h"
+#include "foundation/PxAssert.h"
+#include "foundation/PxMemory.h"
+#include "common/PxPhysXCommonConfig.h"
+
+#include
+
+#if PX_WINDOWS_FAMILY || PX_LINUX_FAMILY || PX_SWITCH
+#include
+#endif
+
+#if !PX_DOXYGEN
+namespace physx
+{
+#endif
+
+#if PX_WINDOWS_FAMILY
+// on win32 we only have 8-byte alignment guaranteed, but the CRT provides special aligned allocation fns
+PX_FORCE_INLINE void* platformAlignedAlloc(size_t size)
+{
+ return _aligned_malloc(size, 16);
+}
+
+PX_FORCE_INLINE void platformAlignedFree(void* ptr)
+{
+ _aligned_free(ptr);
+}
+#elif PX_LINUX_FAMILY || PX_SWITCH
+PX_FORCE_INLINE void* platformAlignedAlloc(size_t size)
+{
+ return ::memalign(16, size);
+}
+
+PX_FORCE_INLINE void platformAlignedFree(void* ptr)
+{
+ ::free(ptr);
+}
+#else
+// on all other platforms we get 16-byte alignment by default
+PX_FORCE_INLINE void* platformAlignedAlloc(size_t size)
+{
+ return ::malloc(size);
+}
+
+PX_FORCE_INLINE void platformAlignedFree(void* ptr)
+{
+ ::free(ptr);
+}
+#endif
+
+/**
+\brief default implementation of the allocator interface required by the SDK
+*/
+class PxDefaultAllocator : public PxAllocatorCallback
+{
+public:
+ virtual void* allocate(size_t size, const char*, const char*, int)
+ {
+ void* ptr = platformAlignedAlloc(size);
+ PX_ASSERT((size_t(ptr) & 15)==0);
+#if PX_STOMP_ALLOCATED_MEMORY
+ if(ptr != NULL)
+ {
+ PxMemSet(ptr, PxI32(0xcd), PxU32(size));
+ }
+#endif
+ return ptr;
+ }
+
+ virtual void deallocate(void* ptr)
+ {
+ platformAlignedFree(ptr);
+ }
+};
+
+#if !PX_DOXYGEN
+} // namespace physx
+#endif
+
+#endif
diff --git a/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxDefaultCpuDispatcher.h b/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxDefaultCpuDispatcher.h
new file mode 100644
index 000000000..966fa7274
--- /dev/null
+++ b/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxDefaultCpuDispatcher.h
@@ -0,0 +1,119 @@
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// * Neither the name of NVIDIA CORPORATION nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
+// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// Copyright (c) 2008-2025 NVIDIA Corporation. All rights reserved.
+// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
+// Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
+
+#ifndef PX_DEFAULT_CPU_DISPATCHER_H
+#define PX_DEFAULT_CPU_DISPATCHER_H
+
+#include "common/PxPhysXCommonConfig.h"
+#include "task/PxCpuDispatcher.h"
+
+#if !PX_DOXYGEN
+namespace physx
+{
+#endif
+
+/**
+\brief A default implementation for a CPU task dispatcher.
+
+\see PxDefaultCpuDispatcherCreate() PxCpuDispatcher
+*/
+class PxDefaultCpuDispatcher : public PxCpuDispatcher
+{
+public:
+ /**
+ \brief Deletes the dispatcher.
+
+ Do not keep a reference to the deleted instance.
+
+ \see PxDefaultCpuDispatcherCreate()
+ */
+ virtual void release() = 0;
+
+ /**
+ \brief Enables profiling at task level.
+
+ \note By default enabled only in profiling builds.
+
+ \param[in] runProfiled True if tasks should be profiled.
+ */
+ virtual void setRunProfiled(bool runProfiled) = 0;
+
+ /**
+ \brief Checks if profiling is enabled at task level.
+
+ \return True if tasks should be profiled.
+ */
+ virtual bool getRunProfiled() const = 0;
+};
+
+
+/**
+\brief If a thread ends up waiting for work it will find itself in a spin-wait loop until work becomes available.
+Three strategies are available to limit wasted cycles.
+The strategies are as follows:
+a) wait until a work task signals the end of the spin-wait period.
+b) yield the thread by providing a hint to reschedule thread execution, thereby allowing other threads to run.
+c) yield the processor by informing it that it is waiting for work and requesting it to more efficiently use compute resources.
+*/
+struct PxDefaultCpuDispatcherWaitForWorkMode
+{
+ enum Enum
+ {
+ eWAIT_FOR_WORK,
+ eYIELD_THREAD,
+ eYIELD_PROCESSOR
+ };
+};
+
+
+/**
+\brief Create default dispatcher, extensions SDK needs to be initialized first.
+
+\param[in] numThreads Number of worker threads the dispatcher should use.
+\param[in] affinityMasks Array with affinity mask for each thread. If not defined, default masks will be used.
+\param[in] mode is the strategy employed when a busy-wait is encountered.
+\param[in] yieldProcessorCount specifies the number of times a OS-specific yield processor command will be executed
+during each cycle of a busy-wait in the event that the specified mode is eYIELD_PROCESSOR
+
+\note numThreads may be zero in which case no worker thread are initialized and
+simulation tasks will be executed on the thread that calls PxScene::simulate()
+
+\note yieldProcessorCount must be greater than zero if eYIELD_PROCESSOR is the chosen mode and equal to zero for all other modes.
+
+\note eYIELD_THREAD and eYIELD_PROCESSOR modes will use compute resources even if the simulation is not running.
+It is left to users to keep threads inactive, if so desired, when no simulation is running.
+
+\see PxDefaultCpuDispatcher
+*/
+PxDefaultCpuDispatcher* PxDefaultCpuDispatcherCreate(PxU32 numThreads, PxU32* affinityMasks = NULL, PxDefaultCpuDispatcherWaitForWorkMode::Enum mode = PxDefaultCpuDispatcherWaitForWorkMode::eWAIT_FOR_WORK, PxU32 yieldProcessorCount = 0);
+
+#if !PX_DOXYGEN
+} // namespace physx
+#endif
+
+#endif
diff --git a/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxDefaultErrorCallback.h b/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxDefaultErrorCallback.h
new file mode 100644
index 000000000..10fa27c5e
--- /dev/null
+++ b/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxDefaultErrorCallback.h
@@ -0,0 +1,61 @@
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// * Neither the name of NVIDIA CORPORATION nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
+// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// Copyright (c) 2008-2025 NVIDIA Corporation. All rights reserved.
+// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
+// Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
+
+#ifndef PX_DEFAULT_ERROR_CALLBACK_H
+#define PX_DEFAULT_ERROR_CALLBACK_H
+
+#include "foundation/PxErrorCallback.h"
+#include "PxPhysXConfig.h"
+
+#if !PX_DOXYGEN
+namespace physx
+{
+#endif
+
+ /**
+ \brief default implementation of the error callback
+
+ This class is provided in order to enable the SDK to be started with the minimum of user code. Typically an application
+ will use its own error callback, and log the error to file or otherwise make it visible. Warnings and error messages from
+ the SDK are usually indicative that changes are required in order for PhysX to function correctly, and should not be ignored.
+ */
+
+ class PxDefaultErrorCallback : public PxErrorCallback
+ {
+ public:
+ PxDefaultErrorCallback();
+ virtual ~PxDefaultErrorCallback();
+
+ virtual void reportError(PxErrorCode::Enum code, const char* message, const char* file, int line) PX_OVERRIDE;
+ };
+
+#if !PX_DOXYGEN
+} // namespace physx
+#endif
+
+#endif
diff --git a/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxDefaultProfiler.h b/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxDefaultProfiler.h
new file mode 100644
index 000000000..89faab8cd
--- /dev/null
+++ b/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxDefaultProfiler.h
@@ -0,0 +1,182 @@
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// * Neither the name of NVIDIA CORPORATION nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
+// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// Copyright (c) 2008-2025 NVIDIA Corporation. All rights reserved.
+// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
+// Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
+
+#ifndef PX_DEFAULT_PROFILER_H
+#define PX_DEFAULT_PROFILER_H
+
+#include "foundation/PxProfiler.h"
+
+
+#if !PX_DOXYGEN
+namespace physx
+{
+#endif
+
+
+
+
+/**
+\brief The major and minor version of the current Default Profiler file format.
+*/
+#define PX_PROFILER_VERSION_MAJOR 0
+#define PX_PROFILER_VERSION_MINOR 1
+
+
+/**
+\brief The various profiler data types that describe what data follows in the stream.
+*/
+struct PxDefaultProfilerDataType
+{
+ enum Enum : PxU64
+ {
+ eTHREAD_BLOCK = 0, //!< A thread ID follows a thread tag. All data following a thread block are from this thread.
+
+ /*!
+ A key, size and character string follows a name registration tag. Event names are only written once per thread.
+
+ Ensure names are global or static so the character pointer is static and does not change.
+ Pointers values are used as keys to look up names. It is especially important for cross thread
+ zones so the zone names can be found across threads.
+ */
+ eNAME_REGISTRATION,
+
+ eZONE_START, //!< A PxProfilerCallback::zoneStart callback. A time tag, context and name key follows a zone start tag.
+ eZONE_END, //!< A PxProfilerCallback::zoneEnd callback. A time tag, context and name key follows a zone end tag.
+ eZONE_START_CROSS_THREAD, //!< A PxProfilerCallback::zoneStart callback with detached set to true indicating a cross thread zone.
+ eZONE_END_CROSS_THREAD, //!< A PxProfilerCallback::zoneEnd callback with detached set to true indicating a cross thread zone.
+ eVALUE_INT, //!< A PxProfilerCallback::recordData callback with an integer value.
+ eVALUE_FLOAT, //!< A PxProfilerCallback::recordData callback with a floating point value.
+ eFRAME //!< A PxProfilerCallback::recordFrame callback. Frames are simple markers that are identifable in the profiling tools.
+ };
+};
+
+struct PxDefaultProfilerVersionInfo
+{
+ PxU32 major; //!< The major version of the current file format.
+ PxU32 minor; //!< The minor version of the current file format.
+};
+
+struct PxDefaultProfilerHeader
+{
+ PxDefaultProfilerDataType::Enum type; //!< The type of event or data that follows this header. See PxDefaultProfilerDataType.
+};
+
+struct PxDefaultProfilerThread
+{
+ PxU64 threadId; //!< The thread identifier for all of the data that follows.
+};
+
+struct PxDefaultProfilerName
+{
+ PxU64 key; //!< The key to the profiler name. Used to store the name in a map for quick look ups. It is also the pointer to the character string.
+ PxU32 size; //!< Byte size of the null terminated string that follows the PxDefaultProfilerName entry in the stream. Note that due to padding the size can be larger than the string size itself.
+
+ /// @cond
+ PxU32 padding;
+ /// @endcond
+};
+
+struct PxDefaultProfilerEvent
+{
+ PxU64 time; //!< The time the event was received, in tens of nano seconds.
+ PxU64 contextId; //!< The context sent with the event. User controlled data to associate with the event.
+ PxU64 nameKey; //!< The key to look up the name at a later time so strings are not stored with every event.
+};
+
+struct PxDefaultProfilerValueEvent : public PxDefaultProfilerEvent
+{
+ union
+ {
+ PxI32 intValue; //!< Either integer or float data that is to be graphed.
+ PxF32 floatValue; //!< Either integer or float data that is to be graphed.
+ };
+
+ /// @cond
+ PxU32 padding;
+ /// @endcond
+};
+
+class PxOutputStream;
+
+/**
+
+\brief Default implementation of PxProfilerCallback to record profiling events.
+
+The profiling events are stored in a memory buffer which gets flushed to a user provided stream when the
+buffer is full, or when flush or release is called.
+
+\see PxDefaultProfilerCreate()
+*/
+class PxDefaultProfiler : public PxProfilerCallback
+{
+public:
+
+ /**
+ \brief Deletes the profiler.
+
+ Do not keep a reference to the deleted instance.
+
+ \see PxDefaultProfilerCreate()
+ */
+ virtual void release() = 0;
+
+ /**
+ \brief Write all of the collected profiling data to the output stream.
+
+ This call is not thread safe, so it should only be called during a sync point or when all threads have yielded.
+ Calling this regularly, at appropriate times will prevent the buffers from filling up and forcing a write
+ to the stream at unexpected times because writes will affect performance.
+ */
+ virtual void flush() = 0;
+};
+
+/**
+\brief Create default profiler.
+
+\note The PhysXExtensions SDK needs to be initialized first before using this method (see #PxInitExtensions)
+
+\param[in] outputStream A PxOutputStream used to write all of the recorded
+profiler events received. Writing to the stream occurs when the
+buffer is full or when flush or release is called.
+\param[in] numberOfBuffers The number of buffers to pre-allocate. One buffer is
+used per thread, so a number larger than the anticipated number of threads is best.
+If more buffers are needed, additional memory is allocated as needed, but this may
+affect performance.
+\param[in] bufferSize The number of bytes to allocate per thread for recording all
+profiler events received on that thread. Once the buffer is full, the profiling data
+is written to the stream, which will cause a slight delay. Use a larger buffer size
+to prevent this, if memory permits. The minimum buffer size is 32,767 bytes, which is also
+the default setting.
+*/
+PxDefaultProfiler* PxDefaultProfilerCreate(PxOutputStream& outputStream, PxU32 numberOfBuffers = 16, PxU32 bufferSize = 32767);
+
+#if !PX_DOXYGEN
+} // namespace physx
+#endif
+
+#endif
diff --git a/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxDefaultSimulationFilterShader.h b/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxDefaultSimulationFilterShader.h
new file mode 100644
index 000000000..118543cc0
--- /dev/null
+++ b/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxDefaultSimulationFilterShader.h
@@ -0,0 +1,265 @@
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// * Neither the name of NVIDIA CORPORATION nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
+// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// Copyright (c) 2008-2025 NVIDIA Corporation. All rights reserved.
+// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
+// Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
+
+#ifndef PX_DEFAULT_SIMULATION_FILTER_SHADER_H
+#define PX_DEFAULT_SIMULATION_FILTER_SHADER_H
+
+#include "PxPhysXConfig.h"
+
+#include "PxFiltering.h"
+
+#if !PX_DOXYGEN
+namespace physx
+{
+#endif
+
+class PxActor;
+
+/**
+\brief 64-bit mask used for collision filtering.
+
+The collision filtering equation for 2 objects o0 and o1 is:
+
+ (G0 op0 K0) op2 (G1 op1 K1) == b
+
+with
+
+
+- G0 = PxGroupsMask for object o0. See PxSetGroupsMask
+- G1 = PxGroupsMask for object o1. See PxSetGroupsMask
+- K0 = filtering constant 0. See PxSetFilterConstants
+- K1 = filtering constant 1. See PxSetFilterConstants
+- b = filtering boolean. See PxSetFilterBool
+- op0, op1, op2 = filtering operations. See PxSetFilterOps
+
+
+If the filtering equation is true, collision detection is enabled.
+
+\see PxSetFilterOps()
+*/
+class PxGroupsMask
+{
+public:
+ PX_INLINE PxGroupsMask():bits0(0),bits1(0),bits2(0),bits3(0) {}
+ PX_INLINE ~PxGroupsMask() {}
+
+ PxU16 bits0, bits1, bits2, bits3;
+};
+
+/**
+\brief Collision filtering operations.
+
+\see PxGroupsMask
+*/
+struct PxFilterOp
+{
+ enum Enum
+ {
+ PX_FILTEROP_AND,
+ PX_FILTEROP_OR,
+ PX_FILTEROP_XOR,
+ PX_FILTEROP_NAND,
+ PX_FILTEROP_NOR,
+ PX_FILTEROP_NXOR,
+ PX_FILTEROP_SWAP_AND
+ };
+};
+
+/**
+\brief Implementation of a simple filter shader that emulates PhysX 2.8.x filtering
+
+This shader provides the following logic:
+\li If one of the two filter objects is a trigger, the pair is acccepted and #PxPairFlag::eTRIGGER_DEFAULT will be used for trigger reports
+\li Else, if the filter mask logic (see further below) discards the pair it will be suppressed (#PxFilterFlag::eSUPPRESS)
+\li Else, the pair gets accepted and collision response gets enabled (#PxPairFlag::eCONTACT_DEFAULT)
+
+Filter mask logic:
+Given the two #PxFilterData structures fd0 and fd1 of two collision objects, the pair passes the filter if the following
+conditions are met:
+
+ 1) Collision groups of the pair are enabled
+ 2) Collision filtering equation is satisfied
+
+Each actor can belong to a single collision group. Use PxSetGroup to set the group of an actor and PxGetGroup to retrieve the group of an actor.
+A collision group is an integer value between 0 and 31 defining which group the actor belongs to. Because that value is written to an actor's
+shapes internally (it is stored in the shapes' PxFilterData), this feature does not work with shared shapes, unless they all belong to actors
+whose groups are similar. For example it would not work to share a shape between actors A and B, and then assign A to group 0 and B to group 1,
+as they would both internally try to write different group values to the same shape.
+
+Once actors are assigned to groups, it is possible to define how groups collide with each-other using the PxSetGroupCollisionFlag function.
+Use this function to set a simple boolean value per group pairs, defining if the corresponding groups should collide. If not, collisions between
+actors of these non-colliding groups will be automatically disabled by the PxDefaultSimulationFilterShader.
+
+\see PxSimulationFilterShader PxGetGroupCollisionFlag PxSetGroupCollisionFlag PxGetGroup PxSetGroup
+*/
+PxFilterFlags PxDefaultSimulationFilterShader(
+ PxFilterObjectAttributes attributes0, PxFilterData filterData0,
+ PxFilterObjectAttributes attributes1, PxFilterData filterData1,
+ PxPairFlags& pairFlags,
+ const void* constantBlock, PxU32 constantBlockSize);
+
+/**
+\brief Determines if collision detection is performed between a pair of groups
+
+\note Collision group is an integer between 0 and 31.
+\note PxGetGroupCollisionFlag(a, b) is the same as PxGetGroupCollisionFlag(b, a)
+
+\param[in] group1 First Group
+\param[in] group2 Second Group
+
+\return True if the groups should collide
+
+\see PxSetGroupCollisionFlag
+*/
+bool PxGetGroupCollisionFlag(const PxU16 group1, const PxU16 group2);
+
+/**
+\brief Specifies if collision should be performed by a pair of groups
+
+\note Collision group is an integer between 0 and 31.
+\note PxSetGroupCollisionFlag(a, b) is the same as PxSetGroupCollisionFlag(b, a)
+
+\param[in] group1 First Group
+\param[in] group2 Second Group
+\param[in] enable True to enable collision between the groups
+
+\see PxGetGroupCollisionFlag
+*/
+void PxSetGroupCollisionFlag(const PxU16 group1, const PxU16 group2, const bool enable);
+
+/**
+\brief Retrieves the value set with PxSetGroup()
+
+\note Collision group is an integer between 0 and 31.
+
+\param[in] actor The actor
+
+\return The collision group this actor belongs to
+
+\see PxSetGroup
+*/
+PxU16 PxGetGroup(const PxActor& actor);
+
+/**
+\brief Sets which collision group this actor is part of
+
+\note Collision group is an integer between 0 and 31.
+
+\param[in] actor The actor
+\param[in] collisionGroup Collision group this actor belongs to
+
+\see PxGetGroup
+*/
+void PxSetGroup(PxActor& actor, const PxU16 collisionGroup);
+
+/**
+\brief Retrieves filtering operation. See comments for PxGroupsMask
+
+\param[out] op0 First filter operator.
+\param[out] op1 Second filter operator.
+\param[out] op2 Third filter operator.
+
+\see PxSetFilterOps PxSetFilterBool PxSetFilterConstants
+*/
+void PxGetFilterOps(PxFilterOp::Enum& op0, PxFilterOp::Enum& op1, PxFilterOp::Enum& op2);
+
+/**
+\brief Setups filtering operations. See comments for PxGroupsMask
+
+\param[in] op0 Filter op 0.
+\param[in] op1 Filter op 1.
+\param[in] op2 Filter op 2.
+
+\see PxSetFilterBool PxSetFilterConstants
+*/
+void PxSetFilterOps(const PxFilterOp::Enum& op0, const PxFilterOp::Enum& op1, const PxFilterOp::Enum& op2);
+
+/**
+\brief Retrieves filtering's boolean value. See comments for PxGroupsMask
+
+\return flag Boolean value for filter.
+
+\see PxSetFilterBool PxSetFilterConstants
+*/
+bool PxGetFilterBool();
+
+/**
+\brief Setups filtering's boolean value. See comments for PxGroupsMask
+
+\param[in] enable Boolean value for filter.
+
+\see PxSetFilterOps PxSsetFilterConstants
+*/
+void PxSetFilterBool(const bool enable);
+
+/**
+\brief Gets filtering constant K0 and K1. See comments for PxGroupsMask
+
+\param[out] c0 the filtering constants, as a mask. See #PxGroupsMask.
+\param[out] c1 the filtering constants, as a mask. See #PxGroupsMask.
+
+\see PxSetFilterOps PxSetFilterBool PxSetFilterConstants
+*/
+void PxGetFilterConstants(PxGroupsMask& c0, PxGroupsMask& c1);
+
+/**
+\brief Setups filtering's K0 and K1 value. See comments for PxGroupsMask
+
+\param[in] c0 The new group mask. See #PxGroupsMask.
+\param[in] c1 The new group mask. See #PxGroupsMask.
+
+\see PxSetFilterOps PxSetFilterBool PxGetFilterConstants
+*/
+void PxSetFilterConstants(const PxGroupsMask& c0, const PxGroupsMask& c1);
+
+/**
+\brief Gets 64-bit mask used for collision filtering. See comments for PxGroupsMask
+
+\param[in] actor The actor
+
+\return The group mask for the actor.
+
+\see PxSetGroupsMask()
+*/
+PxGroupsMask PxGetGroupsMask(const PxActor& actor);
+
+/**
+\brief Sets 64-bit mask used for collision filtering. See comments for PxGroupsMask
+
+\param[in] actor The actor
+\param[in] mask The group mask to set for the actor.
+
+\see PxGetGroupsMask()
+*/
+void PxSetGroupsMask(PxActor& actor, const PxGroupsMask& mask);
+
+#if !PX_DOXYGEN
+} // namespace physx
+#endif
+
+#endif
diff --git a/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxDefaultStreams.h b/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxDefaultStreams.h
new file mode 100644
index 000000000..88ee4384a
--- /dev/null
+++ b/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxDefaultStreams.h
@@ -0,0 +1,143 @@
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// * Neither the name of NVIDIA CORPORATION nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
+// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// Copyright (c) 2008-2025 NVIDIA Corporation. All rights reserved.
+// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
+// Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
+
+#ifndef PX_DEFAULT_STREAMS_H
+#define PX_DEFAULT_STREAMS_H
+
+#include
+#include "common/PxPhysXCommonConfig.h"
+#include "foundation/PxIO.h"
+#include "foundation/PxFoundation.h"
+
+typedef FILE* PxFileHandle;
+
+#if !PX_DOXYGEN
+namespace physx
+{
+#endif
+
+/**
+\brief default implementation of a memory write stream
+
+\see PxOutputStream
+*/
+
+class PxDefaultMemoryOutputStream: public PxOutputStream
+{
+public:
+ PxDefaultMemoryOutputStream(PxAllocatorCallback &allocator = *PxGetAllocatorCallback());
+ virtual ~PxDefaultMemoryOutputStream();
+
+ virtual PxU32 write(const void* src, PxU32 count);
+
+ virtual PxU32 getSize() const { return mSize; }
+ virtual PxU8* getData() const { return mData; }
+
+private:
+ PxDefaultMemoryOutputStream(const PxDefaultMemoryOutputStream&);
+ PxDefaultMemoryOutputStream& operator=(const PxDefaultMemoryOutputStream&);
+
+ PxAllocatorCallback& mAllocator;
+ PxU8* mData;
+ PxU32 mSize;
+ PxU32 mCapacity;
+};
+
+/**
+\brief default implementation of a memory read stream
+
+\see PxInputData
+*/
+
+class PxDefaultMemoryInputData: public PxInputData
+{
+public:
+ PxDefaultMemoryInputData(PxU8* data, PxU32 length);
+
+ virtual PxU32 read(void* dest, PxU32 count);
+ virtual PxU32 getLength() const;
+ virtual void seek(PxU32 pos);
+ virtual PxU32 tell() const;
+
+private:
+ PxU32 mSize;
+ const PxU8* mData;
+ PxU32 mPos;
+};
+
+
+
+/**
+\brief default implementation of a file write stream
+
+\see PxOutputStream
+*/
+
+class PxDefaultFileOutputStream: public PxOutputStream
+{
+public:
+ PxDefaultFileOutputStream(const char* name);
+ virtual ~PxDefaultFileOutputStream();
+
+ virtual PxU32 write(const void* src, PxU32 count);
+ virtual bool isValid();
+private:
+ PxFileHandle mFile;
+};
+
+
+/**
+\brief default implementation of a file read stream
+
+\see PxInputData
+*/
+
+class PxDefaultFileInputData: public PxInputData
+{
+public:
+ PxDefaultFileInputData(const char* name);
+ virtual ~PxDefaultFileInputData();
+
+ virtual PxU32 read(void* dest, PxU32 count);
+ virtual void seek(PxU32 pos);
+ virtual PxU32 tell() const;
+ virtual PxU32 getLength() const;
+
+ bool isValid() const;
+private:
+ PxFileHandle mFile;
+ PxU32 mLength;
+};
+
+#if !PX_DOXYGEN
+}
+#endif
+
+
+#endif
+
diff --git a/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxDeformableSkinningExt.h b/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxDeformableSkinningExt.h
new file mode 100644
index 000000000..7b2689146
--- /dev/null
+++ b/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxDeformableSkinningExt.h
@@ -0,0 +1,99 @@
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// * Neither the name of NVIDIA CORPORATION nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
+// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// Copyright (c) 2008-2025 NVIDIA Corporation. All rights reserved.
+// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
+// Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
+
+#ifndef PX_DEFORMABLE_SKINNING_EXT_H
+#define PX_DEFORMABLE_SKINNING_EXT_H
+
+#include "PxDeformableSkinning.h"
+#include "foundation/PxVec3.h"
+
+#if !PX_DOXYGEN
+namespace physx
+{
+#endif
+
+struct PxCookingParams;
+class PxSimpleTriangleMesh;
+class PxInsertionCallback;
+
+/**
+\brief Utility functions for deformable surface and volume skinning
+*/
+class PxDeformableSkinningExt
+{
+public:
+
+ /**
+ \brief Initializes the interpolated vertices from guide vertices, normals, and triangles for deformable surface skinning
+
+ This function calculates the skinning embedding information for a deformable surface mesh,
+ where each embedded vertex is interpolated based on the surrounding guide vertices and triangles.
+
+ \param[out] embeddingInfo A pointer to a PxTriangleMeshEmbeddingInfo object that will store the calculated embedding information. Must be of length numEmbeddedVertices
+ \param[in] guideVertices A pointer to an array of guide vertices used for interpolation
+ \param[in] guideNormals A pointer to an array of guide normals corresponding to the guide vertices
+ \param[in] guideTriangles A pointer to an array of indices defining the guide triangles
+ \param[in] nbGuideTriangles The number of guide triangles
+ \param[in] embeddedVertices A pointer to an array of vertices that will be embedded and interpolated
+ \param[in] nbEmbeddedVertices The number of embedded vertices
+
+ \see PxTriangleMeshEmbeddingInfo
+ */
+ static void initializeInterpolatedVertices(
+ PxTriangleMeshEmbeddingInfo* embeddingInfo,
+ const PxVec3* guideVertices, const PxVec3* guideNormals,
+ const PxU32* guideTriangles, PxU32 nbGuideTriangles, const PxVec3* embeddedVertices,
+ PxU32 nbEmbeddedVertices);
+
+ /**
+ \brief Initializes the interpolated vertices from guide vertices and tetrahedra for deformable volume skinning
+
+ This function calculates the skinning embedding information for a deformable volume mesh,
+ where each embedded vertex is interpolated based on the surrounding guide vertices and tetrahedra.
+
+ \param[out] embeddingInfo A pointer to a PxTetrahedronMeshEmbeddingInfo object that will store the calculated embedding information. Must be of length numEmbeddedVertices
+ \param[in] guideVertices A pointer to an array of guide vertices used for interpolation
+ \param[in] guideTetrahedra A pointer to an array of indices defining the guide tetrahedra
+ \param[in] nbGuideTetrahedra The number of guide tetrahedra
+ \param[in] embeddedVertices A pointer to an array of vertices that will be embedded and interpolated
+ \param[in] nbEmbeddedVertices The number of embedded vertices
+
+ \see PxTetrahedronMeshEmbeddingInfo
+ */
+ static void initializeInterpolatedVertices(
+ PxTetrahedronMeshEmbeddingInfo* embeddingInfo,
+ const PxVec3* guideVertices,
+ const PxU32* guideTetrahedra, PxU32 nbGuideTetrahedra, const PxVec3* embeddedVertices,
+ PxU32 nbEmbeddedVertices);
+};
+
+#if !PX_DOXYGEN
+} // namespace physx
+#endif
+
+#endif // PX_DEFORMABLE_SKINNING_EXT_H
diff --git a/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxDeformableSurfaceExt.h b/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxDeformableSurfaceExt.h
new file mode 100644
index 000000000..64f47dd17
--- /dev/null
+++ b/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxDeformableSurfaceExt.h
@@ -0,0 +1,177 @@
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// * Neither the name of NVIDIA CORPORATION nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
+// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// Copyright (c) 2008-2025 NVIDIA Corporation. All rights reserved.
+// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
+// Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
+
+#ifndef PX_DEFORMABLE_SURFACE_EXT_H
+#define PX_DEFORMABLE_SURFACE_EXT_H
+
+#include "PxDeformableSurface.h"
+#include "foundation/PxVec4.h"
+#include "foundation/PxTransform.h"
+#include "foundation/PxUserAllocated.h"
+#include "cudamanager/PxCudaContextManager.h"
+#include "cudamanager/PxCudaTypes.h"
+
+#if !PX_DOXYGEN
+namespace physx
+{
+#endif
+
+/**
+\brief Utility functions for use with PxDeformableSurface
+*/
+class PxDeformableSurfaceExt
+{
+public:
+ /**
+ \brief Uploads prepared deformable surface data to the GPU.
+
+ \param[in] deformableSurface The deformable surface to perform the data upload to.
+ \param[in] flags Specifies which buffers the data transfer should include.
+ \param[in] nbVertices The number of vertices in the surface deformable mesh.
+ \param[in] positionsPinned A pointer to a pinned host memory buffer containing position and inverse mass for each vertex.
+ \param[in] velocitiesPinned A pointer to a pinned host memory buffer containing the velocity for each vertex.
+ \param[in] restPositionsPinned A pointer to a pinned host memory buffer containing the rest position for each vertex.
+ \param[in] copyStream An optional cuda stream to schedule the copy on.
+
+ \see PxDeformableSurface
+ */
+ static void copyToDevice(PxDeformableSurface& deformableSurface, PxDeformableSurfaceDataFlags flags, PxU32 nbVertices,
+ PxVec4* positionsPinned, PxVec4* velocitiesPinned, PxVec4* restPositionsPinned,
+ CUstream copyStream = CUstream(0));
+
+ /**
+ \brief Distributes a list of triangles masses to vertices.
+
+ The mass for each triangle will be distributed in equal parts to the vertices of said triangle.
+
+ \param[in] deformableSurface The deformable surface to perform the operation on.
+ \param[in] triangleMasses A list of floats specifying the mass of each triangle.
+ \param[in] positionInvMassPinned A pointer to a pinned host memory buffer containing positions and inverse masses for each vertex.
+
+ \see PxDeformableSurface
+ */
+ static void distributeTriangleMassToVertices(PxDeformableSurface& deformableSurface, const PxReal* triangleMasses,
+ PxVec4* positionInvMassPinned);
+
+ /**
+ \brief Distributes a uniform density to the vertices of a deformable surface.
+
+ This method distributes mass based on a specified mass per unit area. The mass for each vertex is calculated
+ according to the area of the triangles connected to it, and the resulting mass is assigned to the vertex.
+
+ \param[in] deformableSurface The deformable surface to perform the operation on.
+ \param[in] massPerVolume The mass per unit volume (=density) to be distributed across the vertices.
+ \param[in] clothThickness The cloth thickness to compute the mass
+ \param[in] positionInvMassPinned A pointer to a pinned host memory buffer containing positions and inverse masses for each vertex.
+
+ \see PxDeformableSurface
+ */
+ static void distributeDensityToVertices(PxDeformableSurface& deformableSurface, PxReal massPerVolume, PxReal clothThickness,
+ PxVec4* positionInvMassPinned);
+
+ /**
+ \brief Distributes a total mass uniformly to the vertices of a deformable surface.
+
+ This method calculates the total mass to be distributed across all vertices, and assigns a proportional mass to each
+ vertex based on the geometry of the surface. The mass is distributed equally to ensure the total mass of the surface
+ matches the specified value.
+
+ \param[in] deformableSurface The deformable surface to perform the operation on.
+ \param[in] totalMass The total mass to be distributed across the vertices.
+ \param[in] positionInvMassPinned A pointer to a pinned host memory buffer containing positions and inverse masses for each vertex.
+
+ \see PxDeformableSurface
+ */
+ static void distributeMassToVertices(PxDeformableSurface& deformableSurface, PxReal totalMass,
+ PxVec4* positionInvMassPinned);
+
+ /**
+ \brief Allocates and initializes a pinned host memory from a PxTriangleMesh attached to a PxDeformableSurface using a PxShape.
+
+ \note The user is responsible for deallocation and lifetime management of the positionInvMassPinned, velocityPinned
+ and restPositionsPinned buffers.
+
+ This method fails if the deformable surface does not have a shape attached to it.
+
+ \param[in] deformableSurface The deformable surface to perform the operation on.
+ \param[in] positions The initial positions of the surface deformable vertices.
+ \param[in] velocities The initial velocities of the surface deformable vertices.
+ \param[in] restPositions The rest positions of the surface deformable vertices.
+ \param[in] mass The mass of the deformable surface, will be distributed equally among vertices.
+ \param[in] transform The world-space transform of the deformable surface.
+ \param[in] cudaContextManager The PxCudaContextManager of the scene this deformable surface will be simulated in.
+ \param[in] positionInvMassPinned A reference to a pointer for the return value of the positionInvMassPinned buffer, will be set by this function.
+ \param[in] velocityPinned A reference to a pointer for the return value of the velocityPinned buffer, will be set by this function.
+ \param[in] restPositionPinned A reference to a pointer for the return value of the restPositionPinned buffer, will be set by this function.
+
+ \return The number of vertices in the surface deformable mesh.
+
+ \see PxDeformableSurface
+ */
+ static PxU32 allocateAndInitializeHostMirror(PxDeformableSurface& deformableSurface, const PxVec3* positions,
+ const PxVec3* velocities, const PxVec3* restPositions, float mass,
+ const PxTransform& transform, PxCudaContextManager* cudaContextManager,
+ PxVec4*& positionInvMassPinned, PxVec4*& velocityPinned,
+ PxVec4*& restPositionPinned);
+
+ /**
+ \brief Allocates and initializes a pinned host memory from given positions, velocities, and rest positions.
+
+ \note The user is responsible for deallocation and lifetime management of the positionInvMassPinned, velocityPinned
+ and restPositionsPinned buffers.
+
+ If the input 'restPositions' is a null pointer, positions are used in place of restPositions.
+ If the input 'velocities' is a null pointer, zero velocities are assigned to velocityPinned.
+
+ \param[in] positions The positions of the surface deformable vertices, will be used to assign positionInvMassPinned buffer.
+ \param[in] velocities The velocities of the surface deformable vertices, will be used to assign velocityPinned buffer.
+ \param[in] restPositions The rest positions of the surface deformable vertices, will be used to assign restPositionPinned buffer.
+ \param[in] nbVertices The number of vertices in the surface deformable mesh.
+ \param[in] mass The mass of the deformable surface, will be distributed equally among vertices.
+ \param[in] transform The world-space transform of the deformable surface.
+ \param[in] cudaContextManager The PxCudaContextManager of the scene this deformable surface will be simulated in.
+ \param[in] positionInvMassPinned A reference to a pointer for the return value of the positionInvMassPinned buffer, will be set by this function.
+ \param[in] velocityPinned A reference to a pointer for the return value of the velocityPinned buffer, will be set by this function.
+ \param[in] restPositionPinned A reference to a pointer for the return value of the restPositionPinned buffer, will be set by this function.
+
+ \return The number of vertices in the surface deformable mesh.
+
+ \see PxDeformableSurface
+ */
+ static PxU32 allocateAndInitializeHostMirror(const PxVec3* positions, const PxVec3* velocities,
+ const PxVec3* restPositions, PxU32 nbVertices, float mass,
+ const PxTransform& transform, PxCudaContextManager* cudaContextManager,
+ PxVec4*& positionInvMassPinned, PxVec4*& velocityPinned,
+ PxVec4*& restPositionPinned);
+};
+
+#if !PX_DOXYGEN
+} // namespace physx
+#endif
+
+#endif // PX_DEFORMABLE_SURFACE_EXT_H
diff --git a/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxDeformableVolumeExt.h b/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxDeformableVolumeExt.h
new file mode 100644
index 000000000..9f6c250f1
--- /dev/null
+++ b/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxDeformableVolumeExt.h
@@ -0,0 +1,297 @@
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// * Neither the name of NVIDIA CORPORATION nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
+// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// Copyright (c) 2008-2025 NVIDIA Corporation. All rights reserved.
+// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
+// Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
+
+#ifndef PX_DEFORMABLE_VOLUME_EXT_H
+#define PX_DEFORMABLE_VOLUME_EXT_H
+
+#include "foundation/PxTransform.h"
+#include "foundation/PxUserAllocated.h"
+#include "PxDeformableVolume.h"
+#include "PxDeformableVolumeFlag.h"
+#include "cudamanager/PxCudaContextManager.h"
+#include "cudamanager/PxCudaTypes.h"
+
+#if !PX_DOXYGEN
+namespace physx
+{
+#endif
+
+struct PxCookingParams;
+class PxSimpleTriangleMesh;
+class PxInsertionCallback;
+class PxDeformableVolumeMesh;
+
+/**
+\brief Utility functions for use with PxDeformableVolume and subclasses
+*/
+class PxDeformableVolumeExt
+{
+public:
+ /**
+ \brief Computes the deformable volume's vertex masses from the provided density and the volume of the tetrahedra
+
+ The buffers affected by this operation can be obtained from the deformable volume using the methods getSimPositionInvMassBufferD() and getSimVelocityBufferD()
+
+ The inverse mass is stored in the 4th component (the first three components are x, y, z coordinates) of the simulation mesh's position buffer.
+
+ \param[in] deformableVolume The deformable volume which will get its mass updated
+ \param[in] density The density to used to calculate the mass from the body's volume
+ \param[in] maxInvMassRatio Maximum allowed ratio defined as max(vertexMasses) / min(vertexMasses) where vertexMasses is a list of float values with a mass for every vertex in the simulation mesh
+ \param[in] simPositionsPinned A pointer to a pinned host memory buffer containing positions and inverse masses for each vertex of the simulation mesh.
+
+ \see PxDeformableVolume PxDeformableVolume::getSimPositionInvMassBufferD()
+ */
+ static void updateMass(PxDeformableVolume& deformableVolume, const PxReal density, const PxReal maxInvMassRatio, PxVec4* simPositionsPinned);
+
+ /**
+ \brief Computes the deformable volume's vertex masses such that the sum of all masses is equal to the provided mass
+
+ The buffers affected by this operation can be obtained from the deformable volume using the methods getSimPositionInvMassBufferD()) and getSimVelocityBufferD()
+
+ The inverse mass is stored in the 4th component (the first three components are x, y, z coordinates) of the simulation mesh's position buffer.
+
+ \param[in] deformableVolume The deformable volume which will get its mass updated
+ \param[in] mass The deformable volume's mass
+ \param[in] maxInvMassRatio Maximum allowed ratio defined as max(vertexMasses) / min(vertexMasses) where vertexMasses is a list of float values with a mass for every vertex in the simulation mesh
+ \param[in] simPositionsPinned A pointer to a pinned host memory buffer containing positions and inverse masses for each vertex of the simulation mesh.
+
+ \see PxDeformableVolume PxDeformableVolume::getSimPositionInvMassBufferD()
+ */
+ static void setMass(PxDeformableVolume& deformableVolume, const PxReal mass, const PxReal maxInvMassRatio, PxVec4* simPositionsPinned);
+
+ /**
+ \brief Transforms a deformable volume
+
+ The buffers affected by this operation can be obtained from the deformable volume using the methods getSimPositionInvMassBufferD() and getSimVelocityBufferD()
+
+ Applies a transformation to the simulation mesh's positions an velocities. Velocities only get rotated and scaled (translation is not applicable to direction vectors).
+ It does not modify the body's mass.
+ If the method is called multiple times, the transformation will compound with the ones previously applied.
+
+ \param[in] deformableVolume The deformable volume which is transformed
+ \param[in] transform The transform to apply
+ \param[in] scale A scaling factor
+ \param[in] simPositionsPinned A pointer to a pinned host memory buffer containing positions and inverse masses for each vertex of the simulation mesh.
+ \param[in] simVelocitiesPinned A pointer to a pinned host memory buffer containing velocities for each vertex of the simulation mesh.
+ \param[in] collPositionsPinned A pointer to a pinned host memory buffer containing positions and inverse masses for each vertex of the collision mesh.
+ \param[in] restPositionsPinned A pointer to a pinned host memory buffer containing rest positions of the collision mesh.
+
+ \see PxDeformableVolume
+ */
+ static void transform(PxDeformableVolume& deformableVolume, const PxTransform& transform, const PxReal scale, PxVec4* simPositionsPinned, PxVec4* simVelocitiesPinned, PxVec4* collPositionsPinned, PxVec4* restPositionsPinned);
+
+ /**
+ \brief Updates the collision mesh's vertex positions to match the simulation mesh's transformation and scale.
+
+ The buffer affected by this operation can be obtained from the deformable volume using the method getPositionInvMassBufferD()
+
+ \param[in] deformableVolume The deformable volume which will get its collision mesh vertices updated
+ \param[in] simPositionsPinned A pointer to a pinned host memory buffer containing positions and inverse masses for each vertex of the simulation mesh.
+ \param[in] collPositionsPinned A pointer to a pinned host memory buffer containing positions and inverse masses for each vertex of the collision mesh.
+
+ \see PxDeformableVolume
+ */
+ static void updateEmbeddedCollisionMesh(PxDeformableVolume& deformableVolume, PxVec4* simPositionsPinned, PxVec4* collPositionsPinned);
+
+ /**
+ \brief Uploads prepared deformable volume data to the GPU. It ensures that the embedded collision mesh matches the simulation mesh's transformation and scale.
+
+ \param[in] deformableVolume The deformable volume which will perform the data upload
+ \param[in] flags Specifies which buffers the data transfer should include
+ \param[in] simPositionsPinned A pointer to a pinned host memory buffer containing positions and inverse masses for each vertex of the simulation mesh.
+ \param[in] simVelocitiesPinned A pointer to a pinned host memory buffer containing velocities for each vertex of the simulation mesh.
+ \param[in] collPositionsPinned A pointer to a pinned host memory buffer containing positions and inverse masses for each vertex of the collision mesh.
+ \param[in] restPositionsPinned A pointer to a pinned host memory buffer containing rest positions of the collision mesh.
+ \param[in] stream A cuda stream to perform the copies.
+
+ \see PxDeformableVolume
+ */
+ static void copyToDevice(PxDeformableVolume& deformableVolume, PxDeformableVolumeDataFlags flags, PxVec4* simPositionsPinned, PxVec4* simVelocitiesPinned, PxVec4* collPositionsPinned, PxVec4* restPositionsPinned, CUstream stream = CUstream(0));
+
+ /**
+ \brief Creates a full deformable volume mesh matching the shape given as input. Uses a voxel mesh for FEM simulation and a surface-matching mesh for collision detection.
+
+ \param[in] params Cooking params instance required for mesh processing
+ \param[in] surfaceMesh Input triangle mesh that represents the surface of the deformable volume
+ \param[in] numVoxelsAlongLongestAABBAxis The number of voxels along the longest bounding box axis
+ \param[in] insertionCallback The insertion interface from PxPhysics
+ \param[in] validate If set to true the input triangle mesh will get analyzed to find possible deficiencies
+ \return Deformable volume mesh if cooking was successful, NULL otherwise
+ \see PxDeformableVolumeMesh
+ */
+ static PxDeformableVolumeMesh* createDeformableVolumeMesh(const PxCookingParams& params, const PxSimpleTriangleMesh& surfaceMesh, PxU32 numVoxelsAlongLongestAABBAxis, PxInsertionCallback& insertionCallback, const bool validate = true);
+
+ /**
+ \brief Deprecated
+ \see createDeformableVolumeMesh
+ */
+ PX_DEPRECATED static PX_FORCE_INLINE PxDeformableVolumeMesh* createSoftBodyMesh(const PxCookingParams& params, const PxSimpleTriangleMesh& surfaceMesh, PxU32 numVoxelsAlongLongestAABBAxis, PxInsertionCallback& insertionCallback, const bool validate = true)
+ {
+ return createDeformableVolumeMesh(params, surfaceMesh, numVoxelsAlongLongestAABBAxis, insertionCallback, validate);
+ }
+
+ /**
+ \brief Creates a full deformable volume mesh matching the shape given as input. Uses the same surface-matching mesh for collision detection and FEM simulation.
+
+ \param[in] params Cooking params instance required for mesh processing
+ \param[in] surfaceMesh Input triangle mesh that represents the surface of the deformable volume
+ \param[in] insertionCallback The insertion interface from PxPhysics
+ \param[in] maxWeightRatioInTet Upper limit for the ratio of node weights that are adjacent to the same tetrahedron. The closer to one (while remaining larger than one), the more stable the simulation.
+ \param[in] validate If set to true the input triangle mesh will get analyzed to find possible deficiencies
+ \return Deformable volume mesh if cooking was successful, NULL otherwise
+ \see PxDeformableVolumeMesh
+ */
+ static PxDeformableVolumeMesh* createDeformableVolumeMeshNoVoxels(const PxCookingParams& params, const PxSimpleTriangleMesh& surfaceMesh,
+ PxInsertionCallback& insertionCallback, PxReal maxWeightRatioInTet = 1.5f, const bool validate = true);
+
+ /**
+ \brief Deprecated
+ \see createDeformableVolumeMeshNoVoxels
+ */
+ PX_DEPRECATED static PX_FORCE_INLINE PxDeformableVolumeMesh* createSoftBodyMeshNoVoxels(const PxCookingParams& params, const PxSimpleTriangleMesh& surfaceMesh,
+ PxInsertionCallback& insertionCallback, PxReal maxWeightRatioInTet = 1.5f, const bool validate = true)
+ {
+ return createDeformableVolumeMeshNoVoxels(params, surfaceMesh, insertionCallback, maxWeightRatioInTet, validate);
+ }
+
+ /**
+ \brief Creates a deformable volume instance from a deformable volume mesh
+
+ \param[in] deformableVolumeMesh The deformable volume mesh
+ \param[in] transform The transform that defines initial position and orientation of the deformable volume
+ \param[in] material The material
+ \param[in] cudaContextManager A cuda context manager
+ \param[in] density The density used to compute the mass properties
+ \param[in] scale The scaling of the deformable volume
+ \return Deformable volume instance
+ \see PxDeformableVolumeMesh, PxDeformableVolume
+ */
+ static PxDeformableVolume* createDeformableVolumeFromMesh(PxDeformableVolumeMesh* deformableVolumeMesh, const PxTransform& transform,
+ const PxDeformableVolumeMaterial& material, PxCudaContextManager& cudaContextManager, PxReal density = 100.0f, PxReal scale = 1.0f);
+
+ /**
+ \brief Deprecated
+ \see createDeformableVolumeFromMesh
+ */
+ PX_DEPRECATED static PX_FORCE_INLINE PxDeformableVolume* createSoftBodyFromMesh(PxDeformableVolumeMesh* deformableVolumeMesh, const PxTransform& transform,
+ const PxDeformableVolumeMaterial& material, PxCudaContextManager& cudaContextManager, PxReal density = 100.0f, PxU32 solverIterationCount = 30,
+ const PxFEMParameters& femParams = PxFEMParameters(), PxReal scale = 1.0f)
+ {
+ PxDeformableVolume* deformableVolume = createDeformableVolumeFromMesh(deformableVolumeMesh, transform, material,
+ cudaContextManager, density, scale);
+ deformableVolume->setParameter(femParams);
+ deformableVolume->setSolverIterationCounts(solverIterationCount);
+ return deformableVolume;
+ }
+
+ /**
+ \brief Creates a deformable volume instance with a box shape
+
+ \param[in] transform The transform that defines initial position and orientation of the deformable volume
+ \param[in] boxDimensions The dimensions (side lengths) of the box shape
+ \param[in] material The material
+ \param[in] cudaContextManager A cuda context manager
+ \param[in] maxEdgeLength The maximal length of a triangle edge. Subdivision will get applied until the edge length criteria is matched. -1 means no subdivision is applied.
+ \param[in] density The density used to compute the mass properties
+ \param[in] numVoxelsAlongLongestAABBAxis The number of voxels to use for the simulation mesh along the longest bounding box dimension
+ \param[in] scale The scaling of the deformable volume
+ \return Deformable volume instance
+ \see PxDeformableVolumeMesh, PxDeformableVolume
+ */
+ static PxDeformableVolume* createDeformableVolumeBox(const PxTransform& transform, const PxVec3& boxDimensions, const PxDeformableVolumeMaterial& material,
+ PxCudaContextManager& cudaContextManager, PxReal maxEdgeLength = -1.0f, PxReal density = 100.0f, PxU32 numVoxelsAlongLongestAABBAxis = 10, PxReal scale = 1.0f);
+
+ /**
+ \brief Deprecated
+ \see createDeformableVolumeBox
+ */
+ PX_DEPRECATED static PX_FORCE_INLINE PxDeformableVolume* createSoftBodyBox(const PxTransform& transform, const PxVec3& boxDimensions, const PxDeformableVolumeMaterial& material,
+ PxCudaContextManager& cudaContextManager, PxReal maxEdgeLength = -1.0f, PxReal density = 100.0f, PxU32 solverIterationCount = 30,
+ const PxFEMParameters& femParams = PxFEMParameters(), PxU32 numVoxelsAlongLongestAABBAxis = 10, PxReal scale = 1.0f)
+ {
+ PxDeformableVolume* deformableVolume = createDeformableVolumeBox(transform, boxDimensions, material, cudaContextManager, maxEdgeLength, density,
+ numVoxelsAlongLongestAABBAxis, scale);
+ deformableVolume->setParameter(femParams);
+ deformableVolume->setSolverIterationCounts(solverIterationCount);
+ return deformableVolume;
+ }
+
+ /**
+ \brief allocates and initializes pinned host memory buffers from an actor with shape.
+
+ \param[in] deformableVolume A PxDeformableVolume that has a valid shape attached to it.
+ \param[in] cudaContextManager The PxCudaContextManager of the scene this deformable volume will be simulated in
+ \param[in] simPositionInvMassPinned A reference to a pointer for the return value of the simPositionInvMassPinned buffer, will be set by this function.
+ \param[in] simVelocityPinned A reference to a pointer for the return value of the simVelocityPinned buffer, will be set by this function.
+ \param[in] collPositionInvMassPinned A reference to a pointer for the return value of the collPositionInvMassPinned buffer, will be set by this function.
+ \param[in] restPositionPinned A reference to a pointer for the return value of the restPositionPinned buffer, will be set by this function.
+
+ \see PxDeformableVolume
+ */
+ static void allocateAndInitializeHostMirror(PxDeformableVolume& deformableVolume, PxCudaContextManager* cudaContextManager, PxVec4*& simPositionInvMassPinned, PxVec4*& simVelocityPinned, PxVec4*& collPositionInvMassPinned, PxVec4*& restPositionPinned);
+
+ /**
+ \brief Given a set of points and a set of tetrahedra, it finds the equilibrium state of the deformable volume. Every input point is either fixed or can move freely.
+
+ \param[in] verticesOriginal Mesh vertex positions in undeformed original state.
+ \param[in] verticesDeformed Mesh vertex positions in new deformed state. Only fixed vertices must have their final location, all other locations will get updated by the method.
+ \param[in] nbVertices The number of vertices.
+ \param[in] tetrahedra The tetrahedra.
+ \param[in] nbTetraheda The number of tetrahedra.
+ \param[in] vertexIsFixed Optional input that specifies which vertex is fixed and which one can move to relax the tension. If not provided, vertices from verticesOriginal which have a .w value of 0 will be considered fixed.
+ \param[in] numIterations The number of stress relaxation iterations to run.
+ */
+ static void relaxDeformableVolumeMesh(const PxVec4* verticesOriginal, PxVec4* verticesDeformed, PxU32 nbVertices,
+ const PxU32* tetrahedra, PxU32 nbTetraheda, const bool* vertexIsFixed = NULL, PxU32 numIterations = 200);
+
+ /**
+ \brief Deprecated
+ \see relaxDeformableVolumeMesh
+ */
+ PX_DEPRECATED static PX_FORCE_INLINE void relaxSoftBodyMesh(const PxVec4* verticesOriginal, PxVec4* verticesDeformed, PxU32 nbVertices, const PxU32* tetrahedra, PxU32 nbTetraheda, const bool* vertexIsFixed = NULL, PxU32 numIterations = 200)
+ {
+ relaxDeformableVolumeMesh(verticesOriginal, verticesDeformed, nbVertices, tetrahedra, nbTetraheda, vertexIsFixed, numIterations);
+ }
+
+ /**
+ \brief Converts the tet id and barycentric from the collision mesh to the tet id and barycentric of the simulation mesh.
+
+ \param[in] deformableVolume The deformable volume to perform the operation on.
+ \param[in] tetId The tet id of the deformable volume's collision mesh.
+ \param[in] tetBarycentric The barycentric coordinates of the tetrahedron specified with tetId.
+ \param[out] outTetId The tet id of the deformable volume's simulation mesh.
+ \param[out] outTetBarycentric The barycentric coordinates of the tetrahedron specified with outTetId.
+ */
+ static void convertCollisionToSimulationTet(PxDeformableVolume& deformableVolume, PxU32 tetId, const PxVec4& tetBarycentric, PxU32& outTetId, PxVec4& outTetBarycentric);
+};
+
+#if !PX_DOXYGEN
+} // namespace physx
+#endif
+
+#endif // PX_DEFORMABLE_VOLUME_EXT_H
diff --git a/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxDistanceJoint.h b/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxDistanceJoint.h
new file mode 100644
index 000000000..6fc6025bc
--- /dev/null
+++ b/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxDistanceJoint.h
@@ -0,0 +1,264 @@
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// * Neither the name of NVIDIA CORPORATION nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
+// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// Copyright (c) 2008-2025 NVIDIA Corporation. All rights reserved.
+// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
+// Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
+
+#ifndef PX_DISTANCE_JOINT_H
+#define PX_DISTANCE_JOINT_H
+
+#include "extensions/PxJoint.h"
+
+#if !PX_DOXYGEN
+namespace physx
+{
+#endif
+
+class PxDistanceJoint;
+
+/**
+\brief Create a distance Joint.
+
+ \param[in] physics The physics SDK
+ \param[in] actor0 An actor to which the joint is attached. NULL may be used to attach the joint to a specific point in the world frame
+ \param[in] localFrame0 The position and orientation of the joint relative to actor0
+ \param[in] actor1 An actor to which the joint is attached. NULL may be used to attach the joint to a specific point in the world frame
+ \param[in] localFrame1 The position and orientation of the joint relative to actor1
+
+\see PxDistanceJoint
+*/
+PxDistanceJoint* PxDistanceJointCreate(PxPhysics& physics, PxRigidActor* actor0, const PxTransform& localFrame0, PxRigidActor* actor1, const PxTransform& localFrame1);
+
+
+/**
+\brief flags for configuring the drive of a PxDistanceJoint
+
+\see PxDistanceJoint
+*/
+struct PxDistanceJointFlag
+{
+ enum Enum
+ {
+ eMAX_DISTANCE_ENABLED = 1<<1,
+ eMIN_DISTANCE_ENABLED = 1<<2,
+ eSPRING_ENABLED = 1<<3
+ };
+};
+
+typedef PxFlags PxDistanceJointFlags;
+PX_FLAGS_OPERATORS(PxDistanceJointFlag::Enum, PxU16)
+
+/**
+\brief a joint that maintains an upper or lower bound (or both) on the distance between two points on different objects
+
+\see PxDistanceJointCreate PxJoint
+*/
+class PxDistanceJoint : public PxJoint
+{
+public:
+
+ /**
+ \brief Return the current distance of the joint
+ */
+ virtual PxReal getDistance() const = 0;
+
+ /**
+ \brief Set the allowed minimum distance for the joint.
+
+ The minimum distance must be no more than the maximum distance
+
+ Default 0.0f
+ Range [0, PX_MAX_F32)
+
+ \param[in] distance the minimum distance
+
+ \see PxDistanceJoint::minDistance, PxDistanceJointFlag::eMIN_DISTANCE_ENABLED getMinDistance()
+ */
+ virtual void setMinDistance(PxReal distance) = 0;
+
+ /**
+ \brief Get the allowed minimum distance for the joint.
+
+ \return the allowed minimum distance
+
+ \see PxDistanceJoint::minDistance, PxDistanceJointFlag::eMIN_DISTANCE_ENABLED setMinDistance()
+ */
+ virtual PxReal getMinDistance() const = 0;
+
+ /**
+ \brief Set the allowed maximum distance for the joint.
+
+ The maximum distance must be no less than the minimum distance.
+
+ Default 0.0f
+ Range [0, PX_MAX_F32)
+
+ \param[in] distance the maximum distance
+
+ \see PxDistanceJoint::maxDistance, PxDistanceJointFlag::eMAX_DISTANCE_ENABLED getMinDistance()
+ */
+ virtual void setMaxDistance(PxReal distance) = 0;
+
+ /**
+ \brief Get the allowed maximum distance for the joint.
+
+ \return the allowed maximum distance
+
+ \see PxDistanceJoint::maxDistance, PxDistanceJointFlag::eMAX_DISTANCE_ENABLED setMaxDistance()
+ */
+ virtual PxReal getMaxDistance() const = 0;
+
+ /**
+ \brief Set the error tolerance of the joint.
+
+ \param[in] tolerance the distance beyond the allowed range at which the joint becomes active
+
+ \see PxDistanceJoint::tolerance, getTolerance()
+ */
+ virtual void setTolerance(PxReal tolerance) = 0;
+
+ /**
+ \brief Get the error tolerance of the joint.
+
+ the distance beyond the joint's [min, max] range before the joint becomes active.
+
+ Default 0.25f * PxTolerancesScale::length
+ Range (0, PX_MAX_F32)
+
+ This value should be used to ensure that if the minimum distance is zero and the
+ spring function is in use, the rest length of the spring is non-zero.
+
+ \see PxDistanceJoint::tolerance, setTolerance()
+ */
+ virtual PxReal getTolerance() const = 0;
+
+ /**
+ \brief Set the strength of the joint spring.
+
+ The spring is used if enabled, and the distance exceeds the range [min-error, max+error].
+
+ Default 0.0f
+ Range [0, PX_MAX_F32)
+
+ \param[in] stiffness the spring strength of the joint
+
+ \see PxDistanceJointFlag::eSPRING_ENABLED getStiffness()
+ */
+ virtual void setStiffness(PxReal stiffness) = 0;
+
+ /**
+ \brief Get the strength of the joint spring.
+
+ \return stiffness the spring strength of the joint
+
+ \see PxDistanceJointFlag::eSPRING_ENABLED setStiffness()
+ */
+ virtual PxReal getStiffness() const = 0;
+
+ /**
+ \brief Set the damping of the joint spring.
+
+ The spring is used if enabled, and the distance exceeds the range [min-error, max+error].
+
+ Default 0.0f
+ Range [0, PX_MAX_F32)
+
+ \param[in] damping the degree of damping of the joint spring of the joint
+
+ \see PxDistanceJointFlag::eSPRING_ENABLED setDamping()
+ */
+ virtual void setDamping(PxReal damping) = 0;
+
+ /**
+ \brief Get the damping of the joint spring.
+
+ \return the degree of damping of the joint spring of the joint
+
+ \see PxDistanceJointFlag::eSPRING_ENABLED setDamping()
+ */
+ virtual PxReal getDamping() const = 0;
+
+ /**
+ \brief Set the flags specific to the Distance Joint.
+
+ Default PxDistanceJointFlag::eMAX_DISTANCE_ENABLED
+
+ \param[in] flags The joint flags.
+
+ \see PxDistanceJointFlag setFlag() getFlags()
+ */
+ virtual void setDistanceJointFlags(PxDistanceJointFlags flags) = 0;
+
+ /**
+ \brief Set a single flag specific to a Distance Joint to true or false.
+
+ \param[in] flag The flag to set or clear.
+ \param[in] value the value to which to set the flag
+
+ \see PxDistanceJointFlag, getFlags() setFlags()
+ */
+ virtual void setDistanceJointFlag(PxDistanceJointFlag::Enum flag, bool value) = 0;
+
+ /**
+ \brief Get the flags specific to the Distance Joint.
+
+ \return the joint flags
+
+ \see PxDistanceJoint::flags, PxDistanceJointFlag setFlag() setFlags()
+ */
+ virtual PxDistanceJointFlags getDistanceJointFlags() const = 0;
+
+ /**
+ \brief Returns string name of PxDistanceJoint, used for serialization
+ */
+ virtual const char* getConcreteTypeName() const PX_OVERRIDE { return "PxDistanceJoint"; }
+
+protected:
+
+ //serialization
+
+ /**
+ \brief Constructor
+ */
+ PX_INLINE PxDistanceJoint(PxType concreteType, PxBaseFlags baseFlags) : PxJoint(concreteType, baseFlags) {}
+
+ /**
+ \brief Deserialization constructor
+ */
+ PX_INLINE PxDistanceJoint(PxBaseFlags baseFlags) : PxJoint(baseFlags) {}
+
+ /**
+ \brief Returns whether a given type name matches with the type of this instance
+ */
+ virtual bool isKindOf(const char* name) const { PX_IS_KIND_OF(name, "PxDistanceJoint", PxJoint); }
+
+ //~serialization
+};
+
+#if !PX_DOXYGEN
+} // namespace physx
+#endif
+
+#endif
diff --git a/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxExtensionsAPI.h b/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxExtensionsAPI.h
new file mode 100644
index 000000000..99a2a2af1
--- /dev/null
+++ b/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxExtensionsAPI.h
@@ -0,0 +1,89 @@
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// * Neither the name of NVIDIA CORPORATION nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
+// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// Copyright (c) 2008-2025 NVIDIA Corporation. All rights reserved.
+// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
+// Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
+
+#ifndef PX_EXTENSIONS_API_H
+#define PX_EXTENSIONS_API_H
+
+#include "foundation/PxErrorCallback.h"
+#include "extensions/PxDefaultAllocator.h"
+#include "extensions/PxConstraintExt.h"
+#include "extensions/PxDistanceJoint.h"
+#include "extensions/PxFixedJoint.h"
+#include "extensions/PxPrismaticJoint.h"
+#include "extensions/PxRevoluteJoint.h"
+#include "extensions/PxSphericalJoint.h"
+#include "extensions/PxD6Joint.h"
+#include "extensions/PxGearJoint.h"
+#include "extensions/PxRackAndPinionJoint.h"
+#include "extensions/PxDefaultSimulationFilterShader.h"
+#include "extensions/PxDefaultErrorCallback.h"
+#include "extensions/PxDefaultStreams.h"
+#include "extensions/PxRigidActorExt.h"
+#include "extensions/PxRigidBodyExt.h"
+#include "extensions/PxShapeExt.h"
+#include "extensions/PxTriangleMeshExt.h"
+#include "extensions/PxSerialization.h"
+#include "extensions/PxDefaultCpuDispatcher.h"
+#include "extensions/PxSmoothNormals.h"
+#include "extensions/PxSimpleFactory.h"
+#include "extensions/PxStringTableExt.h"
+#include "extensions/PxBroadPhaseExt.h"
+#include "extensions/PxMassProperties.h"
+#include "extensions/PxSceneQueryExt.h"
+#include "extensions/PxSceneQuerySystemExt.h"
+#include "extensions/PxCustomSceneQuerySystem.h"
+#include "extensions/PxConvexMeshExt.h"
+#include "extensions/PxSamplingExt.h"
+#include "extensions/PxTetrahedronMeshExt.h"
+#include "extensions/PxCustomGeometryExt.h"
+#include "extensions/PxDeformableSurfaceExt.h"
+
+/** \brief Initialize the PhysXExtensions library.
+
+This should be called before calling any functions or methods in extensions which may require allocation.
+\note This function does not need to be called before creating a PxDefaultAllocator object.
+
+\param physics a PxPhysics object
+\param pvd an PxPvd (PhysX Visual Debugger) object
+
+\see PxCloseExtensions PxFoundation PxPhysics
+*/
+PX_C_EXPORT bool PX_CALL_CONV PxInitExtensions(physx::PxPhysics& physics, physx::PxPvd* pvd);
+
+/** \brief Shut down the PhysXExtensions library.
+
+This function should be called to cleanly shut down the PhysXExtensions library before application exit.
+
+\note This function is required to be called to release foundation usage.
+
+\see PxInitExtensions
+*/
+PX_C_EXPORT void PX_CALL_CONV PxCloseExtensions();
+
+#endif
+
diff --git a/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxFixedJoint.h b/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxFixedJoint.h
new file mode 100644
index 000000000..44de1b488
--- /dev/null
+++ b/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxFixedJoint.h
@@ -0,0 +1,96 @@
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// * Neither the name of NVIDIA CORPORATION nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
+// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// Copyright (c) 2008-2025 NVIDIA Corporation. All rights reserved.
+// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
+// Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
+
+#ifndef PX_FIXED_JOINT_H
+#define PX_FIXED_JOINT_H
+
+#include "extensions/PxJoint.h"
+
+#if !PX_DOXYGEN
+namespace physx
+{
+#endif
+
+class PxFixedJoint;
+
+/**
+\brief Create a fixed joint.
+
+ \param[in] physics The physics SDK
+ \param[in] actor0 An actor to which the joint is attached. NULL may be used to attach the joint to a specific point in the world frame
+ \param[in] localFrame0 The position and orientation of the joint relative to actor0
+ \param[in] actor1 An actor to which the joint is attached. NULL may be used to attach the joint to a specific point in the world frame
+ \param[in] localFrame1 The position and orientation of the joint relative to actor1
+
+\see PxFixedJoint
+*/
+PxFixedJoint* PxFixedJointCreate(PxPhysics& physics, PxRigidActor* actor0, const PxTransform& localFrame0, PxRigidActor* actor1, const PxTransform& localFrame1);
+
+/**
+ \brief A fixed joint permits no relative movement between two bodies. ie the bodies are glued together.
+
+ \image html fixedJoint.png
+
+ \see PxFixedJointCreate() PxJoint
+*/
+class PxFixedJoint : public PxJoint
+{
+public:
+
+ /**
+ \brief Returns string name of PxFixedJoint, used for serialization
+ */
+ virtual const char* getConcreteTypeName() const PX_OVERRIDE { return "PxFixedJoint"; }
+
+protected:
+
+ //serialization
+
+ /**
+ \brief Constructor
+ */
+ PX_INLINE PxFixedJoint(PxType concreteType, PxBaseFlags baseFlags) : PxJoint(concreteType, baseFlags) {}
+
+ /**
+ \brief Deserialization constructor
+ */
+ PX_INLINE PxFixedJoint(PxBaseFlags baseFlags) : PxJoint(baseFlags) {}
+
+ /**
+ \brief Returns whether a given type name matches with the type of this instance
+ */
+ virtual bool isKindOf(const char* name) const { PX_IS_KIND_OF(name, "PxFixedJoint", PxJoint); }
+
+ //~serialization
+};
+
+#if !PX_DOXYGEN
+} // namespace physx
+#endif
+
+#endif
diff --git a/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxGearJoint.h b/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxGearJoint.h
new file mode 100644
index 000000000..f89230e56
--- /dev/null
+++ b/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxGearJoint.h
@@ -0,0 +1,125 @@
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// * Neither the name of NVIDIA CORPORATION nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
+// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// Copyright (c) 2008-2025 NVIDIA Corporation. All rights reserved.
+// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
+// Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
+
+#ifndef PX_GEAR_JOINT_H
+#define PX_GEAR_JOINT_H
+
+#include "extensions/PxJoint.h"
+
+#if !PX_DOXYGEN
+namespace physx
+{
+#endif
+
+ class PxGearJoint;
+
+ /**
+ \brief Create a gear Joint.
+
+ \param[in] physics The physics SDK
+ \param[in] actor0 An actor to which the joint is attached. NULL may be used to attach the joint to a specific point in the world frame
+ \param[in] localFrame0 The position and orientation of the joint relative to actor0
+ \param[in] actor1 An actor to which the joint is attached. NULL may be used to attach the joint to a specific point in the world frame
+ \param[in] localFrame1 The position and orientation of the joint relative to actor1
+
+ \see PxGearJoint
+ */
+ PxGearJoint* PxGearJointCreate(PxPhysics& physics, PxRigidActor* actor0, const PxTransform& localFrame0, PxRigidActor* actor1, const PxTransform& localFrame1);
+
+ /**
+ \brief A joint that connects two existing revolute joints and constrains their relative angular velocity with respect to each other.
+
+ \see PxGearJointCreate PxJoint
+ */
+ class PxGearJoint : public PxJoint
+ {
+ public:
+
+ /**
+ \brief Set the hinge/revolute joints connected by the gear joint.
+
+ The passed joints can be either PxRevoluteJoint, PxD6Joint or PxArticulationJointReducedCoordinate.
+ The joints must define degrees of freedom around the twist axis.
+
+ Note that these joints are only used to compute the positional error correction term,
+ used to adjust potential drift between jointed actors. The gear joint can run without
+ calling this function, but in that case some visible overlap may develop over time between
+ the teeth of the gear meshes.
+
+ \note Calling this function resets the internal positional error correction term.
+
+ \param[in] hinge0 The first hinge joint
+ \param[in] hinge1 The second hinge joint
+ \return true if success
+ */
+ virtual bool setHinges(const PxBase* hinge0, const PxBase* hinge1) = 0;
+
+ /**
+ \brief Get the hinge/revolute joints connected by the gear joint.
+
+ \param[out] hinge0 The first hinge joint
+ \param[out] hinge1 The second hinge joint
+ */
+ virtual void getHinges(const PxBase*& hinge0, const PxBase*& hinge1) const = 0;
+
+ /**
+ \brief Set the desired gear ratio.
+
+ For two gears with n0 and n1 teeth respectively, the gear ratio is n0/n1.
+
+ \note You may need to use a negative gear ratio if the joint frames of involved actors are not oriented in the same direction.
+
+ \note Calling this function resets the internal positional error correction term.
+
+ \param[in] ratio Desired ratio between the two hinges.
+ */
+ virtual void setGearRatio(float ratio) = 0;
+
+ /**
+ \brief Get the gear ratio.
+
+ \return Current ratio
+ */
+ virtual float getGearRatio() const = 0;
+
+ virtual const char* getConcreteTypeName() const PX_OVERRIDE { return "PxGearJoint"; }
+
+ protected:
+
+ PX_INLINE PxGearJoint(PxType concreteType, PxBaseFlags baseFlags) : PxJoint(concreteType, baseFlags) {}
+
+ PX_INLINE PxGearJoint(PxBaseFlags baseFlags) : PxJoint(baseFlags) {}
+
+ virtual bool isKindOf(const char* name) const { PX_IS_KIND_OF(name, "PxGearJoint", PxJoint); }
+ };
+
+#if !PX_DOXYGEN
+} // namespace physx
+#endif
+
+#endif
diff --git a/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxGjkQueryExt.h b/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxGjkQueryExt.h
new file mode 100644
index 000000000..bdbca1bb7
--- /dev/null
+++ b/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxGjkQueryExt.h
@@ -0,0 +1,234 @@
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// * Neither the name of NVIDIA CORPORATION nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
+// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// Copyright (c) 2008-2025 NVIDIA Corporation. All rights reserved.
+// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
+// Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
+
+#ifndef PX_GJK_QUERY_EXT_H
+#define PX_GJK_QUERY_EXT_H
+
+#include "geometry/PxGjkQuery.h"
+#include "geometry/PxGeometry.h"
+
+#if !PX_DOXYGEN
+namespace physx
+{
+#endif
+
+class PxSphereGeometry;
+class PxCapsuleGeometry;
+class PxBoxGeometry;
+class PxConvexCoreGeometry;
+class PxConvexMeshGeometry;
+class PxContactBuffer;
+class PxConvexMesh;
+
+/**
+\brief Pre-made support mapping for built-in convex geometry types.
+*/
+class PxGjkQueryExt
+{
+public:
+ /**
+ \brief Pre-made support mapping for a sphere
+ */
+ struct SphereSupport : PxGjkQuery::Support
+ {
+ PxReal radius;
+
+ /**
+ \brief Default constructor
+ */
+ SphereSupport();
+ /**
+ \brief Constructs a SphereSupport for a sphere radius
+ */
+ SphereSupport(PxReal radius);
+ /**
+ \brief Constructs a SphereSupport for a PxSphereGeometry
+ */
+ SphereSupport(const PxSphereGeometry& geom);
+
+ virtual PxReal getMargin() const PX_OVERRIDE PX_FINAL;
+ virtual PxVec3 supportLocal(const PxVec3& dir) const PX_OVERRIDE PX_FINAL;
+ };
+
+ /**
+ \brief Pre-made support mapping for a capsule
+ */
+ struct CapsuleSupport : PxGjkQuery::Support
+ {
+ PxReal radius, halfHeight;
+
+ /**
+ \brief Default constructor
+ */
+ CapsuleSupport();
+ /**
+ \brief Constructs a CapsuleSupport for capsule radius and halfHeight
+ */
+ CapsuleSupport(PxReal radius, PxReal halfHeight);
+ /**
+ \brief Constructs a CapsuleSupport for a PxCapsuleGeometry
+ */
+ CapsuleSupport(const PxCapsuleGeometry& geom);
+
+ virtual PxReal getMargin() const PX_OVERRIDE PX_FINAL;
+ virtual PxVec3 supportLocal(const PxVec3& dir) const PX_OVERRIDE PX_FINAL;
+ };
+
+ /**
+ \brief Pre-made support mapping for a box
+ */
+ struct BoxSupport : PxGjkQuery::Support
+ {
+ PxVec3 halfExtents;
+ PxReal margin;
+
+ /**
+ \brief Default constructor
+ */
+ BoxSupport();
+ /**
+ \brief Constructs a BoxSupport for a box halfExtents with optional margin
+ */
+ BoxSupport(const PxVec3& halfExtents, PxReal margin = 0);
+ /**
+ \brief Constructs a BoxSupport for a PxBoxGeometry
+ */
+ BoxSupport(const PxBoxGeometry& box, PxReal margin = 0);
+
+ virtual PxReal getMargin() const PX_OVERRIDE PX_FINAL;
+ virtual PxVec3 supportLocal(const PxVec3& dir) const PX_OVERRIDE PX_FINAL;
+ };
+
+ /**
+ \brief Pre-made support mapping for a convex core
+ */
+ struct ConvexCoreSupport : PxGjkQuery::Support
+ {
+ PxU64 shapeData[10];
+
+ /**
+ \brief Default constructor
+ */
+ ConvexCoreSupport();
+ /**
+ \brief Constructs a ConvexCoreSupport for a PxConvexCoreGeometry
+ */
+ ConvexCoreSupport(const PxConvexCoreGeometry& geom, PxReal margin = 0);
+
+ virtual PxReal getMargin() const PX_OVERRIDE PX_FINAL;
+ virtual PxVec3 supportLocal(const PxVec3& dir) const PX_OVERRIDE PX_FINAL;
+ };
+
+ /**
+ \brief Pre-made support mapping for a convex mesh
+ */
+ struct ConvexMeshSupport : PxGjkQuery::Support
+ {
+ const PxConvexMesh* convexMesh;
+ PxVec3 scale;
+ PxQuat scaleRotation;
+ PxReal margin;
+
+ /**
+ \brief Default constructor
+ */
+ ConvexMeshSupport();
+ /**
+ \brief Constructs a BoxSupport for a PxConvexMesh
+ */
+ ConvexMeshSupport(const PxConvexMesh& convexMesh, const PxVec3& scale = PxVec3(1), const PxQuat& scaleRotation = PxQuat(PxIdentity), PxReal margin = 0);
+ /**
+ \brief Constructs a BoxSupport for a PxConvexMeshGeometry
+ */
+ ConvexMeshSupport(const PxConvexMeshGeometry& convexMesh, PxReal margin = 0);
+
+ virtual PxReal getMargin() const PX_OVERRIDE PX_FINAL;
+ virtual PxVec3 supportLocal(const PxVec3& dir) const PX_OVERRIDE PX_FINAL;
+ };
+
+ /**
+ \brief Pre-made support mapping for any PhysX's convex geometry (sphere, capsule, box, convex mesh)
+ */
+ struct ConvexGeomSupport : PxGjkQuery::Support
+ {
+ /**
+ \brief Default constructor
+ */
+ ConvexGeomSupport();
+ /**
+ \brief Constructs a BoxSupport for a PxGeometry
+ */
+ ConvexGeomSupport(const PxGeometry& geom, PxReal margin = 0);
+ /**
+ \brief Destructor
+ */
+ ~ConvexGeomSupport();
+
+ /**
+ \brief Returns false if ConvexGeomSupport was constructed from non-convex geometry
+ */
+ bool isValid() const;
+
+ virtual PxReal getMargin() const PX_OVERRIDE PX_FINAL;
+ virtual PxVec3 supportLocal(const PxVec3& dir) const PX_OVERRIDE PX_FINAL;
+
+ private:
+ PxGeometryType::Enum mType;
+ union {
+ void* alignment;
+ PxU8 sphere[sizeof(SphereSupport)];
+ PxU8 capsule[sizeof(CapsuleSupport)];
+ PxU8 box[sizeof(BoxSupport)];
+ PxU8 convexCore[sizeof(ConvexCoreSupport)];
+ PxU8 convexMesh[sizeof(ConvexMeshSupport)];
+ } mSupport;
+ };
+
+ /**
+ \brief Generates a contact point between two shapes using GJK-EPA algorithm
+
+ \param[in] a Shape A support mapping
+ \param[in] b Shape B support mapping
+ \param[in] poseA Shape A transformation
+ \param[in] poseB Shape B transformation
+ \param[in] contactDistance The distance at which contacts begin to be generated between the shapes
+ \param[in] toleranceLength The toleranceLength. Used for scaling distance-based thresholds internally to produce appropriate results given simulations in different units
+ \param[out] contactBuffer A buffer to store the contact
+
+ \return True if there is a contact.
+ */
+ static bool generateContacts(const PxGjkQuery::Support& a, const PxGjkQuery::Support& b, const PxTransform& poseA, const PxTransform& poseB,
+ PxReal contactDistance, PxReal toleranceLength, PxContactBuffer& contactBuffer);
+
+};
+
+#if !PX_DOXYGEN
+}
+#endif
+
+#endif
diff --git a/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxJoint.h b/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxJoint.h
new file mode 100644
index 000000000..5533a5735
--- /dev/null
+++ b/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxJoint.h
@@ -0,0 +1,395 @@
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// * Neither the name of NVIDIA CORPORATION nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
+// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// Copyright (c) 2008-2025 NVIDIA Corporation. All rights reserved.
+// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
+// Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
+
+#ifndef PX_JOINT_H
+#define PX_JOINT_H
+
+#include "foundation/PxTransform.h"
+#include "PxRigidActor.h"
+#include "PxConstraint.h"
+#include "common/PxBase.h"
+
+#if !PX_DOXYGEN
+namespace physx
+{
+#endif
+
+class PxRigidActor;
+class PxScene;
+class PxPhysics;
+class PxConstraint;
+
+/**
+\brief an enumeration of PhysX' built-in joint types
+
+\see PxJoint
+*/
+struct PxJointConcreteType
+{
+ enum Enum
+ {
+ eSPHERICAL = PxConcreteType::eFIRST_PHYSX_EXTENSION,
+ eREVOLUTE,
+ ePRISMATIC,
+ eFIXED,
+ eDISTANCE,
+ eD6,
+ eGEAR,
+ eRACK_AND_PINION,
+ eLast
+ };
+};
+
+PX_DEFINE_TYPEINFO(PxJoint, PxConcreteType::eUNDEFINED)
+PX_DEFINE_TYPEINFO(PxRackAndPinionJoint, PxJointConcreteType::eRACK_AND_PINION)
+PX_DEFINE_TYPEINFO(PxGearJoint, PxJointConcreteType::eGEAR)
+PX_DEFINE_TYPEINFO(PxD6Joint, PxJointConcreteType::eD6)
+PX_DEFINE_TYPEINFO(PxDistanceJoint, PxJointConcreteType::eDISTANCE)
+PX_DEFINE_TYPEINFO(PxFixedJoint, PxJointConcreteType::eFIXED)
+PX_DEFINE_TYPEINFO(PxPrismaticJoint, PxJointConcreteType::ePRISMATIC)
+PX_DEFINE_TYPEINFO(PxRevoluteJoint, PxJointConcreteType::eREVOLUTE)
+PX_DEFINE_TYPEINFO(PxSphericalJoint, PxJointConcreteType::eSPHERICAL)
+
+
+/**
+\brief an enumeration for specifying one or other of the actors referenced by a joint
+
+\see PxJoint
+*/
+
+struct PxJointActorIndex
+{
+ enum Enum
+ {
+ eACTOR0,
+ eACTOR1,
+ COUNT
+ };
+};
+
+/**
+\brief a base interface providing common functionality for PhysX joints
+*/
+
+class PxJoint : public PxBase
+{
+public:
+
+ /**
+ \brief Set the actors for this joint.
+
+ An actor may be NULL to indicate the world frame. At most one of the actors may be NULL.
+
+ \param[in] actor0 the first actor.
+ \param[in] actor1 the second actor
+
+ \see getActors()
+ */
+ virtual void setActors(PxRigidActor* actor0, PxRigidActor* actor1) = 0;
+
+ /**
+ \brief Get the actors for this joint.
+
+ \param[out] actor0 the first actor.
+ \param[out] actor1 the second actor
+
+ \see setActors()
+ */
+ virtual void getActors(PxRigidActor*& actor0, PxRigidActor*& actor1) const = 0;
+
+ /**
+ \brief Set the joint local pose for an actor.
+
+ This is the relative pose which locates the joint frame relative to the actor.
+
+ \param[in] actor 0 for the first actor, 1 for the second actor.
+ \param[in] localPose the local pose for the actor this joint
+
+ \see getLocalPose()
+ */
+ virtual void setLocalPose(PxJointActorIndex::Enum actor, const PxTransform& localPose) = 0;
+
+ /**
+ \brief get the joint local pose for an actor.
+
+ \param[in] actor 0 for the first actor, 1 for the second actor.
+
+ return the local pose for this joint
+
+ \see setLocalPose()
+ */
+ virtual PxTransform getLocalPose(PxJointActorIndex::Enum actor) const = 0;
+
+ /**
+ \brief get the relative pose for this joint
+
+ This function returns the pose of the joint frame of actor1 relative to actor0
+
+ */
+ virtual PxTransform getRelativeTransform() const = 0;
+
+ /**
+ \brief get the relative linear velocity of the joint
+
+ This function returns the linear velocity of the origin of the constraint frame of actor1, relative to the origin of the constraint
+ frame of actor0. The value is returned in the constraint frame of actor0
+ */
+ virtual PxVec3 getRelativeLinearVelocity() const = 0;
+
+ /**
+ \brief get the relative angular velocity of the joint
+
+ This function returns the angular velocity of actor1 relative to actor0. The value is returned in the constraint frame of actor0
+ */
+ virtual PxVec3 getRelativeAngularVelocity() const = 0;
+
+ /**
+ \brief set the break force for this joint.
+
+ if the constraint force or torque on the joint exceeds the specified values, the joint will break,
+ at which point it will not constrain the two actors and the flag PxConstraintFlag::eBROKEN will be set. The
+ force and torque are measured in the joint frame of the first actor
+
+ \param[in] force the maximum force the joint can apply before breaking
+ \param[in] torque the maximum torque the joint can apply before breaking
+ */
+ virtual void setBreakForce(PxReal force, PxReal torque) = 0;
+
+ /**
+ \brief get the break force for this joint.
+
+ \param[out] force the maximum force the joint can apply before breaking
+ \param[out] torque the maximum torque the joint can apply before breaking
+
+ \see setBreakForce()
+ */
+ virtual void getBreakForce(PxReal& force, PxReal& torque) const = 0;
+
+ /**
+ \brief set the constraint flags for this joint.
+
+ \param[in] flags the constraint flags
+
+ \see PxConstraintFlag
+ */
+ virtual void setConstraintFlags(PxConstraintFlags flags) = 0;
+
+ /**
+ \brief set a constraint flags for this joint to a specified value.
+
+ \param[in] flag the constraint flag
+ \param[in] value the value to which to set the flag
+
+ \see PxConstraintFlag
+ */
+ virtual void setConstraintFlag(PxConstraintFlag::Enum flag, bool value) = 0;
+
+ /**
+ \brief get the constraint flags for this joint.
+
+ \return the constraint flags
+
+ \see PxConstraintFlag
+ */
+ virtual PxConstraintFlags getConstraintFlags() const = 0;
+
+ /**
+ \brief set the inverse mass scale for actor0.
+
+ \param[in] invMassScale the scale to apply to the inverse mass of actor 0 for resolving this constraint
+
+ \see getInvMassScale0
+ */
+ virtual void setInvMassScale0(PxReal invMassScale) = 0;
+
+ /**
+ \brief get the inverse mass scale for actor0.
+
+ \return inverse mass scale for actor0
+
+ \see setInvMassScale0
+ */
+ virtual PxReal getInvMassScale0() const = 0;
+
+ /**
+ \brief set the inverse inertia scale for actor0.
+
+ \param[in] invInertiaScale the scale to apply to the inverse inertia of actor0 for resolving this constraint
+
+ \see getInvMassScale0
+ */
+ virtual void setInvInertiaScale0(PxReal invInertiaScale) = 0;
+
+ /**
+ \brief get the inverse inertia scale for actor0.
+
+ \return inverse inertia scale for actor0
+
+ \see setInvInertiaScale0
+ */
+ virtual PxReal getInvInertiaScale0() const = 0;
+
+ /**
+ \brief set the inverse mass scale for actor1.
+
+ \param[in] invMassScale the scale to apply to the inverse mass of actor 1 for resolving this constraint
+
+ \see getInvMassScale1
+ */
+ virtual void setInvMassScale1(PxReal invMassScale) = 0;
+
+ /**
+ \brief get the inverse mass scale for actor1.
+
+ \return inverse mass scale for actor1
+
+ \see setInvMassScale1
+ */
+ virtual PxReal getInvMassScale1() const = 0;
+
+ /**
+ \brief set the inverse inertia scale for actor1.
+
+ \param[in] invInertiaScale the scale to apply to the inverse inertia of actor1 for resolving this constraint
+
+ \see getInvInertiaScale1
+ */
+ virtual void setInvInertiaScale1(PxReal invInertiaScale) = 0;
+
+ /**
+ \brief get the inverse inertia scale for actor1.
+
+ \return inverse inertia scale for actor1
+
+ \see setInvInertiaScale1
+ */
+ virtual PxReal getInvInertiaScale1() const = 0;
+
+ /**
+ \brief Retrieves the PxConstraint corresponding to this joint.
+
+ This can be used to determine, among other things, the force applied at the joint.
+
+ \return the constraint
+ */
+ virtual PxConstraint* getConstraint() const = 0;
+
+ /**
+ \brief Sets a name string for the object that can be retrieved with getName().
+
+ This is for debugging and is not used by the SDK. The string is not copied by the SDK,
+ only the pointer is stored.
+
+ \param[in] name String to set the objects name to.
+
+ \see getName()
+ */
+ virtual void setName(const char* name) = 0;
+
+ /**
+ \brief Retrieves the name string set with setName().
+
+ \return Name string associated with object.
+
+ \see setName()
+ */
+ virtual const char* getName() const = 0;
+
+ /**
+ \brief Deletes the joint.
+
+ \note This call does not wake up the connected rigid bodies.
+ */
+ virtual void release() = 0;
+
+ /**
+ \brief Retrieves the scene which this joint belongs to.
+
+ \return Owner Scene. NULL if not part of a scene.
+
+ \see PxScene
+ */
+ virtual PxScene* getScene() const = 0;
+
+ void* userData; //!< user can assign this to whatever, usually to create a 1:1 relationship with a user object.
+
+protected:
+ virtual ~PxJoint() {}
+
+ //serialization
+
+ /**
+ \brief Constructor
+ */
+ PX_INLINE PxJoint(PxType concreteType, PxBaseFlags baseFlags) : PxBase(concreteType, baseFlags), userData(NULL) {}
+
+ /**
+ \brief Deserialization constructor
+ */
+ PX_INLINE PxJoint(PxBaseFlags baseFlags) : PxBase(baseFlags) {}
+
+ /**
+ \brief Returns whether a given type name matches with the type of this instance
+ */
+ virtual bool isKindOf(const char* name) const { PX_IS_KIND_OF(name, "PxJoint", PxBase); }
+
+ //~serialization
+};
+
+class PxSpring
+{
+public:
+
+ PxReal stiffness; //!< the spring strength of the drive: that is, the force proportional to the position error
+ PxReal damping; //!< the damping strength of the drive: that is, the force proportional to the velocity error
+
+ PxSpring(PxReal stiffness_, PxReal damping_): stiffness(stiffness_), damping(damping_) {}
+};
+
+
+#if !PX_DOXYGEN
+} // namespace physx
+#endif
+
+/** \brief Helper function to setup a joint's global frame
+
+ This replaces the following functions from previous SDK versions:
+
+ void NxJointDesc::setGlobalAnchor(const NxVec3& wsAnchor);
+ void NxJointDesc::setGlobalAxis(const NxVec3& wsAxis);
+
+ The function sets the joint's localPose using world-space input parameters.
+
+ \param[in] wsAnchor Global frame anchor point. Range: position vector
+ \param[in] wsAxis Global frame axis. Range: direction vector
+ \param[in,out] joint Joint having its global frame set.
+*/
+
+PX_C_EXPORT void PX_CALL_CONV PxSetJointGlobalFrame(physx::PxJoint& joint, const physx::PxVec3* wsAnchor, const physx::PxVec3* wsAxis);
+
+#endif
diff --git a/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxJointLimit.h b/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxJointLimit.h
new file mode 100644
index 000000000..bb36b6a48
--- /dev/null
+++ b/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxJointLimit.h
@@ -0,0 +1,483 @@
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// * Neither the name of NVIDIA CORPORATION nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
+// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// Copyright (c) 2008-2025 NVIDIA Corporation. All rights reserved.
+// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
+// Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
+
+#ifndef PX_JOINT_LIMIT_H
+#define PX_JOINT_LIMIT_H
+
+#include "foundation/PxMath.h"
+#include "common/PxTolerancesScale.h"
+#include "extensions/PxJoint.h"
+#include "PxPhysXConfig.h"
+
+#if !PX_DOXYGEN
+namespace physx
+{
+#endif
+
+/**
+\brief Describes the parameters for a joint limit.
+
+Limits are enabled or disabled by setting flags or other configuration parameters joints, see the
+documentation for specific joint types for details.
+*/
+class PxJointLimitParameters
+{
+public:
+ /**
+ \brief Controls the amount of bounce when the joint hits a limit.
+
+ A restitution value of 1.0 causes the joint to bounce back with the velocity which it hit the limit.
+ A value of zero causes the joint to stop dead.
+
+ In situations where the joint has many locked DOFs (e.g. 5) the restitution may not be applied
+ correctly. This is due to a limitation in the solver which causes the restitution velocity to become zero
+ as the solver enforces constraints on the other DOFs.
+
+ This limitation applies to both angular and linear limits, however it is generally most apparent with limited
+ angular DOFs. Disabling joint projection and increasing the solver iteration count may improve this behavior
+ to some extent.
+
+ Also, combining soft joint limits with joint drives driving against those limits may affect stability.
+
+ Range: [0,1]
+ Default: 0.0
+ */
+ PxReal restitution;
+
+ /**
+ determines the minimum impact velocity which will cause the joint to bounce
+ */
+ PxReal bounceThreshold;
+
+ /**
+ \brief if greater than zero, the limit is soft, i.e. a spring pulls the joint back to the limit
+
+ Range: [0, PX_MAX_F32)
+ Default: 0.0
+ */
+ PxReal stiffness;
+
+ /**
+ \brief if spring is greater than zero, this is the damping of the limit spring
+
+ Range: [0, PX_MAX_F32)
+ Default: 0.0
+ */
+ PxReal damping;
+
+ PxJointLimitParameters() :
+ restitution (0.0f),
+ bounceThreshold (0.0f),
+ stiffness (0.0f),
+ damping (0.0f)
+ {
+ }
+
+ PxJointLimitParameters(const PxJointLimitParameters& p) :
+ restitution (p.restitution),
+ bounceThreshold (p.bounceThreshold),
+ stiffness (p.stiffness),
+ damping (p.damping)
+ {
+ }
+
+ /**
+ \brief Returns true if the current settings are valid.
+
+ \return true if the current settings are valid
+ */
+ PX_INLINE bool isValid() const
+ {
+ return PxIsFinite(restitution) && restitution >= 0 && restitution <= 1 &&
+ PxIsFinite(stiffness) && stiffness >= 0 &&
+ PxIsFinite(damping) && damping >= 0 &&
+ PxIsFinite(bounceThreshold) && bounceThreshold >= 0;
+ }
+
+ PX_INLINE bool isSoft() const
+ {
+ return damping>0 || stiffness>0;
+ }
+
+protected:
+ ~PxJointLimitParameters() {}
+};
+
+
+/**
+\brief Describes a one-sided linear limit.
+*/
+class PxJointLinearLimit : public PxJointLimitParameters
+{
+public:
+ /**
+ \brief the extent of the limit.
+
+ Range: (0, PX_MAX_F32)
+ Default: PX_MAX_F32
+ */
+ PxReal value;
+
+ /**
+ \brief construct a linear hard limit
+
+ \param[in] extent The extent of the limit
+
+ \see PxJointLimitParameters
+ */
+ PxJointLinearLimit(PxReal extent) : value(extent)
+ {
+ }
+
+ /**
+ \brief construct a linear soft limit
+
+ \param[in] extent the extent of the limit
+ \param[in] spring the stiffness and damping parameters for the limit spring
+
+ \see PxJointLimitParameters
+ */
+ PxJointLinearLimit(PxReal extent, const PxSpring& spring) : value(extent)
+ {
+ stiffness = spring.stiffness;
+ damping = spring.damping;
+ }
+
+ /**
+ \brief Returns true if the limit is valid
+
+ \return true if the current settings are valid
+ */
+ PX_INLINE bool isValid() const
+ {
+ return PxJointLimitParameters::isValid() &&
+ PxIsFinite(value) &&
+ value > 0.0f;
+ }
+};
+
+
+/**
+\brief Describes a two-sided limit.
+*/
+class PxJointLinearLimitPair : public PxJointLimitParameters
+{
+public:
+ /**
+ \brief the range of the limit. The upper limit must be no lower than the
+ lower limit, and if they are equal the limited degree of freedom will be treated as locked.
+
+ Range: See the joint on which the limit is used for details
+ Default: lower = -PX_MAX_F32/3, upper = PX_MAX_F32/3
+ */
+ PxReal upper, lower;
+
+ /**
+ \brief Construct a linear hard limit pair. The lower distance value must be less than the upper distance value.
+
+ \param[in] scale A PxTolerancesScale struct. Should be the same as used when creating the PxPhysics object.
+ \param[in] lowerLimit The lower distance of the limit
+ \param[in] upperLimit The upper distance of the limit
+
+ \see PxJointLimitParameters PxTolerancesScale
+ */
+ PxJointLinearLimitPair(const PxTolerancesScale& scale, PxReal lowerLimit = -PX_MAX_F32/3.0f, PxReal upperLimit = PX_MAX_F32/3.0f) :
+ upper(upperLimit),
+ lower(lowerLimit)
+ {
+ bounceThreshold = 2.0f*scale.length;
+ }
+
+ /**
+ \brief construct a linear soft limit pair
+
+ \param[in] lowerLimit The lower distance of the limit
+ \param[in] upperLimit The upper distance of the limit
+ \param[in] spring The stiffness and damping parameters of the limit spring
+
+ \see PxJointLimitParameters
+ */
+ PxJointLinearLimitPair(PxReal lowerLimit, PxReal upperLimit, const PxSpring& spring) :
+ upper(upperLimit),
+ lower(lowerLimit)
+ {
+ stiffness = spring.stiffness;
+ damping = spring.damping;
+ }
+
+ /**
+ \brief Returns true if the limit is valid.
+
+ \return true if the current settings are valid
+ */
+ PX_INLINE bool isValid() const
+ {
+ return PxJointLimitParameters::isValid() &&
+ PxIsFinite(upper) && PxIsFinite(lower) && upper >= lower &&
+ PxIsFinite(upper - lower);
+ }
+};
+
+
+class PxJointAngularLimitPair : public PxJointLimitParameters
+{
+public:
+ /**
+ \brief the range of the limit. The upper limit must be no lower than the lower limit.
+
+ Unit: Angular: Radians
+ Range: See the joint on which the limit is used for details
+ Default: lower = -PI/2, upper = PI/2
+ */
+ PxReal upper, lower;
+
+ /**
+ \brief construct an angular hard limit pair.
+
+ The lower value must be less than the upper value.
+
+ \param[in] lowerLimit The lower angle of the limit
+ \param[in] upperLimit The upper angle of the limit
+
+ \see PxJointLimitParameters
+ */
+ PxJointAngularLimitPair(PxReal lowerLimit, PxReal upperLimit) :
+ upper(upperLimit),
+ lower(lowerLimit)
+ {
+ bounceThreshold = 0.5f;
+ }
+
+ /**
+ \brief construct an angular soft limit pair.
+
+ The lower value must be less than the upper value.
+
+ \param[in] lowerLimit The lower angle of the limit
+ \param[in] upperLimit The upper angle of the limit
+ \param[in] spring The stiffness and damping of the limit spring
+
+ \see PxJointLimitParameters
+ */
+ PxJointAngularLimitPair(PxReal lowerLimit, PxReal upperLimit, const PxSpring& spring) :
+ upper(upperLimit),
+ lower(lowerLimit)
+ {
+ stiffness = spring.stiffness;
+ damping = spring.damping;
+ }
+
+ /**
+ \brief Returns true if the limit is valid.
+
+ \return true if the current settings are valid
+ */
+ PX_INLINE bool isValid() const
+ {
+ return PxJointLimitParameters::isValid() &&
+ PxIsFinite(upper) && PxIsFinite(lower) && upper >= lower;
+ }
+};
+
+/**
+\brief Describes an elliptical conical joint limit. Note that very small or highly elliptical limit cones may
+result in jitter.
+
+\see PxD6Joint PxSphericalJoint
+*/
+class PxJointLimitCone : public PxJointLimitParameters
+{
+public:
+ /**
+ \brief the maximum angle from the Y axis of the constraint frame.
+
+ Unit: Angular: Radians
+ Range: Angular: (0,PI)
+ Default: PI/2
+ */
+ PxReal yAngle;
+
+ /**
+ \brief the maximum angle from the Z-axis of the constraint frame.
+
+ Unit: Angular: Radians
+ Range: Angular: (0,PI)
+ Default: PI/2
+ */
+ PxReal zAngle;
+
+ /**
+ \brief Construct a cone hard limit.
+
+ \param[in] yLimitAngle The limit angle from the Y-axis of the constraint frame
+ \param[in] zLimitAngle The limit angle from the Z-axis of the constraint frame
+
+ \see PxJointLimitParameters
+ */
+ PxJointLimitCone(PxReal yLimitAngle, PxReal zLimitAngle) :
+ yAngle(yLimitAngle),
+ zAngle(zLimitAngle)
+ {
+ bounceThreshold = 0.5f;
+ }
+
+ /**
+ \brief Construct a cone soft limit.
+
+ \param[in] yLimitAngle The limit angle from the Y-axis of the constraint frame
+ \param[in] zLimitAngle The limit angle from the Z-axis of the constraint frame
+ \param[in] spring The stiffness and damping of the limit spring
+
+ \see PxJointLimitParameters
+ */
+ PxJointLimitCone(PxReal yLimitAngle, PxReal zLimitAngle, const PxSpring& spring) :
+ yAngle(yLimitAngle),
+ zAngle(zLimitAngle)
+ {
+ stiffness = spring.stiffness;
+ damping = spring.damping;
+ }
+
+ /**
+ \brief Returns true if the limit is valid.
+
+ \return true if the current settings are valid
+ */
+ PX_INLINE bool isValid() const
+ {
+ return PxJointLimitParameters::isValid() &&
+ PxIsFinite(yAngle) && yAngle>0 && yAngle0 && zAngleUnit: Angular: Radians
+ Range: Angular: (-PI,PI)
+ Default: -PI/2
+ */
+ PxReal yAngleMin;
+
+ /**
+ \brief the maximum angle from the Y axis of the constraint frame.
+
+ Unit: Angular: Radians
+ Range: Angular: (-PI,PI)
+ Default: PI/2
+ */
+ PxReal yAngleMax;
+
+ /**
+ \brief the minimum angle from the Z-axis of the constraint frame.
+
+ Unit: Angular: Radians
+ Range: Angular: (-PI,PI)
+ Default: -PI/2
+ */
+ PxReal zAngleMin;
+
+ /**
+ \brief the maximum angle from the Z-axis of the constraint frame.
+
+ Unit: Angular: Radians
+ Range: Angular: (-PI,PI)
+ Default: PI/2
+ */
+ PxReal zAngleMax;
+
+ /**
+ \brief Construct a pyramid hard limit.
+
+ \param[in] yLimitAngleMin The minimum limit angle from the Y-axis of the constraint frame
+ \param[in] yLimitAngleMax The maximum limit angle from the Y-axis of the constraint frame
+ \param[in] zLimitAngleMin The minimum limit angle from the Z-axis of the constraint frame
+ \param[in] zLimitAngleMax The maximum limit angle from the Z-axis of the constraint frame
+
+ \see PxJointLimitParameters
+ */
+ PxJointLimitPyramid(PxReal yLimitAngleMin, PxReal yLimitAngleMax, PxReal zLimitAngleMin, PxReal zLimitAngleMax) :
+ yAngleMin(yLimitAngleMin),
+ yAngleMax(yLimitAngleMax),
+ zAngleMin(zLimitAngleMin),
+ zAngleMax(zLimitAngleMax)
+ {
+ bounceThreshold = 0.5f;
+ }
+
+ /**
+ \brief Construct a pyramid soft limit.
+
+ \param[in] yLimitAngleMin The minimum limit angle from the Y-axis of the constraint frame
+ \param[in] yLimitAngleMax The maximum limit angle from the Y-axis of the constraint frame
+ \param[in] zLimitAngleMin The minimum limit angle from the Z-axis of the constraint frame
+ \param[in] zLimitAngleMax The maximum limit angle from the Z-axis of the constraint frame
+ \param[in] spring The stiffness and damping of the limit spring
+
+ \see PxJointLimitParameters
+ */
+ PxJointLimitPyramid(PxReal yLimitAngleMin, PxReal yLimitAngleMax, PxReal zLimitAngleMin, PxReal zLimitAngleMax, const PxSpring& spring) :
+ yAngleMin(yLimitAngleMin),
+ yAngleMax(yLimitAngleMax),
+ zAngleMin(zLimitAngleMin),
+ zAngleMax(zLimitAngleMax)
+ {
+ stiffness = spring.stiffness;
+ damping = spring.damping;
+ }
+
+ /**
+ \brief Returns true if the limit is valid.
+
+ \return true if the current settings are valid
+ */
+ PX_INLINE bool isValid() const
+ {
+ return PxJointLimitParameters::isValid() &&
+ PxIsFinite(yAngleMin) && yAngleMin>-PxPi && yAngleMin-PxPi && yAngleMax-PxPi && zAngleMin-PxPi && zAngleMax=yAngleMin && zAngleMax>=zAngleMin;
+ }
+};
+
+#if !PX_DOXYGEN
+} // namespace physx
+#endif
+
+#endif
diff --git a/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxMassProperties.h b/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxMassProperties.h
new file mode 100644
index 000000000..bd578e914
--- /dev/null
+++ b/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxMassProperties.h
@@ -0,0 +1,370 @@
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// * Neither the name of NVIDIA CORPORATION nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
+// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// Copyright (c) 2008-2025 NVIDIA Corporation. All rights reserved.
+// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
+// Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
+
+#ifndef PX_MASS_PROPERTIES_H
+#define PX_MASS_PROPERTIES_H
+
+#include "PxPhysXConfig.h"
+#include "foundation/PxMath.h"
+#include "foundation/PxMathUtils.h"
+#include "foundation/PxVec3.h"
+#include "foundation/PxMat33.h"
+#include "foundation/PxQuat.h"
+#include "foundation/PxTransform.h"
+#include "geometry/PxGeometry.h"
+#include "geometry/PxBoxGeometry.h"
+#include "geometry/PxSphereGeometry.h"
+#include "geometry/PxCapsuleGeometry.h"
+#include "geometry/PxConvexMeshGeometry.h"
+#include "geometry/PxConvexMesh.h"
+#include "geometry/PxCustomGeometry.h"
+#include "geometry/PxConvexCoreGeometry.h"
+#include "geometry/PxTriangleMeshGeometry.h"
+#include "geometry/PxTriangleMesh.h"
+#include "PxConvexCoreExt.h"
+
+#if !PX_DOXYGEN
+namespace physx
+{
+#endif
+
+/**
+\brief Utility class to compute and manipulate mass and inertia tensor properties.
+
+In most cases #PxRigidBodyExt::updateMassAndInertia(), #PxRigidBodyExt::setMassAndUpdateInertia() should be enough to
+setup the mass properties of a rigid body. This utility class targets users that need to customize the mass properties
+computation.
+*/
+class PxMassProperties
+{
+public:
+ /**
+ \brief Default constructor.
+ */
+ PX_FORCE_INLINE PxMassProperties() : inertiaTensor(PxIdentity), centerOfMass(0.0f), mass(1.0f) {}
+
+ /**
+ \brief Construct from individual elements.
+ */
+ PX_FORCE_INLINE PxMassProperties(const PxReal m, const PxMat33& inertiaT, const PxVec3& com) : inertiaTensor(inertiaT), centerOfMass(com), mass(m) {}
+
+ /**
+ \brief Compute mass properties based on a provided geometry structure.
+
+ This constructor assumes the geometry has a density of 1. Mass and inertia tensor scale linearly with density.
+
+ \param[in] geometry The geometry to compute the mass properties for. Supported geometry types are: sphere, box, capsule and convex mesh.
+ */
+ PxMassProperties(const PxGeometry& geometry)
+ {
+ switch (geometry.getType())
+ {
+ case PxGeometryType::eSPHERE:
+ {
+ const PxSphereGeometry& s = static_cast(geometry);
+ mass = (4.0f / 3.0f) * PxPi * s.radius * s.radius * s.radius;
+ inertiaTensor = PxMat33::createDiagonal(PxVec3(2.0f / 5.0f * mass * s.radius * s.radius));
+ centerOfMass = PxVec3(0.0f);
+ }
+ break;
+
+ case PxGeometryType::eBOX:
+ {
+ const PxBoxGeometry& b = static_cast(geometry);
+ mass = b.halfExtents.x * b.halfExtents.y * b.halfExtents.z * 8.0f;
+ PxVec3 d2 = b.halfExtents.multiply(b.halfExtents);
+ inertiaTensor = PxMat33::createDiagonal(PxVec3(d2.y + d2.z, d2.x + d2.z, d2.x + d2.y)) * (mass * 1.0f / 3.0f);
+ centerOfMass = PxVec3(0.0f);
+ }
+ break;
+
+ case PxGeometryType::eCAPSULE:
+ {
+ const PxCapsuleGeometry& c = static_cast(geometry);
+ PxReal r = c.radius, h = c.halfHeight;
+ mass = ((4.0f / 3.0f) * r + 2 * c.halfHeight) * PxPi * r * r;
+
+ PxReal a = r*r*r * (8.0f / 15.0f) + h*r*r * (3.0f / 2.0f) + h*h*r * (4.0f / 3.0f) + h*h*h * (2.0f / 3.0f);
+ PxReal b = r*r*r * (8.0f / 15.0f) + h*r*r;
+ inertiaTensor = PxMat33::createDiagonal(PxVec3(b, a, a) * PxPi * r * r);
+ centerOfMass = PxVec3(0.0f);
+ }
+ break;
+
+ case PxGeometryType::eCONVEXCORE:
+ {
+ const PxConvexCoreGeometry& g = static_cast(geometry);
+ PxConvexCoreExt::computeMassInfo(g, mass, inertiaTensor, centerOfMass);
+ }
+ break;
+
+ case PxGeometryType::eCONVEXMESH:
+ {
+ const PxConvexMeshGeometry& c = static_cast(geometry);
+ PxVec3 unscaledCoM;
+ PxMat33 unscaledInertiaTensorNonCOM; // inertia tensor of convex mesh in mesh local space
+ PxMat33 unscaledInertiaTensorCOM;
+ PxReal unscaledMass;
+ c.convexMesh->getMassInformation(unscaledMass, unscaledInertiaTensorNonCOM, unscaledCoM);
+
+ // inertia tensor relative to center of mass
+ unscaledInertiaTensorCOM[0][0] = unscaledInertiaTensorNonCOM[0][0] - unscaledMass*PxReal((unscaledCoM.y*unscaledCoM.y+unscaledCoM.z*unscaledCoM.z));
+ unscaledInertiaTensorCOM[1][1] = unscaledInertiaTensorNonCOM[1][1] - unscaledMass*PxReal((unscaledCoM.z*unscaledCoM.z+unscaledCoM.x*unscaledCoM.x));
+ unscaledInertiaTensorCOM[2][2] = unscaledInertiaTensorNonCOM[2][2] - unscaledMass*PxReal((unscaledCoM.x*unscaledCoM.x+unscaledCoM.y*unscaledCoM.y));
+ unscaledInertiaTensorCOM[0][1] = unscaledInertiaTensorCOM[1][0] = (unscaledInertiaTensorNonCOM[0][1] + unscaledMass*PxReal(unscaledCoM.x*unscaledCoM.y));
+ unscaledInertiaTensorCOM[1][2] = unscaledInertiaTensorCOM[2][1] = (unscaledInertiaTensorNonCOM[1][2] + unscaledMass*PxReal(unscaledCoM.y*unscaledCoM.z));
+ unscaledInertiaTensorCOM[0][2] = unscaledInertiaTensorCOM[2][0] = (unscaledInertiaTensorNonCOM[0][2] + unscaledMass*PxReal(unscaledCoM.z*unscaledCoM.x));
+
+ const PxMeshScale& s = c.scale;
+ mass = unscaledMass * s.scale.x * s.scale.y * s.scale.z;
+ centerOfMass = s.transform(unscaledCoM);
+ inertiaTensor = scaleInertia(unscaledInertiaTensorCOM, s.rotation, s.scale);
+ }
+ break;
+
+ case PxGeometryType::eCUSTOM:
+ {
+ *this = PxMassProperties();
+ static_cast(geometry).callbacks->computeMassProperties(geometry, *this);
+ }
+ break;
+
+ case PxGeometryType::eTRIANGLEMESH:
+ {
+ const PxTriangleMeshGeometry& g = static_cast(geometry);
+
+ PxVec3 unscaledCoM;
+ PxMat33 unscaledInertiaTensorNonCOM; // inertia tensor of convex mesh in mesh local space
+ PxMat33 unscaledInertiaTensorCOM;
+ PxReal unscaledMass;
+ g.triangleMesh->getMassInformation(unscaledMass, unscaledInertiaTensorNonCOM, unscaledCoM);
+
+ // inertia tensor relative to center of mass
+ unscaledInertiaTensorCOM[0][0] = unscaledInertiaTensorNonCOM[0][0] - unscaledMass * PxReal((unscaledCoM.y*unscaledCoM.y + unscaledCoM.z*unscaledCoM.z));
+ unscaledInertiaTensorCOM[1][1] = unscaledInertiaTensorNonCOM[1][1] - unscaledMass * PxReal((unscaledCoM.z*unscaledCoM.z + unscaledCoM.x*unscaledCoM.x));
+ unscaledInertiaTensorCOM[2][2] = unscaledInertiaTensorNonCOM[2][2] - unscaledMass * PxReal((unscaledCoM.x*unscaledCoM.x + unscaledCoM.y*unscaledCoM.y));
+ unscaledInertiaTensorCOM[0][1] = unscaledInertiaTensorCOM[1][0] = (unscaledInertiaTensorNonCOM[0][1] + unscaledMass * PxReal(unscaledCoM.x*unscaledCoM.y));
+ unscaledInertiaTensorCOM[1][2] = unscaledInertiaTensorCOM[2][1] = (unscaledInertiaTensorNonCOM[1][2] + unscaledMass * PxReal(unscaledCoM.y*unscaledCoM.z));
+ unscaledInertiaTensorCOM[0][2] = unscaledInertiaTensorCOM[2][0] = (unscaledInertiaTensorNonCOM[0][2] + unscaledMass * PxReal(unscaledCoM.z*unscaledCoM.x));
+
+ const PxMeshScale& s = g.scale;
+ mass = unscaledMass * s.scale.x * s.scale.y * s.scale.z;
+ centerOfMass = s.transform(unscaledCoM);
+ inertiaTensor = scaleInertia(unscaledInertiaTensorCOM, s.rotation, s.scale);
+ }
+ break;
+
+ default:
+ {
+ *this = PxMassProperties();
+ }
+ }
+
+ PX_ASSERT(inertiaTensor.column0.isFinite() && inertiaTensor.column1.isFinite() && inertiaTensor.column2.isFinite());
+ PX_ASSERT(centerOfMass.isFinite());
+ PX_ASSERT(PxIsFinite(mass));
+ }
+
+ /**
+ \brief Scale mass properties.
+
+ \param[in] scale The linear scaling factor to apply to the mass properties.
+ \return The scaled mass properties.
+ */
+ PX_FORCE_INLINE PxMassProperties operator*(const PxReal scale) const
+ {
+ PX_ASSERT(PxIsFinite(scale));
+
+ return PxMassProperties(mass * scale, inertiaTensor * scale, centerOfMass);
+ }
+
+ /**
+ \brief Translate the center of mass by a given vector and adjust the inertia tensor accordingly.
+
+ \param[in] t The translation vector for the center of mass.
+ */
+ PX_FORCE_INLINE void translate(const PxVec3& t)
+ {
+ PX_ASSERT(t.isFinite());
+
+ inertiaTensor = translateInertia(inertiaTensor, mass, t);
+ centerOfMass += t;
+
+ PX_ASSERT(inertiaTensor.column0.isFinite() && inertiaTensor.column1.isFinite() && inertiaTensor.column2.isFinite());
+ PX_ASSERT(centerOfMass.isFinite());
+ }
+
+ /**
+ \brief Get the entries of the diagonalized inertia tensor and the corresponding reference rotation.
+
+ \param[in] inertia The inertia tensor to diagonalize.
+ \param[out] massFrame The frame the diagonalized tensor refers to.
+ \return The entries of the diagonalized inertia tensor.
+ */
+ PX_FORCE_INLINE static PxVec3 getMassSpaceInertia(const PxMat33& inertia, PxQuat& massFrame)
+ {
+ PX_ASSERT(inertia.column0.isFinite() && inertia.column1.isFinite() && inertia.column2.isFinite());
+
+ PxVec3 diagT = PxDiagonalize(inertia, massFrame);
+ PX_ASSERT(diagT.isFinite());
+ PX_ASSERT(massFrame.isFinite());
+ return diagT;
+ }
+
+ /**
+ \brief Translate an inertia tensor using the parallel axis theorem
+
+ \param[in] inertia The inertia tensor to translate.
+ \param[in] mass The mass of the object.
+ \param[in] t The relative frame to translate the inertia tensor to.
+ \return The translated inertia tensor.
+ */
+ PX_FORCE_INLINE static PxMat33 translateInertia(const PxMat33& inertia, const PxReal mass, const PxVec3& t)
+ {
+ PX_ASSERT(inertia.column0.isFinite() && inertia.column1.isFinite() && inertia.column2.isFinite());
+ PX_ASSERT(PxIsFinite(mass));
+ PX_ASSERT(t.isFinite());
+
+ PxMat33 s( PxVec3(0,t.z,-t.y),
+ PxVec3(-t.z,0,t.x),
+ PxVec3(t.y,-t.x,0) );
+
+ PxMat33 translatedIT = s.getTranspose() * s * mass + inertia;
+ PX_ASSERT(translatedIT.column0.isFinite() && translatedIT.column1.isFinite() && translatedIT.column2.isFinite());
+ return translatedIT;
+ }
+
+ /**
+ \brief Rotate an inertia tensor around the center of mass
+
+ \param[in] inertia The inertia tensor to rotate.
+ \param[in] q The rotation from the new to the old coordinate frame, i.e. q.rotate(v) transforms
+ the coordinates of vector v from the old to the new coordinate frame.
+ \return The rotated inertia tensor.
+ */
+ PX_FORCE_INLINE static PxMat33 rotateInertia(const PxMat33& inertia, const PxQuat& q)
+ {
+ PX_ASSERT(inertia.column0.isFinite() && inertia.column1.isFinite() && inertia.column2.isFinite());
+ PX_ASSERT(q.isUnit());
+
+ PxMat33 m(q);
+ PxMat33 rotatedIT = m * inertia * m.getTranspose();
+ PX_ASSERT(rotatedIT.column0.isFinite() && rotatedIT.column1.isFinite() && rotatedIT.column2.isFinite());
+ return rotatedIT;
+ }
+
+ /**
+ \brief Non-uniform scaling of the inertia tensor
+
+ \param[in] inertia The inertia tensor to scale.
+ \param[in] scaleRotation The rotation from the scaling frame to the frame that inertia is expressed in.
+ I.e. scaleRotation.rotate(v) transforms the coordinates of vertex v from inertia's frame to the scaling-axes frame.
+ \param[in] scale The scaling factor for each axis (relative to the frame specified with scaleRotation).
+ \return The scaled inertia tensor.
+ */
+ static PxMat33 scaleInertia(const PxMat33& inertia, const PxQuat& scaleRotation, const PxVec3& scale)
+ {
+ PX_ASSERT(inertia.column0.isFinite() && inertia.column1.isFinite() && inertia.column2.isFinite());
+ PX_ASSERT(scaleRotation.isUnit());
+ PX_ASSERT(scale.isFinite());
+
+ PxMat33 localInertiaT = rotateInertia(inertia, scaleRotation); // rotate inertia into scaling frame
+ PxVec3 diagonal(localInertiaT[0][0], localInertiaT[1][1], localInertiaT[2][2]);
+
+ PxVec3 xyz2 = PxVec3(diagonal.dot(PxVec3(0.5f))) - diagonal; // original x^2, y^2, z^2
+ PxVec3 scaledxyz2 = xyz2.multiply(scale).multiply(scale);
+
+ PxReal xx = scaledxyz2.y + scaledxyz2.z,
+ yy = scaledxyz2.z + scaledxyz2.x,
+ zz = scaledxyz2.x + scaledxyz2.y;
+
+ PxReal xy = localInertiaT[0][1] * scale.x * scale.y,
+ xz = localInertiaT[0][2] * scale.x * scale.z,
+ yz = localInertiaT[1][2] * scale.y * scale.z;
+
+ PxMat33 scaledInertia( PxVec3(xx, xy, xz),
+ PxVec3(xy, yy, yz),
+ PxVec3(xz, yz, zz));
+
+ PxMat33 scaledIT = rotateInertia(scaledInertia * (scale.x * scale.y * scale.z), scaleRotation.getConjugate());
+ PX_ASSERT(scaledIT.column0.isFinite() && scaledIT.column1.isFinite() && scaledIT.column2.isFinite());
+ return scaledIT;
+ }
+
+ /**
+ \brief Sum up individual mass properties.
+
+ \param[in] props Array of mass properties to sum up.
+ \param[in] transforms Reference transforms for each mass properties entry.
+ \param[in] count The number of mass properties to sum up.
+ \return The summed up mass properties.
+ */
+ static PxMassProperties sum(const PxMassProperties* props, const PxTransform* transforms, const PxU32 count)
+ {
+ PxReal combinedMass = 0.0f;
+ PxVec3 combinedCoM(0.0f);
+ PxMat33 combinedInertiaT = PxMat33(PxZero);
+
+ for(PxU32 i = 0; i < count; i++)
+ {
+ PX_ASSERT(props[i].inertiaTensor.column0.isFinite() && props[i].inertiaTensor.column1.isFinite() && props[i].inertiaTensor.column2.isFinite());
+ PX_ASSERT(props[i].centerOfMass.isFinite());
+ PX_ASSERT(PxIsFinite(props[i].mass));
+
+ combinedMass += props[i].mass;
+ const PxVec3 comTm = transforms[i].transform(props[i].centerOfMass);
+ combinedCoM += comTm * props[i].mass;
+ }
+
+ if(combinedMass > 0.f)
+ combinedCoM /= combinedMass;
+
+ for(PxU32 i = 0; i < count; i++)
+ {
+ const PxVec3 comTm = transforms[i].transform(props[i].centerOfMass);
+ combinedInertiaT += translateInertia(rotateInertia(props[i].inertiaTensor, transforms[i].q), props[i].mass, combinedCoM - comTm);
+ }
+
+ PX_ASSERT(combinedInertiaT.column0.isFinite() && combinedInertiaT.column1.isFinite() && combinedInertiaT.column2.isFinite());
+ PX_ASSERT(combinedCoM.isFinite());
+ PX_ASSERT(PxIsFinite(combinedMass));
+
+ return PxMassProperties(combinedMass, combinedInertiaT, combinedCoM);
+ }
+
+
+ PxMat33 inertiaTensor; //!< The inertia tensor of the object.
+ PxVec3 centerOfMass; //!< The center of mass of the object.
+ PxReal mass; //!< The mass of the object.
+};
+
+#if !PX_DOXYGEN
+} // namespace physx
+#endif
+
+#endif
diff --git a/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxParticleClothCooker.h b/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxParticleClothCooker.h
new file mode 100644
index 000000000..fe3eaa0be
--- /dev/null
+++ b/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxParticleClothCooker.h
@@ -0,0 +1,122 @@
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// * Neither the name of NVIDIA CORPORATION nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
+// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// Copyright (c) 2008-2025 NVIDIA Corporation. All rights reserved.
+// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
+// Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
+
+#ifndef PX_PARTICLE_CLOTH_COOKER_H
+#define PX_PARTICLE_CLOTH_COOKER_H
+
+#include "foundation/PxSimpleTypes.h"
+#include "foundation/PxVec4.h"
+
+#if !PX_DOXYGEN
+namespace physx
+{
+#endif
+
+namespace ExtGpu
+{
+
+/**
+\brief Holds all the information for a particle cloth constraint used in the PxParticleClothCooker.
+
+\deprecated Particle-cloth, -rigids, -attachments and -volumes have been deprecated.
+*/
+struct PX_DEPRECATED PxParticleClothConstraint
+{
+ enum
+ {
+ eTYPE_INVALID_CONSTRAINT = 0,
+ eTYPE_HORIZONTAL_CONSTRAINT = 1,
+ eTYPE_VERTICAL_CONSTRAINT = 2,
+ eTYPE_DIAGONAL_CONSTRAINT = 4,
+ eTYPE_BENDING_CONSTRAINT = 8,
+ eTYPE_DIAGONAL_BENDING_CONSTRAINT = 16,
+ eTYPE_ALL = eTYPE_HORIZONTAL_CONSTRAINT | eTYPE_VERTICAL_CONSTRAINT | eTYPE_DIAGONAL_CONSTRAINT | eTYPE_BENDING_CONSTRAINT | eTYPE_DIAGONAL_BENDING_CONSTRAINT
+ };
+ PxU32 particleIndexA; //!< The first particle index of this constraint.
+ PxU32 particleIndexB; //!< The second particle index of this constraint.
+ PxReal length; //!< The distance between particle A and B.
+ PxU32 constraintType; //!< The type of constraint, see the constraint type enum.
+};
+
+/*
+\brief Generates PxParticleClothConstraint constraints that connect the individual particles of a particle cloth.
+
+\deprecated Particle-cloth, -rigids, -attachments and -volumes have been deprecated.
+*/
+class PX_DEPRECATED PxParticleClothCooker
+{
+public:
+ virtual void release() = 0;
+
+ /**
+ \brief Generate the constraint list and triangle index list.
+
+ \param[in] constraints A pointer to an array of PxParticleClothConstraint constraints. If NULL, the cooker will generate all the constraints. Otherwise, the user-provided constraints will be added.
+ \param[in] numConstraints The number of user-provided PxParticleClothConstraint s.
+ */
+ virtual void cookConstraints(const PxParticleClothConstraint* constraints = NULL, const PxU32 numConstraints = 0) = 0;
+
+ virtual PxU32* getTriangleIndices() = 0; //!< \return A pointer to the triangle indices.
+ virtual PxU32 getTriangleIndicesCount() = 0; //!< \return The number of triangle indices.
+ virtual PxParticleClothConstraint* getConstraints() = 0; //!< \return A pointer to the PxParticleClothConstraint constraints.
+ virtual PxU32 getConstraintCount() = 0; //!< \return The number of constraints.
+ virtual void calculateMeshVolume() = 0; //!< Computes the volume of a closed mesh and the contraintScale. Expects vertices in local space - 'close' to origin.
+ virtual PxReal getMeshVolume() = 0; //!< \return The mesh volume calculated by PxParticleClothCooker::calculateMeshVolume.
+
+protected:
+ virtual ~PxParticleClothCooker() {}
+};
+
+} // namespace ExtGpu
+
+/**
+\brief Creates a PxParticleClothCooker.
+
+\deprecated Particle-cloth, -rigids, -attachments and -volumes have been deprecated.
+
+\param[in] vertexCount The number of vertices of the particle cloth.
+\param[in] inVertices The vertex positions of the particle cloth.
+\param[in] triangleIndexCount The number of triangles of the cloth mesh.
+\param[in] inTriangleIndices The triangle indices of the cloth mesh
+\param[in] constraintTypeFlags The types of constraints to generate. See PxParticleClothConstraint.
+\param[in] verticalDirection The vertical direction of the cloth mesh. This is needed to generate the correct horizontal and vertical constraints to model shear stiffness.
+\param[in] bendingConstraintMaxAngle The maximum angle (in radians) considered in the bending constraints.
+
+\return A pointer to the new PxParticleClothCooker.
+*/
+PX_DEPRECATED ExtGpu::PxParticleClothCooker* PxCreateParticleClothCooker(PxU32 vertexCount, physx::PxVec4* inVertices, PxU32 triangleIndexCount, PxU32* inTriangleIndices,
+ PxU32 constraintTypeFlags = ExtGpu::PxParticleClothConstraint::eTYPE_ALL,
+ PxVec3 verticalDirection = PxVec3(0.0f, 1.0f, 0.0f), PxReal bendingConstraintMaxAngle = 20.0f*PxTwoPi/360.0f
+);
+
+
+#if !PX_DOXYGEN
+} // namespace physx
+#endif
+
+#endif
diff --git a/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxParticleExt.h b/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxParticleExt.h
new file mode 100644
index 000000000..e3f335cdf
--- /dev/null
+++ b/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxParticleExt.h
@@ -0,0 +1,410 @@
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// * Neither the name of NVIDIA CORPORATION nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
+// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// Copyright (c) 2008-2025 NVIDIA Corporation. All rights reserved.
+// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
+// Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
+
+#ifndef PX_PARTICLE_EXT_H
+#define PX_PARTICLE_EXT_H
+
+#include "PxPBDParticleSystem.h"
+#include "PxParticleBuffer.h"
+#include "foundation/PxArray.h"
+#include "foundation/PxHashMap.h"
+#include "foundation/PxUserAllocated.h"
+#include "PxDeformableAttachment.h"
+
+#if !PX_DOXYGEN
+namespace physx
+{
+#endif
+
+namespace ExtGpu
+{
+
+/**
+\brief Structure to define user-defined particle state when constructing a new particle system.
+*/
+struct PxParticleBufferDesc
+{
+ PxVec4* positions;
+ PxVec4* velocities;
+ PxU32* phases;
+ PxParticleVolume* volumes;
+ PxU32 numActiveParticles;
+ PxU32 maxParticles;
+ PxU32 numVolumes;
+ PxU32 maxVolumes;
+
+ PxParticleBufferDesc() : positions(NULL), velocities(NULL), phases(NULL), volumes(NULL), numActiveParticles(0), maxParticles(0), numVolumes(0), maxVolumes(0) { }
+};
+
+/**
+\brief Structure to define user-defined particle state when constructing a new particle system that includes diffuse particles.
+*/
+struct PxParticleAndDiffuseBufferDesc : public PxParticleBufferDesc
+{
+ PxDiffuseParticleParams diffuseParams;
+ PxU32 maxDiffuseParticles;
+ PxU32 maxActiveDiffuseParticles;
+
+ PxParticleAndDiffuseBufferDesc() : PxParticleBufferDesc() { }
+};
+
+/**
+\brief Structure to define user-defined particle state when constructing a new particle system that includes shape-matched rigid bodies.
+*/
+struct PxParticleRigidDesc
+{
+ PxParticleRigidDesc() : rigidOffsets(NULL), rigidCoefficients(NULL), rigidTranslations(NULL), rigidRotations(NULL),
+ rigidLocalPositions(NULL), rigidLocalNormals(NULL), maxRigids(0), numActiveRigids(0) { }
+
+ PxU32* rigidOffsets;
+ PxReal* rigidCoefficients;
+ PxVec4* rigidTranslations;
+ PxQuat* rigidRotations;
+ PxVec4* rigidLocalPositions;
+ PxVec4* rigidLocalNormals;
+ PxU32 maxRigids;
+ PxU32 numActiveRigids;
+};
+
+//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+/**
+\brief Helper class to manage PxParticleClothDesc buffers used for communicating particle based cloths to PxParticleClothBuffer.
+
+\deprecated Particle-cloth, -rigids, -attachments and -volumes have been deprecated.
+*/
+class PX_DEPRECATED PxParticleClothBufferHelper
+{
+public:
+ virtual void release() = 0;
+
+ virtual PxU32 getMaxCloths() const = 0; //!< \return The maximum number of cloths this PxParticleClothBufferHelper can hold.
+ virtual PxU32 getNumCloths() const = 0; //!< \return The current number of cloths in this PxParticleClothBufferHelper.
+ virtual PxU32 getMaxSprings() const = 0; //!< \return The maximum number of springs this PxParticleClothBufferHelper can hold.
+ virtual PxU32 getNumSprings() const = 0; //!< \return The current number of springs in this PxParticleClothBufferHelper.
+ virtual PxU32 getMaxTriangles() const = 0; //!< \return The maximum number of triangles this PxParticleClothBufferHelper can hold.
+ virtual PxU32 getNumTriangles() const = 0; //!< \return The current number of triangles in this PxParticleClothBufferHelper.
+ virtual PxU32 getMaxParticles() const = 0; //!< \return The maximum number of particles this PxParticleClothBufferHelper can hold.
+ virtual PxU32 getNumParticles() const = 0; //!< \return The current number of particles in this PxParticleClothBufferHelper.
+
+ /**
+ \brief Adds a PxParticleCloth to this PxParticleClothBufferHelper instance.
+
+ \param[in] particleCloth The PxParticleCloth to be added.
+ \param[in] triangles A pointer to the triangles
+ \param[in] numTriangles The number of triangles
+ \param[in] springs A pointer to the springs
+ \param[in] numSprings The number of springs
+ \param[in] restPositions A pointer to the particle rest positions
+ \param[in] numParticles The number of particles in this cloth
+
+ \see PxParticleCloth PxParticleSpring
+ */
+ virtual void addCloth(const PxParticleCloth& particleCloth,
+ const PxU32* triangles, const PxU32 numTriangles,
+ const PxParticleSpring* springs, const PxU32 numSprings, const PxVec4* restPositions, const PxU32 numParticles) = 0;
+
+ /**
+ \brief Adds a cloth to this PxParticleClothBufferHelper instance.
+
+ Adds a cloth to this PxParticleClothBufferHelper instance. With this method the relevant parameters for inflatable simulation
+ (restVolume, pressure) can be set directly.
+
+ \param[in] blendScale This should be 1.f / (numPartitions + 1) if the springs are partitioned by the user. Otherwise this will be set during spring partitioning.
+ \param[in] restVolume The rest volume of the inflatable
+ \param[in] pressure The pressure of the inflatable. The target inflatable volume is defined as restVolume * pressure. Setting this to > 0.0 will enable inflatable simulation.
+ \param[in] triangles A pointer to the triangles
+ \param[in] numTriangles The number of triangles
+ \param[in] springs A pointer to the springs
+ \param[in] numSprings The number of springs
+ \param[in] restPositions A pointer to the particle rest positions
+ \param[in] numParticles The number of particles in this cloth
+
+ \see PxParticleSpring
+ */
+ virtual void addCloth(const PxReal blendScale, const PxReal restVolume, const PxReal pressure,
+ const PxU32* triangles, const PxU32 numTriangles,
+ const PxParticleSpring* springs, const PxU32 numSprings,
+ const PxVec4* restPositions, const PxU32 numParticles) = 0;
+
+ /**
+ \brief Returns a PxParticleClothDesc for this PxParticleClothBufferHelper instance to be used for spring partitioning.
+
+ \return the PxParticleClothDesc.
+
+ \see PxCreateAndPopulateParticleClothBuffer, PxParticleClothPreProcessor::partitionSprings
+ */
+ virtual PxParticleClothDesc& getParticleClothDesc() = 0;
+
+protected:
+ virtual ~PxParticleClothBufferHelper() {}
+};
+
+
+/**
+\brief Helper struct that holds information about a specific mesh in a PxParticleVolumeBufferHelper.
+
+\deprecated Particle-cloth, -rigids, -attachments and -volumes have been deprecated.
+*/
+struct PX_DEPRECATED PxParticleVolumeMesh
+{
+ PxU32 startIndex; //!< The index of the first triangle of this mesh in the triangle array of the PxParticleVolumeBufferHelper instance.
+ PxU32 count; //!< The number of triangles of this mesh.
+};
+
+/**
+\brief Helper class to manage communicating PxParticleVolumes data to PxParticleBuffer.
+
+\deprecated Particle-cloth, -rigids, -attachments and -volumes have been deprecated.
+*/
+class PX_DEPRECATED PxParticleVolumeBufferHelper
+{
+public:
+ virtual void release() = 0;
+
+ virtual PxU32 getMaxVolumes() const = 0; //!< \return The maximum number of PxParticleVolume this PxParticleVolumeBufferHelper instance can hold.
+ virtual PxU32 getNumVolumes() const = 0; //!< \return The current number of PxParticleVolume in this PxParticleVolumeBufferHelper instance.
+ virtual PxU32 getMaxTriangles() const = 0; //!< \return The maximum number of triangles this PxParticleVolumeBufferHelper instance can hold.
+ virtual PxU32 getNumTriangles() const = 0; //!< \return The current number of triangles in this PxParticleVolumeBufferHelper instance.
+
+ virtual PxParticleVolume* getParticleVolumes() = 0; //!< \return A pointer to the PxParticleVolume s of this PxParticleVolumeBufferHelper instance.
+ virtual PxParticleVolumeMesh* getParticleVolumeMeshes() = 0; //!< \return A pointer to the PxParticleVolumeMesh structs describing the PxParticleVolumes of this PxParticleVolumeBufferHelper instance.
+ virtual PxU32* getTriangles() = 0; //!< \return A pointer to the triangle indices in this PxParticleVolumeBufferHelper instance.
+
+ /**
+ \brief Adds a PxParticleVolume with a PxParticleVolumeMesh
+
+ \param[in] volume The PxParticleVolume to be added.
+ \param[in] volumeMesh A PxParticleVolumeMesh that describes the volumes to be added. startIndex is the index into the triangle list of the PxParticleVolumeBufferHelper instance.
+ \param[in] triangles A pointer to the triangle indices of the PxParticleVolume to be added.
+ \param[in] numTriangles The number of triangles of the PxParticleVolume to be added.
+ */
+ virtual void addVolume(const PxParticleVolume& volume, const PxParticleVolumeMesh& volumeMesh, const PxU32* triangles, const PxU32 numTriangles) = 0;
+
+ /**
+ \brief Adds a volume
+
+ \param[in] particleOffset The index of the first particle of the cloth that maps to this volume in the PxParticleClothBufferHelper instance.
+ \param[in] numParticles The number of particles of the cloth that maps to this volume in the PxParticleClothBufferHelper instance.
+ \param[in] triangles A pointer to the triangle indices of this volume.
+ \param[in] numTriangles The number of triangles in this volume.
+ */
+ virtual void addVolume(const PxU32 particleOffset, const PxU32 numParticles, const PxU32* triangles, const PxU32 numTriangles) = 0;
+
+protected:
+ virtual ~PxParticleVolumeBufferHelper() {}
+};
+
+
+/**
+\brief Helper class to manage PxParticleRigidDesc buffers used for communicating particle based rigids to PxPaticleSystem.
+
+\deprecated Particle-cloth, -rigids, -attachments and -volumes have been deprecated.
+*/
+class PX_DEPRECATED PxParticleRigidBufferHelper
+{
+public:
+ virtual void release() = 0;
+
+ virtual PxU32 getMaxRigids() const = 0; //!< \return The maximum number of rigids this PxParticleRigidBufferHelper instance can hold.
+ virtual PxU32 getNumRigids() const = 0; //!< \return The current number of rigids in this PxParticleRigidBufferHelper instance.
+ virtual PxU32 getMaxParticles() const = 0; //!< \return The maximum number of particles this PxParticleRigidBufferHelper instance can hold.
+ virtual PxU32 getNumParticles() const = 0; //!< \return The current number of particles in this PxParticleRigidBufferHelper instance.
+
+ /**
+ \brief Adds a rigid.
+
+ \param[in] translation The world-space location of the rigid.
+ \param[in] rotation The world-space rotation of the rigid.
+ \param[in] coefficient The stiffness of the rigid.
+ \param[in] localPositions The particle positions in local space.
+ \param[in] localNormals The surface normal for all the particles in local space. Each PxVec4 has the normal in the first 3 components and the SDF in the last component.
+ \param[in] numParticles The number of particles in this rigid.
+ */
+ virtual void addRigid(const PxVec3& translation, const PxQuat& rotation, const PxReal coefficient,
+ const PxVec4* localPositions, const PxVec4* localNormals, PxU32 numParticles) = 0;
+
+ /**
+ \brief Get the PxParticleRigidDesc for this buffer.
+
+ \returns A PxParticleRigidDesc.
+ */
+ virtual PxParticleRigidDesc& getParticleRigidDesc() = 0;
+
+protected:
+ virtual ~PxParticleRigidBufferHelper() {}
+};
+
+///////////////////////////////////////////////////////////////////////////////
+
+/**
+\brief Holds user-defined attachment data to attach particles to other bodies
+
+\deprecated Particle-cloth, -rigids, -attachments and -volumes have been deprecated.
+*/
+class PX_DEPRECATED PxParticleAttachmentBuffer : public PxUserAllocated
+{
+ PxArray mAttachments;
+ PxArray mFilters;
+ PxHashMap mReferencedBodies;
+ PxArray mNewReferencedBodies;
+ PxArray mDestroyedRefrencedBodies;
+
+ PxParticleBuffer& mParticleBuffer;
+
+ PxParticleRigidAttachment* mDeviceAttachments;
+ PxParticleRigidFilterPair* mDeviceFilters;
+ PxU32 mNumDeviceAttachments;
+ PxU32 mNumDeviceFilters;
+
+ PxCudaContextManager* mCudaContextManager;
+
+ PxParticleSystem& mParticleSystem;
+
+ bool mDirty;
+
+ PX_NOCOPY(PxParticleAttachmentBuffer)
+
+public:
+
+ PxParticleAttachmentBuffer(PxParticleBuffer& particleBuffer, PxPBDParticleSystem& particleSystem);
+
+ ~PxParticleAttachmentBuffer();
+
+ // adds attachment to attachment buffer - localPose is in actor space for attachments to all types of rigids.
+ void addRigidAttachment(PxRigidActor* rigidBody, const PxU32 particleID, const PxVec3& localPose, PxConeLimitedConstraint* coneLimit = NULL);
+ bool removeRigidAttachment(PxRigidActor* rigidBody, const PxU32 particleID);
+ void addRigidFilter(PxRigidActor* rigidBody, const PxU32 particleID);
+ bool removeRigidFilter(PxRigidActor* rigidBody, const PxU32 particleID);
+
+ void copyToDevice(CUstream stream = 0);
+};
+
+/**
+\brief Creates a PxParticleRigidBufferHelper.
+
+\deprecated Particle-cloth, -rigids, -attachments and -volumes have been deprecated.
+
+\param[in] maxRigids The maximum number of rigids this PxParticleRigidsBuffers instance should hold.
+\param[in] maxParticles The maximum number of particles this PxParticleRigidBufferHelper instance should hold.
+\param[in] cudaContextManager A pointer to a PxCudaContextManager.
+
+\return A pointer to the new PxParticleRigidBufferHelper.
+*/
+PX_DEPRECATED PxParticleRigidBufferHelper* PxCreateParticleRigidBufferHelper(PxU32 maxRigids, PxU32 maxParticles, PxCudaContextManager* cudaContextManager);
+
+/**
+\brief Creates a PxParticleClothBufferHelper helper.
+
+\deprecated Particle-cloth, -rigids, -attachments and -volumes have been deprecated.
+
+\param[in] maxCloths The maximum number of cloths this PxParticleClothBufferHelper should hold.
+\param[in] maxTriangles The maximum number of triangles this PxParticleClothBufferHelper should hold.
+\param[in] maxSprings The maximum number of springs this PxParticleClothBufferHelper should hold.
+\param[in] maxParticles The maximum number of particles this PxParticleClothBufferHelper should hold.
+\param[in] cudaContextManager A pointer to a PxCudaContextManager.
+
+\return A pointer to the PxParticleClothBufferHelper that was created.
+*/
+PX_DEPRECATED PxParticleClothBufferHelper* PxCreateParticleClothBufferHelper(const PxU32 maxCloths, const PxU32 maxTriangles, const PxU32 maxSprings, const PxU32 maxParticles, PxCudaContextManager* cudaContextManager);
+
+/**
+\brief Creates a PxParticleVolumeBufferHelper.
+
+\param[in] maxVolumes The maximum number of PxParticleVolume s this PxParticleVolumeBufferHelper instance should hold.
+\param[in] maxTriangles The maximum number of triangles this PxParticleVolumeBufferHelper instance should hold.
+\param[in] cudaContextManager A pointer to a PxCudaContextManager.
+
+\return A pointer to the new PxParticleVolumeBufferHelper.
+*/
+PX_DEPRECATED PxParticleVolumeBufferHelper* PxCreateParticleVolumeBufferHelper(PxU32 maxVolumes, PxU32 maxTriangles, PxCudaContextManager* cudaContextManager);
+
+/**
+\brief Creates a particle attachment buffer
+
+\deprecated Particle-cloth, -rigids, -attachments and -volumes have been deprecated.
+
+\param[in] particleBuffer The particle buffer that contains particles that should get attached to something
+\param[in] particleSystem The particle system that is used to simulate the userBuffer
+\return An attachment buffer ready to use
+*/
+PX_DEPRECATED PxParticleAttachmentBuffer* PxCreateParticleAttachmentBuffer(PxParticleBuffer& particleBuffer, PxParticleSystem& particleSystem);
+
+/**
+\brief Creates and populates a particle buffer
+
+\param[in] desc The particle buffer descriptor
+\param[in] cudaContextManager A cuda context manager
+\return A fully populated particle buffer ready to use
+*/
+PxParticleBuffer* PxCreateAndPopulateParticleBuffer(const ExtGpu::PxParticleBufferDesc& desc, PxCudaContextManager* cudaContextManager);
+
+/**
+\brief Creates and populates a particle buffer that includes support for diffuse particles
+
+\param[in] desc The particle buffer descriptor
+\param[in] cudaContextManager A cuda context manager
+\return A fully populated particle buffer ready to use
+*/
+PxParticleAndDiffuseBuffer* PxCreateAndPopulateParticleAndDiffuseBuffer(const ExtGpu::PxParticleAndDiffuseBufferDesc& desc, PxCudaContextManager* cudaContextManager);
+
+/**
+\brief Creates and populates a particle cloth buffer
+
+\deprecated Particle-cloth, -rigids, -attachments and -volumes have been deprecated.
+
+\param[in] desc The particle buffer descriptor
+\param[in] clothDesc The cloth descriptor
+\param[out] output A cloth output object to further configure the behavior of the cloth
+\param[in] cudaContextManager A cuda context manager
+\return A fully populated particle cloth buffer ready to use
+*/
+PX_DEPRECATED PxParticleClothBuffer* PxCreateAndPopulateParticleClothBuffer(const ExtGpu::PxParticleBufferDesc& desc, const PxParticleClothDesc& clothDesc,
+ PxPartitionedParticleCloth& output, PxCudaContextManager* cudaContextManager);
+
+/**
+\brief Creates and populates a particle rigid buffer. Particle rigids are particles that try to keep their relative positions. They are a bit commpressible similar to softbodies.
+
+\deprecated Particle-cloth, -rigids, -attachments and -volumes have been deprecated.
+
+\param[in] desc The particle buffer descriptor
+\param[in] rigidDesc The rigid descriptor
+\param[in] cudaContextManager A cuda context manager
+\return A fully populated particle rigid buffer ready to use
+*/
+PX_DEPRECATED PxParticleRigidBuffer* PxCreateAndPopulateParticleRigidBuffer(const ExtGpu::PxParticleBufferDesc& desc, const ExtGpu::PxParticleRigidDesc& rigidDesc,
+ PxCudaContextManager* cudaContextManager);
+
+} // namespace ExtGpu
+
+#if !PX_DOXYGEN
+} // namespace physx
+#endif
+
+#endif
+
diff --git a/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxPrismaticJoint.h b/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxPrismaticJoint.h
new file mode 100644
index 000000000..0e70daecf
--- /dev/null
+++ b/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxPrismaticJoint.h
@@ -0,0 +1,174 @@
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// * Neither the name of NVIDIA CORPORATION nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
+// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// Copyright (c) 2008-2025 NVIDIA Corporation. All rights reserved.
+// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
+// Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
+
+#ifndef PX_PRISMATIC_JOINT_H
+#define PX_PRISMATIC_JOINT_H
+
+#include "extensions/PxJoint.h"
+#include "extensions/PxJointLimit.h"
+
+#if !PX_DOXYGEN
+namespace physx
+{
+#endif
+
+class PxPrismaticJoint;
+
+/**
+\brief Create a prismatic joint.
+
+ \param[in] physics The physics SDK
+ \param[in] actor0 An actor to which the joint is attached. NULL may be used to attach the joint to a specific point in the world frame
+ \param[in] localFrame0 The position and orientation of the joint relative to actor0
+ \param[in] actor1 An actor to which the joint is attached. NULL may be used to attach the joint to a specific point in the world frame
+ \param[in] localFrame1 The position and orientation of the joint relative to actor1
+
+\see PxPrismaticJoint
+*/
+PxPrismaticJoint* PxPrismaticJointCreate(PxPhysics& physics, PxRigidActor* actor0, const PxTransform& localFrame0, PxRigidActor* actor1, const PxTransform& localFrame1);
+
+
+/**
+\brief Flags specific to the prismatic joint.
+
+\see PxPrismaticJoint
+*/
+struct PxPrismaticJointFlag
+{
+ enum Enum
+ {
+ eLIMIT_ENABLED = 1<<1
+ };
+};
+
+typedef PxFlags PxPrismaticJointFlags;
+PX_FLAGS_OPERATORS(PxPrismaticJointFlag::Enum, PxU16)
+
+/**
+ \brief A prismatic joint permits relative translational movement between two bodies along
+ an axis, but no relative rotational movement.
+
+ The axis on each body is defined as the line containing the origin of the joint frame and
+ extending along the x-axis of that frame.
+
+ \image html prismJoint.png
+
+ \see PxPrismaticJointCreate() PxJoint
+*/
+class PxPrismaticJoint : public PxJoint
+{
+public:
+
+ /**
+ \brief returns the displacement of the joint along its axis.
+ */
+ virtual PxReal getPosition() const = 0;
+
+ /**
+ \brief returns the velocity of the joint along its axis
+ */
+ virtual PxReal getVelocity() const = 0;
+
+ /**
+ \brief sets the joint limit parameters.
+
+ The limit range is [-PX_MAX_F32, PX_MAX_F32], but note that the width of the limit (upper-lower) must also be
+ a valid float.
+
+ \see PxJointLinearLimitPair getLimit()
+ */
+ virtual void setLimit(const PxJointLinearLimitPair&) = 0;
+
+ /**
+ \brief gets the joint limit parameters.
+
+ \see PxJointLinearLimit getLimit()
+ */
+ virtual PxJointLinearLimitPair getLimit() const = 0;
+
+ /**
+ \brief Set the flags specific to the Prismatic Joint.
+
+ Default PxPrismaticJointFlags(0)
+
+ \param[in] flags The joint flags.
+
+ \see PxPrismaticJointFlag setFlag() getFlags()
+ */
+ virtual void setPrismaticJointFlags(PxPrismaticJointFlags flags) = 0;
+
+ /**
+ \brief Set a single flag specific to a Prismatic Joint to true or false.
+
+ \param[in] flag The flag to set or clear.
+ \param[in] value The value to which to set the flag
+
+ \see PxPrismaticJointFlag, getFlags() setFlags()
+ */
+ virtual void setPrismaticJointFlag(PxPrismaticJointFlag::Enum flag, bool value) = 0;
+
+ /**
+ \brief Get the flags specific to the Prismatic Joint.
+
+ \return the joint flags
+
+ \see PxPrismaticJoint::flags, PxPrismaticJointFlag setFlag() setFlags()
+ */
+ virtual PxPrismaticJointFlags getPrismaticJointFlags() const = 0;
+
+ /**
+ \brief Returns string name of PxPrismaticJoint, used for serialization
+ */
+ virtual const char* getConcreteTypeName() const PX_OVERRIDE { return "PxPrismaticJoint"; }
+
+protected:
+ //serialization
+
+ /**
+ \brief Constructor
+ */
+ PX_INLINE PxPrismaticJoint(PxType concreteType, PxBaseFlags baseFlags) : PxJoint(concreteType, baseFlags) {}
+
+ /**
+ \brief Deserialization constructor
+ */
+ PX_INLINE PxPrismaticJoint(PxBaseFlags baseFlags) : PxJoint(baseFlags) {}
+
+ /**
+ \brief Returns whether a given type name matches with the type of this instance
+ */
+ virtual bool isKindOf(const char* name) const { PX_IS_KIND_OF(name, "PxPrismaticJoint", PxJoint); }
+
+ //~serialization
+};
+
+#if !PX_DOXYGEN
+} // namespace physx
+#endif
+
+#endif
diff --git a/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxRackAndPinionJoint.h b/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxRackAndPinionJoint.h
new file mode 100644
index 000000000..c572aeaab
--- /dev/null
+++ b/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxRackAndPinionJoint.h
@@ -0,0 +1,140 @@
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// * Neither the name of NVIDIA CORPORATION nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
+// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// Copyright (c) 2008-2025 NVIDIA Corporation. All rights reserved.
+// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
+// Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
+
+#ifndef PX_RACK_AND_PINION_JOINT_H
+#define PX_RACK_AND_PINION_JOINT_H
+
+#include "extensions/PxJoint.h"
+
+#if !PX_DOXYGEN
+namespace physx
+{
+#endif
+
+ class PxRackAndPinionJoint;
+
+ /**
+ \brief Create a rack & pinion Joint.
+
+ \param[in] physics The physics SDK
+ \param[in] actor0 An actor to which the joint is attached. NULL may be used to attach the joint to a specific point in the world frame
+ \param[in] localFrame0 The position and orientation of the joint relative to actor0
+ \param[in] actor1 An actor to which the joint is attached. NULL may be used to attach the joint to a specific point in the world frame
+ \param[in] localFrame1 The position and orientation of the joint relative to actor1
+
+ \see PxRackAndPinionJoint
+ */
+ PxRackAndPinionJoint* PxRackAndPinionJointCreate(PxPhysics& physics, PxRigidActor* actor0, const PxTransform& localFrame0, PxRigidActor* actor1, const PxTransform& localFrame1);
+
+ /**
+ \brief A joint that connects an existing revolute joint to an existing prismatic joint,
+ and constrains their relative angular/linear velocity and position with respect to each other.
+
+ \see PxRackAndPinionJointCreate PxJoint
+ */
+ class PxRackAndPinionJoint : public PxJoint
+ {
+ public:
+
+ /**
+ \brief Set the hinge & prismatic joints connected by the rack & pinion joint.
+
+ The passed hinge joint can be either PxRevoluteJoint, PxD6Joint or PxArticulationJointReducedCoordinate.
+ The passed prismatic joint can be either PxPrismaticJoint or PxD6Joint.
+
+ Note that these joints are only used to compute the positional error correction term,
+ used to adjust potential drift between jointed actors. The rack & pinion joint can run without
+ calling this function, but in that case some visible overlap may develop over time between
+ the teeth of the rack & pinion meshes.
+
+ \note Calling this function resets the internal positional error correction term.
+
+ \param[in] hinge The hinge joint (pinion)
+ \param[in] prismatic The prismatic joint (rack)
+ \return true if success
+ */
+ virtual bool setJoints(const PxBase* hinge, const PxBase* prismatic) = 0;
+
+ /**
+ \brief Get the hinge & prismatic joints connected by the rack & pinion joint.
+
+ \param[out] hinge The hinge joint (pinion)
+ \param[out] prismatic The prismatic joint (rack)
+ */
+ virtual void getJoints(const PxBase*& hinge, const PxBase*& prismatic) const = 0;
+
+ /**
+ \brief Set the desired ratio directly.
+
+ \note You may need to use a negative gear ratio if the joint frames of involved actors are not oriented in the same direction.
+
+ \note Calling this function resets the internal positional error correction term.
+
+ \param[in] ratio Desired ratio between the hinge and the prismatic.
+ */
+ virtual void setRatio(float ratio) = 0;
+
+ /**
+ \brief Get the ratio.
+
+ \return Current ratio
+ */
+ virtual float getRatio() const = 0;
+
+ /**
+ \brief Set the desired ratio indirectly.
+
+ This is a simple helper function that computes the ratio from passed data:
+
+ ratio = (PI*2*nbRackTeeth)/(rackLength*nbPinionTeeth)
+
+ \note Calling this function resets the internal positional error correction term.
+
+ \param[in] nbRackTeeth Number of teeth on the rack (cannot be zero)
+ \param[in] nbPinionTeeth Number of teeth on the pinion (cannot be zero)
+ \param[in] rackLength Length of the rack
+ \return true if success
+ */
+ virtual bool setData(PxU32 nbRackTeeth, PxU32 nbPinionTeeth, float rackLength) = 0;
+
+ virtual const char* getConcreteTypeName() const PX_OVERRIDE { return "PxRackAndPinionJoint"; }
+
+ protected:
+
+ PX_INLINE PxRackAndPinionJoint(PxType concreteType, PxBaseFlags baseFlags) : PxJoint(concreteType, baseFlags) {}
+
+ PX_INLINE PxRackAndPinionJoint(PxBaseFlags baseFlags) : PxJoint(baseFlags) {}
+
+ virtual bool isKindOf(const char* name) const { PX_IS_KIND_OF(name, "PxRackAndPinionJoint", PxJoint); }
+ };
+
+#if !PX_DOXYGEN
+} // namespace physx
+#endif
+
+#endif
diff --git a/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxRaycastCCD.h b/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxRaycastCCD.h
new file mode 100644
index 000000000..d3dc93f27
--- /dev/null
+++ b/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxRaycastCCD.h
@@ -0,0 +1,105 @@
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// * Neither the name of NVIDIA CORPORATION nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
+// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// Copyright (c) 2008-2025 NVIDIA Corporation. All rights reserved.
+// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
+// Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
+
+#ifndef PX_RAYCAST_CCD_H
+#define PX_RAYCAST_CCD_H
+
+#include "common/PxPhysXCommonConfig.h"
+#include "foundation/PxVec3.h"
+
+#if !PX_DOXYGEN
+namespace physx
+{
+#endif
+
+ class PxScene;
+ class PxShape;
+ class PxRigidDynamic;
+ class RaycastCCDManagerInternal;
+
+ /**
+ \brief Raycast-CCD manager.
+
+ Raycast-CCD is a simple and potentially cheaper alternative to the SDK's built-in continuous collision detection algorithm.
+
+ This implementation has some limitations:
+ - it is only implemented for PxRigidDynamic objects (not for PxArticulationLink)
+ - it is only implemented for simple actors with 1 shape (not for "compounds")
+
+ Also, since it is raycast-based, the solution is not perfect. In particular:
+ - small dynamic objects can still go through the static world if the ray goes through a crack between edges, or a small
+ hole in the world (like the keyhole from a door).
+ - dynamic-vs-dynamic CCD is very approximate. It only works well for fast-moving dynamic objects colliding against
+ slow-moving dynamic objects.
+
+ Finally, since it is using the SDK's scene queries under the hood, it only works provided the simulation shapes also have
+ scene-query shapes associated with them. That is, if the objects in the scene only use PxShapeFlag::eSIMULATION_SHAPE
+ (and no PxShapeFlag::eSCENE_QUERY_SHAPE), then the raycast-CCD system will not work.
+ */
+ class RaycastCCDManager
+ {
+ public:
+ RaycastCCDManager(PxScene* scene);
+ ~RaycastCCDManager();
+
+ /**
+ \brief Register dynamic object for raycast CCD.
+
+ \param[in] actor object's actor
+ \param[in] shape object's shape
+
+ \return True if success
+ */
+ bool registerRaycastCCDObject(PxRigidDynamic* actor, PxShape* shape);
+
+ /**
+ \brief Unregister dynamic object for raycast CCD.
+
+ \param[in] actor object's actor
+ \param[in] shape object's shape
+
+ \return True if success
+ */
+ bool unregisterRaycastCCDObject(PxRigidDynamic* actor, PxShape* shape);
+
+ /**
+ \brief Perform raycast CCD. Call this after your simulate/fetchResults calls.
+
+ \param[in] doDynamicDynamicCCD True to enable dynamic-vs-dynamic CCD (more expensive, not always needed)
+ */
+ void doRaycastCCD(bool doDynamicDynamicCCD);
+
+ private:
+ RaycastCCDManagerInternal* mImpl;
+ };
+
+#if !PX_DOXYGEN
+} // namespace physx
+#endif
+
+#endif
diff --git a/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxRemeshingExt.h b/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxRemeshingExt.h
new file mode 100644
index 000000000..43aa588c1
--- /dev/null
+++ b/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxRemeshingExt.h
@@ -0,0 +1,87 @@
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// * Neither the name of NVIDIA CORPORATION nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
+// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// Copyright (c) 2008-2025 NVIDIA Corporation. All rights reserved.
+// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
+// Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
+
+#ifndef PX_REMESHING_EXT_H
+#define PX_REMESHING_EXT_H
+
+#include "foundation/PxVec3.h"
+#include "foundation/PxArray.h"
+
+#if !PX_DOXYGEN
+namespace physx
+{
+#endif
+
+ /**
+ \brief Provides methods to adjust the tessellation of meshes
+ */
+ class PxRemeshingExt
+ {
+ public:
+ /**
+ \brief Processes a triangle mesh and makes sure that no triangle edge is longer than the maximal edge length specified
+
+ To shorten edges that are too long, additional points get inserted at their center leading to a subdivision of the input mesh.
+ This process is executed repeatedly until the maximum edge length criterion is satisfied
+
+ \param[in,out] triangles The triangles of the mesh where a maximum edge length should be enforced. They will be modified in place during the process.
+ \param[in,out] points The vertices of the mesh where a maximum edge length should be enforced. They will be modified in place during the process.
+ \param[in] maxEdgeLength The maximum edge length allowed after processing the input
+ \param[in] maxIterations The maximum number of subdivision iterations
+ \param[out] triangleMap An optional map that provides the index of the original triangle for every triangle after the subdivision
+ \param[in] triangleCountThreshold Optional limit to the number of triangles. Not guaranteed to match exactly, the algorithm will just stop as soon as possible after reaching the limit.
+
+ \return True if any remeshing was applied
+ */
+ static bool limitMaxEdgeLength(PxArray& triangles, PxArray& points, PxReal maxEdgeLength,
+ PxU32 maxIterations = 100, PxArray* triangleMap = NULL, PxU32 triangleCountThreshold = 0xFFFFFFFF);
+
+ /**
+ \brief Processes a triangle mesh and makes sure that no triangle edge is longer than the maximal edge length specified
+
+ To shorten edges that are too long, additional points get inserted at their center leading to a subdivision of the input mesh.
+ This process is executed repeatedly until the maximum edge length criterion is satisfied
+
+ \param[in,out] triangles The triangles of the mesh where a maximum edge length should be enforced. They will be modified in place during the process.
+ \param[in,out] points The vertices of the mesh where a maximum edge length should be enforced. They will be modified in place during the process.
+ \param[in] maxEdgeLength The maximum edge length allowed after processing the input
+ \param[in] maxIterations The maximum number of subdivision iterations
+ \param[out] triangleMap An optional map that provides the index of the original triangle for every triangle after the subdivision
+ \param[in] triangleCountThreshold Optional limit to the number of triangles. Not guaranteed to match exactly, the algorithm will just stop as soon as possible after reaching the limit.
+
+ \return True if any remeshing was applied
+ */
+ static bool reduceSliverTriangles(PxArray& triangles, PxArray& points, PxReal maxEdgeLength,
+ PxU32 maxIterations = 3, PxArray* triangleMap = NULL, PxU32 triangleCountThreshold = 0xFFFFFFFF);
+ };
+
+#if !PX_DOXYGEN
+} // namespace physx
+#endif
+
+#endif
diff --git a/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxRepXSerializer.h b/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxRepXSerializer.h
new file mode 100644
index 000000000..d8e740919
--- /dev/null
+++ b/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxRepXSerializer.h
@@ -0,0 +1,152 @@
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// * Neither the name of NVIDIA CORPORATION nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
+// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// Copyright (c) 2008-2025 NVIDIA Corporation. All rights reserved.
+// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
+// Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
+
+#ifndef PX_REPX_SERIALIZER_H
+#define PX_REPX_SERIALIZER_H
+
+#include "common/PxBase.h"
+#include "extensions/PxRepXSimpleType.h"
+
+#if !PX_DOXYGEN
+namespace physx
+{
+#endif
+
+ class XmlMemoryAllocator;
+ class XmlWriter;
+ class XmlReader;
+ class MemoryBuffer;
+
+ /**
+ \brief Serializer interface for RepX (Xml) serialization.
+
+ \deprecated Xml serialization is deprecated. An alternative serialization system is provided through USD Physics.
+
+ In order to serialize a class to RepX both a PxSerializer and
+ a PxRepXSerializer implementation are needed.
+
+ A repx Serializer provides the ability to capture a live
+ object to a descriptor or static state and the ability to
+ write that state out to a file. Objects allocated
+ by the Serializer using the allocator are freed when the
+ collection itself is freed.
+ SnRepXCoreSerializers.cpp implements a set of Serializers
+ for the core PhysX types.
+
+ \note Implementing a PxRepXSerializer is currently not practical without including the internal PhysXExtension header "SnRepXSerializerImpl.h".
+
+ \see PxSerializer, PX_NEW_REPX_SERIALIZER, PxSerializationRegistry::registerRepXSerializer
+ */
+ class PX_DEPRECATED PxRepXSerializer
+ {
+ protected:
+ virtual ~PxRepXSerializer(){}
+ public:
+
+ /**
+ \brief The type this Serializer is meant to operate on.
+ \see PxRepXObject::typeName
+ */
+ virtual const char* getTypeName() = 0;
+
+ /**
+ \brief Convert from a RepX object to a key-value pair hierarchy
+
+ \param[in] inLiveObject The object to convert to the passed in descriptor.
+ \param[in] inCollection The collection to use to find ids of references of this object.
+ \param[in] inWriter Interface to write data to.
+ \param[in] inTempBuffer used to for temporary allocations.
+ \param[in] inArgs The arguments used in create resources and objects.
+ */
+ virtual void objectToFile( const PxRepXObject& inLiveObject, PxCollection* inCollection, XmlWriter& inWriter, MemoryBuffer& inTempBuffer, PxRepXInstantiationArgs& inArgs ) = 0;
+
+ /**
+ \brief Convert from a descriptor to a live object. Must be an object of this Serializer type.
+
+ \param[in] inReader The inverse of the writer, a key-value pair database.
+ \param[in] inAllocator An allocator to use for temporary allocations. These will be freed after instantiation completes.
+ \param[in] inArgs The arguments used in create resources and objects.
+ \param[in] inCollection The collection used to find references.
+
+ \return The new live object. It can be an invalid object if the instantiation cannot take place.
+ */
+ virtual PxRepXObject fileToObject( XmlReader& inReader, XmlMemoryAllocator& inAllocator, PxRepXInstantiationArgs& inArgs, PxCollection* inCollection ) = 0;
+
+ };
+
+#if !PX_DOXYGEN
+} // namespace physx
+#endif
+
+/**
+\brief Inline helper template function to create PxRepXObject from TDataType type supporting PxTypeInfo::name.
+\deprecated Xml serialization is deprecated. An alternative serialization system is provided through USD Physics.
+*/
+template
+PX_DEPRECATED PX_INLINE physx::PxRepXObject PxCreateRepXObject(const TDataType* inType, const physx::PxSerialObjectId inId)
+{
+ return physx::PxRepXObject(physx::PxTypeInfo::name(), inType, inId);
+}
+
+/**
+\brief Inline helper function to create PxRepXObject from a PxBase instance.
+\deprecated Xml serialization is deprecated. An alternative serialization system is provided through USD Physics.
+*/
+PX_DEPRECATED PX_INLINE physx::PxRepXObject PxCreateRepXObject(const physx::PxBase* inType, const physx::PxSerialObjectId inId)
+{
+ PX_ASSERT(inType);
+ return physx::PxRepXObject(inType->getConcreteTypeName(), inType, inId);
+}
+
+/**
+\brief Inline helper template function to create PxRepXObject form TDataType type using inType pointer as a PxSerialObjectId id.
+\deprecated Xml serialization is deprecated. An alternative serialization system is provided through USD Physics.
+*/
+template
+PX_DEPRECATED PX_INLINE physx::PxRepXObject PxCreateRepXObject(const TDataType* inType)
+{
+ return PxCreateRepXObject(inType, static_cast