Public Attributes
nvidia::apex::ClothingMeshSkinningMap Struct Reference

Maps from a triangle of the simulated mesh to a vertex of the rendered mesh. The barycentric coordinates describe the position of a point in space relative to a simulated triangle. The actual z-coordinate is computed by bary.z = 1 - bary.x - bary.y. The z part of the vector contains the height of the skinned vertex along the normal of the simulated triangle. More...

#include <ClothingAsset.h>

List of all members.

Public Attributes

PxVec3 positionBary
 Barycentric coordinates of the graphical vertex relative to the simulated triangle.
uint32_t vertexIndex0
 First vertex of the simulated triangle.
PxVec3 normalBary
 Barycentric coordinates of a point that represents the normal. The actual normal can be extracted by subtracting the skinned position from this point.
uint32_t vertexIndex1
 Second vertex of the simulated triangle.
PxVec3 tangentBary
 Barycentric coordinates of a point that represents the tangent. The actual tangent can be extracted by subtracting the skinned position from this point.
uint32_t vertexIndex2
 Third vertex of the simulated triangle.

Detailed Description

Maps from a triangle of the simulated mesh to a vertex of the rendered mesh. The barycentric coordinates describe the position of a point in space relative to a simulated triangle. The actual z-coordinate is computed by bary.z = 1 - bary.x - bary.y. The z part of the vector contains the height of the skinned vertex along the normal of the simulated triangle.

So, the following computes the new skinned position:

uint32_t i0 = map[mapId].vertexIndex0; uint32_t i1 = map[mapId].vertexIndex1; uint32_t i2 = map[mapId].vertexIndex2;

PxVec3 bary = map[mapId].positionBary; float heightOffset = bary.z * actorScale; bary.z = (1 - bary.x - bary.y);

PxVec3 posOnTriangle = physPositions[i0] * bary.x + physPositions[i1] * bary.y + physPositions[i2] * bary.z;

offsetFromTriangle = (physNormals[i0] * bary.x + physNormals[i1] * bary.y + physNormals[i2] * bary.z) heightOffset;

skinnedPos = posOnTriangle + offsetFromTriangle;


Member Data Documentation

Barycentric coordinates of a point that represents the normal. The actual normal can be extracted by subtracting the skinned position from this point.

Note:
PX_MAX_F32 values represent invalid coordinates.

Barycentric coordinates of the graphical vertex relative to the simulated triangle.

Note:
PX_MAX_F32 values represent invalid coordinates.

Barycentric coordinates of a point that represents the tangent. The actual tangent can be extracted by subtracting the skinned position from this point.

Note:
PX_MAX_F32 values represent invalid coordinates.

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

Generated on Sat Dec 1 2018 15:51:51

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