PxLineStripSkinning

Defined in include/PxLineStripSkinning.h

class PxLineStripSkinning

Utility class to embed high resolution line strips into low resolution line strips.

No internal data is cached except a reference to the cuda context manager. Therefore, a single instance of this class may be used for different hair systems.

Public Functions

virtual void initializeInterpolatedVertices(const PxVec4 *simVertices, const PxU32 *simStrandPastEndIndices, PxU32 nbLineStrips, const PxLineStripSkinnedVertex *skinnedVertices, PxU32 nbSkinnedVertices, PxVec4 *skinnedVertexInterpolationData, PxVec3 *skinningInfoRootStrandDirections, PxU32 *skinningInfoStrandStartIndices, PxU32 *skinningInfoReorderMap = NULL, const PxMat44 &transform = PxMat44(PxIdentity), PxReal catmullRomAlpha = 0.5f) = 0

Computes the skinning information used to update the skinned points during simulation.

Note

All computations in this function are happening on the CPU, therefore, all supplied pointers must point to CPU-accessible memory.

Parameters
  • simVertices[in] The simulated vertices in the state in which the skinning information shall be computed. These vertices will eventually drive the skinned vertices

  • simStrandPastEndIndices[in] The index after the last strand vertex for the simulation strands (strand = line strip)

  • nbLineStrips[in] The number of line strips

  • skinnedVertices[in] The positions and segment locations of the skinned vertices in the initial frame. They will keep their position relative to the line strip segment during simulation.

  • nbSkinnedVertices[in] The total number of skinned vertices

  • skinnedVertexInterpolationData[out] Must provide space for one entry per skinned vertex. Contains the location of the skinned vertex relative to the interpolated base frame. The w component encodes the location of the base frame along the line segment.

  • skinningInfoRootStrandDirections[out] Must provide space for one entry per line strip. Contains the direction of the first line segment per line strip during the calculation of the skinning information.

  • skinningInfoStrandStartIndices[out] Must provide space for one entry per line strip. Contains the index of the first skinning vertex in the buffer for every line strip. The skinned vertices must be sorted such that vertices attached to the same line strip are adjacent to each other in the buffer.

  • skinningInfoReorderMap[out] Can be NULL if the skinning vertices are already sorted per strand segment id. Must provide space for one entry per skinned vertex. Contains a reorder map since the skinning algorithm needs to process the skinned vertices in a specific order.

  • transform[in] Optional transform that gets applied to the simVertices before computing the skinning information

  • catmullRomAlpha[in] Optional parameter in the range 0…1 that allows to control the curve interpolation.

virtual void evaluateInterpolatedVertices(const PxVec4 *simVerticesD, const PxU32 *simStrandPastEndIndicesD, PxU32 nbSimStrands, const PxVec4 *skinnedVertexInterpolationDataD, const PxU32 *skinningInfoStrandStartIndicesD, const PxVec3 *skinningInfoRootStrandDirectionsD, const PxU32 *skinningInfoReorderMapD, PxU32 nbSkinnedVertices, PxVec3 *resultD, CUstream stream, const PxMat44 *inputTransformD = NULL, const PxMat44 *outputTransformD = NULL, PxReal catmullRomAlpha = 0.5f) = 0

Evaluates and updates the skinned positions based on the interpolation data on the GPU.

All input and output arrays must be accessible on the GPU.

Parameters
  • simVerticesD[in] The simulation vertices (device pointer) according to which the skinned positions shall be computed.

  • simStrandPastEndIndicesD[in] Device pointer containing the index after the last strand vertex for the simulation strands (strand = line strip)

  • nbSimStrands[in] The number of line strips

  • skinnedVertexInterpolationDataD[in] Device pointer containing the location of the skinned vertex relative to the interpolated base frame. The w component encodes the location of the base frame along the line segment.

  • skinningInfoStrandStartIndicesD[in] Device pointer containing the index of the first skinning vertex in the buffer for every line strip. The skinned vertices must be sorted such that vertices attached to the same line strip are adjacent to each other in the buffer.

  • skinningInfoRootStrandDirectionsD[in] Device pointer containing the direction of the first line segment per line strip during the calculation of the skinning information.

  • skinningInfoReorderMapD[in] Can be NULL if the skinning vertices are already sorted per strand segment id. Device pointer containing the reorder map for the skinned vertices.

  • nbSkinnedVertices[in] The total number of skinned vertices

  • resultD[out] The skinned vertex positions where the updated positions will be written

  • stream[in] The cuda stream on which ther kernel call gets scheduled

  • inputTransformD[in] Optional device buffer holding a transform that gets applied to the simVertices before computing the skinning information

  • outputTransformD[in] Optional device buffer holding a transform that gets applied to result vertices

  • catmullRomAlpha[in] Optional parameter in the range 0…1 that allows to control the curve interpolation.

inline virtual ~PxLineStripSkinning()

Destructor.