Public Member Functions | Protected Member Functions
nvidia::apex::DestructibleActor Class Reference

#include <DestructibleActor.h>

List of all members.

Public Member Functions

virtual const RenderMeshActor * getRenderMeshActor (DestructibleActorMeshType::Enum type=DestructibleActorMeshType::Skinned) const =0
virtual const
DestructibleParameters
getDestructibleParameters () const =0
virtual void setDestructibleParameters (const DestructibleParameters &destructibleParameters)=0
virtual PxMat44 getInitialGlobalPose () const =0
virtual void setInitialGlobalPose (const PxMat44 &pose)=0
virtual PxVec3 getScale () const =0
virtual bool isInitiallyDynamic () const =0
virtual void getChunkVisibilities (uint8_t *visibilityArray, uint32_t visibilityArraySize) const =0
virtual uint32_t getNumVisibleChunks () const =0
virtual const uint16_t * getVisibleChunks () const =0
virtual bool acquireChunkEventBuffer (const nvidia::DestructibleChunkEvent *&buffer, uint32_t &bufferSize)=0
virtual bool releaseChunkEventBuffer (bool clearBuffer=true)=0
virtual bool acquirePhysXActorBuffer (physx::PxRigidDynamic **&buffer, uint32_t &bufferSize, uint32_t flags=DestructiblePhysXActorQueryFlags::AllStates)=0
virtual bool releasePhysXActorBuffer ()=0
virtual physx::PxRigidDynamic * getChunkPhysXActor (uint32_t chunkIndex)=0
virtual uint32_t getChunkPhysXShapes (physx::PxShape **&shapes, uint32_t chunkIndex) const =0
virtual PxTransform getChunkPose (uint32_t chunkIndex) const =0
virtual PxTransform getChunkTransform (uint32_t chunkIndex) const =0
virtual PxVec3 getChunkLinearVelocity (uint32_t chunkIndex) const =0
virtual PxVec3 getChunkAngularVelocity (uint32_t chunkIndex) const =0
virtual const PxMat44 getChunkTM (uint32_t chunkIndex) const =0
virtual int32_t getChunkBehaviorGroupIndex (uint32_t chunkIndex) const =0
virtual uint32_t getChunkActorFlags (uint32_t chunkIndex) const =0
virtual void setGlobalPose (const PxMat44 &pose)=0
virtual bool getGlobalPose (PxMat44 &pose)=0
virtual void setLinearVelocity (const PxVec3 &linearVelocity)=0
virtual void setAngularVelocity (const PxVec3 &angularVelocity)=0
virtual void setDynamic (int32_t chunkIndex=ModuleDestructibleConst::INVALID_CHUNK_INDEX)=0
virtual bool isDynamic (uint32_t chunkIndex) const =0
virtual void enableHardSleeping ()=0
virtual void disableHardSleeping (bool wake=false)=0
virtual bool isHardSleepingEnabled () const =0
virtual bool setChunkPhysXActorAwakeState (uint32_t chunkIndex, bool awake)=0
virtual bool addForce (uint32_t chunkIndex, const PxVec3 &force, physx::PxForceMode::Enum mode, const PxVec3 *position=NULL, bool wakeup=true)=0
virtual void setSkinnedOverrideMaterial (uint32_t submeshIndex, const char *overrideMaterialName)=0
virtual void setStaticOverrideMaterial (uint32_t submeshIndex, const char *overrideMaterialName)=0
virtual void setRuntimeFractureOverridePattern (const char *overridePatternName)=0
virtual void applyDamage (float damage, float momentum, const PxVec3 &position, const PxVec3 &direction, int32_t chunkIndex=ModuleDestructibleConst::INVALID_CHUNK_INDEX, void *damageUserData=NULL)=0
virtual void applyRadiusDamage (float damage, float momentum, const PxVec3 &position, float radius, bool falloff, void *damageUserData=NULL)=0
virtual void takeImpact (const PxVec3 &force, const PxVec3 &position, uint16_t chunkIndex, PxActor const *damageImpactActor)=0
virtual int32_t rayCast (float &time, PxVec3 &normal, const PxVec3 &worldRayOrig, const PxVec3 &worldRayDir, DestructibleActorRaycastFlags::Enum flags, int32_t parentChunkIndex=ModuleDestructibleConst::INVALID_CHUNK_INDEX) const =0
virtual int32_t obbSweep (float &time, PxVec3 &normal, const PxVec3 &worldBoxCenter, const PxVec3 &worldBoxExtents, const PxMat33 &worldBoxRot, const PxVec3 &worldDisplacement, DestructibleActorRaycastFlags::Enum flags) const =0
virtual void setCrumbleEmitterState (bool enable)=0
virtual void setDustEmitterState (bool enable)=0
virtual void setPreferredRenderVolume (RenderVolume *volume, DestructibleEmitterType::Enum type)=0
virtual EmitterActor * getApexEmitter (DestructibleEmitterType::Enum type)=0
virtual bool recreateApexEmitter (DestructibleEmitterType::Enum type)=0
virtual const
::NvParameterized::Interface * 
getNvParameterized (DestructibleParameterizedType::Enum type=DestructibleParameterizedType::State) const =0
 Returns the actor's NvParamaterized interface This cannot be directly modified! It is read only to the user. This handle can be used to directly serialize the complete actor state.
virtual void setNvParameterized (::NvParameterized::Interface *)=0
 Sets the actor's state via the NvParameterized object This can be used to update the state from deserialized data. The actor assumes control of the interface.
virtual bool setSyncParams (uint32_t userActorID, uint32_t actorSyncFlags=0, const DestructibleActorSyncState *actorSyncState=NULL, const DestructibleChunkSyncState *chunkSyncState=NULL)=0
virtual bool setHitChunkTrackingParams (bool flushHistory, bool startTracking, uint32_t trackingDepth, bool trackAllChunks=true)=0
virtual bool getHitChunkHistory (const DestructibleHitChunk *&hitChunkContainer, uint32_t &hitChunkCount) const =0
virtual bool forceChunkHits (const DestructibleHitChunk *hitChunkContainer, uint32_t hitChunkCount, bool removeChunks=true, bool deferredEvent=false, PxVec3 damagePosition=PxVec3(0.0f), PxVec3 damageDirection=PxVec3(0.0f))=0
virtual bool getDamageColoringHistory (const DamageEventCoreData *&damageEventCoreDataContainer, uint32_t &damageEventCoreDataCount) const =0
virtual bool forceDamageColoring (const DamageEventCoreData *damageEventCoreDataContainer, uint32_t damageEventCoreDataCount)=0
virtual PxBounds3 getLocalBounds () const =0
virtual PxBounds3 getOriginalBounds () const =0
virtual bool isChunkSolitary (int32_t chunkIndex) const =0
virtual PxBounds3 getChunkBounds (uint32_t chunkIndex) const =0
virtual PxBounds3 getChunkLocalBounds (uint32_t chunkIndex) const =0
virtual bool isChunkDestroyed (int32_t chunkIndex) const =0
virtual uint32_t getSupportDepthChunkIndices (uint32_t *const OutChunkIndices, uint32_t MaxOutIndices) const =0
virtual uint32_t getSupportDepth () const =0
virtual void setDeleteFracturedChunks (bool inDeleteChunkMode)=0
virtual DestructibleRenderableacquireRenderableReference ()=0
virtual uint32_t getCustomBehaviorGroupCount () const =0
virtual bool getBehaviorGroup (nvidia::DestructibleBehaviorGroupDesc &behaviorGroupDesc, int32_t index=-1) const =0

Protected Member Functions

virtual ~DestructibleActor ()

Detailed Description

Destructible actor API. The destructible actor is instanced from an DestructibleAsset.


Constructor & Destructor Documentation

virtual nvidia::apex::DestructibleActor::~DestructibleActor ( ) [inline, protected, virtual]

Member Function Documentation

virtual bool nvidia::apex::DestructibleActor::acquireChunkEventBuffer ( const nvidia::DestructibleChunkEvent *&  buffer,
uint32_t &  bufferSize 
) [pure virtual]

Locks the chunk event buffer, and (if successful) returns the head of the chunk event buffer in the buffer field and the length of the buffer (the number of events) in the bufferSize field. To unlock the buffer, use releaseChunkEventBuffer(). See DestructibleChunkEvent. This buffer is filled with chunk events if the DestructibleActor parameter createChunkEvents is set to true. This buffer is not automatically cleared by APEX. The user must clear it using releaseChunkEventBuffer(true).

N.B. This function only works when the user has *not* requested chunk event callbacks via ModuleDestructible::scheduleChunkStateEventCallback.

Returns:
Returns true if successful, false otherwise.
virtual bool nvidia::apex::DestructibleActor::acquirePhysXActorBuffer ( physx::PxRigidDynamic **&  buffer,
uint32_t &  bufferSize,
uint32_t  flags = DestructiblePhysXActorQueryFlags::AllStates 
) [pure virtual]

Locks a PhysX actor buffer, and (if successful) returns the head of the buffer in the buffer field and the length of the buffer (the number of PhysX actors) in the bufferSize field. To unlock the buffer, use releasePhysXActorBuffer(). The user must release this buffer before another call to releasePhysXActorBuffer.

Parameters:
bufferreturned buffer, if successful
bufferSizereturned buffer size, if successful
flagsflags which control which actors are returned. See DestructiblePhysXActorQueryFlags.
Returns:
Returns true if successful, false otherwise.
virtual DestructibleRenderable* nvidia::apex::DestructibleActor::acquireRenderableReference ( ) [pure virtual]

Acquire a pointer to the destructible's renderable proxy and increment its reference count. The DestructibleRenderable will only be deleted when its reference count is zero. Calls to DestructibleRenderable::release decrement the reference count, as does a call to DestructibleActor::release(). .

virtual bool nvidia::apex::DestructibleActor::addForce ( uint32_t  chunkIndex,
const PxVec3 &  force,
physx::PxForceMode::Enum  mode,
const PxVec3 *  position = NULL,
bool  wakeup = true 
) [pure virtual]

Apply force to chunk's actor

Parameters:
chunkIndexthe chunk index within the actor
forceforce, impulse, velocity change, or acceleration (depending on value of mode)
modePhysX force mode (PxForceMode::Enum)
positionif not null, applies force at position. Otherwise applies force at center of mass
wakeupif true, the actor is awakened

Returns true iff successful.

virtual void nvidia::apex::DestructibleActor::applyDamage ( float  damage,
float  momentum,
const PxVec3 &  position,
const PxVec3 &  direction,
int32_t  chunkIndex = ModuleDestructibleConst::INVALID_CHUNK_INDEX,
void *  damageUserData = NULL 
) [pure virtual]

Damage Apply damage at a point. Damage will be propagated into the destructible based upon its DestructibleParameters.

Parameters:
damagethe amount of damage at the damage point
momentumthe magnitude of the impulse to transfer to the actor
positionthe damage location
directiondirection of impact. This is valid even if momentum = 0, for use in deformation calculations.
chunkIndexwhich chunk to damage (returned by rayCast and ModuleDestructible::getDestructibleAndChunk). If chunkIndex = ModuleDestructibleConst::INVALID_CHUNK_INDEX, then the nearest visible chunk hit is found.
damageUserDatapointer which will be returned in damage and fracture event callbacks
virtual void nvidia::apex::DestructibleActor::applyRadiusDamage ( float  damage,
float  momentum,
const PxVec3 &  position,
float  radius,
bool  falloff,
void *  damageUserData = NULL 
) [pure virtual]

Apply damage to all chunks within a radius. Damage will also propagate into the destructible based upon its DestructibleParameters.

Parameters:
damagethe amount of damage at the damage point
momentumthe magnitude of the impulse to transfer to each chunk
positionthe damage location
radiusdistance from damage location at which chunks will be affected
falloffwhether or not to decrease damage with distance from the damage location. If true, damage will decrease linearly from the full damage (at zero distance) to zero damage (at radius). If false, full damage is applied to all chunks within the radius.
damageUserDatapointer which will be returned in damage and fracture event callbacks
virtual void nvidia::apex::DestructibleActor::disableHardSleeping ( bool  wake = false) [pure virtual]

See the comments for enableHardSleeping() for a description of this feature. The disableHardSleeping function takes a "wake" parameter, which (if true) will not only turn kinematic-sleeping actors dynamic, but wake them as well.

virtual void nvidia::apex::DestructibleActor::enableHardSleeping ( ) [pure virtual]

If "hard sleeping" is enabled, physx actors for chunk islands that go to sleep will be turned kinematic. If a chunk island has chunks from more than one DestructibleActor, then hard sleeping will be used if ANY of the destructibles have hard sleeping enabled.

virtual bool nvidia::apex::DestructibleActor::forceChunkHits ( const DestructibleHitChunk hitChunkContainer,
uint32_t  hitChunkCount,
bool  removeChunks = true,
bool  deferredEvent = false,
PxVec3  damagePosition = PxVec3(0.0f),
PxVec3  damageDirection = PxVec3(0.0f) 
) [pure virtual]

Force the actor to register chunk hits.

Parameters:
hitChunkContainershould take in an argument that was generated from another destructible actor. See getHitChunkHistory()
hitChunkCounthit chunk count
removeChunksremoveChunks == true indicates that the chunks given by hitChunkContainer will be forcibly removed.
deferredEventwhether to enable deferred event mode. If true, fracture events won't get processed until the next tick.
damagePositionpassed through to ApexDamageEventReportData::hitPosition and hitDirection in the damage notify output by APEX.
damageDirectionpassed through to ApexDamageEventReportData::hitPosition and hitDirection in the damage notify output by APEX.
virtual bool nvidia::apex::DestructibleActor::forceDamageColoring ( const DamageEventCoreData damageEventCoreDataContainer,
uint32_t  damageEventCoreDataCount 
) [pure virtual]

Force the actor to register damage coloring.

Parameters:
damageEventCoreDataContainershould take in an argument that was generated from another destructible actor. See getDamageColoringHistory()
damageEventCoreDataCountthe count of damageEventCoreDataContainer.
Returns:
Returns true if the function executes correctly with the given arguments.
virtual EmitterActor* nvidia::apex::DestructibleActor::getApexEmitter ( DestructibleEmitterType::Enum  type) [pure virtual]

Returns the EmitterActor of either a dust or crumble emitter Note - only crumble emitters are implemented in 1.2.0

virtual bool nvidia::apex::DestructibleActor::getBehaviorGroup ( nvidia::DestructibleBehaviorGroupDesc &  behaviorGroupDesc,
int32_t  index = -1 
) const [pure virtual]

Access to behavior groups created for this actor. Each chunk has a behavior group index associated with it.

This returns the indexed behavior group. The index must be either -1 (for the default group) or in the range [0, getCustomBehaviorGroupCount()-1]. If any other index is given, this function returns false. Otherwise it returns true and the behavior descriptor is filled in.

virtual uint32_t nvidia::apex::DestructibleActor::getChunkActorFlags ( uint32_t  chunkIndex) const [pure virtual]

Returns the DestructibleActorChunkFlags for a chunk. These are flags that describe aspects of the chunk that can only be determined at runtime.

Parameters:
chunkIndexthe chunk index within the actor
virtual PxVec3 nvidia::apex::DestructibleActor::getChunkAngularVelocity ( uint32_t  chunkIndex) const [pure virtual]

Returns a chunk's angular velocity in world space.

Parameters:
chunkIndexthe chunk index within the actor
virtual int32_t nvidia::apex::DestructibleActor::getChunkBehaviorGroupIndex ( uint32_t  chunkIndex) const [pure virtual]

Returns the behavior group index associated with the chunk. Use getBehaviorGroup() to access the behavior group data. The index will either be -1, in which case it is the default behavior group, or in the range [0, getCustomBehaviorGroupCount()-1]. Any of those values is valid for getBehaviorGroup().

Parameters:
chunkIndexthe chunk index within the actor
virtual PxBounds3 nvidia::apex::DestructibleActor::getChunkBounds ( uint32_t  chunkIndex) const [pure virtual]

Accessor to query the axis aligned bounding box of a given chunk in world-space.

virtual PxVec3 nvidia::apex::DestructibleActor::getChunkLinearVelocity ( uint32_t  chunkIndex) const [pure virtual]

Returns a chunk's linear velocity in world space.

Parameters:
chunkIndexthe chunk index within the actor
virtual PxBounds3 nvidia::apex::DestructibleActor::getChunkLocalBounds ( uint32_t  chunkIndex) const [pure virtual]

Accessor to query the axis aligned bounding box of a given chunk in chunk local-space.

virtual physx::PxRigidDynamic* nvidia::apex::DestructibleActor::getChunkPhysXActor ( uint32_t  chunkIndex) [pure virtual]

Returns the PhysX actor associated with the given chunk. Note, more than one chunk may be associated with a given PhysX actor, and chunks from different DestructibleActors may even be associated with the same PhysX actor. Caution is recommended when using this function. During APEX scene simulate/fetchResults, this actor may be deleted, replaced, or tampered with. When the chunk in question is not visible, but an ancestor of a visible chunk, the visible ancestor's shapes are returned.

Parameters:
chunkIndexthe chunk index within the actor
virtual uint32_t nvidia::apex::DestructibleActor::getChunkPhysXShapes ( physx::PxShape **&  shapes,
uint32_t  chunkIndex 
) const [pure virtual]

Returns the PhysX shapes associated with the given chunk. Caution is recommended when using this function. During APEX scene simulate/fetchResults, this actor may be deleted, replaced, or tampered with. It is safe to use the results of this function during the chunk event callback (see ModuleDestructible::setChunkReport).

Parameters:
shapesreturned pointer to array of shapes. May be NULL.
chunkIndexthe chunk index within the actor
Returns:
size of array pointed to by shapes pointer. 0 if shapes == NULL.
virtual PxTransform nvidia::apex::DestructibleActor::getChunkPose ( uint32_t  chunkIndex) const [pure virtual]

Returns current pose of a chunk's reference frame, without scaling. This pose can be used to transform the chunk's hull data from the asset into global space.

Parameters:
chunkIndexthe chunk index within the actor
Note:
This pose's translation might not be inside the chunk. Use getChunkBounds to get a better representation of where the chunk is located.
virtual const PxMat44 nvidia::apex::DestructibleActor::getChunkTM ( uint32_t  chunkIndex) const [pure virtual]

Returns the transform of the chunk's graphical representation. This may have a scale component.

Parameters:
chunkIndexthe chunk index within the actor
virtual PxTransform nvidia::apex::DestructibleActor::getChunkTransform ( uint32_t  chunkIndex) const [pure virtual]

Returns current pose of a chunk's reference frame, without scaling. This pose can be used to transform the chunk's hull data from the asset into global space.

Parameters:
chunkIndexthe chunk index within the actor
Note:
This pose's translation might not be inside the chunk. Use getChunkBounds to get a better representation of where the chunk is located.
virtual void nvidia::apex::DestructibleActor::getChunkVisibilities ( uint8_t *  visibilityArray,
uint32_t  visibilityArraySize 
) const [pure virtual]

Returns an array of visibility data for each chunk. Each byte in the array is 0 if the corresponding chunkIndex is invisible, 1 if visibile.

Parameters:
visibilityArraya pointer to the byte buffer to hold the visibility values.
visibilityArraySizethe size of the visibilityArray
virtual uint32_t nvidia::apex::DestructibleActor::getCustomBehaviorGroupCount ( ) const [pure virtual]

Access to behavior groups created for this actor. Each chunk has a behavior group index associated with it.

Returns:
This returns the number of custom (non-default) behavior groups.
virtual bool nvidia::apex::DestructibleActor::getDamageColoringHistory ( const DamageEventCoreData *&  damageEventCoreDataContainer,
uint32_t &  damageEventCoreDataCount 
) const [pure virtual]

Get the damage coloring history of the actor. To start caching damage coloring, see setHitChunkTrackingParams()

Returns:
Returns true if the function executes correctly with the given arguments.
virtual const DestructibleParameters& nvidia::apex::DestructibleActor::getDestructibleParameters ( ) const [pure virtual]

Gets the destructible's DestructibleParameter block of parameters. These are initially set from the asset.

virtual bool nvidia::apex::DestructibleActor::getGlobalPose ( PxMat44 &  pose) [pure virtual]

Get the destructible actor's global pose. This will be the pose of the physx PxActor or PxActor for the static chunks in the structure containing this actor, if there are static chunks. If there are no static chunks in the structure, pose will not be modified and false will be returned. Otherwise pose will be filled in with a scale-free transform, and true is returned.

virtual bool nvidia::apex::DestructibleActor::getHitChunkHistory ( const DestructibleHitChunk *&  hitChunkContainer,
uint32_t &  hitChunkCount 
) const [pure virtual]

Get the chunk hit history of the actor. To start caching chunk hits, see setHitChunkTrackingParams()

Returns:
Returns true if the function executes correctly with the given arguments.
virtual PxMat44 nvidia::apex::DestructibleActor::getInitialGlobalPose ( ) const [pure virtual]

Gets the global pose used when the actor is added to the scene, in the DestructibleActorDesc

virtual PxBounds3 nvidia::apex::DestructibleActor::getLocalBounds ( ) const [pure virtual]

Accessor to get the initial locally-aligned bounding box of a destructible actor.

virtual uint32_t nvidia::apex::DestructibleActor::getNumVisibleChunks ( ) const [pure virtual]

Returns the number of visible chunks. This is the number of 1's written to the visibilityArray by getChunkVisibilities.

virtual const ::NvParameterized::Interface* nvidia::apex::DestructibleActor::getNvParameterized ( DestructibleParameterizedType::Enum  type = DestructibleParameterizedType::State) const [pure virtual]

Returns the actor's NvParamaterized interface This cannot be directly modified! It is read only to the user. This handle can be used to directly serialize the complete actor state.

virtual PxBounds3 nvidia::apex::DestructibleActor::getOriginalBounds ( ) const [pure virtual]

Accessor to get the initial world axis-aligned bounding box of a destructible actor.

virtual const RenderMeshActor* nvidia::apex::DestructibleActor::getRenderMeshActor ( DestructibleActorMeshType::Enum  type = DestructibleActorMeshType::Skinned) const [pure virtual]

Get the render mesh actor for the specified mesh type.

virtual PxVec3 nvidia::apex::DestructibleActor::getScale ( ) const [pure virtual]

Gets the destructible actor's 3D (possibly nonuniform) scale

virtual uint32_t nvidia::apex::DestructibleActor::getSupportDepth ( ) const [pure virtual]

Query the actor's support depth.

virtual uint32_t nvidia::apex::DestructibleActor::getSupportDepthChunkIndices ( uint32_t *const  OutChunkIndices,
uint32_t  MaxOutIndices 
) const [pure virtual]

Accessor to get the array of chunk indices at the support depth.

virtual const uint16_t* nvidia::apex::DestructibleActor::getVisibleChunks ( ) const [pure virtual]

Returns a pointer to an array of visible chunk indices.

virtual bool nvidia::apex::DestructibleActor::isChunkDestroyed ( int32_t  chunkIndex) const [pure virtual]

Accessor to query if a chunk has been destroyed.

virtual bool nvidia::apex::DestructibleActor::isChunkSolitary ( int32_t  chunkIndex) const [pure virtual]

Accessor to query if a chunk is part of a detached island.

virtual bool nvidia::apex::DestructibleActor::isDynamic ( uint32_t  chunkIndex) const [pure virtual]

Returns true if the chunkIndex is valid, and the indexed chunk is dynamic. Returns false otherwise.

virtual bool nvidia::apex::DestructibleActor::isHardSleepingEnabled ( ) const [pure virtual]

Returns true iff hard sleeping is selected for this DestructibleActor.

virtual bool nvidia::apex::DestructibleActor::isInitiallyDynamic ( ) const [pure virtual]

Returns true iff the destructible actor starts off life dynamic.

virtual int32_t nvidia::apex::DestructibleActor::obbSweep ( float &  time,
PxVec3 &  normal,
const PxVec3 &  worldBoxCenter,
const PxVec3 &  worldBoxExtents,
const PxMat33 &  worldBoxRot,
const PxVec3 &  worldDisplacement,
DestructibleActorRaycastFlags::Enum  flags 
) const [pure virtual]

Physx SDK 3.X. Returns the index of the first visible chunk hit in the actor by swept oriented bounding box, if any. Otherwise returns ModuleDestructibleConst::INVALID_CHUNK_INDEX. If a chunk is hit, the time and normal fields are modified.

Parameters:
[out]time(return value) of the time to the hit chunk, if any.
[out]normal(return value) the surface normal of the hit chunk's collision volume, if any.
worldBoxCenterthe center of the obb to sweep against the actor, oriented in world space
worldBoxExtentsthe extents of the obb to sweep against the actor, oriented in world space
worldBoxRotthe rotation of the obb to sweep against the actor, oriented in world space
worldDisplacementthe displacement of the center of the worldBox through the sweep, in world space
flagsraycast control flags (see DestructibleActorRaycastFlags)
virtual int32_t nvidia::apex::DestructibleActor::rayCast ( float &  time,
PxVec3 &  normal,
const PxVec3 &  worldRayOrig,
const PxVec3 &  worldRayDir,
DestructibleActorRaycastFlags::Enum  flags,
int32_t  parentChunkIndex = ModuleDestructibleConst::INVALID_CHUNK_INDEX 
) const [pure virtual]

PhysX SDK 3.X. Returns the index of the first visible chunk hit in the actor by worldRay, if any. Otherwise returns ModuleDestructibleConst::INVALID_CHUNK_INDEX. If a chunk is hit, the time and normal fields are modified.

Parameters:
[out]time(return value) of the time to the hit chunk, if any.
[out]normal(return value) the surface normal of the hit chunk's collision volume, if any.
worldRayOrigorigin of the ray to fire at the actor (the direction need not be normalized)
worldRayDirdirection of the ray to fire at the actor (the direction need not be normalized)
flagsraycast control flags (see DestructibleActorRaycastFlags)
parentChunkIndex(if not equal to ModuleDestructibleConst::INVALID_CHUNK_INDEX) the chunk subhierarchy in which to confine the raycast. If parentChunkIndex = ModuleDestructibleConst::INVALID_CHUNK_INDEX, then the whole actor is searched.
virtual bool nvidia::apex::DestructibleActor::recreateApexEmitter ( DestructibleEmitterType::Enum  type) [pure virtual]

Recreates the Apex Emitter, if necessary. Use this method to re-initialize the crumble or dust emitter after a change has been made to a dependent asset Note - only crumble emitters are implemented in 1.2.0

virtual bool nvidia::apex::DestructibleActor::releaseChunkEventBuffer ( bool  clearBuffer = true) [pure virtual]

Releases the chunk event buffer, which may have been locked by acquireChunkEventBuffer(). If clearBuffer is true, the buffer will be erased before it is unlocked.

Returns:
Returns true if successful, false otherwise.
virtual bool nvidia::apex::DestructibleActor::releasePhysXActorBuffer ( ) [pure virtual]

Releases the PhysX actor buffer, which may have been locked by acquirePhysXActorBuffer(). The buffer will be erased before it is unlocked.

Returns:
Returns true if successful, false otherwise.
virtual void nvidia::apex::DestructibleActor::setAngularVelocity ( const PxVec3 &  angularVelocity) [pure virtual]

Sets the angular velocity of every dynamic chunk to the given value.

virtual bool nvidia::apex::DestructibleActor::setChunkPhysXActorAwakeState ( uint32_t  chunkIndex,
bool  awake 
) [pure virtual]

Puts the PxActor associated with the given chunk to sleep, or wakes it up, depending upon the value of the 'awake' bool.

Parameters:
chunkIndexthe chunk index within the actor
awakeif true, wakes the actor, otherwise puts the actor to sleep

Returns true iff successful.

virtual void nvidia::apex::DestructibleActor::setCrumbleEmitterState ( bool  enable) [pure virtual]

Enable/disable the crumble emitter

virtual void nvidia::apex::DestructibleActor::setDeleteFracturedChunks ( bool  inDeleteChunkMode) [pure virtual]

Set the actor to delete its fractured chunks instead of simulating them.

virtual void nvidia::apex::DestructibleActor::setDestructibleParameters ( const DestructibleParameters destructibleParameters) [pure virtual]

Sets the destructible's DestructibleParameter block of parameters. These may be set at runtime.

virtual void nvidia::apex::DestructibleActor::setDustEmitterState ( bool  enable) [pure virtual]

Enable/disable the dust emitter Note - this is a placeholder API. The dust feature is disabled in 1.2.0.

virtual void nvidia::apex::DestructibleActor::setDynamic ( int32_t  chunkIndex = ModuleDestructibleConst::INVALID_CHUNK_INDEX) [pure virtual]

If the indexed chunk is visible, it is made dynamic (if it is not already). If ModuleDestructibleConst::INVALID_CHUNK_INDEX is passed in, all visible chunks in the destructible actor are made dynamic, if they are not already.

virtual void nvidia::apex::DestructibleActor::setGlobalPose ( const PxMat44 &  pose) [pure virtual]

Set the destructible actor's global pose. This will only be applied to the physx PxActor or PxActor for the static chunks, and therefore will apply to all static chunks in the structure which contains the this destructible actor. This pose should not contain scale, as the scale is already contained in the actor's scale parameter.

virtual bool nvidia::apex::DestructibleActor::setHitChunkTrackingParams ( bool  flushHistory,
bool  startTracking,
uint32_t  trackingDepth,
bool  trackAllChunks = true 
) [pure virtual]

Set the tracking properties of the actor for chunks that are hit. Chunks that are hit are chunks directly affected by fracture events.

Parameters:
flushHistoryflushHistory == true indicates that both the cached chunk hit history and the cached damage event core data will be cleared. To get the chunk hit history of this actor, see getHitChunkHistory() To get the damage coloring history of this actor, see getDamageColoringHistory()
startTrackingstartTracking == true indicates that chunk hits and damage coloring will begin caching internally. The actor does not cache chunk hits by default.
trackingDepththe depth at which hit chunks will be cached. This value should not exceed the maximum depth level.
trackAllChunkstrackAllChunks == true indicates that all the chunks will be cached, trackAllChunks == false indicates that only static chunks will be cached.

Returns true if the function executes correctly with the given arguments.

virtual void nvidia::apex::DestructibleActor::setInitialGlobalPose ( const PxMat44 &  pose) [pure virtual]

Resets the initial global pose used for support calculations when the first simulation step is run.

virtual void nvidia::apex::DestructibleActor::setLinearVelocity ( const PxVec3 &  linearVelocity) [pure virtual]

Sets the linear velocity of every dynamic chunk to the given value.

virtual void nvidia::apex::DestructibleActor::setNvParameterized ( ::NvParameterized::Interface *  ) [pure virtual]

Sets the actor's state via the NvParameterized object This can be used to update the state from deserialized data. The actor assumes control of the interface.

virtual void nvidia::apex::DestructibleActor::setPreferredRenderVolume ( RenderVolume *  volume,
DestructibleEmitterType::Enum  type 
) [pure virtual]

Sets a preferred render volume for a dust or crumble emitter Note - only crumble emitters are implemented in 1.2.0

virtual void nvidia::apex::DestructibleActor::setRuntimeFractureOverridePattern ( const char *  overridePatternName) [pure virtual]

Sets the override fracture pattern.

virtual void nvidia::apex::DestructibleActor::setSkinnedOverrideMaterial ( uint32_t  submeshIndex,
const char *  overrideMaterialName 
) [pure virtual]

Sets the override material.

virtual void nvidia::apex::DestructibleActor::setStaticOverrideMaterial ( uint32_t  submeshIndex,
const char *  overrideMaterialName 
) [pure virtual]

Sets the override material.

virtual bool nvidia::apex::DestructibleActor::setSyncParams ( uint32_t  userActorID,
uint32_t  actorSyncFlags = 0,
const DestructibleActorSyncState actorSyncState = NULL,
const DestructibleChunkSyncState chunkSyncState = NULL 
) [pure virtual]

Set the syncing properties of the destructible actor.

Parameters:
userActorIDuser-defined value used to identify the syncing actor. This value will be used to identify destructible actors between the server and client. userActorID = 0 is used for unregistering the actor as a syncing actor, and is the default value. The other arguments will then be forcibly set to the default (non-participating) values. userActorID != 0 registers the actor as a participating syncing actor. userActorID can be overwritten. In this case, the destructible actor which used to hold this userActorID will behave exactly like a call to set userActorID to 0.
actorSyncFlagsdescribes the kind of actor information that participates in syncing. See struct DestructibleActorSyncFlags
actorSyncStatedescribes information that allows finer control over the actor that participates in syncing. See struct DestructibleActorSyncState
chunkSyncStatedescribes information that allows finer control over the chunk that participates in syncing. See struct DestructibleChunkSyncState
Returns:
Returns true if arguments are accepted. Any one invalid argument will cause a return false. In such a case, no changes are made.
virtual void nvidia::apex::DestructibleActor::takeImpact ( const PxVec3 &  force,
const PxVec3 &  position,
uint16_t  chunkIndex,
PxActor const *  damageImpactActor 
) [pure virtual]

Register a rigid body impact for impact-based damage. Much like applyDamage, but multplies the input 'force' by the destructible's forceToDamage parameter, and also allows the user to report the impacting PhysX actor


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

Generated on Tue Aug 1 2017 22:43:54

Copyright © 2012-2017 NVIDIA Corporation, 2701 San Tomas Expressway, Santa Clara, CA 95050 U.S.A. All rights reserved.