aboutsummaryrefslogtreecommitdiff
path: root/sdk/toolkit/include
diff options
context:
space:
mode:
authorAnton Novoselov <[email protected]>2017-08-01 12:53:38 +0300
committerAnton Novoselov <[email protected]>2017-08-01 12:53:38 +0300
commit236f03c0b9a4982328ed1201978f7f69d192d9b2 (patch)
treee486f2fa39dba203563895541e92c60ed3e25759 /sdk/toolkit/include
parentAdded screens to welcome page (diff)
downloadblast-236f03c0b9a4982328ed1201978f7f69d192d9b2.tar.xz
blast-236f03c0b9a4982328ed1201978f7f69d192d9b2.zip
Blast 1.1 release (windows / linux)
see docs/release_notes.txt for details
Diffstat (limited to 'sdk/toolkit/include')
-rw-r--r--sdk/toolkit/include/NvBlastTk.h36
-rw-r--r--sdk/toolkit/include/NvBlastTkActor.h45
-rw-r--r--sdk/toolkit/include/NvBlastTkAsset.h42
-rw-r--r--sdk/toolkit/include/NvBlastTkEvent.h36
-rw-r--r--sdk/toolkit/include/NvBlastTkFamily.h40
-rw-r--r--sdk/toolkit/include/NvBlastTkFramework.h130
-rw-r--r--sdk/toolkit/include/NvBlastTkGroup.h157
-rw-r--r--sdk/toolkit/include/NvBlastTkIdentifiable.h41
-rw-r--r--sdk/toolkit/include/NvBlastTkJoint.h36
-rw-r--r--sdk/toolkit/include/NvBlastTkObject.h36
-rw-r--r--sdk/toolkit/include/NvBlastTkSerializable.h60
-rw-r--r--sdk/toolkit/include/NvBlastTkType.h36
12 files changed, 426 insertions, 269 deletions
diff --git a/sdk/toolkit/include/NvBlastTk.h b/sdk/toolkit/include/NvBlastTk.h
index 6471165..1f4f579 100644
--- a/sdk/toolkit/include/NvBlastTk.h
+++ b/sdk/toolkit/include/NvBlastTk.h
@@ -1,12 +1,30 @@
-/*
-* Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved.
-*
-* NVIDIA CORPORATION and its licensors retain all intellectual property
-* and proprietary rights in and to this software, related documentation
-* and any modifications thereto. Any use, reproduction, disclosure or
-* distribution of this software and related documentation without an express
-* license agreement from NVIDIA CORPORATION is strictly prohibited.
-*/
+// This code contains NVIDIA Confidential Information and is disclosed to you
+// under a form of NVIDIA software license agreement provided separately to you.
+//
+// Notice
+// NVIDIA Corporation and its licensors retain all intellectual property and
+// proprietary rights in and to this software and related documentation and
+// any modifications thereto. Any use, reproduction, disclosure, or
+// distribution of this software and related documentation without an express
+// license agreement from NVIDIA Corporation is strictly prohibited.
+//
+// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES
+// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
+// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT,
+// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.
+//
+// Information and code furnished is believed to be accurate and reliable.
+// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such
+// information or for any infringement of patents or other rights of third parties that may
+// result from its use. No license is granted by implication or otherwise under any patent
+// or patent rights of NVIDIA Corporation. Details are subject to change without notice.
+// This code supersedes and replaces all information previously supplied.
+// NVIDIA Corporation products are not authorized for use as critical
+// components in life support devices or systems without express written approval of
+// NVIDIA Corporation.
+//
+// Copyright (c) 2016-2017 NVIDIA Corporation. All rights reserved.
+
#ifndef NVBLASTTK_H
#define NVBLASTTK_H
diff --git a/sdk/toolkit/include/NvBlastTkActor.h b/sdk/toolkit/include/NvBlastTkActor.h
index a810ee1..453e4c4 100644
--- a/sdk/toolkit/include/NvBlastTkActor.h
+++ b/sdk/toolkit/include/NvBlastTkActor.h
@@ -1,12 +1,30 @@
-/*
-* Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved.
-*
-* NVIDIA CORPORATION and its licensors retain all intellectual property
-* and proprietary rights in and to this software, related documentation
-* and any modifications thereto. Any use, reproduction, disclosure or
-* distribution of this software and related documentation without an express
-* license agreement from NVIDIA CORPORATION is strictly prohibited.
-*/
+// This code contains NVIDIA Confidential Information and is disclosed to you
+// under a form of NVIDIA software license agreement provided separately to you.
+//
+// Notice
+// NVIDIA Corporation and its licensors retain all intellectual property and
+// proprietary rights in and to this software and related documentation and
+// any modifications thereto. Any use, reproduction, disclosure, or
+// distribution of this software and related documentation without an express
+// license agreement from NVIDIA Corporation is strictly prohibited.
+//
+// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES
+// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
+// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT,
+// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.
+//
+// Information and code furnished is believed to be accurate and reliable.
+// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such
+// information or for any infringement of patents or other rights of third parties that may
+// result from its use. No license is granted by implication or otherwise under any patent
+// or patent rights of NVIDIA Corporation. Details are subject to change without notice.
+// This code supersedes and replaces all information previously supplied.
+// NVIDIA Corporation products are not authorized for use as critical
+// components in life support devices or systems without express written approval of
+// NVIDIA Corporation.
+//
+// Copyright (c) 2016-2017 NVIDIA Corporation. All rights reserved.
+
#ifndef NVBLASTTKACTOR_H
#define NVBLASTTKACTOR_H
@@ -230,6 +248,15 @@ public:
\return the number of TkJoint pointers written to the joints array.
*/
virtual uint32_t getJoints(TkJoint** joints, uint32_t jointsSize) const = 0;
+
+ /**
+ Whether or not this actor is bound to the world using a bond with an invalid chunk index to represent the NRF.
+
+ NOTE: Wrapper function over low-level function call NvBlastActorIsBoundToWorld.
+
+ \return true iff this actor contains the "world" support graph node, created when a bond contains the UINT32_MAX value for one of their chunkIndices.
+ */
+ virtual bool isBoundToWorld() const = 0;
};
} // namespace Blast
diff --git a/sdk/toolkit/include/NvBlastTkAsset.h b/sdk/toolkit/include/NvBlastTkAsset.h
index 987da7d..1d8426b 100644
--- a/sdk/toolkit/include/NvBlastTkAsset.h
+++ b/sdk/toolkit/include/NvBlastTkAsset.h
@@ -1,17 +1,35 @@
-/*
-* Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved.
-*
-* NVIDIA CORPORATION and its licensors retain all intellectual property
-* and proprietary rights in and to this software, related documentation
-* and any modifications thereto. Any use, reproduction, disclosure or
-* distribution of this software and related documentation without an express
-* license agreement from NVIDIA CORPORATION is strictly prohibited.
-*/
+// This code contains NVIDIA Confidential Information and is disclosed to you
+// under a form of NVIDIA software license agreement provided separately to you.
+//
+// Notice
+// NVIDIA Corporation and its licensors retain all intellectual property and
+// proprietary rights in and to this software and related documentation and
+// any modifications thereto. Any use, reproduction, disclosure, or
+// distribution of this software and related documentation without an express
+// license agreement from NVIDIA Corporation is strictly prohibited.
+//
+// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES
+// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
+// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT,
+// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.
+//
+// Information and code furnished is believed to be accurate and reliable.
+// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such
+// information or for any infringement of patents or other rights of third parties that may
+// result from its use. No license is granted by implication or otherwise under any patent
+// or patent rights of NVIDIA Corporation. Details are subject to change without notice.
+// This code supersedes and replaces all information previously supplied.
+// NVIDIA Corporation products are not authorized for use as critical
+// components in life support devices or systems without express written approval of
+// NVIDIA Corporation.
+//
+// Copyright (c) 2016-2017 NVIDIA Corporation. All rights reserved.
+
#ifndef NVBLASTTKASSET_H
#define NVBLASTTKASSET_H
-#include "NvBlastTkSerializable.h"
+#include "NvBlastTkIdentifiable.h"
#include "NvBlastTypes.h"
#include "PxVec3.h"
@@ -38,7 +56,7 @@ struct TkAssetJointDesc
The static data associated with a destructible actor. TkAsset encapsulates an NvBlastAsset. In addition to the NvBlastAsset,
the TkAsset stores joint descriptors (see TkAssetJointDesc).
*/
-class TkAsset : public TkSerializable
+class TkAsset : public TkIdentifiable
{
public:
/**
@@ -115,7 +133,7 @@ public:
The number of internal TkJoint objects that will be created when this asset is instanced into a TkActor
(see TkFramework::createActor). These joints will not trigger TkJointUpdateEvent events
until this actor is split into actors such that a joint connects two actors. At this time the actor's family
- will dispatch a TkJointUpdateEvent::External event during a call to TkGroup::sync() (see TkGroup).
+ will dispatch a TkJointUpdateEvent::External event during a call to TkGroup::endProcess() (see TkGroup).
\return the number of descriptors for internal joints.
*/
diff --git a/sdk/toolkit/include/NvBlastTkEvent.h b/sdk/toolkit/include/NvBlastTkEvent.h
index 1e640f1..765d4d2 100644
--- a/sdk/toolkit/include/NvBlastTkEvent.h
+++ b/sdk/toolkit/include/NvBlastTkEvent.h
@@ -1,12 +1,30 @@
-/*
-* Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved.
-*
-* NVIDIA CORPORATION and its licensors retain all intellectual property
-* and proprietary rights in and to this software, related documentation
-* and any modifications thereto. Any use, reproduction, disclosure or
-* distribution of this software and related documentation without an express
-* license agreement from NVIDIA CORPORATION is strictly prohibited.
-*/
+// This code contains NVIDIA Confidential Information and is disclosed to you
+// under a form of NVIDIA software license agreement provided separately to you.
+//
+// Notice
+// NVIDIA Corporation and its licensors retain all intellectual property and
+// proprietary rights in and to this software and related documentation and
+// any modifications thereto. Any use, reproduction, disclosure, or
+// distribution of this software and related documentation without an express
+// license agreement from NVIDIA Corporation is strictly prohibited.
+//
+// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES
+// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
+// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT,
+// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.
+//
+// Information and code furnished is believed to be accurate and reliable.
+// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such
+// information or for any infringement of patents or other rights of third parties that may
+// result from its use. No license is granted by implication or otherwise under any patent
+// or patent rights of NVIDIA Corporation. Details are subject to change without notice.
+// This code supersedes and replaces all information previously supplied.
+// NVIDIA Corporation products are not authorized for use as critical
+// components in life support devices or systems without express written approval of
+// NVIDIA Corporation.
+//
+// Copyright (c) 2016-2017 NVIDIA Corporation. All rights reserved.
+
#ifndef NVBLASTTKEVENT_H
#define NVBLASTTKEVENT_H
diff --git a/sdk/toolkit/include/NvBlastTkFamily.h b/sdk/toolkit/include/NvBlastTkFamily.h
index be6edd6..119d308 100644
--- a/sdk/toolkit/include/NvBlastTkFamily.h
+++ b/sdk/toolkit/include/NvBlastTkFamily.h
@@ -1,17 +1,35 @@
-/*
-* Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved.
-*
-* NVIDIA CORPORATION and its licensors retain all intellectual property
-* and proprietary rights in and to this software, related documentation
-* and any modifications thereto. Any use, reproduction, disclosure or
-* distribution of this software and related documentation without an express
-* license agreement from NVIDIA CORPORATION is strictly prohibited.
-*/
+// This code contains NVIDIA Confidential Information and is disclosed to you
+// under a form of NVIDIA software license agreement provided separately to you.
+//
+// Notice
+// NVIDIA Corporation and its licensors retain all intellectual property and
+// proprietary rights in and to this software and related documentation and
+// any modifications thereto. Any use, reproduction, disclosure, or
+// distribution of this software and related documentation without an express
+// license agreement from NVIDIA Corporation is strictly prohibited.
+//
+// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES
+// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
+// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT,
+// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.
+//
+// Information and code furnished is believed to be accurate and reliable.
+// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such
+// information or for any infringement of patents or other rights of third parties that may
+// result from its use. No license is granted by implication or otherwise under any patent
+// or patent rights of NVIDIA Corporation. Details are subject to change without notice.
+// This code supersedes and replaces all information previously supplied.
+// NVIDIA Corporation products are not authorized for use as critical
+// components in life support devices or systems without express written approval of
+// NVIDIA Corporation.
+//
+// Copyright (c) 2016-2017 NVIDIA Corporation. All rights reserved.
+
#ifndef NVBLASTTKFAMILY_H
#define NVBLASTTKFAMILY_H
-#include "NvBlastTkSerializable.h"
+#include "NvBlastTkIdentifiable.h"
// Forward declarations
@@ -34,7 +52,7 @@ The TkFamily is associated with the TkActor that is instanced from a TkAsset, as
by spliting TkActors within the family. It encapsulates an NvBlastFamily, and also holds a material which will be used
by default on all TkActors during damage functions.
*/
-class TkFamily : public TkSerializable
+class TkFamily : public TkIdentifiable
{
public:
/**
diff --git a/sdk/toolkit/include/NvBlastTkFramework.h b/sdk/toolkit/include/NvBlastTkFramework.h
index 353eebd..51ee743 100644
--- a/sdk/toolkit/include/NvBlastTkFramework.h
+++ b/sdk/toolkit/include/NvBlastTkFramework.h
@@ -1,12 +1,30 @@
-/*
-* Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved.
-*
-* NVIDIA CORPORATION and its licensors retain all intellectual property
-* and proprietary rights in and to this software, related documentation
-* and any modifications thereto. Any use, reproduction, disclosure or
-* distribution of this software and related documentation without an express
-* license agreement from NVIDIA CORPORATION is strictly prohibited.
-*/
+// This code contains NVIDIA Confidential Information and is disclosed to you
+// under a form of NVIDIA software license agreement provided separately to you.
+//
+// Notice
+// NVIDIA Corporation and its licensors retain all intellectual property and
+// proprietary rights in and to this software and related documentation and
+// any modifications thereto. Any use, reproduction, disclosure, or
+// distribution of this software and related documentation without an express
+// license agreement from NVIDIA Corporation is strictly prohibited.
+//
+// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES
+// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
+// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT,
+// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.
+//
+// Information and code furnished is believed to be accurate and reliable.
+// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such
+// information or for any infringement of patents or other rights of third parties that may
+// result from its use. No license is granted by implication or otherwise under any patent
+// or patent rights of NVIDIA Corporation. Details are subject to change without notice.
+// This code supersedes and replaces all information previously supplied.
+// NVIDIA Corporation products are not authorized for use as critical
+// components in life support devices or systems without express written approval of
+// NVIDIA Corporation.
+//
+// Copyright (c) 2016-2017 NVIDIA Corporation. All rights reserved.
+
#ifndef NVBLASTTKFRAMEWORK_H
#define NVBLASTTKFRAMEWORK_H
@@ -24,13 +42,7 @@
// Forward declarations
namespace physx
{
-class PxErrorCallback;
-class PxAllocatorCallback;
class PxTransform;
-namespace general_PxIOStream2
-{
-class PxFileBuf;
-}
}
@@ -47,25 +59,12 @@ struct TkGroupDesc;
class TkGroup;
class TkActor;
class TkJoint;
-class TkSerializable;
class TkIdentifiable;
struct TkAssetJointDesc;
/**
-Descriptor for framework creation.
-
-The TkFramework uses PxShared callbacks for messages and allocation.
-*/
-struct TkFrameworkDesc
-{
- physx::PxErrorCallback* errorCallback; //!< User-defined message callback (see PxErrorCallback)
- physx::PxAllocatorCallback* allocatorCallback; //!< User-defined allocation callback (see PxAllocatorCallback)
-};
-
-
-/**
Descriptor for asset creation
Used to create a TkAsset. This may be used by an authoring tool to describe the asset to be created.
@@ -165,41 +164,7 @@ public:
Release this framework and all contained objects.
Global singleton is set to NULL.
*/
- virtual void release() = 0;
-
- /**
- Access to the error callback set by the user.
- */
- virtual physx::PxErrorCallback& getErrorCallback() const = 0;
-
- /**
- Access to the allocator callback set by the user.
- */
- virtual physx::PxAllocatorCallback& getAllocatorCallback() const = 0;
-
- /**
- Access to a log function which can be used in Blast low-level calls.
- This function uses the user-supplied PxErrorCallback (see TkFrameworkDesc).
- */
- virtual NvBlastLog getLogFn() const = 0;
-
- /**
- Deserialize an object from the given stream. Only objects derived from TkSerializable may be serialized and
- deserialized. Use the parent class method TkIdentifiable::getType() to know the type to which to cast the object.
-
- Notes for different classes:
-
- TkAsset: deserializing a serialized TkAsset will recreate the asset in memory with the same NvBlastID (see
- TkIdentifiable::getID()) as the original asset.
-
- TkFamily: deserializing a serialized TkFamily will generate all TkActor and TkJoint objects that were originally
- contained in the family. The TkAsset which generated the family must exist at the time the family is deserialized.
-
- \param[in] stream User-defined stream object.
-
- \return pointer the deserialized object if successful, or NULL if unsuccessful.
- */
- virtual TkSerializable* deserialize(physx::general_PxIOStream2::PxFileBuf& stream) = 0;
+ virtual void release() = 0;
/**
To find the type information for a given TkIdentifiable-derived class, use this funtion with the TkTypeIndex::Enum
@@ -209,7 +174,7 @@ public:
\return type object associated with the object's class.
*/
- virtual const TkType* getType(TkTypeIndex::Enum typeIndex) const = 0;
+ virtual const TkType* getType(TkTypeIndex::Enum typeIndex) const = 0;
/**
Look up an object derived from TkIdentifiable by its ID.
@@ -218,7 +183,7 @@ public:
\return pointer the object if it exists, NULL otherwise.
*/
- virtual TkIdentifiable* findObjectByID(const NvBlastID& id) const = 0;
+ virtual TkIdentifiable* findObjectByID(const NvBlastID& id) const = 0;
/**
The number of TkIdentifiable-derived objects in the framework of the given type.
@@ -227,7 +192,7 @@ public:
\return the number of objects that currently exist of the given type.
*/
- virtual uint32_t getObjectCount(const TkType& type) const = 0;
+ virtual uint32_t getObjectCount(const TkType& type) const = 0;
/**
Retrieve an array of pointers (into the user-supplied buffer) to TkIdentifiable-derived objects of the given type.
@@ -239,7 +204,7 @@ public:
\return the number of TkIdentifiable pointers written to the buffer.
*/
- virtual uint32_t getObjects(TkIdentifiable** buffer, uint32_t bufferSize, const TkType& type, uint32_t indexStart = 0) const = 0;
+ virtual uint32_t getObjects(TkIdentifiable** buffer, uint32_t bufferSize, const TkType& type, uint32_t indexStart = 0) const = 0;
//////// Asset creation ////////
/**
@@ -249,15 +214,16 @@ public:
This function may modify both the chunkDescs and bondDescs array, since rearranging chunk descriptors requires re-indexing within the bond descriptors.
- \param[in] chunkDescs Array of chunk descriptors of size chunkCount. It will be updated accordingly.
- \param[in] chunkCount The number of chunk descriptors.
- \param[in] bondDescs Array of bond descriptors of size chunkCount. It will be updated accordingly.
- \param[in] bondCount The number of bond descriptors.
- \param[in] chunkReorderMap If not NULL, must be a pointer to a uint32_t array of size desc.chunkCount. Maps old chunk indices to the reordered chunk indices.
+ \param[in] chunkDescs Array of chunk descriptors of size chunkCount. It will be updated accordingly.
+ \param[in] chunkCount The number of chunk descriptors.
+ \param[in] bondDescs Array of bond descriptors of size chunkCount. It will be updated accordingly.
+ \param[in] bondCount The number of bond descriptors.
+ \param[in] chunkReorderMap If not NULL, must be a pointer to a uint32_t array of size desc.chunkCount. Maps old chunk indices to the reordered chunk indices.
+ \param[in] keepBondNormalChunkOrder If true, bond normals will be flipped if their chunk index order was reveresed by the reorder map.
\return true iff the chunks did not require reordering (chunkReorderMap is the identity map).
*/
- virtual bool reorderAssetDescChunks(NvBlastChunkDesc* chunkDescs, uint32_t chunkCount, NvBlastBondDesc* bondDescs, uint32_t bondCount, uint32_t* chunkReorderMap = nullptr) const = 0;
+ virtual bool reorderAssetDescChunks(NvBlastChunkDesc* chunkDescs, uint32_t chunkCount, NvBlastBondDesc* bondDescs, uint32_t bondCount, uint32_t* chunkReorderMap = nullptr, bool keepBondNormalChunkOrder = false) const = 0;
/**
Helper function to ensure (check and update) support coverage of chunks, required for asset creation via the createAsset function.
@@ -271,7 +237,7 @@ public:
\return true iff coverage was already exact.
*/
- virtual bool ensureAssetExactSupportCoverage(NvBlastChunkDesc* chunkDescs, uint32_t chunkCount) const = 0;
+ virtual bool ensureAssetExactSupportCoverage(NvBlastChunkDesc* chunkDescs, uint32_t chunkCount) const = 0;
/**
Create an asset from the given descriptor.
@@ -280,7 +246,7 @@ public:
\return the created asset, if the descriptor was valid and memory was available for the operation. Otherwise, returns NULL.
*/
- virtual TkAsset* createAsset(const TkAssetDesc& desc) = 0;
+ virtual TkAsset* createAsset(const TkAssetDesc& desc) = 0;
/**
Create an asset from a low-level NvBlastAsset.
@@ -292,7 +258,7 @@ public:
\return the created asset, if memory was available for the operation. Otherwise, returns NULL.
*/
- virtual TkAsset* createAsset(const NvBlastAsset* assetLL, Nv::Blast::TkAssetJointDesc* jointDescs = nullptr, uint32_t jointDescCount = 0, bool ownsAsset = false) = 0;
+ virtual TkAsset* createAsset(const NvBlastAsset* assetLL, Nv::Blast::TkAssetJointDesc* jointDescs = nullptr, uint32_t jointDescCount = 0, bool ownsAsset = false) = 0;
//////// Group creation ////////
/**
@@ -304,7 +270,7 @@ public:
\return the created group, if the descriptor was valid and memory was available for the operation. Otherwise, returns NULL.
*/
- virtual TkGroup* createGroup(const TkGroupDesc& desc) = 0;
+ virtual TkGroup* createGroup(const TkGroupDesc& desc) = 0;
//////// Actor creation ////////
/**
@@ -314,7 +280,7 @@ public:
\return the created actor, if the descriptor was valid and memory was available for the operation. Otherwise, returns NULL.
*/
- virtual TkActor* createActor(const TkActorDesc& desc) = 0;
+ virtual TkActor* createActor(const TkActorDesc& desc) = 0;
//////// Joint creation ////////
/**
@@ -329,13 +295,13 @@ public:
\return the created joint, if the descriptor was valid and memory was available for the operation. Otherwise, returns NULL.
*/
- virtual TkJoint* createJoint(const TkJointDesc& desc) = 0;
+ virtual TkJoint* createJoint(const TkJointDesc& desc) = 0;
protected:
/**
Destructor is virtual and not public - use the release() method instead of explicitly deleting the TkFramework
*/
- virtual ~TkFramework() {}
+ virtual ~TkFramework() {}
};
} // namespace Blast
@@ -347,11 +313,9 @@ protected:
/**
Create a new TkFramework. This creates a global singleton, and will fail if a TkFramework object already exists.
-\param[in] desc The descriptor used to create the new framework (see TkFrameworkDesc).
-
\return the new TkFramework if successful, NULL otherwise.
*/
-NVBLAST_API Nv::Blast::TkFramework* NvBlastTkFrameworkCreate(const Nv::Blast::TkFrameworkDesc& desc);
+NVBLAST_API Nv::Blast::TkFramework* NvBlastTkFrameworkCreate();
/**
diff --git a/sdk/toolkit/include/NvBlastTkGroup.h b/sdk/toolkit/include/NvBlastTkGroup.h
index 585cccb..2e5ee3e 100644
--- a/sdk/toolkit/include/NvBlastTkGroup.h
+++ b/sdk/toolkit/include/NvBlastTkGroup.h
@@ -1,12 +1,30 @@
-/*
-* Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved.
-*
-* NVIDIA CORPORATION and its licensors retain all intellectual property
-* and proprietary rights in and to this software, related documentation
-* and any modifications thereto. Any use, reproduction, disclosure or
-* distribution of this software and related documentation without an express
-* license agreement from NVIDIA CORPORATION is strictly prohibited.
-*/
+// This code contains NVIDIA Confidential Information and is disclosed to you
+// under a form of NVIDIA software license agreement provided separately to you.
+//
+// Notice
+// NVIDIA Corporation and its licensors retain all intellectual property and
+// proprietary rights in and to this software and related documentation and
+// any modifications thereto. Any use, reproduction, disclosure, or
+// distribution of this software and related documentation without an express
+// license agreement from NVIDIA Corporation is strictly prohibited.
+//
+// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES
+// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
+// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT,
+// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.
+//
+// Information and code furnished is believed to be accurate and reliable.
+// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such
+// information or for any infringement of patents or other rights of third parties that may
+// result from its use. No license is granted by implication or otherwise under any patent
+// or patent rights of NVIDIA Corporation. Details are subject to change without notice.
+// This code supersedes and replaces all information previously supplied.
+// NVIDIA Corporation products are not authorized for use as critical
+// components in life support devices or systems without express written approval of
+// NVIDIA Corporation.
+//
+// Copyright (c) 2016-2017 NVIDIA Corporation. All rights reserved.
+
#ifndef NVBLASTTKGROUP_H
#define NVBLASTTKGROUP_H
@@ -14,13 +32,6 @@
#include "NvBlastTkIdentifiable.h"
-// Forward declarations
-namespace physx
-{
-class PxTaskManager;
-}
-
-
namespace Nv
{
namespace Blast
@@ -31,12 +42,12 @@ class TkActor;
/**
-Descriptor for a TkGroup. It uses the PxShared PxTaskManager interface to dispatch PxLightCpuTask.
-@see TkWorker
+Descriptor for a TkGroup. TkGroup uses a number of TkGroupWorker to process its actors.
+@see TkGroupWorker, TkGroup::setWorkerCount
*/
struct TkGroupDesc
{
- physx::PxTaskManager* pxTaskManager; //!< User-defined task manager
+ uint32_t workerCount; //!< The number of expected TkWorkers to process the TkGroup concurrently.
};
@@ -53,14 +64,39 @@ struct TkGroupStats
/**
+A worker as provided by TkGroup::acquireWorker(). It manages the necessary memory for parallel processing.
+The group can be processed concurrently by calling process() from different threads using a different TkGroupWorker each.
+
+TkActors that have been damaged with applyFracture() such that they may be split into separate
+actors are split by this function. TkActors that have damage queued through the actor's damage() function
+will be fractured and split by this function.
+*/
+class TkGroupWorker
+{
+public:
+ /**
+ Process a job of this worker's TkGroup.
+
+ /param[in] jobId a job id in the range (0, TkGroup::startProcess()]
+ */
+ virtual void process(uint32_t jobId) = 0;
+};
+
+
+/**
A group is a processing unit, to which the user may add TkActors. New actors generated from splitting a TkActor
are automatically put into the same group. However, any actor may be removed from its group and placed into
another group (or no group) by the user's choice.
When the group's process function is called, all actors' damage buffers will be processed and turned into fracture events
and the actor is split if applicable.
-This work is done in separate (possibly multiple) threads. The sync function waits for the processing threads to finish
-and dispatches events for processing that actually occurred.
+
+This work can be done in multiple threads with the help of TkGroupWorker:
+Instead of calling the process function, commence the procedure with startProcess which returns the number of jobs to process.
+Each concurrent thread uses an acquired TkGroupWorker to process the jobs.
+Over the whole procedure, each job must be processed once and only once.
+Jobs can be processed in any order. TkGroupWorkers can be returned and acquired later by another task.
+After processing every job and returning all the workers to the group, endProcess concludes the procedure.
*/
class TkGroup : public TkIdentifiable
{
@@ -72,14 +108,14 @@ public:
\return true if successful, false otherwise.
*/
- virtual bool addActor(TkActor& actor) = 0;
+ virtual bool addActor(TkActor& actor) = 0;
/**
The number of actors currently in this group.
\return the number of TkActors that currently exist in this group.
*/
- virtual uint32_t getActorCount() const = 0;
+ virtual uint32_t getActorCount() const = 0;
/**
Retrieve an array of pointers (into the user-supplied buffer) to actors.
@@ -90,32 +126,57 @@ public:
\return the number of TkActor pointers written to the buffer.
*/
- virtual uint32_t getActors(TkActor** buffer, uint32_t bufferSize, uint32_t indexStart = 0) const = 0;
+ virtual uint32_t getActors(TkActor** buffer, uint32_t bufferSize, uint32_t indexStart = 0) const = 0;
/**
- TkActors that have been damaged with applyFracture() such that they may be split into separate
- actors are split by this function. TkActors that have damage queued through the actor's damage() function
- will be fractured and split by this function.
- Fracture and splitting work will be run on different threads provided through TkGroupDesc::pxTaskManager.
- All work is done asynchronously, and the results are gathered by the sync() function.
+ Lock this group for processing concurrently with TkGroupWorker. The group is unlocked again with the endProcess() function.
- Note: The number of threads provided by pxTaskManager must not change over the group's lifetime.
-
- \return true if processing may be launched (this group is not currently processing), false otherwise.
+ \return The number of jobs to process. TkGroupWorker::process must be called once for each jobID from 0 to this number-1.
+ See TkGroup::process for a single threaded example.
*/
- virtual bool process() = 0;
+ virtual uint32_t startProcess() = 0;
/**
- If all threads spawned by process() have finished, and sync() has not yet been called since, then this
- function gathers the results of the split operations on the actors in this group. Events will be dispatched
+ Unlock this group after all jobs were processed with TkGroupWorker. All workers must have been returned with returnWorker().
+ This function gathers the results of the split operations on the actors in this group. Events will be dispatched
to notify listeners of new and deleted actors.
- \param[in] block If true, this function waits until all threads have completed execution, then performs the gather and dispatch work.
- If false, this function will perform the gather and dispatch work only if threads have completed execution, otherwise it returns immediately.
+ Note that groups concurrently dispatching events for the same TkFamily require synchronization in the TkFamily's Listener.
+ However, concurrent use of endProcess is not recommended in this version. It should be called from the main thread.
- \return true if gather and dispatch work have been performed, false otherwise.
+ \return true if the group was processing
*/
- virtual bool sync(bool block = true) = 0;
+ virtual bool endProcess() = 0;
+
+ /**
+ Set the expected number of concurrent worker threads that will process this group concurrently.
+ */
+ virtual void setWorkerCount(uint32_t workerCount) = 0;
+
+ /**
+ \return The total amount of workers allocated for this group.
+ */
+ virtual uint32_t getWorkerCount() const = 0;
+
+ /**
+ Acquire one worker to process the group concurrently on a thread.
+ The worker must be returned with returnWorker() before endProcess() is called on its group.
+
+ \return A worker for this group (at most getWorkerCount) or nullptr if none is available.
+ */
+ virtual TkGroupWorker* acquireWorker() = 0;
+
+ /**
+ Return a worker previously acquired with acquireWorker() to this TkGroup.
+
+ \param[in] The TkGroupWorker previously acquired from this TkGroup.
+ */
+ virtual void returnWorker(TkGroupWorker*) = 0;
+
+ /**
+ Helper function to process the group synchronously on a single thread.
+ */
+ virtual void process();
/**
For profile builds only, request stats of the last successful processing. Inactive in other builds.
@@ -123,11 +184,27 @@ public:
\param[in] stats The struct to be filled in.
*/
- virtual void getStats(TkGroupStats& stats) const = 0;
+ virtual void getStats(TkGroupStats& stats) const = 0;
};
} // namespace Blast
} // namespace Nv
+NV_INLINE void Nv::Blast::TkGroup::process()
+{
+ uint32_t jobCount = startProcess();
+ if (jobCount > 0)
+ {
+ TkGroupWorker* worker = acquireWorker();
+ for (uint32_t i = 0; i < jobCount; i++)
+ {
+ worker->process(i);
+ }
+ returnWorker(worker);
+ }
+ endProcess();
+}
+
+
#endif // ifndef NVBLASTTKGROUP_H
diff --git a/sdk/toolkit/include/NvBlastTkIdentifiable.h b/sdk/toolkit/include/NvBlastTkIdentifiable.h
index 6efe954..a36bc61 100644
--- a/sdk/toolkit/include/NvBlastTkIdentifiable.h
+++ b/sdk/toolkit/include/NvBlastTkIdentifiable.h
@@ -1,12 +1,30 @@
-/*
-* Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved.
-*
-* NVIDIA CORPORATION and its licensors retain all intellectual property
-* and proprietary rights in and to this software, related documentation
-* and any modifications thereto. Any use, reproduction, disclosure or
-* distribution of this software and related documentation without an express
-* license agreement from NVIDIA CORPORATION is strictly prohibited.
-*/
+// This code contains NVIDIA Confidential Information and is disclosed to you
+// under a form of NVIDIA software license agreement provided separately to you.
+//
+// Notice
+// NVIDIA Corporation and its licensors retain all intellectual property and
+// proprietary rights in and to this software and related documentation and
+// any modifications thereto. Any use, reproduction, disclosure, or
+// distribution of this software and related documentation without an express
+// license agreement from NVIDIA Corporation is strictly prohibited.
+//
+// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES
+// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
+// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT,
+// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.
+//
+// Information and code furnished is believed to be accurate and reliable.
+// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such
+// information or for any infringement of patents or other rights of third parties that may
+// result from its use. No license is granted by implication or otherwise under any patent
+// or patent rights of NVIDIA Corporation. Details are subject to change without notice.
+// This code supersedes and replaces all information previously supplied.
+// NVIDIA Corporation products are not authorized for use as critical
+// components in life support devices or systems without express written approval of
+// NVIDIA Corporation.
+//
+// Copyright (c) 2016-2017 NVIDIA Corporation. All rights reserved.
+
#ifndef NVBLASTTKIDENTIFIABLE_H
#define NVBLASTTKIDENTIFIABLE_H
@@ -52,6 +70,11 @@ public:
\return the static type data for this object type.
*/
virtual const TkType& getType() const = 0;
+
+ /**
+ Integer field available to the user which may be serialized.
+ */
+ uint64_t userIntData;
};
} // namespace Blast
diff --git a/sdk/toolkit/include/NvBlastTkJoint.h b/sdk/toolkit/include/NvBlastTkJoint.h
index 1fc41c0..d1f8ce4 100644
--- a/sdk/toolkit/include/NvBlastTkJoint.h
+++ b/sdk/toolkit/include/NvBlastTkJoint.h
@@ -1,12 +1,30 @@
-/*
-* Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved.
-*
-* NVIDIA CORPORATION and its licensors retain all intellectual property
-* and proprietary rights in and to this software, related documentation
-* and any modifications thereto. Any use, reproduction, disclosure or
-* distribution of this software and related documentation without an express
-* license agreement from NVIDIA CORPORATION is strictly prohibited.
-*/
+// This code contains NVIDIA Confidential Information and is disclosed to you
+// under a form of NVIDIA software license agreement provided separately to you.
+//
+// Notice
+// NVIDIA Corporation and its licensors retain all intellectual property and
+// proprietary rights in and to this software and related documentation and
+// any modifications thereto. Any use, reproduction, disclosure, or
+// distribution of this software and related documentation without an express
+// license agreement from NVIDIA Corporation is strictly prohibited.
+//
+// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES
+// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
+// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT,
+// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.
+//
+// Information and code furnished is believed to be accurate and reliable.
+// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such
+// information or for any infringement of patents or other rights of third parties that may
+// result from its use. No license is granted by implication or otherwise under any patent
+// or patent rights of NVIDIA Corporation. Details are subject to change without notice.
+// This code supersedes and replaces all information previously supplied.
+// NVIDIA Corporation products are not authorized for use as critical
+// components in life support devices or systems without express written approval of
+// NVIDIA Corporation.
+//
+// Copyright (c) 2016-2017 NVIDIA Corporation. All rights reserved.
+
#ifndef NVBLASTTKJOINT_H
#define NVBLASTTKJOINT_H
diff --git a/sdk/toolkit/include/NvBlastTkObject.h b/sdk/toolkit/include/NvBlastTkObject.h
index 085e859..90a3b27 100644
--- a/sdk/toolkit/include/NvBlastTkObject.h
+++ b/sdk/toolkit/include/NvBlastTkObject.h
@@ -1,12 +1,30 @@
-/*
-* Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved.
-*
-* NVIDIA CORPORATION and its licensors retain all intellectual property
-* and proprietary rights in and to this software, related documentation
-* and any modifications thereto. Any use, reproduction, disclosure or
-* distribution of this software and related documentation without an express
-* license agreement from NVIDIA CORPORATION is strictly prohibited.
-*/
+// This code contains NVIDIA Confidential Information and is disclosed to you
+// under a form of NVIDIA software license agreement provided separately to you.
+//
+// Notice
+// NVIDIA Corporation and its licensors retain all intellectual property and
+// proprietary rights in and to this software and related documentation and
+// any modifications thereto. Any use, reproduction, disclosure, or
+// distribution of this software and related documentation without an express
+// license agreement from NVIDIA Corporation is strictly prohibited.
+//
+// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES
+// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
+// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT,
+// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.
+//
+// Information and code furnished is believed to be accurate and reliable.
+// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such
+// information or for any infringement of patents or other rights of third parties that may
+// result from its use. No license is granted by implication or otherwise under any patent
+// or patent rights of NVIDIA Corporation. Details are subject to change without notice.
+// This code supersedes and replaces all information previously supplied.
+// NVIDIA Corporation products are not authorized for use as critical
+// components in life support devices or systems without express written approval of
+// NVIDIA Corporation.
+//
+// Copyright (c) 2016-2017 NVIDIA Corporation. All rights reserved.
+
#ifndef NVBLASTTKOBJECT_H
#define NVBLASTTKOBJECT_H
diff --git a/sdk/toolkit/include/NvBlastTkSerializable.h b/sdk/toolkit/include/NvBlastTkSerializable.h
deleted file mode 100644
index 93b9b47..0000000
--- a/sdk/toolkit/include/NvBlastTkSerializable.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
-* Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved.
-*
-* NVIDIA CORPORATION and its licensors retain all intellectual property
-* and proprietary rights in and to this software, related documentation
-* and any modifications thereto. Any use, reproduction, disclosure or
-* distribution of this software and related documentation without an express
-* license agreement from NVIDIA CORPORATION is strictly prohibited.
-*/
-
-#ifndef NVBLASTTKSERIALIZABLE_H
-#define NVBLASTTKSERIALIZABLE_H
-
-
-#include "NvBlastTkIdentifiable.h"
-
-
-// Forward declarations
-namespace physx
-{
-namespace general_PxIOStream2
-{
-class PxFileBuf;
-}
-}
-
-
-namespace Nv
-{
-namespace Blast
-{
-
-/**
-TkSerializable objects support the serialize interface, and are returned by TkFramework::deserialize.
-*/
-class TkSerializable : public TkIdentifiable
-{
-public:
- /**
- Write the object data to the user-defined PxFileBuf stream.
-
- \param[in] stream User-defined stream object.
-
- \return true if serialization was successful, false otherwise.
- */
- virtual bool serialize(physx::general_PxIOStream2::PxFileBuf& stream) const = 0;
-
- // Data
-
- /**
- Integer field available to the user. This data is serialized.
- */
- uint64_t userIntData;
-};
-
-} // namespace Blast
-} // namespace Nv
-
-
-#endif // ifndef NVBLASTTKSERIALIZABLE_H
diff --git a/sdk/toolkit/include/NvBlastTkType.h b/sdk/toolkit/include/NvBlastTkType.h
index 6f3afbf..ebb6436 100644
--- a/sdk/toolkit/include/NvBlastTkType.h
+++ b/sdk/toolkit/include/NvBlastTkType.h
@@ -1,12 +1,30 @@
-/*
-* Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved.
-*
-* NVIDIA CORPORATION and its licensors retain all intellectual property
-* and proprietary rights in and to this software, related documentation
-* and any modifications thereto. Any use, reproduction, disclosure or
-* distribution of this software and related documentation without an express
-* license agreement from NVIDIA CORPORATION is strictly prohibited.
-*/
+// This code contains NVIDIA Confidential Information and is disclosed to you
+// under a form of NVIDIA software license agreement provided separately to you.
+//
+// Notice
+// NVIDIA Corporation and its licensors retain all intellectual property and
+// proprietary rights in and to this software and related documentation and
+// any modifications thereto. Any use, reproduction, disclosure, or
+// distribution of this software and related documentation without an express
+// license agreement from NVIDIA Corporation is strictly prohibited.
+//
+// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES
+// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
+// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT,
+// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.
+//
+// Information and code furnished is believed to be accurate and reliable.
+// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such
+// information or for any infringement of patents or other rights of third parties that may
+// result from its use. No license is granted by implication or otherwise under any patent
+// or patent rights of NVIDIA Corporation. Details are subject to change without notice.
+// This code supersedes and replaces all information previously supplied.
+// NVIDIA Corporation products are not authorized for use as critical
+// components in life support devices or systems without express written approval of
+// NVIDIA Corporation.
+//
+// Copyright (c) 2016-2017 NVIDIA Corporation. All rights reserved.
+
#ifndef NVBLASTTKTYPE_H
#define NVBLASTTKTYPE_H