Nv::Blast::TkActorImpl Class Reference

#include <NvBlastTkActorImpl.h>

Inheritance diagram for Nv::Blast::TkActorImpl:

Nv::Blast::TkActor Nv::Blast::TkObject

List of all members.

Classes

struct  DamageData
class  JointIt

Public Member Functions

virtual void applyFracture (NvBlastFractureBuffers *eventBuffers, const NvBlastFractureBuffers *commands) override
virtual void damage (const NvBlastDamageProgram &program, const void *programParams) override
virtual void generateFracture (NvBlastFractureBuffers *commands, const NvBlastDamageProgram &program, const void *programParams) const override
virtual const NvBlastActorgetActorLL () const override
NvBlastActorgetActorLLInternal () const
virtual const TkAssetgetAsset () const override
virtual const float * getBondHealths () const override
virtual TkFamilygetFamily () const override
TkFamilyImpl & getFamilyImpl () const
NvBlastFamilygetFamilyLL () const
virtual uint32_t getGraphNodeCount () const override
virtual uint32_t getGraphNodeIndices (uint32_t *graphNodeIndices, uint32_t graphNodeIndicesSize) const override
virtual TkGroupgetGroup () const override
TkGroupImpl * getGroupImpl () const
virtual uint32_t getIndex () const override
uint32_t getIndexInternal () const
virtual uint32_t getJointCount () const override
uint32_t getJointCountInternal () const
virtual uint32_t getJoints (TkJoint **joints, uint32_t jointsSize) const override
virtual uint32_t getSplitMaxActorCount () const override
virtual uint32_t getVisibleChunkCount () const override
virtual uint32_t getVisibleChunkIndices (uint32_t *visibleChunkIndices, uint32_t visibleChunkIndicesSize) const override
bool isActive () const
virtual bool isBoundToWorld () const override
virtual bool isPending () const override
 operator Nv::Blast::TkActorData () const
virtual void release () override
virtual TkGroupremoveFromGroup () override
 TkActorImpl ()
 ~TkActorImpl ()

Static Public Member Functions

static TkActorImplcreate (const TkActorDesc &desc)

Friends

class TkFamilyImpl
class TkFrameworkImpl
class TkGroupImpl
class TkJointImpl
class TkWorker


Detailed Description

Implementation of TkActor.

Constructor & Destructor Documentation

Nv::Blast::TkActorImpl::TkActorImpl (  ) 

Nv::Blast::TkActorImpl::~TkActorImpl (  ) 


Member Function Documentation

virtual void Nv::Blast::TkActorImpl::applyFracture ( NvBlastFractureBuffers eventBuffers,
const NvBlastFractureBuffers commands 
) [override, virtual]

Function applies the direct fracture and breaks graph bonds/edges as necessary. Sets actor in 'pending' state if any bonds or chunks were damaged. Dispatches FractureCommand events.

NOTE: Calls NvBlastActorApplyFracture internally. see NvBlastActorApplyFracture for details.

Parameters:
[in,out] eventBuffers Target buffers to hold applied fracture events. May be NULL, in which case events are not reported. To avoid data loss, provide an entry for every lower-support chunk and every bond in the original actor.
[in] commands The fracture commands to process.

Implements Nv::Blast::TkActor.

static TkActorImpl* Nv::Blast::TkActorImpl::create ( const TkActorDesc desc  )  [static]

Factory create method.

Parameters:
[in] desc Actor descriptor set by the user.
Returns:
a pointer to a new TkActorImpl object if successful, NULL otherwise.

virtual void Nv::Blast::TkActorImpl::damage ( const NvBlastDamageProgram program,
const void *  programParams 
) [override, virtual]

Apply damage to this actor.

Actual damage processing is deferred till the group worker process() call. Sets actor in 'pending' state.

It's the user's responsibility to keep programParams pointer alive until the group endProcess() call.

Parameters:
[in] program A NvBlastDamageProgram containing damage shaders.
[in] programParams Parameters for the NvBlastDamageProgram.

Implements Nv::Blast::TkActor.

virtual void Nv::Blast::TkActorImpl::generateFracture ( NvBlastFractureBuffers commands,
const NvBlastDamageProgram program,
const void *  programParams 
) const [override, virtual]

Creates fracture commands for the actor using an NvBlastMaterialFunction.

Cannot be called during group processing, in that case a warning will be raised and function will do nothing.

NOTE: Wrapper function over low-level function call, see NvBlastActorGenerateFracture for details.

Parameters:
[in,out] commands Target buffers to hold generated commands. To avoid data loss, provide an entry for every support chunk and every bond in the original actor.
[in] program A NvBlastDamageProgram containing damage shaders.
[in] programParams Parameters for the NvBlastDamageProgram.

Implements Nv::Blast::TkActor.

virtual const NvBlastActor* Nv::Blast::TkActorImpl::getActorLL (  )  const [override, virtual]

Access to underlying low-level actor.

Returns:
a pointer to the (const) low-level NvBlastActor object.

Implements Nv::Blast::TkActor.

NV_INLINE NvBlastActor * Nv::Blast::TkActorImpl::getActorLLInternal (  )  const

Access to the low-level actor associated with this TkActorImpl.

Returns:
a pointer to the NvBlastActor associated with this TkActorImpl. If this actor is inactive (see isActive), this function returns NULL.

virtual const TkAsset* Nv::Blast::TkActorImpl::getAsset (  )  const [override, virtual]

Every actor has an associated asset.

Returns:
a pointer to the (const) TkAsset object.

Implements Nv::Blast::TkActor.

virtual const float* Nv::Blast::TkActorImpl::getBondHealths (  )  const [override, virtual]

Access the bond health data for an actor.

NOTE: Wrapper function over low-level function call, see NvBlastActorGetBondHealths for details.

Returns:
the array of bond healths for the actor's family, or NULL if the actor is invalid.

Implements Nv::Blast::TkActor.

virtual TkFamily& Nv::Blast::TkActorImpl::getFamily (  )  const [override, virtual]

Every actor is part of an actor family, even if that family contains a single actor. This function returns a reference to the actor's TkFamily.

Returns:
a pointer to the actor's TkFamily.

Implements Nv::Blast::TkActor.

NV_INLINE TkFamilyImpl & Nv::Blast::TkActorImpl::getFamilyImpl (  )  const

Utility to access the TkFamily to which this actor belongs.

Returns:
a reference to the TkFamilyImpl to which this TkActorImpl belongs.

NvBlastFamily* Nv::Blast::TkActorImpl::getFamilyLL (  )  const

Utility to return the low-level family to which the low-level actor belongs.

Returns:
a pointer to the NvBlastFamily to which the low-level actor belongs.

virtual uint32_t Nv::Blast::TkActorImpl::getGraphNodeCount (  )  const [override, virtual]

Get the number of graph nodes for this actor. May be used in conjunction with getGraphNodeIndices.

NOTE: Wrapper function over low-level function call, see NvBlastActorGetGraphNodeCount for details.

Returns:
the number of graph node indices for the actor.

Implements Nv::Blast::TkActor.

virtual uint32_t Nv::Blast::TkActorImpl::getGraphNodeIndices ( uint32_t *  graphNodeIndices,
uint32_t  graphNodeIndicesSize 
) const [override, virtual]

Retrieve a list of graph node indices for the actor into the given array.

NOTE: Wrapper function over low-level function call, see NvBlastActorGetGraphNodeIndices for details.

Parameters:
[in] graphNodeIndices User-supplied array to be filled in with indices of graph nodes for this actor.
[in] graphNodeIndicesSize The size of the graphNodeIndices array. To receive all graph node indices, the size must be at least that given by getGraphNodeCount().
Returns:
the number of indices written to graphNodeIndices. This will not exceed graphNodeIndicesSize.

Implements Nv::Blast::TkActor.

virtual TkGroup* Nv::Blast::TkActorImpl::getGroup (  )  const [override, virtual]

Actors may be part of (no more than) one group. See TkGroup for the functions to add and remove actors. This function returns a pointer to the actor's group, or NULL if it is not in a group.

Implements Nv::Blast::TkActor.

NV_INLINE TkGroupImpl * Nv::Blast::TkActorImpl::getGroupImpl (  )  const

Access to the group to which this actor belongs, if any.

Returns:
a pointer to the TkGroupImpl to which this TkActorImpl belongs, if any. If this actor is not in a group, this function returns NULL.

virtual uint32_t Nv::Blast::TkActorImpl::getIndex (  )  const [override, virtual]

Every actor has a unique index within a family. This function returns that index.

Implements Nv::Blast::TkActor.

NV_INLINE uint32_t Nv::Blast::TkActorImpl::getIndexInternal (  )  const

Returns:
the index of this actor with its TkFamilyImpl.

virtual uint32_t Nv::Blast::TkActorImpl::getJointCount (  )  const [override, virtual]

The number of joints currently attached to this actor.

Returns:
the number of TkJoints that are currently attached to this actor.

Implements Nv::Blast::TkActor.

NV_INLINE uint32_t Nv::Blast::TkActorImpl::getJointCountInternal (  )  const

Returns:
the number of TkJointImpl objects that reference this actor.

virtual uint32_t Nv::Blast::TkActorImpl::getJoints ( TkJoint **  joints,
uint32_t  jointsSize 
) const [override, virtual]

Retrieve an array of pointers (into the user-supplied buffer) to joints.

Parameters:
[out] joints A user-supplied array of TkJoint pointers.
[in] jointsSize The number of elements available to write into the joints array.
Returns:
the number of TkJoint pointers written to the joints array.

Implements Nv::Blast::TkActor.

virtual uint32_t Nv::Blast::TkActorImpl::getSplitMaxActorCount (  )  const [override, virtual]

Returns the upper-bound number of actors which can be created by splitting this actor.

NOTE: Wrapper function over low-level function call, see NvBlastActorGetMaxActorCountForSplit for details.

Returns:
the upper-bound number of actors which can be created by splitting this actor.

Implements Nv::Blast::TkActor.

virtual uint32_t Nv::Blast::TkActorImpl::getVisibleChunkCount (  )  const [override, virtual]

Get the number of visible chunks for this actor. May be used in conjunction with getVisibleChunkIndices.

NOTE: Wrapper function over low-level function call, see NvBlastActorGetVisibleChunkCount for details.

Returns:
the number of visible chunk indices for the actor.

Implements Nv::Blast::TkActor.

virtual uint32_t Nv::Blast::TkActorImpl::getVisibleChunkIndices ( uint32_t *  visibleChunkIndices,
uint32_t  visibleChunkIndicesSize 
) const [override, virtual]

Retrieve a list of visible chunk indices for the actor into the given array.

NOTE: Wrapper function over low-level function call, see NvBlastActorGetVisibleChunkIndices for details.

Parameters:
[in] visibleChunkIndices User-supplied array to be filled in with indices of visible chunks for this actor.
[in] visibleChunkIndicesSize The size of the visibleChunkIndices array. To receive all visible chunk indices, the size must be at least that given by getVisibleChunkCount().
Returns:
the number of indices written to visibleChunkIndices. This will not exceed visibleChunkIndicesSize.

Implements Nv::Blast::TkActor.

NV_INLINE bool Nv::Blast::TkActorImpl::isActive (  )  const

TkActorImpl objects are created in an array within a TkFamilyImpl. Actors may become 'inactive' without their memory being freed. If inactive, the actor should be treated as if it has been released.

Returns:
the active status of this TkActorImpl.

virtual bool Nv::Blast::TkActorImpl::isBoundToWorld (  )  const [override, virtual]

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.

Returns:
true iff this actor contains the "world" support graph node, created when a bond contains the UINT32_MAX value for one of their chunkIndices.

Implements Nv::Blast::TkActor.

NV_INLINE bool Nv::Blast::TkActorImpl::isPending (  )  const [override, virtual]

Report whether this actor is in 'pending' state. Being in 'pending' state leads to actor being processed by group.

Returns:
true iff actor is in 'pending' state.

Implements Nv::Blast::TkActor.

Nv::Blast::TkActorImpl::operator Nv::Blast::TkActorData (  )  const

Implicit converter to TkActorData for events.

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

Release this object and free associated memory.

Implements Nv::Blast::TkObject.

virtual TkGroup* Nv::Blast::TkActorImpl::removeFromGroup (  )  [override, virtual]

Remove this actor from its group, if it is in one.

Returns:
the actor's former group if successful, NULL otherwise.

Implements Nv::Blast::TkActor.


Friends And Related Function Documentation

friend class TkFamilyImpl [friend]

friend class TkFrameworkImpl [friend]

friend class TkGroupImpl [friend]

friend class TkJointImpl [friend]

friend class TkWorker [friend]


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