APEX Clothing Module: nvidia::apex::ClothingActor Class Reference

NVIDIA APEX

nvidia::apex::ClothingActor Class Reference

Instance of ClothingAsset. Can be positioned, animated, updated and rendered. More...

#include <ClothingActor.h>

List of all members.

Public Member Functions

virtual
::NvParameterized::Interface * 
getActorDesc ()=0
 Returns a reference to the actor descriptor as it is held by the ClothingActor.
virtual void updateState (const PxMat44 &globalPose, const PxMat44 *newBoneMatrices, uint32_t boneMatricesByteStride, uint32_t numBoneMatrices, ClothingTeleportMode::Enum teleportMode)=0
 Updates all internal bone matrices. This should be called with updated information before apex scenes start simulating.
virtual void updateMaxDistanceScale (float scale, bool multipliable)=0
 Change the max distance of all active vertices with a scalar parameter.
virtual const PxMat44 & getGlobalPose () const =0
 returns the globalPose that was set with ClothingActor::updateState()
virtual void setWind (float windAdaption, const PxVec3 &windVelocity)=0
 Sets the wind strength and direction, can be called any time.
virtual void setMaxDistanceBlendTime (float blendTime)=0
 DEPRECATED Time in seconds how long it takes to go from 0 maxDistance to full maxDistance
virtual float getMaxDistanceBlendTime () const =0
 DEPRECATED Time in seconds how long it takes to go from 0 maxDistance to full maxDistance
virtual void setVisible (bool enable)=0
 Tells the actor if it will be rendered or not. If an actor is simulated, but not rendered, some computations (skinning, normal and tangent calculation) doesn't need to be done.
virtual bool isVisible () const =0
 Returns the current visibility setting. The most recently set value is returned (i.e. the buffered value, not the actual value).
virtual void setFrozen (bool enable)=0
 Stops simulating the actor.
virtual bool isFrozen () const =0
 Returns if the simulation is currently stopped for this actor.
virtual ClothSolverMode::Enum getClothSolverMode () const =0
 Returns whether the actor is simulated using the 2.8.x or the 3.x cloth solver.
virtual void setGraphicalLOD (uint32_t lod)=0
 sets the graphical Lod This chooses the graphical mesh of all the meshes stored in the asset to be rendered. It has to be set before the simulate call to take effect for the next time the actor is rendered. Otherwise, the given value will be buffered and used as soon as possible.
virtual uint32_t getGraphicalLod ()=0
 returns the graphical Lod This returns the buffered most recently set graphical lod, even if it's not active yet.
virtual bool rayCast (const PxVec3 &worldOrigin, const PxVec3 &worldDirection, float &time, PxVec3 &normal, uint32_t &vertexIndex)=0
 Raycasts against the ClothingActor.
virtual void attachVertexToGlobalPosition (uint32_t vertexIndex, const PxVec3 &globalPosition)=0
 Attach a vertex to a global position.
virtual void freeVertex (uint32_t vertexIndex)=0
 Free a previously attached vertex.
virtual uint32_t getClothingMaterial () const =0
 Returns the actively selected material.
virtual void setClothingMaterial (uint32_t index)=0
 Sets which clothing material is used from the assets library.
virtual void setOverrideMaterial (uint32_t submeshIndex, const char *overrideMaterialName)=0
 Sets the override material for the submesh with the given index.
virtual void setVelocityCallback (ClothingVelocityCallback *callback)=0
 sets the velocity callback for an individual actor, turned off when NULL
virtual void getPhysicalMeshPositions (void *buffer, uint32_t byteStride)=0
 Returns the current position of all physics vertices.
virtual void getPhysicalMeshNormals (void *buffer, uint32_t byteStride)=0
 Returns the current normals of all physics vertices.
virtual float getMaximumSimulationBudget () const =0
 Returns how much an Actor will cost at maximum.
virtual uint32_t getNumSimulationVertices () const =0
 Returns the number of currently simulation vertices.
virtual const PxVec3 * getSimulationPositions ()=0
 Returns a pointer to the internal positions array of the simulated physics mesh Blocks until the simulation and post simulation processing is done (with asyncFetchResult set to true)
virtual const PxVec3 * getSimulationNormals ()=0
 Returns a pointer to the internal normals array of the simulated physics mesh Blocks until the simulation and post simulation processing is done (with asyncFetchResult set to true)
virtual bool getSimulationVelocities (PxVec3 *velocities)=0
 Writes the current velocities of the simulated vertices into the provided array. A buffer of getNumSimulationVertices() PxVec3's needs to be provided. The function cannot be called during simulation. Blocks until the simulation and post simulation processing is done (with asyncFetchResult set to true)
virtual uint32_t getNumGraphicalVerticesActive (uint32_t submeshIndex) const =0
 Returns the number of the graphical vertices that need to be skinned to the simulation mesh [0, numGraphicalVerticesActive)
virtual PxMat44 getRenderGlobalPose () const =0
 Returns the transform that needs to be applied to the rendered mesh.
virtual const PxMat44 * getCurrentBoneSkinningMatrices () const =0
 Returns the current skinning matrices. The skinning matrices already contain the global pose of the actor.
virtual bool isHalfPrecisionAllowed () const =0
 return whether GPU solver can use half precision for storing positions.
virtual void setHalfPrecision (bool isAllowed)=0
 allow GPU solver to use half precision for storing positions.
virtual ClothingPlanecreateCollisionPlane (const PxPlane &plane)=0
 Create a collision plane for the actor.
virtual ClothingConvexcreateCollisionConvex (ClothingPlane **planes, uint32_t numPlanes)=0
 Create a collision convex for the actor, defined by planes.
virtual ClothingSpherecreateCollisionSphere (const PxVec3 &position, float radius)=0
 Create a collision sphere for the actor.
virtual ClothingCapsulecreateCollisionCapsule (ClothingSphere &sphere1, ClothingSphere &sphere2)=0
 Create a tapered collision capsule for the actor, defined by two spheres.
virtual ClothingTriangleMeshcreateCollisionTriangleMesh ()=0
 Create a collision triangle mesh for the actor.
virtual ClothingRenderProxyacquireRenderProxy ()=0
 Returns the Render Proxy for this clothing actor.

Detailed Description

Instance of ClothingAsset. Can be positioned, animated, updated and rendered.


Member Function Documentation

virtual ClothingRenderProxy* nvidia::apex::ClothingActor::acquireRenderProxy ( ) [pure virtual]

Returns the Render Proxy for this clothing actor.

Call this function after fetchResults to get the ClothingRenderProxy object that can be used to render the simulation reset. The render proxy can be acquired at any time, it contains the result from the last fetchResults call. It is recommended to acquire the render proxy after fetchResults and to release it before the next simulate call to prevent the memory overhead of buffering the render data. The data in the render proxy remains consistent until it is released (release returns the object into a pool from which it can be reused). The ClothingRenderProxy object is valid even after the release of the clothing actor. However it becomes invalid when the corresponding asset is released. Blocks until the simulation and post simulation processing is done (with asyncFetchResult set to true)

Returns:
ClothingRenderProxy object with static render data. Can be acquired only once per frame, otherwise NULL is returned.
virtual ::NvParameterized::Interface* nvidia::apex::ClothingActor::getActorDesc ( ) [pure virtual]

Returns a reference to the actor descriptor as it is held by the ClothingActor.

This descriptor can be modified at any time, changes will only be read during the first part of the simulation.

virtual const PxMat44* nvidia::apex::ClothingActor::getCurrentBoneSkinningMatrices ( ) const [pure virtual]

Returns the current skinning matrices. The skinning matrices already contain the global pose of the actor.

Note:
Only valid after simulate.
virtual float nvidia::apex::ClothingActor::getMaxDistanceBlendTime ( ) const [pure virtual]

DEPRECATED Time in seconds how long it takes to go from 0 maxDistance to full maxDistance

Deprecated:
Use ClothingActor::getActorDesc() and read the maxDistanceBlendTime part of it
virtual uint32_t nvidia::apex::ClothingActor::getNumGraphicalVerticesActive ( uint32_t  submeshIndex) const [pure virtual]

Returns the number of the graphical vertices that need to be skinned to the simulation mesh [0, numGraphicalVerticesActive)

The rest must be regularly skinned to bones [numGraphicalVerticesActive, numVertices)

Note:
Only valid after simulate.
virtual uint32_t nvidia::apex::ClothingActor::getNumSimulationVertices ( ) const [pure virtual]

Returns the number of currently simulation vertices.

Note:
This is not to be used for getPhysicalMeshPositions. getNumSimulatedVertices returns the number of actually simulated verts, while getPhysicalMeshPositions returns the complete physical mesh, regardless of the current physical lod
virtual void nvidia::apex::ClothingActor::getPhysicalMeshNormals ( void *  buffer,
uint32_t  byteStride 
) [pure virtual]

Returns the current normals of all physics vertices.

This method provides the normals of the currently simulated part of the physics mesh and skins the non-simulated part with the current bone positions.

Note:
This should usually not be needed other than for rendering the physics mesh yourself
Must be called in between Scene::fetchResults and Scene::simulate.
virtual void nvidia::apex::ClothingActor::getPhysicalMeshPositions ( void *  buffer,
uint32_t  byteStride 
) [pure virtual]

Returns the current position of all physics vertices.

This method provides the positions of the currently simulated part of the physics mesh and skins the non-simulated part with the current bone positions.

Note:
This should usually not be needed other than for rendering the physics mesh yourself
Must be called in between Scene::fetchResults and Scene::simulate.
virtual PxMat44 nvidia::apex::ClothingActor::getRenderGlobalPose ( ) const [pure virtual]

Returns the transform that needs to be applied to the rendered mesh.

Note:
Only valid after simulate.
virtual const PxVec3* nvidia::apex::ClothingActor::getSimulationNormals ( ) [pure virtual]

Returns a pointer to the internal normals array of the simulated physics mesh Blocks until the simulation and post simulation processing is done (with asyncFetchResult set to true)

Returns:
Pointer the simulation mesh normals
virtual const PxVec3* nvidia::apex::ClothingActor::getSimulationPositions ( ) [pure virtual]

Returns a pointer to the internal positions array of the simulated physics mesh Blocks until the simulation and post simulation processing is done (with asyncFetchResult set to true)

Returns:
Pointer the simulation mesh positions
virtual bool nvidia::apex::ClothingActor::getSimulationVelocities ( PxVec3 *  velocities) [pure virtual]

Writes the current velocities of the simulated vertices into the provided array. A buffer of getNumSimulationVertices() PxVec3's needs to be provided. The function cannot be called during simulation. Blocks until the simulation and post simulation processing is done (with asyncFetchResult set to true)

Returns:
true if a simulation is available and the velocities have been written
virtual bool nvidia::apex::ClothingActor::isHalfPrecisionAllowed ( ) const [pure virtual]

return whether GPU solver can use half precision for storing positions.

Note:
If allowed half precision will be activated only when actors cannot be fitted to shared memory with float precision.
virtual bool nvidia::apex::ClothingActor::rayCast ( const PxVec3 &  worldOrigin,
const PxVec3 &  worldDirection,
float &  time,
PxVec3 &  normal,
uint32_t &  vertexIndex 
) [pure virtual]

Raycasts against the ClothingActor.

Parameters:
[in]worldOriginThe world ray's origin
[in]worldDirectionThe world ray's direction, needs not to be normalized
[out]timeImpact time
[out]normalImpact normal in world space
[out]vertexIndexVertex index that was hit
Returns:
true if this actor is hit
virtual void nvidia::apex::ClothingActor::setGraphicalLOD ( uint32_t  lod) [pure virtual]

sets the graphical Lod This chooses the graphical mesh of all the meshes stored in the asset to be rendered. It has to be set before the simulate call to take effect for the next time the actor is rendered. Otherwise, the given value will be buffered and used as soon as possible.

Parameters:
[in]lodlod used to render the mesh
Note:
It is safe to call this even during simulation
virtual void nvidia::apex::ClothingActor::setHalfPrecision ( bool  isAllowed) [pure virtual]

allow GPU solver to use half precision for storing positions.

Note:
This option will be activated only when actors cannot be fitted to shared memory with float precision. Be aware half precision might be insufficient for some cloth simulation. Especially simulation with extensive self collisions sensitive to precision.
Parameters:
[in]isAllowedtrue - allow GPU solver to use half precision, false - don't allow
virtual void nvidia::apex::ClothingActor::setMaxDistanceBlendTime ( float  blendTime) [pure virtual]

DEPRECATED Time in seconds how long it takes to go from 0 maxDistance to full maxDistance

Deprecated:
Use ClothingActor::getActorDesc() and modify the maxDistanceBlendTime part of it Default: 1.0
Note:
This also influences how quickly different physical LoDs can be switched
It is safe to call this even during simulation.
virtual void nvidia::apex::ClothingActor::setVisible ( bool  enable) [pure virtual]

Tells the actor if it will be rendered or not. If an actor is simulated, but not rendered, some computations (skinning, normal and tangent calculation) doesn't need to be done.

disabling is set immediately, disabling is buffered for the next frame.

virtual void nvidia::apex::ClothingActor::setWind ( float  windAdaption,
const PxVec3 &  windVelocity 
) [pure virtual]

Sets the wind strength and direction, can be called any time.

Deprecated:
Use ClothingActor::getActorDesc() and modify the wind part of it
Parameters:
[in]windAdaptionThe rate of adaption. The higher this value, the faster the cloth reaches the wind velocity. Set to 0 to turn off wind
[in]windVelocityThe target velocity each vertex tries to achieve.
Note:
It is safe to call this even during simulation, but it will only have an effect after the next call to Scene::simulate()
virtual void nvidia::apex::ClothingActor::updateMaxDistanceScale ( float  scale,
bool  multipliable 
) [pure virtual]

Change the max distance of all active vertices with a scalar parameter.

Parameters:
[in]scaleMust be in [0,1] range
[in]multipliableSetting to define how the scale is applied. True will multiply the scale on top of the max distance, False will subtract the maximum max distance.
virtual void nvidia::apex::ClothingActor::updateState ( const PxMat44 &  globalPose,
const PxMat44 *  newBoneMatrices,
uint32_t  boneMatricesByteStride,
uint32_t  numBoneMatrices,
ClothingTeleportMode::Enum  teleportMode 
) [pure virtual]

Updates all internal bone matrices. This should be called with updated information before apex scenes start simulating.

Parameters:
[in]globalPoseThe new location of the actor
[in]newBoneMatricesPointer to the array of transformations that contain the composite bone transformations for the current frame
[in]boneMatricesByteStridestride of the bone matrices, must be bigger than sizeof(PxMat44)
[in]numBoneMatricesnumber of bone matrices available. This should correspond with the number of bones present in the asset
[in]teleportModeSetting this to anything but TM_Continuous will force apply a teleport and optionally a reset.
Note:
This must be called before Scene::simulate is called

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

Generated on Fri Dec 15 2017 13:58:20

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