Nv::Blast::TkFrameworkImpl Class Reference

#include <NvBlastTkFrameworkImpl.h>

Inheritance diagram for Nv::Blast::TkFrameworkImpl:

Nv::Blast::TkFramework

List of all members.

Public Member Functions

virtual TkActorcreateActor (const TkActorDesc &desc) override
virtual TkAssetcreateAsset (const NvBlastAsset *assetLL, Nv::Blast::TkAssetJointDesc *jointDescs=nullptr, uint32_t jointDescCount=0, bool ownsAsset=false) override
virtual TkAssetcreateAsset (const TkAssetDesc &desc) override
virtual TkGroupcreateGroup (const TkGroupDesc &desc) override
virtual TkJointcreateJoint (const TkJointDesc &desc) override
virtual bool ensureAssetExactSupportCoverage (NvBlastChunkDesc *chunkDescs, uint32_t chunkCount) const override
virtual TkIdentifiablefindObjectByID (const NvBlastID &id) const override
TkIdentifiablefindObjectByIDInternal (const NvBlastID &id) const
virtual uint32_t getObjectCount (const TkType &type) const override
virtual uint32_t getObjects (TkIdentifiable **buffer, uint32_t bufferSize, const TkType &type, uint32_t indexStart=0) const override
virtual const TkTypegetType (TkTypeIndex::Enum typeIndex) const override
void onCreate (TkJointImpl &joint)
void onCreate (TkIdentifiable &object)
void onDestroy (TkJointImpl &joint)
void onDestroy (TkIdentifiable &object)
void onIDChange (TkIdentifiable &object, const NvBlastID &IDPrev, const NvBlastID &IDCurr)
virtual void release () override
virtual bool reorderAssetDescChunks (NvBlastChunkDesc *chunkDescs, uint32_t chunkCount, NvBlastBondDesc *bondDescs, uint32_t bondCount, uint32_t *chunkReorderMap=nullptr, bool keepBondNormalChunkOrder=false) const override
 TkFrameworkImpl ()
 ~TkFrameworkImpl ()

Static Public Member Functions

static TkFrameworkImplget ()
static bool set (TkFrameworkImpl *framework)


Detailed Description

Implementation of TkFramework

Constructor & Destructor Documentation

Nv::Blast::TkFrameworkImpl::TkFrameworkImpl (  ) 

Nv::Blast::TkFrameworkImpl::~TkFrameworkImpl (  ) 


Member Function Documentation

virtual TkActor* Nv::Blast::TkFrameworkImpl::createActor ( const TkActorDesc desc  )  [override, virtual]

Create an actor from the given descriptor. The actor will be the first member of a new TkFamily.

Parameters:
[in] desc The actor descriptor (see TkActorDesc).
Returns:
the created actor, if the descriptor was valid and memory was available for the operation. Otherwise, returns NULL.

Implements Nv::Blast::TkFramework.

virtual TkAsset* Nv::Blast::TkFrameworkImpl::createAsset ( const NvBlastAsset assetLL,
Nv::Blast::TkAssetJointDesc jointDescs = nullptr,
uint32_t  jointDescCount = 0,
bool  ownsAsset = false 
) [override, virtual]

Create an asset from a low-level NvBlastAsset.

Parameters:
[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.
Returns:
the created asset, if memory was available for the operation. Otherwise, returns NULL.

Implements Nv::Blast::TkFramework.

virtual TkAsset* Nv::Blast::TkFrameworkImpl::createAsset ( const TkAssetDesc desc  )  [override, virtual]

Create an asset from the given descriptor.

Parameters:
[in] desc The asset descriptor (see TkAssetDesc).
Returns:
the created asset, if the descriptor was valid and memory was available for the operation. Otherwise, returns NULL.

Implements Nv::Blast::TkFramework.

virtual TkGroup* Nv::Blast::TkFrameworkImpl::createGroup ( const TkGroupDesc desc  )  [override, 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.

Parameters:
[in] desc The group descriptor (see TkGroupDesc).
Returns:
the created group, if the descriptor was valid and memory was available for the operation. Otherwise, returns NULL.

Implements Nv::Blast::TkFramework.

virtual TkJoint* Nv::Blast::TkFrameworkImpl::createJoint ( const TkJointDesc desc  )  [override, 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.

Parameters:
[in] desc The joint descriptor (see TkJointDesc).
Returns:
the created joint, if the descriptor was valid and memory was available for the operation. Otherwise, returns NULL.

Implements Nv::Blast::TkFramework.

virtual bool Nv::Blast::TkFrameworkImpl::ensureAssetExactSupportCoverage ( NvBlastChunkDesc chunkDescs,
uint32_t  chunkCount 
) const [override, 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.

Parameters:
[in] chunkDescs An array of chunk descriptors.
[in] chunkCount The size of the chunkDescs array.
Returns:
true iff coverage was already exact.

Implements Nv::Blast::TkFramework.

virtual TkIdentifiable* Nv::Blast::TkFrameworkImpl::findObjectByID ( const NvBlastID id  )  const [override, virtual]

Look up an object derived from TkIdentifiable by its ID.

Parameters:
[in] id The ID of the object to look up (see NvBlastID).
Returns:
pointer the object if it exists, NULL otherwise.

Implements Nv::Blast::TkFramework.

NV_INLINE TkIdentifiable * Nv::Blast::TkFrameworkImpl::findObjectByIDInternal ( const NvBlastID id  )  const

Internal (non-virtual) method to find a TkIdentifiable object based upon its NvBlastID.

static TkFrameworkImpl* Nv::Blast::TkFrameworkImpl::get (  )  [static]

Retrieve the global singleton.

virtual uint32_t Nv::Blast::TkFrameworkImpl::getObjectCount ( const TkType type  )  const [override, virtual]

The number of TkIdentifiable-derived objects in the framework of the given type.

Parameters:
[in] type The type object for the given type.
Returns:
the number of objects that currently exist of the given type.

Implements Nv::Blast::TkFramework.

virtual uint32_t Nv::Blast::TkFrameworkImpl::getObjects ( TkIdentifiable **  buffer,
uint32_t  bufferSize,
const TkType type,
uint32_t  indexStart = 0 
) const [override, virtual]

Retrieve an array of pointers (into the user-supplied buffer) to TkIdentifiable-derived objects of the given type.

Parameters:
[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.
Returns:
the number of TkIdentifiable pointers written to the buffer.

Implements Nv::Blast::TkFramework.

virtual const TkType* Nv::Blast::TkFrameworkImpl::getType ( TkTypeIndex::Enum  typeIndex  )  const [override, 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.

Parameters:
[in] typeIndex Enumerated object type (see TkTypeIndex).
Returns:
type object associated with the object's class.

Implements Nv::Blast::TkFramework.

void Nv::Blast::TkFrameworkImpl::onCreate ( TkJointImpl joint  ) 

Special onCreate method for joints, since they are not TkIdentifiable.

void Nv::Blast::TkFrameworkImpl::onCreate ( TkIdentifiable object  ) 

To be called by any TkIdentifiable object when it is created, so the framework can track it.

void Nv::Blast::TkFrameworkImpl::onDestroy ( TkJointImpl joint  ) 

Special onDestroy method for joints, since they are not TkIdentifiable.

void Nv::Blast::TkFrameworkImpl::onDestroy ( TkIdentifiable object  ) 

To be called by any TkIdentifiable object when it is deleted, so the framework can stop tracking it.

void Nv::Blast::TkFrameworkImpl::onIDChange ( TkIdentifiable object,
const NvBlastID IDPrev,
const NvBlastID IDCurr 
)

Must be called whenever a TkIdentifiable object's ID is changed, so that the framework can associate the new ID with it.

virtual void Nv::Blast::TkFrameworkImpl::release (  )  [override, virtual]

Release this framework and all contained objects. Global singleton is set to NULL.

Implements Nv::Blast::TkFramework.

virtual bool Nv::Blast::TkFrameworkImpl::reorderAssetDescChunks ( NvBlastChunkDesc chunkDescs,
uint32_t  chunkCount,
NvBlastBondDesc bondDescs,
uint32_t  bondCount,
uint32_t *  chunkReorderMap = nullptr,
bool  keepBondNormalChunkOrder = false 
) const [override, 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.

Parameters:
[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.
Returns:
true iff the chunks did not require reordering (chunkReorderMap is the identity map).

Implements Nv::Blast::TkFramework.

static bool Nv::Blast::TkFrameworkImpl::set ( TkFrameworkImpl framework  )  [static]

Set the global singleton, if it's not already set, or set it to NULL. Returns true iff successful.


The documentation for this class was generated from the following file: