#include <NvBlastTkFramework.h>
Public Member Functions | |
| virtual TkActor * | createActor (const TkActorDesc &desc)=0 |
| virtual TkAsset * | createAsset (const NvBlastAsset *assetLL, Nv::Blast::TkAssetJointDesc *jointDescs=nullptr, uint32_t jointDescCount=0, bool ownsAsset=false)=0 |
| virtual TkAsset * | createAsset (const TkAssetDesc &desc)=0 |
| virtual TkGroup * | createGroup (const TkGroupDesc &desc)=0 |
| virtual TkJoint * | createJoint (const TkJointDesc &desc)=0 |
| virtual bool | ensureAssetExactSupportCoverage (NvBlastChunkDesc *chunkDescs, uint32_t chunkCount) const =0 |
| virtual TkIdentifiable * | findObjectByID (const NvBlastID &id) const =0 |
| virtual uint32_t | getObjectCount (const TkType &type) const =0 |
| virtual uint32_t | getObjects (TkIdentifiable **buffer, uint32_t bufferSize, const TkType &type, uint32_t indexStart=0) const =0 |
| virtual const TkType * | getType (TkTypeIndex::Enum typeIndex) const =0 |
| virtual void | release ()=0 |
| virtual bool | reorderAssetDescChunks (NvBlastChunkDesc *chunkDescs, uint32_t chunkCount, NvBlastBondDesc *bondDescs, uint32_t bondCount, uint32_t *chunkReorderMap=nullptr, bool keepBondNormalChunkOrder=false) const =0 |
Protected Member Functions | |
| virtual | ~TkFramework () |
The framework exists as a singleton and is used to create objects, deserialize object streams, and hold references to identified objects (TkAsset, TkFamily, and TkGroup) which may be recalled by their GUIDs.
| virtual Nv::Blast::TkFramework::~TkFramework | ( | ) | [inline, protected, virtual] |
Destructor is virtual and not public - use the release() method instead of explicitly deleting the TkFramework
| virtual TkActor* Nv::Blast::TkFramework::createActor | ( | const TkActorDesc & | desc | ) | [pure virtual] |
Create an actor from the given descriptor. The actor will be the first member of a new TkFamily.
| [in] | desc | The actor descriptor (see TkActorDesc). |
| virtual TkAsset* Nv::Blast::TkFramework::createAsset | ( | const NvBlastAsset * | assetLL, | |
| Nv::Blast::TkAssetJointDesc * | jointDescs = nullptr, |
|||
| uint32_t | jointDescCount = 0, |
|||
| bool | ownsAsset = false | |||
| ) | [pure virtual] |
Create an asset from a low-level NvBlastAsset.
| [in] | assetLL | The low-level NvBlastAsset to encapsulate. |
| [in] | jointDescs | Optional joint descriptors to add to the new asset. |
| [in] | jointDescCount | The number of joint descriptors in the jointDescs array. If non-zero, jointDescs cannot be NULL. |
| [in] | ownsAsset | Does this TkAsset own the NvBlastAsset and thus is responsible for freeing it. |
| virtual TkAsset* Nv::Blast::TkFramework::createAsset | ( | const TkAssetDesc & | desc | ) | [pure virtual] |
Create an asset from the given descriptor.
| [in] | desc | The asset descriptor (see TkAssetDesc). |
| virtual TkGroup* Nv::Blast::TkFramework::createGroup | ( | const TkGroupDesc & | desc | ) | [pure virtual] |
Create a group from the given descriptor. 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 optionally placed into another group, or left groupless.
| [in] | desc | The group descriptor (see TkGroupDesc). |
| virtual TkJoint* Nv::Blast::TkFramework::createJoint | ( | const TkJointDesc & | desc | ) | [pure virtual] |
Create a joint from the given descriptor. The following restrictions apply:
Only one joint may be created between any two support chunks.
A joint cannot be created between chunks within the same actor using this method. See TkAssetDesc for a description of bond joint flags, which will create internal joints within an actor.
| [in] | desc | The joint descriptor (see TkJointDesc). |
| virtual bool Nv::Blast::TkFramework::ensureAssetExactSupportCoverage | ( | NvBlastChunkDesc * | chunkDescs, | |
| uint32_t | chunkCount | |||
| ) | const [pure virtual] |
Helper function to ensure (check and update) support coverage of chunks, required for asset creation via the createAsset function.
This is a convenience wrapper for the low-level NvBlastEnsureAssetExactSupportCoverage function.
The chunk descriptors may have their support flags be modified to ensure exact coverage.
| [in] | chunkDescs | An array of chunk descriptors. |
| [in] | chunkCount | The size of the chunkDescs array. |
| virtual TkIdentifiable* Nv::Blast::TkFramework::findObjectByID | ( | const NvBlastID & | id | ) | const [pure virtual] |
Look up an object derived from TkIdentifiable by its ID.
| [in] | id | The ID of the object to look up (see NvBlastID). |
| virtual uint32_t Nv::Blast::TkFramework::getObjectCount | ( | const TkType & | type | ) | const [pure virtual] |
The number of TkIdentifiable-derived objects in the framework of the given type.
| [in] | type | The type object for the given type. |
| virtual uint32_t Nv::Blast::TkFramework::getObjects | ( | TkIdentifiable ** | buffer, | |
| uint32_t | bufferSize, | |||
| const TkType & | type, | |||
| uint32_t | indexStart = 0 | |||
| ) | const [pure virtual] |
Retrieve an array of pointers (into the user-supplied buffer) to TkIdentifiable-derived objects of the given type.
| [out] | buffer | A user-supplied array of TkIdentifiable pointers. |
| [in] | bufferSize | The number of elements available to write into buffer. |
| [in] | type | The type object for the given type. |
| [in] | indexStart | The starting index of the object. |
| virtual const TkType* Nv::Blast::TkFramework::getType | ( | TkTypeIndex::Enum | typeIndex | ) | const [pure virtual] |
To find the type information for a given TkIdentifiable-derived class, use this funtion with the TkTypeIndex::Enum corresponding to the desired class name.
| [in] | typeIndex | Enumerated object type (see TkTypeIndex). |
| virtual void Nv::Blast::TkFramework::release | ( | ) | [pure virtual] |
Release this framework and all contained objects. Global singleton is set to NULL.
| virtual bool Nv::Blast::TkFramework::reorderAssetDescChunks | ( | NvBlastChunkDesc * | chunkDescs, | |
| uint32_t | chunkCount, | |||
| NvBlastBondDesc * | bondDescs, | |||
| uint32_t | bondCount, | |||
| uint32_t * | chunkReorderMap = nullptr, |
|||
| bool | keepBondNormalChunkOrder = false | |||
| ) | const [pure virtual] |
Helper function to build and apply chunk reorder map, so that chunk descriptors are properly ordered for the createAsset function.
This is a convenience wrapper for the low-level NvBlastReorderAssetDescChunks function.
This function may modify both the chunkDescs and bondDescs array, since rearranging chunk descriptors requires re-indexing within the bond descriptors.
| [in] | chunkDescs | Array of chunk descriptors of size chunkCount. It will be updated accordingly. |
| [in] | chunkCount | The number of chunk descriptors. |
| [in] | bondDescs | Array of bond descriptors of size chunkCount. It will be updated accordingly. |
| [in] | bondCount | The number of bond descriptors. |
| [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. |
| [in] | keepBondNormalChunkOrder | If true, bond normals will be flipped if their chunk index order was reveresed by the reorder map. |