feat(physics): wire physx sdk into build
This commit is contained in:
53
engine/third_party/physx/pvdruntime/include/OmniPvdCommands.h
vendored
Normal file
53
engine/third_party/physx/pvdruntime/include/OmniPvdCommands.h
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
// 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 OMNI_PVD_COMMANDS_H
|
||||
#define OMNI_PVD_COMMANDS_H
|
||||
|
||||
struct OmniPvdCommand
|
||||
{
|
||||
enum Enum
|
||||
{
|
||||
eINVALID,
|
||||
eREGISTER_CLASS,
|
||||
eREGISTER_ENUM,
|
||||
eREGISTER_ATTRIBUTE,
|
||||
eREGISTER_CLASS_ATTRIBUTE,
|
||||
eREGISTER_UNIQUE_LIST_ATTRIBUTE,
|
||||
eSET_ATTRIBUTE,
|
||||
eADD_TO_UNIQUE_LIST_ATTRIBUTE,
|
||||
eREMOVE_FROM_UNIQUE_LIST_ATTRIBUTE,
|
||||
eCREATE_OBJECT,
|
||||
eDESTROY_OBJECT,
|
||||
eSTART_FRAME,
|
||||
eSTOP_FRAME,
|
||||
eRECORD_MESSAGE
|
||||
};
|
||||
};
|
||||
|
||||
#endif
|
||||
199
engine/third_party/physx/pvdruntime/include/OmniPvdDefines.h
vendored
Normal file
199
engine/third_party/physx/pvdruntime/include/OmniPvdDefines.h
vendored
Normal file
@@ -0,0 +1,199 @@
|
||||
// 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 OMNI_PVD_DEFINES_H
|
||||
#define OMNI_PVD_DEFINES_H
|
||||
|
||||
#define OMNI_PVD_INVALID_HANDLE 0
|
||||
|
||||
#define OMNI_PVD_VERSION_MAJOR 0
|
||||
#define OMNI_PVD_VERSION_MINOR 4
|
||||
#define OMNI_PVD_VERSION_PATCH 0
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Versions so far : (major, minor, patch), top one is newest
|
||||
//
|
||||
// [0, 4, 0]
|
||||
// add new eRECORD_MESSAGE command to record messages in the OVD stream.
|
||||
// [0, 3, 0]
|
||||
// writes/read out the base class handle in the class registration call
|
||||
// backwards compatible with [0, 2, 0] and [0, 1, 42]
|
||||
// [0, 2, 0]
|
||||
// intermediate version was never official, no real change, but there are many files with this version
|
||||
// [0, 1, 42]
|
||||
// no proper base class written/read in the class registration call
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__)
|
||||
#define OMNI_PVD_WIN
|
||||
#define OMNI_PVD_CALL __cdecl
|
||||
#define OMNI_PVD_EXPORT extern "C" __declspec(dllexport)
|
||||
#else
|
||||
#ifdef __cdecl__
|
||||
#define OMNI_PVD_CALL __attribute__((__cdecl__))
|
||||
#else
|
||||
#define OMNI_PVD_CALL
|
||||
#endif
|
||||
#if __GNUC__ >= 4
|
||||
#define OMNI_PVD_EXPORT extern "C" __attribute__((visibility("default")))
|
||||
#else
|
||||
#define OMNI_PVD_EXPORT extern "C"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
typedef uint64_t OmniPvdObjectHandle;
|
||||
typedef uint64_t OmniPvdContextHandle;
|
||||
typedef uint32_t OmniPvdClassHandle;
|
||||
typedef uint32_t OmniPvdAttributeHandle;
|
||||
typedef uint32_t OmniPvdVersionType;
|
||||
typedef uint32_t OmniPvdEnumValueType;
|
||||
|
||||
typedef void (OMNI_PVD_CALL *OmniPvdLogFunction)(char *logLine);
|
||||
|
||||
struct OmniPvdDataType
|
||||
{
|
||||
enum Enum
|
||||
{
|
||||
eINT8,
|
||||
eINT16,
|
||||
eINT32,
|
||||
eINT64,
|
||||
eUINT8,
|
||||
eUINT16,
|
||||
eUINT32,
|
||||
eUINT64,
|
||||
eFLOAT32,
|
||||
eFLOAT64,
|
||||
eSTRING,
|
||||
eOBJECT_HANDLE,
|
||||
eENUM_VALUE,
|
||||
eFLAGS_WORD
|
||||
};
|
||||
};
|
||||
|
||||
template<uint32_t tType>
|
||||
inline uint32_t getOmniPvdDataTypeSize() { return 0; }
|
||||
|
||||
template<>
|
||||
inline uint32_t getOmniPvdDataTypeSize<OmniPvdDataType::eINT8>() { return sizeof(int8_t); }
|
||||
|
||||
template<>
|
||||
inline uint32_t getOmniPvdDataTypeSize<OmniPvdDataType::eINT16>() { return sizeof(int16_t); }
|
||||
|
||||
template<>
|
||||
inline uint32_t getOmniPvdDataTypeSize<OmniPvdDataType::eINT32>() { return sizeof(int32_t); }
|
||||
|
||||
template<>
|
||||
inline uint32_t getOmniPvdDataTypeSize<OmniPvdDataType::eINT64>() { return sizeof(int64_t); }
|
||||
|
||||
template<>
|
||||
inline uint32_t getOmniPvdDataTypeSize<OmniPvdDataType::eUINT8>() { return sizeof(uint8_t); }
|
||||
|
||||
template<>
|
||||
inline uint32_t getOmniPvdDataTypeSize<OmniPvdDataType::eUINT16>() { return sizeof(uint16_t); }
|
||||
|
||||
template<>
|
||||
inline uint32_t getOmniPvdDataTypeSize<OmniPvdDataType::eUINT32>() { return sizeof(uint32_t); }
|
||||
|
||||
template<>
|
||||
inline uint32_t getOmniPvdDataTypeSize<OmniPvdDataType::eUINT64>() { return sizeof(uint64_t); }
|
||||
|
||||
template<>
|
||||
inline uint32_t getOmniPvdDataTypeSize<OmniPvdDataType::eFLOAT32>() { return sizeof(float); }
|
||||
|
||||
template<>
|
||||
inline uint32_t getOmniPvdDataTypeSize<OmniPvdDataType::eFLOAT64>() { return sizeof(double); }
|
||||
|
||||
template<>
|
||||
inline uint32_t getOmniPvdDataTypeSize<OmniPvdDataType::eSTRING>() { return 0; }
|
||||
|
||||
template<>
|
||||
inline uint32_t getOmniPvdDataTypeSize<OmniPvdDataType::eOBJECT_HANDLE>() { return sizeof(OmniPvdObjectHandle); }
|
||||
|
||||
template<>
|
||||
inline uint32_t getOmniPvdDataTypeSize<OmniPvdDataType::eENUM_VALUE>() { return sizeof(OmniPvdEnumValueType); }
|
||||
|
||||
template<>
|
||||
inline uint32_t getOmniPvdDataTypeSize<OmniPvdDataType::eFLAGS_WORD>() { return sizeof(OmniPvdClassHandle); }
|
||||
|
||||
inline uint32_t getOmniPvdDataTypeSizeFromEnum(OmniPvdDataType::Enum dataType)
|
||||
{
|
||||
switch (dataType)
|
||||
{
|
||||
case OmniPvdDataType::eINT8:
|
||||
return getOmniPvdDataTypeSize<OmniPvdDataType::eINT8>();
|
||||
break;
|
||||
case OmniPvdDataType::eINT16:
|
||||
return getOmniPvdDataTypeSize<OmniPvdDataType::eINT16>();
|
||||
break;
|
||||
case OmniPvdDataType::eINT32:
|
||||
return getOmniPvdDataTypeSize<OmniPvdDataType::eINT32>();
|
||||
break;
|
||||
case OmniPvdDataType::eINT64:
|
||||
return getOmniPvdDataTypeSize<OmniPvdDataType::eINT64>();
|
||||
break;
|
||||
case OmniPvdDataType::eUINT8:
|
||||
return getOmniPvdDataTypeSize<OmniPvdDataType::eUINT8>();
|
||||
break;
|
||||
case OmniPvdDataType::eUINT16:
|
||||
return getOmniPvdDataTypeSize<OmniPvdDataType::eUINT16>();
|
||||
break;
|
||||
case OmniPvdDataType::eUINT32:
|
||||
return getOmniPvdDataTypeSize<OmniPvdDataType::eUINT32>();
|
||||
break;
|
||||
case OmniPvdDataType::eUINT64:
|
||||
return getOmniPvdDataTypeSize<OmniPvdDataType::eUINT64>();
|
||||
break;
|
||||
case OmniPvdDataType::eFLOAT32:
|
||||
return getOmniPvdDataTypeSize<OmniPvdDataType::eFLOAT32>();
|
||||
break;
|
||||
case OmniPvdDataType::eFLOAT64:
|
||||
return getOmniPvdDataTypeSize<OmniPvdDataType::eFLOAT64>();
|
||||
break;
|
||||
case OmniPvdDataType::eSTRING:
|
||||
return getOmniPvdDataTypeSize<OmniPvdDataType::eSTRING>();
|
||||
break;
|
||||
case OmniPvdDataType::eOBJECT_HANDLE:
|
||||
return getOmniPvdDataTypeSize<OmniPvdDataType::eOBJECT_HANDLE>();
|
||||
break;
|
||||
case OmniPvdDataType::eENUM_VALUE:
|
||||
return getOmniPvdDataTypeSize<OmniPvdDataType::eENUM_VALUE>();
|
||||
break;
|
||||
case OmniPvdDataType::eFLAGS_WORD:
|
||||
return getOmniPvdDataTypeSize<OmniPvdDataType::eFLAGS_WORD>();
|
||||
break;
|
||||
default:
|
||||
return 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
68
engine/third_party/physx/pvdruntime/include/OmniPvdFileReadStream.h
vendored
Normal file
68
engine/third_party/physx/pvdruntime/include/OmniPvdFileReadStream.h
vendored
Normal file
@@ -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 OMNI_PVD_FILE_READ_STREAM_H
|
||||
#define OMNI_PVD_FILE_READ_STREAM_H
|
||||
|
||||
#include "OmniPvdReadStream.h"
|
||||
|
||||
/**
|
||||
* \brief Used to abstract a file read stream
|
||||
*
|
||||
* Used to set the filename, opening and closing it.
|
||||
*/
|
||||
class OmniPvdFileReadStream : public OmniPvdReadStream
|
||||
{
|
||||
public:
|
||||
virtual ~OmniPvdFileReadStream()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Sets the file name of the file to read from
|
||||
*
|
||||
* \param fileName The file name of the file to open
|
||||
*/
|
||||
virtual void OMNI_PVD_CALL setFileName(const char* fileName) = 0;
|
||||
|
||||
/**
|
||||
* \brief Opens the file
|
||||
*
|
||||
* \return True if the file opening was successfull
|
||||
*/
|
||||
virtual bool OMNI_PVD_CALL openFile() = 0;
|
||||
|
||||
/**
|
||||
* \brief Closes the file
|
||||
*
|
||||
* \return True if the file closing was successfull
|
||||
*/
|
||||
virtual bool OMNI_PVD_CALL closeFile() = 0;
|
||||
};
|
||||
|
||||
#endif
|
||||
68
engine/third_party/physx/pvdruntime/include/OmniPvdFileWriteStream.h
vendored
Normal file
68
engine/third_party/physx/pvdruntime/include/OmniPvdFileWriteStream.h
vendored
Normal file
@@ -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 OMNI_PVD_FILE_WRITE_STREAM_H
|
||||
#define OMNI_PVD_FILE_WRITE_STREAM_H
|
||||
|
||||
#include "OmniPvdWriteStream.h"
|
||||
|
||||
/**
|
||||
* \brief Used to abstract a file write stream
|
||||
*
|
||||
* Used to set the filename, opening and closing it.
|
||||
*/
|
||||
class OmniPvdFileWriteStream : public OmniPvdWriteStream
|
||||
{
|
||||
public:
|
||||
virtual ~OmniPvdFileWriteStream()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Sets the file name of the file to write to
|
||||
*
|
||||
* \param fileName The file name of the file to open
|
||||
*/
|
||||
virtual void OMNI_PVD_CALL setFileName(const char* fileName) = 0;
|
||||
|
||||
/**
|
||||
* \brief Opens the file
|
||||
*
|
||||
* \return True if the file opening was successfull
|
||||
*/
|
||||
virtual bool OMNI_PVD_CALL openFile() = 0;
|
||||
|
||||
/**
|
||||
* \brief Closes the file
|
||||
*
|
||||
* \return True if the file closing was successfull
|
||||
*/
|
||||
virtual bool OMNI_PVD_CALL closeFile() = 0;
|
||||
};
|
||||
|
||||
#endif
|
||||
54
engine/third_party/physx/pvdruntime/include/OmniPvdLibraryFunctions.h
vendored
Normal file
54
engine/third_party/physx/pvdruntime/include/OmniPvdLibraryFunctions.h
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
// 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 OMNI_PVD_LIBRARY_FUNCTIONS_H
|
||||
#define OMNI_PVD_LIBRARY_FUNCTIONS_H
|
||||
|
||||
#include "OmniPvdDefines.h"
|
||||
|
||||
class OmniPvdReader;
|
||||
class OmniPvdWriter;
|
||||
class OmniPvdFileReadStream;
|
||||
class OmniPvdFileWriteStream;
|
||||
class OmniPvdMemoryStream;
|
||||
|
||||
typedef OmniPvdReader* (OMNI_PVD_CALL *createOmniPvdReaderFp)();
|
||||
typedef void (OMNI_PVD_CALL *destroyOmniPvdReaderFp)(OmniPvdReader& reader);
|
||||
|
||||
typedef OmniPvdWriter* (OMNI_PVD_CALL *createOmniPvdWriterFp)();
|
||||
typedef void (OMNI_PVD_CALL *destroyOmniPvdWriterFp)(OmniPvdWriter& writer);
|
||||
|
||||
typedef OmniPvdFileReadStream* (OMNI_PVD_CALL *createOmniPvdFileReadStreamFp)();
|
||||
typedef void (OMNI_PVD_CALL *destroyOmniPvdFileReadStreamFp)(OmniPvdFileReadStream& fileReadStream);
|
||||
|
||||
typedef OmniPvdFileWriteStream* (OMNI_PVD_CALL *createOmniPvdFileWriteStreamFp)();
|
||||
typedef void (OMNI_PVD_CALL *destroyOmniPvdFileWriteStreamFp)(OmniPvdFileWriteStream& fileWriteStream);
|
||||
|
||||
typedef OmniPvdMemoryStream* (OMNI_PVD_CALL *createOmniPvdMemoryStreamFp)();
|
||||
typedef void (OMNI_PVD_CALL *destroyOmniPvdMemoryStreamFp)(OmniPvdMemoryStream& memoryStream);
|
||||
|
||||
#endif
|
||||
41
engine/third_party/physx/pvdruntime/include/OmniPvdLibraryHelpers.h
vendored
Normal file
41
engine/third_party/physx/pvdruntime/include/OmniPvdLibraryHelpers.h
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
// 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 OMNI_PVD_LIBRARY_FUNCTIONS_H
|
||||
#define OMNI_PVD_LIBRARY_FUNCTIONS_H
|
||||
|
||||
#include "OmniPvdDefines.h"
|
||||
|
||||
class OmniPvdReader;
|
||||
class OmniPvdWriter;
|
||||
|
||||
typedef OmniPvdReader* (OMNI_PVD_CALL *createOmniPvdReaderFp)();
|
||||
typedef void (OMNI_PVD_CALL *destroyOmniPvdReaderFp)(OmniPvdReader *reader);
|
||||
|
||||
typedef OmniPvdWriter* (OMNI_PVD_CALL *createOmniPvdWriterFp)();
|
||||
typedef void (OMNI_PVD_CALL *destroyOmniPvdWriterFp)(OmniPvdWriter *writer);
|
||||
|
||||
#endif
|
||||
178
engine/third_party/physx/pvdruntime/include/OmniPvdLoader.h
vendored
Normal file
178
engine/third_party/physx/pvdruntime/include/OmniPvdLoader.h
vendored
Normal file
@@ -0,0 +1,178 @@
|
||||
// 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 OMNI_PVD_LOADER_H
|
||||
#define OMNI_PVD_LOADER_H
|
||||
|
||||
#include "OmniPvdWriter.h"
|
||||
#include "OmniPvdReader.h"
|
||||
#include "OmniPvdLibraryFunctions.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#ifdef OMNI_PVD_WIN
|
||||
#ifndef _WINDOWS_ // windows already included otherwise
|
||||
#include <foundation/windows/PxWindowsInclude.h>
|
||||
#endif
|
||||
#elif defined(__linux__)
|
||||
#include <dlfcn.h>
|
||||
#endif
|
||||
|
||||
class OmniPvdLoader
|
||||
{
|
||||
public:
|
||||
OmniPvdLoader();
|
||||
~OmniPvdLoader();
|
||||
bool loadOmniPvd(const char *libFile);
|
||||
void unloadOmniPvd();
|
||||
void* mLibraryHandle;
|
||||
|
||||
createOmniPvdWriterFp mCreateOmniPvdWriter;
|
||||
destroyOmniPvdWriterFp mDestroyOmniPvdWriter;
|
||||
|
||||
createOmniPvdReaderFp mCreateOmniPvdReader;
|
||||
destroyOmniPvdReaderFp mDestroyOmniPvdReader;
|
||||
|
||||
createOmniPvdFileReadStreamFp mCreateOmniPvdFileReadStream;
|
||||
destroyOmniPvdFileReadStreamFp mDestroyOmniPvdFileReadStream;
|
||||
|
||||
createOmniPvdFileWriteStreamFp mCreateOmniPvdFileWriteStream;
|
||||
destroyOmniPvdFileWriteStreamFp mDestroyOmniPvdFileWriteStream;
|
||||
|
||||
createOmniPvdMemoryStreamFp mCreateOmniPvdMemoryStream;
|
||||
destroyOmniPvdMemoryStreamFp mDestroyOmniPvdMemoryStream;
|
||||
};
|
||||
|
||||
inline OmniPvdLoader::OmniPvdLoader()
|
||||
{
|
||||
mLibraryHandle = 0;
|
||||
|
||||
mCreateOmniPvdWriter = 0;
|
||||
mDestroyOmniPvdWriter = 0;
|
||||
|
||||
mCreateOmniPvdReader = 0;
|
||||
mDestroyOmniPvdReader = 0;
|
||||
|
||||
mCreateOmniPvdFileReadStream = 0;
|
||||
mDestroyOmniPvdFileReadStream = 0;
|
||||
|
||||
mCreateOmniPvdFileWriteStream = 0;
|
||||
mDestroyOmniPvdFileWriteStream = 0;
|
||||
|
||||
mCreateOmniPvdMemoryStream = 0;
|
||||
mDestroyOmniPvdMemoryStream = 0;
|
||||
}
|
||||
|
||||
inline OmniPvdLoader::~OmniPvdLoader()
|
||||
{
|
||||
unloadOmniPvd();
|
||||
}
|
||||
|
||||
inline bool OmniPvdLoader::loadOmniPvd(const char *libFile)
|
||||
{
|
||||
|
||||
#ifdef OMNI_PVD_WIN
|
||||
mLibraryHandle = LoadLibraryA(libFile);
|
||||
#elif defined(__linux__)
|
||||
mLibraryHandle = dlopen(libFile, RTLD_NOW);
|
||||
#endif
|
||||
|
||||
if (mLibraryHandle)
|
||||
{
|
||||
#ifdef OMNI_PVD_WIN
|
||||
mCreateOmniPvdWriter = (createOmniPvdWriterFp)GetProcAddress((HINSTANCE)mLibraryHandle, "createOmniPvdWriter");
|
||||
mDestroyOmniPvdWriter = (destroyOmniPvdWriterFp)GetProcAddress((HINSTANCE)mLibraryHandle, "destroyOmniPvdWriter");
|
||||
|
||||
mCreateOmniPvdReader = (createOmniPvdReaderFp)GetProcAddress((HINSTANCE)mLibraryHandle, "createOmniPvdReader");
|
||||
mDestroyOmniPvdReader = (destroyOmniPvdReaderFp)GetProcAddress((HINSTANCE)mLibraryHandle, "destroyOmniPvdReader");
|
||||
|
||||
mCreateOmniPvdFileReadStream = (createOmniPvdFileReadStreamFp)GetProcAddress((HINSTANCE)mLibraryHandle, "createOmniPvdFileReadStream");
|
||||
mDestroyOmniPvdFileReadStream = (destroyOmniPvdFileReadStreamFp)GetProcAddress((HINSTANCE)mLibraryHandle, "destroyOmniPvdFileReadStream");
|
||||
|
||||
mCreateOmniPvdFileWriteStream = (createOmniPvdFileWriteStreamFp)GetProcAddress((HINSTANCE)mLibraryHandle, "createOmniPvdFileWriteStream");
|
||||
mDestroyOmniPvdFileWriteStream = (destroyOmniPvdFileWriteStreamFp)GetProcAddress((HINSTANCE)mLibraryHandle, "destroyOmniPvdFileWriteStream");
|
||||
|
||||
mCreateOmniPvdMemoryStream = (createOmniPvdMemoryStreamFp)GetProcAddress((HINSTANCE)mLibraryHandle, "createOmniPvdMemoryStream");
|
||||
mDestroyOmniPvdMemoryStream = (destroyOmniPvdMemoryStreamFp)GetProcAddress((HINSTANCE)mLibraryHandle, "destroyOmniPvdMemoryStream");
|
||||
#elif defined(__linux__)
|
||||
mCreateOmniPvdWriter = (createOmniPvdWriterFp)dlsym(mLibraryHandle, "createOmniPvdWriter");
|
||||
mDestroyOmniPvdWriter = (destroyOmniPvdWriterFp)dlsym(mLibraryHandle, "destroyOmniPvdWriter");
|
||||
|
||||
mCreateOmniPvdReader = (createOmniPvdReaderFp)dlsym(mLibraryHandle, "createOmniPvdReader");
|
||||
mDestroyOmniPvdReader = (destroyOmniPvdReaderFp)dlsym(mLibraryHandle, "destroyOmniPvdReader");
|
||||
|
||||
mCreateOmniPvdFileReadStream = (createOmniPvdFileReadStreamFp)dlsym(mLibraryHandle, "createOmniPvdFileReadStream");
|
||||
mDestroyOmniPvdFileReadStream = (destroyOmniPvdFileReadStreamFp)dlsym(mLibraryHandle, "destroyOmniPvdFileReadStream");
|
||||
|
||||
mCreateOmniPvdFileWriteStream = (createOmniPvdFileWriteStreamFp)dlsym(mLibraryHandle, "createOmniPvdFileWriteStream");
|
||||
mDestroyOmniPvdFileWriteStream = (destroyOmniPvdFileWriteStreamFp)dlsym(mLibraryHandle, "destroyOmniPvdFileWriteStream");
|
||||
|
||||
mCreateOmniPvdMemoryStream = (createOmniPvdMemoryStreamFp)dlsym(mLibraryHandle, "createOmniPvdMemoryStream");
|
||||
mDestroyOmniPvdMemoryStream = (destroyOmniPvdMemoryStreamFp)dlsym(mLibraryHandle, "destroyOmniPvdMemoryStream");
|
||||
|
||||
#endif
|
||||
|
||||
if ((!mCreateOmniPvdWriter) ||
|
||||
(!mDestroyOmniPvdWriter) ||
|
||||
(!mCreateOmniPvdReader) ||
|
||||
(!mDestroyOmniPvdReader) ||
|
||||
(!mCreateOmniPvdFileReadStream) ||
|
||||
(!mDestroyOmniPvdFileReadStream) ||
|
||||
(!mCreateOmniPvdFileWriteStream) ||
|
||||
(!mDestroyOmniPvdFileWriteStream) ||
|
||||
(!mCreateOmniPvdMemoryStream) ||
|
||||
(!mDestroyOmniPvdMemoryStream)
|
||||
)
|
||||
{
|
||||
#ifdef OMNI_PVD_WIN
|
||||
FreeLibrary((HINSTANCE)mLibraryHandle);
|
||||
#elif defined(__linux__)
|
||||
dlclose(mLibraryHandle);
|
||||
#endif
|
||||
mLibraryHandle = 0;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
inline void OmniPvdLoader::unloadOmniPvd()
|
||||
{
|
||||
if (mLibraryHandle)
|
||||
{
|
||||
#ifdef OMNI_PVD_WIN
|
||||
FreeLibrary((HINSTANCE)mLibraryHandle);
|
||||
#elif defined(__linux__)
|
||||
dlclose(mLibraryHandle);
|
||||
#endif
|
||||
mLibraryHandle = 0;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
68
engine/third_party/physx/pvdruntime/include/OmniPvdMemoryStream.h
vendored
Normal file
68
engine/third_party/physx/pvdruntime/include/OmniPvdMemoryStream.h
vendored
Normal file
@@ -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 OMNI_PVD_MEMORY_STREAM_H
|
||||
#define OMNI_PVD_MEMORY_STREAM_H
|
||||
|
||||
#include "OmniPvdReadStream.h"
|
||||
#include "OmniPvdWriteStream.h"
|
||||
|
||||
/**
|
||||
* \brief Used to abstract a memory read/write stream
|
||||
*
|
||||
* Used to get the read and write streams.
|
||||
*/
|
||||
class OmniPvdMemoryStream
|
||||
{
|
||||
public:
|
||||
virtual ~OmniPvdMemoryStream()
|
||||
{
|
||||
}
|
||||
/**
|
||||
* \brief Used to get the read stream
|
||||
*
|
||||
* \return The read stream
|
||||
*/
|
||||
virtual OmniPvdReadStream* OMNI_PVD_CALL getReadStream() = 0;
|
||||
|
||||
/**
|
||||
* \brief Used to get the write stream
|
||||
*
|
||||
* \return The write stream
|
||||
*/
|
||||
virtual OmniPvdWriteStream* OMNI_PVD_CALL getWriteStream() = 0;
|
||||
|
||||
/**
|
||||
* \brief Sets the buffer size in bytes of the memory streams
|
||||
*
|
||||
* \return The actually allocated length of the memory stream
|
||||
*/
|
||||
virtual uint64_t OMNI_PVD_CALL setBufferSize(uint64_t bufferLength) = 0;
|
||||
};
|
||||
|
||||
#endif
|
||||
78
engine/third_party/physx/pvdruntime/include/OmniPvdReadStream.h
vendored
Normal file
78
engine/third_party/physx/pvdruntime/include/OmniPvdReadStream.h
vendored
Normal file
@@ -0,0 +1,78 @@
|
||||
// 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 OMNI_PVD_READ_STREAM_H
|
||||
#define OMNI_PVD_READ_STREAM_H
|
||||
|
||||
#include "OmniPvdDefines.h"
|
||||
|
||||
/**
|
||||
* \brief Used to abstract a memory read stream
|
||||
*
|
||||
* Allows to read and skip bytes as well as open/close it.
|
||||
*/
|
||||
class OmniPvdReadStream
|
||||
{
|
||||
public:
|
||||
virtual ~OmniPvdReadStream()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Read n bytes from the shared memory buffer
|
||||
*
|
||||
* \param bytes Reads n bytes into the destination pointer
|
||||
* \param nbrBytes The requested number of bytes to read
|
||||
* \return The actual number of bytes read
|
||||
*/
|
||||
virtual uint64_t OMNI_PVD_CALL readBytes(uint8_t* bytes, uint64_t nbrBytes) = 0;
|
||||
|
||||
/**
|
||||
* \brief Skip n bytes from the shared memory buffer
|
||||
*
|
||||
* \param nbrBytes The requested number of bytes to skip
|
||||
* \return The actual number of bytes skipped
|
||||
*/
|
||||
virtual uint64_t OMNI_PVD_CALL skipBytes(uint64_t nbrBytes) = 0;
|
||||
|
||||
/**
|
||||
* \brief Opens the read stream
|
||||
*
|
||||
* \return True if it succeeded
|
||||
*/
|
||||
virtual bool OMNI_PVD_CALL openStream() = 0;
|
||||
|
||||
/**
|
||||
* \brief Closes the read stream
|
||||
*
|
||||
* \return True if it succeeded
|
||||
*/
|
||||
virtual bool OMNI_PVD_CALL closeStream() = 0;
|
||||
};
|
||||
|
||||
#endif
|
||||
237
engine/third_party/physx/pvdruntime/include/OmniPvdReader.h
vendored
Normal file
237
engine/third_party/physx/pvdruntime/include/OmniPvdReader.h
vendored
Normal file
@@ -0,0 +1,237 @@
|
||||
// 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 OMNI_PVD_READER_H
|
||||
#define OMNI_PVD_READER_H
|
||||
|
||||
#include "OmniPvdDefines.h"
|
||||
#include "OmniPvdCommands.h"
|
||||
#include "OmniPvdReadStream.h"
|
||||
|
||||
#define OMNI_PVD_MAX_STRING_LENGTH 2048
|
||||
|
||||
|
||||
/**
|
||||
* \brief Used to read debug information from an OmniPvdReadStream
|
||||
*
|
||||
* Using the getNextCommand function in a while loop for example one can traverse the stream one command after another. Given the command, different functions below will be available.
|
||||
*
|
||||
* Using the OmniPvdCommand::Enum one can determine the type of command and like that use the appropriate get functions to extract the payload from the command.
|
||||
*/
|
||||
|
||||
class OmniPvdReader
|
||||
{
|
||||
public:
|
||||
virtual ~OmniPvdReader()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Sets the log function to print the internal debug messages of the OmniPVD Reader instance
|
||||
*
|
||||
* \param logFunction The function pointer to receive the log messages
|
||||
*/
|
||||
virtual void OMNI_PVD_CALL setLogFunction(OmniPvdLogFunction logFunction) = 0;
|
||||
|
||||
/**
|
||||
* \brief Sets the read stream that contains the OmniPVD API command stream
|
||||
*
|
||||
* \param stream The OmniPvdReadStream that holds the stream of API calls/notifications
|
||||
*/
|
||||
virtual void OMNI_PVD_CALL setReadStream(OmniPvdReadStream& stream) = 0;
|
||||
|
||||
/**
|
||||
* \brief Extracts the versions from the binary file to read and tests if the file is older or equal to that of the reader.
|
||||
*
|
||||
* \param majorVersion The major versions of the stream
|
||||
* \param minorVersion The minor versions of the stream
|
||||
* \param patch The patch number of the stream
|
||||
* \return If the reading was possible to start or not
|
||||
*/
|
||||
virtual bool OMNI_PVD_CALL startReading(OmniPvdVersionType& majorVersion, OmniPvdVersionType& minorVersion, OmniPvdVersionType& patch) = 0;
|
||||
|
||||
/**
|
||||
* \brief The heartbeat function of the reader class. As long as the command that is returned is not equal to OmniPvdCommand::eINVALID, then one can safely extract the data fields from the command.
|
||||
*
|
||||
* \return The command enum type
|
||||
*/
|
||||
virtual OmniPvdCommand::Enum OMNI_PVD_CALL getNextCommand() = 0;
|
||||
|
||||
/**
|
||||
* \brief Returns the major version of the stream
|
||||
*
|
||||
* \return The major version
|
||||
*/
|
||||
virtual OmniPvdVersionType OMNI_PVD_CALL getMajorVersion() = 0;
|
||||
|
||||
/**
|
||||
* \brief Returns the minor version of the stream
|
||||
*
|
||||
* \return The minor version
|
||||
*/
|
||||
virtual OmniPvdVersionType OMNI_PVD_CALL getMinorVersion() = 0;
|
||||
|
||||
/**
|
||||
* \brief Returns the patch number of the stream
|
||||
*
|
||||
* \return The patch value
|
||||
*/
|
||||
virtual OmniPvdVersionType OMNI_PVD_CALL getPatch() = 0;
|
||||
|
||||
/**
|
||||
* \brief Returns the context handle of the latest command, if it had one, else OMNI_PVD_INVALID_HANDLE
|
||||
*
|
||||
* \return The context handle of the latest command
|
||||
*/
|
||||
virtual OmniPvdContextHandle OMNI_PVD_CALL getContextHandle() = 0;
|
||||
|
||||
/**
|
||||
* \brief Returns the object handle of the latest command, if it had one, else OMNI_PVD_INVALID_HANDLE
|
||||
*
|
||||
* \return The object handle of the latest command
|
||||
*/
|
||||
virtual OmniPvdObjectHandle OMNI_PVD_CALL getObjectHandle() = 0;
|
||||
|
||||
/**
|
||||
* \brief Returns the class handle of the latest command, if it had one, else OMNI_PVD_INVALID_HANDLE
|
||||
*
|
||||
* \return The class handle of the latest command
|
||||
*/
|
||||
virtual OmniPvdClassHandle OMNI_PVD_CALL getClassHandle() = 0;
|
||||
|
||||
/**
|
||||
* \brief Returns the base class handle of the latest command, if it had one, else OMNI_PVD_INVALID_HANDLE
|
||||
*
|
||||
* \return The base class handle of the latest command
|
||||
*/
|
||||
virtual OmniPvdClassHandle OMNI_PVD_CALL getBaseClassHandle() = 0;
|
||||
|
||||
/**
|
||||
* \brief Returns the attribute handle of the latest command, if it had one, else OMNI_PVD_INVALID_HANDLE
|
||||
*
|
||||
* \return The attribute handle of the latest command
|
||||
*/
|
||||
virtual OmniPvdAttributeHandle OMNI_PVD_CALL getAttributeHandle() = 0;
|
||||
|
||||
/**
|
||||
* \brief Returns the class name of the latest command, if it had one, else a null terminated string of length 0
|
||||
*
|
||||
* \return The string containing the class name
|
||||
*/
|
||||
virtual const char* OMNI_PVD_CALL getClassName() = 0;
|
||||
|
||||
/**
|
||||
* \brief Returns the attribute name of the latest command, if it had one, else a null terminated string of length 0
|
||||
*
|
||||
* \return The string containing the attribute name
|
||||
*/
|
||||
virtual const char* OMNI_PVD_CALL getAttributeName() = 0;
|
||||
|
||||
/**
|
||||
* \brief Returns the object name of the latest command, if it had one, else a null terminated string of length 0
|
||||
*
|
||||
* \return The string containing the object name
|
||||
*/
|
||||
virtual const char* OMNI_PVD_CALL getObjectName() = 0;
|
||||
|
||||
/**
|
||||
* \brief Returns the attribute data pointer, if it had one, else returns 0
|
||||
*
|
||||
* \return The array containing the attribute data
|
||||
*/
|
||||
virtual const uint8_t* OMNI_PVD_CALL getAttributeDataPointer() = 0;
|
||||
|
||||
/**
|
||||
* \brief Returns the attribute data type, the data type is undefined if the last command did not contain attribute data
|
||||
*
|
||||
* \return The attribute data type
|
||||
*/
|
||||
virtual OmniPvdDataType::Enum OMNI_PVD_CALL getAttributeDataType() = 0;
|
||||
|
||||
/**
|
||||
* \brief Returns the attribute data length, the data length of the last command if it was defined, otherwise returns 0
|
||||
*
|
||||
* \return The attribute data length
|
||||
*/
|
||||
virtual uint32_t OMNI_PVD_CALL getAttributeDataLength() = 0;
|
||||
|
||||
/**
|
||||
* \brief Returns the number of elements contained in the last set operation, if they were defined, otherwise returns 0
|
||||
*
|
||||
* \return The number of elements
|
||||
*/
|
||||
virtual uint32_t OMNI_PVD_CALL getAttributeNumberElements() = 0;
|
||||
|
||||
/**
|
||||
* \brief Returns the numberclass handle of the attribute class, if it was defined, else returns OMNI_PVD_INVALID_HANDLE
|
||||
*
|
||||
* \return The attibute class handle
|
||||
*/
|
||||
virtual OmniPvdClassHandle OMNI_PVD_CALL getAttributeClassHandle() = 0;
|
||||
|
||||
/**
|
||||
* \brief Returns the frame start value
|
||||
*
|
||||
* \return The frame ID value
|
||||
*/
|
||||
virtual uint64_t OMNI_PVD_CALL getFrameTimeStart() = 0;
|
||||
|
||||
/**
|
||||
* \brief Returns the frame stop value
|
||||
*
|
||||
* \return The frame ID value
|
||||
*/
|
||||
virtual uint64_t OMNI_PVD_CALL getFrameTimeStop() = 0;
|
||||
|
||||
/**
|
||||
* \brief Returns data for the last message received.
|
||||
*
|
||||
* \param message A handle to the message string is returned.
|
||||
* \param file A handle to the string containing the file name the message originated from is returned.
|
||||
* \param line A handle to the line number in the file where the message originated from is returned.
|
||||
* \param type A handle to the message type is returned.
|
||||
* \param handle A handle to the Omni PVD class handle is returned.
|
||||
*/
|
||||
virtual bool OMNI_PVD_CALL getMessageData(const char*& message, const char*& file, uint32_t& line, uint32_t& type, OmniPvdClassHandle& handle) = 0;
|
||||
|
||||
/**
|
||||
* \brief Returns the class handle containing the enum values, if it was defined, else returns OMNI_PVD_INVALID_HANDLE
|
||||
*
|
||||
* \return The enum class handle
|
||||
*/
|
||||
virtual OmniPvdClassHandle OMNI_PVD_CALL getEnumClassHandle() = 0;
|
||||
|
||||
/**
|
||||
* \brief Returns the enum value for a specific flag, if it was defined, else returns 0
|
||||
*
|
||||
* \return The enum value
|
||||
*/
|
||||
virtual OmniPvdEnumValueType OMNI_PVD_CALL getEnumValue() = 0;
|
||||
};
|
||||
|
||||
#endif
|
||||
77
engine/third_party/physx/pvdruntime/include/OmniPvdWriteStream.h
vendored
Normal file
77
engine/third_party/physx/pvdruntime/include/OmniPvdWriteStream.h
vendored
Normal file
@@ -0,0 +1,77 @@
|
||||
// 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 OMNI_PVD_WRITE_STREAM_H
|
||||
#define OMNI_PVD_WRITE_STREAM_H
|
||||
|
||||
#include "OmniPvdDefines.h"
|
||||
|
||||
/**
|
||||
* \brief Used to abstract a memory write stream
|
||||
*
|
||||
* Allows to write bytes as well as open/close the stream.
|
||||
*/
|
||||
class OmniPvdWriteStream
|
||||
{
|
||||
public:
|
||||
virtual ~OmniPvdWriteStream()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Write n bytes to the shared memory buffer
|
||||
*
|
||||
* \param bytes pointer to the bytes to write
|
||||
* \param nbrBytes The requested number of bytes to write
|
||||
* \return The actual number of bytes written
|
||||
*/
|
||||
virtual uint64_t OMNI_PVD_CALL writeBytes(const uint8_t* bytes, uint64_t nbrBytes) = 0;
|
||||
|
||||
/**
|
||||
* \brief Flushes the writes
|
||||
*
|
||||
* \return The success of the operation
|
||||
*/
|
||||
virtual bool OMNI_PVD_CALL flush() = 0;
|
||||
|
||||
/**
|
||||
* \brief Opens the stream
|
||||
*
|
||||
* \return The success of the operation
|
||||
*/
|
||||
virtual bool OMNI_PVD_CALL openStream() = 0;
|
||||
|
||||
/**
|
||||
* \brief Closes the stream
|
||||
*
|
||||
* \return The success of the operation
|
||||
*/
|
||||
virtual bool OMNI_PVD_CALL closeStream() = 0;
|
||||
};
|
||||
|
||||
#endif
|
||||
396
engine/third_party/physx/pvdruntime/include/OmniPvdWriter.h
vendored
Normal file
396
engine/third_party/physx/pvdruntime/include/OmniPvdWriter.h
vendored
Normal file
@@ -0,0 +1,396 @@
|
||||
// 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 OMNI_PVD_WRITER_H
|
||||
#define OMNI_PVD_WRITER_H
|
||||
|
||||
#include "OmniPvdDefines.h"
|
||||
#include "OmniPvdWriteStream.h"
|
||||
|
||||
|
||||
/**
|
||||
\brief Flags which report the status of an OmniPvdWriter.
|
||||
*/
|
||||
struct OmniPvdWriterStatusFlag
|
||||
{
|
||||
enum Enum
|
||||
{
|
||||
/**
|
||||
* \brief Set if any attempt to write to the stream failed
|
||||
*
|
||||
* \see OmniPvdWriter.getStatus()
|
||||
*/
|
||||
eSTREAM_WRITE_FAILURE = (1<<0)
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* \brief Used to write debug information to an OmniPvdWriteStream
|
||||
*
|
||||
* Allows the registration of OmniPVD classes and attributes, in a similar fashion to an object oriented language. A registration returns a unique identifier or handle.
|
||||
*
|
||||
* Once classes and attributes have been registered, one can create for example object instances of a class and set the values of the attributes of a specific object.
|
||||
*
|
||||
* Objects can be grouped by context using the context handle. The context handle is a user-specified handle which is passed to the set functions and object creation and destruction functions.
|
||||
*
|
||||
* Each context can have its own notion of time. The current time of a context can be exported with calls to the startFrame and stopFrame functions.
|
||||
*/
|
||||
class OmniPvdWriter
|
||||
{
|
||||
public:
|
||||
virtual ~OmniPvdWriter()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Sets the log function to print the internal debug messages of the OmniPVD API
|
||||
*
|
||||
* \param logFunction The function pointer to receive the log messages
|
||||
*/
|
||||
virtual void OMNI_PVD_CALL setLogFunction(OmniPvdLogFunction logFunction) = 0;
|
||||
|
||||
/**
|
||||
* \brief Sets the write stream to receive the API command stream
|
||||
*
|
||||
* \param writeStream The OmniPvdWriteStream to receive the stream of API calls/notifications
|
||||
*/
|
||||
virtual void OMNI_PVD_CALL setWriteStream(OmniPvdWriteStream& writeStream) = 0;
|
||||
|
||||
/**
|
||||
* \brief Gets the pointer to the write stream
|
||||
*
|
||||
* \return A pointer to the write stream
|
||||
*/
|
||||
virtual OmniPvdWriteStream* OMNI_PVD_CALL getWriteStream() = 0;
|
||||
|
||||
/**
|
||||
* \brief Registers an OmniPVD class
|
||||
*
|
||||
* Returns a unique handle to a class, which can be used to register class attributes and express object lifetimes with the createObject and destroyObject functions. Class inheritance can be described by calling registerClass with a base class handle. Derived classes inherit the attributes of the parent classes.
|
||||
*
|
||||
* \param className The class name
|
||||
* \param baseClassHandle The handle to the base class. This handle is obtained by pre-registering the base class. Defaults to 0 which means the class has no parent class
|
||||
* \return A unique class handle for the registered class
|
||||
*
|
||||
* \see OmniPvdWriter::registerAttribute()
|
||||
* \see OmniPvdWriter::registerEnumValue()
|
||||
* \see OmniPvdWriter::registerFlagsAttribute()
|
||||
* \see OmniPvdWriter::registerClassAttribute()
|
||||
* \see OmniPvdWriter::registerUniqueListAttribute()
|
||||
* \see OmniPvdWriter::createObject()
|
||||
*/
|
||||
virtual OmniPvdClassHandle OMNI_PVD_CALL registerClass(const char* className, OmniPvdClassHandle baseClassHandle = 0) = 0;
|
||||
|
||||
/**
|
||||
* \brief Registers an enum name and corresponding value for a pre-registered class.
|
||||
*
|
||||
* Registering enums happens in two steps. First, registerClass() is called with the name of the enum. This returns a class handle, which is used in a second step for the enum value registration with registerEnumValue(). If an enum has multiple values, registerEnumValue() has to be called with the different values.
|
||||
*
|
||||
* Note that enums differ from usual classes because their attributes, the enum values, do not change over time and there is no need to call setAttribute().
|
||||
*
|
||||
* \param classHandle The handle from the registerClass() call
|
||||
* \param attributeName The name of the enum value
|
||||
* \param value The value of the enum value
|
||||
* \return A unique attribute handle for the registered enum value
|
||||
*
|
||||
* \see OmniPvdWriter::registerClass()
|
||||
*/
|
||||
virtual OmniPvdAttributeHandle OMNI_PVD_CALL registerEnumValue(OmniPvdClassHandle classHandle, const char* attributeName, OmniPvdEnumValueType value) = 0;
|
||||
|
||||
/**
|
||||
* \brief Registers an attribute.
|
||||
*
|
||||
* The class handle is obtained from a previous call to registerClass(). After registering an attribute, one gets an attribute handle which can be used to set data values of an attribute with setAttribute(). All attributes are treated as arrays, even if the attribute has only a single data item. Set nbElements to 0 to indicate that the array has a variable length.
|
||||
*
|
||||
* \param classHandle The handle from the registerClass() call
|
||||
* \param attributeName The attribute name
|
||||
* \param attributeDataType The attribute data type
|
||||
* \param nbElements The number of elements in the array. Set this to 0 to indicate a variable length array
|
||||
* \return A unique attribute handle for the registered attribute
|
||||
*
|
||||
* \see OmniPvdWriter::registerClass()
|
||||
* \see OmniPvdWriter::setAttribute()
|
||||
*/
|
||||
virtual OmniPvdAttributeHandle OMNI_PVD_CALL registerAttribute(OmniPvdClassHandle classHandle, const char* attributeName, OmniPvdDataType::Enum attributeDataType, uint32_t nbElements) = 0;
|
||||
|
||||
/**
|
||||
* \brief Registers an attribute which is a flag.
|
||||
*
|
||||
* Use this function to indicate that a pre-registered class has a flag attribute, i.e., the attribute is a pre-registered enum.
|
||||
*
|
||||
* The returned attribute handle can be used in setAttribute() to set an object's flags.
|
||||
*
|
||||
* \param classHandle The handle from the registerClass() call of the class
|
||||
* \param attributeName The attribute name
|
||||
* \param enumClassHandle The handle from the registerClass() call of the enum
|
||||
* \return A unique attribute handle for the registered flags attribute
|
||||
*
|
||||
* \see OmniPvdWriter::registerClass()
|
||||
* \see OmniPvdWriter::setAttribute()
|
||||
*/
|
||||
virtual OmniPvdAttributeHandle OMNI_PVD_CALL registerFlagsAttribute(OmniPvdClassHandle classHandle, const char* attributeName, OmniPvdClassHandle enumClassHandle) = 0;
|
||||
|
||||
/**
|
||||
* \brief Registers an attribute which is a class.
|
||||
*
|
||||
* Use this function to indicate that a pre-registered class has an attribute which is a pre-registered class.
|
||||
*
|
||||
* The returned attribute handle can be used in setAttribute() to set an object's class attribute.
|
||||
*
|
||||
* \param classHandle The handle from the registerClass() call of the class
|
||||
* \param attributeName The attribute name
|
||||
* \param classAttributeHandle The handle from the registerClass() call of the class attribute
|
||||
* \return A unique handle for the registered class attribute
|
||||
*
|
||||
* \see OmniPvdWriter::registerClass()
|
||||
* \see OmniPvdWriter::setAttribute()
|
||||
*/
|
||||
virtual OmniPvdAttributeHandle OMNI_PVD_CALL registerClassAttribute(OmniPvdClassHandle classHandle, const char* attributeName, OmniPvdClassHandle classAttributeHandle) = 0;
|
||||
|
||||
/**
|
||||
* \brief Registers an attribute which can hold a list of unique items.
|
||||
*
|
||||
* The returned attribute handle can be used in calls to addToUniqueListAttribute() and removeFromUniqueListAttribute(), to add an item to and remove it from the list, respectively.
|
||||
*
|
||||
* \param classHandle The handle from the registerClass() call of the class
|
||||
* \param attributeName The attribute name
|
||||
* \param attributeDataType The data type of the items which will get added to the list attribute
|
||||
* \return A unique handle for the registered list attribute
|
||||
*
|
||||
* \see OmniPvdWriter::registerClass()
|
||||
* \see OmniPvdWriter::addToUniqueListAttribute()
|
||||
* \see OmniPvdWriter::removeFromUniqueListAttribute()
|
||||
*/
|
||||
virtual OmniPvdAttributeHandle OMNI_PVD_CALL registerUniqueListAttribute(OmniPvdClassHandle classHandle, const char* attributeName, OmniPvdDataType::Enum attributeDataType) = 0;
|
||||
|
||||
/**
|
||||
* \brief Sets an attribute value.
|
||||
*
|
||||
* Since an attribute can be part of a nested construct of class attributes, the method
|
||||
* expects an array of attribute handles as input to uniquely identify the attribute.
|
||||
*
|
||||
* \param contextHandle The user-defined context handle for grouping objects
|
||||
* \param objectHandle The user-defined unique handle of the object. E.g. its physical memory address
|
||||
* \param attributeHandles The attribute handles containing all class attribute handles of a nested class
|
||||
* construct. The last one has to be the handle from the registerUniqueListAttribute() call.
|
||||
* \param nbAttributeHandles The number of attribute handles provided in attributeHandles
|
||||
* \param data The pointer to the data of the element(s) to remove from the set
|
||||
* \param nbrBytes The number of bytes to be written
|
||||
*
|
||||
* \see OmniPvdWriter::registerAttribute()
|
||||
*/
|
||||
virtual void OMNI_PVD_CALL setAttribute(OmniPvdContextHandle contextHandle, OmniPvdObjectHandle objectHandle, const OmniPvdAttributeHandle* attributeHandles, uint8_t nbAttributeHandles, const uint8_t *data, uint32_t nbrBytes) = 0;
|
||||
|
||||
/**
|
||||
* \brief Sets an attribute value.
|
||||
*
|
||||
* See other setAttribute method for details. This special version covers the case where the
|
||||
* attribute is not part of a class attribute construct.
|
||||
*
|
||||
* \param contextHandle The user-defined context handle for grouping objects
|
||||
* \param objectHandle The user-defined unique handle of the object. E.g. its physical memory address
|
||||
* \param attributeHandle The handle from the registerAttribute() call
|
||||
* \param data The pointer to the data
|
||||
* \param nbrBytes The number of bytes to be written
|
||||
*
|
||||
* \see OmniPvdWriter::registerAttribute()
|
||||
*/
|
||||
inline void OMNI_PVD_CALL setAttribute(OmniPvdContextHandle contextHandle, OmniPvdObjectHandle objectHandle, OmniPvdAttributeHandle attributeHandle, const uint8_t *data, uint32_t nbrBytes)
|
||||
{
|
||||
setAttribute(contextHandle, objectHandle, &attributeHandle, 1, data, nbrBytes);
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Adds an item to a unique list attribute.
|
||||
*
|
||||
* A unique list attribute is defined like a set in mathematics, where each element must be unique.
|
||||
*
|
||||
* Since an attribute can be part of a nested construct of class attributes, the method
|
||||
* expects an array of attribute handles as input to uniquely identify the attribute.
|
||||
*
|
||||
* \param contextHandle The user-defined context handle for grouping objects
|
||||
* \param objectHandle The user-defined unique handle of the object. E.g. its physical memory address
|
||||
* \param attributeHandles The attribute handles containing all class attribute handles of a nested class
|
||||
* construct. The last one has to be the handle from the registerUniqueListAttribute() call.
|
||||
* \param nbAttributeHandles The number of attribute handles provided in attributeHandles
|
||||
* \param data The pointer to the data of the item to add to the list
|
||||
* \param nbrBytes The number of bytes to be written
|
||||
*
|
||||
* \see OmniPvdWriter::registerUniqueListAttribute()
|
||||
*/
|
||||
virtual void OMNI_PVD_CALL addToUniqueListAttribute(OmniPvdContextHandle contextHandle, OmniPvdObjectHandle objectHandle, const OmniPvdAttributeHandle* attributeHandles, uint8_t nbAttributeHandles, const uint8_t* data, uint32_t nbrBytes) = 0;
|
||||
|
||||
/**
|
||||
* \brief Adds an item to a unique list attribute.
|
||||
*
|
||||
* See other addToUniqueListAttribute method for details. This special version covers the case where the
|
||||
* attribute is not part of a class attribute construct.
|
||||
*
|
||||
* \param contextHandle The user-defined context handle for grouping objects
|
||||
* \param objectHandle The user-defined unique handle of the object. E.g. its physical memory address
|
||||
* \param attributeHandle The handle from the registerUniqueListAttribute() call
|
||||
* \param data The pointer to the data of the item to add to the list
|
||||
* \param nbrBytes The number of bytes to be written
|
||||
*
|
||||
* \see OmniPvdWriter::registerUniqueListAttribute()
|
||||
*/
|
||||
inline void OMNI_PVD_CALL addToUniqueListAttribute(OmniPvdContextHandle contextHandle, OmniPvdObjectHandle objectHandle, OmniPvdAttributeHandle attributeHandle, const uint8_t* data, uint32_t nbrBytes)
|
||||
{
|
||||
addToUniqueListAttribute(contextHandle, objectHandle, &attributeHandle, 1, data, nbrBytes);
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Removes an item from a uniqe list attribute
|
||||
*
|
||||
* A uniqe list attribute is defined like a set in mathematics, where each element must be unique.
|
||||
*
|
||||
* Since an attribute can be part of a nested construct of class attributes, the method
|
||||
* expects an array of attribute handles as input to uniquely identify the attribute.
|
||||
*
|
||||
* \param contextHandle The user-defined context handle for grouping objects
|
||||
* \param objectHandle The user-defined unique handle of the object. E.g. its physical memory address
|
||||
* \param attributeHandles The attribute handles containing all class attribute handles of a nested class
|
||||
* construct. The last one has to be the handle from the registerUniqueListAttribute() call.
|
||||
* \param nbAttributeHandles The number of attribute handles provided in attributeHandles
|
||||
* \param data The pointer to the data of the item to remove from the list
|
||||
* \param nbrBytes The number of bytes to be written
|
||||
*
|
||||
* \see OmniPvdWriter::registerUniqueListAttribute()
|
||||
*/
|
||||
virtual void OMNI_PVD_CALL removeFromUniqueListAttribute(OmniPvdContextHandle contextHandle, OmniPvdObjectHandle objectHandle, const OmniPvdAttributeHandle* attributeHandles, uint8_t nbAttributeHandles, const uint8_t* data, uint32_t nbrBytes) = 0;
|
||||
|
||||
/**
|
||||
* \brief Removes an item from a uniqe list attribute
|
||||
*
|
||||
* See other removeFromUniqueListAttribute method for details. This special version covers the case where the
|
||||
* attribute is not part of a class attribute construct.
|
||||
*
|
||||
* \param contextHandle The user-defined context handle for grouping objects
|
||||
* \param objectHandle The user-defined unique handle of the object. E.g. its physical memory address
|
||||
* \param attributeHandle The handle from the registerUniqueListAttribute() call
|
||||
* \param data The pointer to the data of the item to remove from the list
|
||||
* \param nbrBytes The number of bytes to be written
|
||||
*
|
||||
* \see OmniPvdWriter::registerUniqueListAttribute()
|
||||
*/
|
||||
inline void OMNI_PVD_CALL removeFromUniqueListAttribute(OmniPvdContextHandle contextHandle, OmniPvdObjectHandle objectHandle, OmniPvdAttributeHandle attributeHandle, const uint8_t* data, uint32_t nbrBytes)
|
||||
{
|
||||
removeFromUniqueListAttribute(contextHandle, objectHandle, &attributeHandle, 1, data, nbrBytes);
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Creates an object creation event
|
||||
*
|
||||
* Indicates that an object is created. One can freely choose a context handle for grouping objects.
|
||||
*
|
||||
* The class handle is obtained from a registerClass() call. The object handle should be unique, but as it's not tracked by the OmniPVD API, it's important this is set to a valid handle such as the object's physical memory address.
|
||||
*
|
||||
* The object name can be freely choosen or not set.
|
||||
*
|
||||
* Create about object destruction event by calling destroyObject().
|
||||
*
|
||||
* \param contextHandle The user-defined context handle for grouping objects
|
||||
* \param classHandle The handle from the registerClass() call
|
||||
* \param objectHandle The user-defined unique handle of the object. E.g. its physical memory address
|
||||
* \param objectName The user-defined name of the object. Can be the empty string
|
||||
*
|
||||
* \see OmniPvdWriter::registerClass()
|
||||
* \see OmniPvdWriter::destroyObject()
|
||||
*/
|
||||
virtual void OMNI_PVD_CALL createObject(OmniPvdContextHandle contextHandle, OmniPvdClassHandle classHandle, OmniPvdObjectHandle objectHandle, const char* objectName) = 0;
|
||||
|
||||
/**
|
||||
* \brief Creates an object destruction event
|
||||
*
|
||||
* Use this to indicate that an object is destroyed. Use the same user-defined context and object handles as were used in the create object calls.
|
||||
*
|
||||
* \param contextHandle The user-defined context handle for grouping objects
|
||||
* \param objectHandle The user-defined unique handle of the object. E.g. its physical memory address
|
||||
*
|
||||
* \see OmniPvdWriter::registerClass()
|
||||
* \see OmniPvdWriter::createObject()
|
||||
*/
|
||||
virtual void OMNI_PVD_CALL destroyObject(OmniPvdContextHandle contextHandle, OmniPvdObjectHandle objectHandle) = 0;
|
||||
|
||||
/**
|
||||
* \brief Creates a frame start event
|
||||
*
|
||||
* Time or frames are counted separatly per user-defined context.
|
||||
*
|
||||
* \param contextHandle The user-defined context handle for grouping objects
|
||||
* \param timeStamp The timestamp of the frame start event
|
||||
*/
|
||||
virtual void OMNI_PVD_CALL startFrame(OmniPvdContextHandle contextHandle, uint64_t timeStamp) = 0;
|
||||
|
||||
/**
|
||||
* \brief Creates a stop frame event
|
||||
*
|
||||
* Time is counted separately per user-defined context.
|
||||
*
|
||||
* \param contextHandle The user-defined context handle for grouping objects
|
||||
* \param timeStamp The timestamp of the frame stop event
|
||||
*/
|
||||
|
||||
virtual void OMNI_PVD_CALL stopFrame(OmniPvdContextHandle contextHandle, uint64_t timeStamp) = 0;
|
||||
|
||||
/**
|
||||
* \brief Record a message
|
||||
*
|
||||
* Record a message in the OVD stream. The file, line and type parameters can help locate
|
||||
* the source of the message when debugging.
|
||||
*
|
||||
* \param contextHandle The user-defined context handle for grouping objects
|
||||
* \param message A character string text message.
|
||||
* \param file A character string containing the name of the source file where the message originated from.
|
||||
* NULL is a valid value if a file name is not needed.
|
||||
* \param line The line number in the source file where the message originated from.
|
||||
* \param type An enumerated type describing the message type. If unneeded, any value can be set.
|
||||
* \param handle A handle to an Omni PVD enumerated type that contains all values for the previous type parameter.
|
||||
* Setting OMNI_PVD_INVALID_HANDLE will cause this parameter to be ignored.
|
||||
* See #registerEnumValue()
|
||||
*/
|
||||
virtual void OMNI_PVD_CALL recordMessage(OmniPvdContextHandle contextHandle, const char* message, const char* file, uint32_t line, uint32_t type, OmniPvdClassHandle handle = OMNI_PVD_INVALID_HANDLE) = 0;
|
||||
|
||||
/**
|
||||
* @brief Gets the status of the writer
|
||||
*
|
||||
* \return The current status flags of the writer, held in a 32 bit unsigned integer with the flag bits defined by OmniPvdWriterStatusFlag
|
||||
*
|
||||
* \see OmniPvdWriterStatusFlag
|
||||
*/
|
||||
virtual uint32_t OMNI_PVD_CALL getStatus() = 0;
|
||||
|
||||
/**
|
||||
* \brief Clears or resets the status of the writer
|
||||
*
|
||||
*/
|
||||
virtual void OMNI_PVD_CALL clearStatus() = 0;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user