The clothing authoring asset. This is used to generate streams that can then be deserialized into a regular asset. More...
#include <ClothingAssetAuthoring.h>
Public Member Functions | |
virtual void | setDefaultConstrainCoefficients (const ClothingConstrainCoefficients &coeff)=0 |
set the default value for all coefficients if none is available | |
virtual void | setInvalidConstrainCoefficients (const ClothingConstrainCoefficients &coeff)=0 |
set the value which is considered invalid when painting | |
virtual void | setMeshes (uint32_t lod, RenderMeshAssetAuthoring *graphicalMesh, ClothingPhysicalMesh *physicalMesh, float normalResemblance=25, bool ignoreUnusedVertices=true, IProgressListener *progress=NULL)=0 |
Sets the graphical and physical mesh for the given graphical lod level. | |
virtual bool | addPlatformToGraphicalLod (uint32_t lod, PlatformTag platform)=0 |
Assigns a platform tag to a graphical lod. | |
virtual bool | removePlatform (uint32_t lod, PlatformTag platform)=0 |
Removes a platform tag from a graphical lod. | |
virtual uint32_t | getNumPlatforms (uint32_t lod) const =0 |
Get number of platform tags for a given lod. | |
virtual PlatformTag | getPlatform (uint32_t lod, uint32_t i) const =0 |
Get i-th platform tag of given lod;. | |
virtual uint32_t | getNumLods () const =0 |
Returns the number of LoDs that have been set in the ClothingAssetAuthoring::setMeshes call. | |
virtual int32_t | getLodValue (uint32_t lod) const =0 |
Returns the n-th LoD value from the ClothingAssetAuthoring::setMeshes call. | |
virtual void | clearMeshes ()=0 |
Clears all lods and meshes. | |
virtual ClothingPhysicalMesh * | getClothingPhysicalMesh (uint32_t graphicalLod) const =0 |
Returns a reference to the internal copy of the physical mesh for the given graphical lod. Returned object MUST be destroyed by the user immediately after use. | |
virtual void | setBoneInfo (uint32_t boneIndex, const char *boneName, const PxMat44 &bindPose, int32_t parentIndex)=0 |
assigns name and bindpose to a bone. This needs to be called for every bone at least once | |
virtual void | setRootBone (const char *boneName)=0 |
Specifies the root bone. | |
virtual uint32_t | addBoneConvex (const char *boneName, const PxVec3 *positions, uint32_t numPositions)=0 |
add a convex collision representation to a bone, vertices must be in bone-bind-pose space! | |
virtual uint32_t | addBoneConvex (uint32_t boneIndex, const PxVec3 *positions, uint32_t numPositions)=0 |
add a convex collision representation to a bone, vertices must be in bone-bind-pose space! | |
virtual void | addBoneCapsule (const char *boneName, float capsuleRadius, float capsuleHeight, const PxMat44 &localPose)=0 |
add a capsule to the bone's collision. all relative to bone-bind-pose space! | |
virtual void | addBoneCapsule (uint32_t boneIndex, float capsuleRadius, float capsuleHeight, const PxMat44 &localPose)=0 |
add a capsule to the bone's collision. all relative to bone-bind-pose space! | |
virtual void | clearBoneActors (const char *boneName)=0 |
clear all collision information for a given bone name | |
virtual void | clearBoneActors (uint32_t boneIndex)=0 |
clear all collision information for a given bone index | |
virtual void | clearAllBoneActors ()=0 |
clear all collision information for any bone | |
virtual void | setCollision (const char **boneNames, float *radii, PxVec3 *localPositions, uint32_t numSpheres, uint16_t *pairs, uint32_t numIndices)=0 |
Set up the collision volumes for PhysX3. The boneNames, radii and localPositions array need to be of size numSpheres, each triplet describes a sphere that is attached to a bone. The pairs array describes connections between pairs of spheres. It defines capsules with 2 radii. | |
virtual void | setCollision (uint32_t *boneIndices, float *radii, PxVec3 *localPositions, uint32_t numSpheres, uint16_t *pairs, uint32_t numIndices)=0 |
Set up the collision volumes for PhysX3. | |
virtual void | clearCollision ()=0 |
Clear the collision volumes for PhysX3. | |
virtual void | setSimulationHierarchicalLevels (uint32_t levels)=0 |
Number of hierarchical levels. 0 to turn off. | |
virtual void | setSimulationThickness (float thickness)=0 |
The radius of the cloth/softbody particles. | |
virtual void | setSimulationVirtualParticleDensity (float density)=0 |
The amount of virtual particles created. 0 means none, 1 means 2 or 3 per triangle. | |
virtual void | setSimulationSleepLinearVelocity (float sleep)=0 |
The sleep velocity. If all vertices of a cloth/softbody are below this velocity for some time, it falls asleep. | |
virtual void | setSimulationGravityDirection (const PxVec3 &gravity)=0 |
The direction of gravity. Can be used for cooking. | |
virtual void | setSimulationDisableCCD (bool disable)=0 |
Turn off Continuous collision detection for clothing. | |
virtual void | setSimulationTwowayInteraction (bool enable)=0 |
Turns on twoway interaction with rigid body. Only of limited use for clothing. | |
virtual void | setSimulationUntangling (bool enable)=0 |
EXPERIMENTAL: Turns on local untangling. | |
virtual void | setSimulationRestLengthScale (float scale)=0 |
The scale of the cloth rest length. | |
virtual void | setExportScale (float scale)=0 |
Provide a scaling to the serialize functionality. | |
virtual void | applyTransformation (const PxMat44 &transformation, float scale, bool applyToGraphics, bool applyToPhysics)=0 |
Apply an arbitrary transformation to either the physical, the graphical mesh or both. | |
virtual void | updateBindPoses (const PxMat44 *newBindPoses, uint32_t newBindPosesCount, bool isInternalOrder, bool maintainCollisionWorldSpace)=0 |
Move every bone bind pose to a new position. | |
virtual void | setDeriveNormalsFromBones (bool enable)=0 |
If enabled, the normals of the physical mesh are derived from the directions of the physical vertex to the bind poses of the assigned bones. | |
virtual NvParameterized::Interface * | getMaterialLibrary ()=0 |
Returns the material interface. | |
virtual bool | setMaterialLibrary (NvParameterized::Interface *materialLibrary, uint32_t materialIndex, bool transferOwnership)=0 |
Adds a new material library to the asset. | |
virtual ::NvParameterized::Interface * | getRenderMeshAssetAuthoring (uint32_t lodLevel) const =0 |
Gets the parameterized render mesh associated with this asset. | |
virtual bool | getBoneBindPose (uint32_t boneIndex, PxMat44 &bindPose) const =0 |
Retrieves the bind pose transform of this bone. | |
virtual bool | setBoneBindPose (uint32_t boneIndex, const PxMat44 &bindPose)=0 |
Directly sets the bind pose transform of this bone. |
The clothing authoring asset. This is used to generate streams that can then be deserialized into a regular asset.
virtual void nvidia::apex::ClothingAssetAuthoring::addBoneCapsule | ( | const char * | boneName, |
float | capsuleRadius, | ||
float | capsuleHeight, | ||
const PxMat44 & | localPose | ||
) | [pure virtual] |
add a capsule to the bone's collision. all relative to bone-bind-pose space!
[in] | boneName | name of the bone this collision info is for. |
[in] | capsuleRadius | The radius of the capsule. if set to 0, bone collision will default back to convex |
[in] | capsuleHeight | The height of the capsule |
[in] | localPose | The frame of the capsule relative to the frame of the bone (not world space) |
virtual void nvidia::apex::ClothingAssetAuthoring::addBoneCapsule | ( | uint32_t | boneIndex, |
float | capsuleRadius, | ||
float | capsuleHeight, | ||
const PxMat44 & | localPose | ||
) | [pure virtual] |
add a capsule to the bone's collision. all relative to bone-bind-pose space!
[in] | boneIndex | index of the bone this collision info is for. |
[in] | capsuleRadius | if set to 0, bone collision will default back to convex |
[in] | capsuleHeight | The height of the capsule |
[in] | localPose | The frame of the capsule relative to the frame of the bone (not world space) |
virtual uint32_t nvidia::apex::ClothingAssetAuthoring::addBoneConvex | ( | const char * | boneName, |
const PxVec3 * | positions, | ||
uint32_t | numPositions | ||
) | [pure virtual] |
add a convex collision representation to a bone, vertices must be in bone-bind-pose space!
[in] | boneName | name of the bone this collision info is for. |
[in] | positions | array of vertices with the positions. |
[in] | numPositions | number of elements in positions array. if set to 0, bone collision will be capsule. |
virtual uint32_t nvidia::apex::ClothingAssetAuthoring::addBoneConvex | ( | uint32_t | boneIndex, |
const PxVec3 * | positions, | ||
uint32_t | numPositions | ||
) | [pure virtual] |
add a convex collision representation to a bone, vertices must be in bone-bind-pose space!
[in] | boneIndex | index of the bone this collision info is for. |
[in] | positions | array of vertices with the positions. |
[in] | numPositions | number of elements in positions array. if set to 0, bone collision will be capsule. |
virtual void nvidia::apex::ClothingAssetAuthoring::applyTransformation | ( | const PxMat44 & | transformation, |
float | scale, | ||
bool | applyToGraphics, | ||
bool | applyToPhysics | ||
) | [pure virtual] |
Apply an arbitrary transformation to either the physical, the graphical mesh or both.
This is a permanent transformation and it changes the object state. Should only be called immediately before serialization and without further modifying the object later on.
transformation | This matrix is allowed to contain a translation and a rotation. |
scale | Apply a uniform scaling as well |
applyToGraphics | Apply the transformation and scale to the graphical part of the asset |
applyToPhysics | Apply the transformation and scale to the physical part of the asset |
virtual int32_t nvidia::apex::ClothingAssetAuthoring::getLodValue | ( | uint32_t | lod | ) | const [pure virtual] |
Returns the n-th LoD value from the ClothingAssetAuthoring::setMeshes call.
virtual ::NvParameterized::Interface* nvidia::apex::ClothingAssetAuthoring::getRenderMeshAssetAuthoring | ( | uint32_t | lodLevel | ) | const [pure virtual] |
Gets the parameterized render mesh associated with this asset.
[in] | lodLevel | The LoD level of the render mesh asset |
virtual void nvidia::apex::ClothingAssetAuthoring::setBoneInfo | ( | uint32_t | boneIndex, |
const char * | boneName, | ||
const PxMat44 & | bindPose, | ||
int32_t | parentIndex | ||
) | [pure virtual] |
assigns name and bindpose to a bone. This needs to be called for every bone at least once
[in] | boneIndex | The bone index the information is provided for. |
[in] | boneName | The bone name. An internal copy of this string will be made. |
[in] | bindPose | The bind or rest pose of this bone. |
[in] | parentIndex | The bone index of the parent bone, -1 for root bones. |
virtual void nvidia::apex::ClothingAssetAuthoring::setCollision | ( | const char ** | boneNames, |
float * | radii, | ||
PxVec3 * | localPositions, | ||
uint32_t | numSpheres, | ||
uint16_t * | pairs, | ||
uint32_t | numIndices | ||
) | [pure virtual] |
Set up the collision volumes for PhysX3. The boneNames, radii and localPositions array need to be of size numSpheres, each triplet describes a sphere that is attached to a bone. The pairs array describes connections between pairs of spheres. It defines capsules with 2 radii.
[in] | boneNames | names of the bones to which a spheres are added |
[in] | radii | radii of the spheres |
[in] | localPositions | sphere positions relative to the bone |
[in] | numSpheres | number of spheres that are being defined |
[in] | pairs | pairs of indices that reference 2 spheres to define a capsule with 2 radii |
[in] | numIndices | size of the pairs array |
virtual void nvidia::apex::ClothingAssetAuthoring::setExportScale | ( | float | scale | ) | [pure virtual] |
Provide a scaling to the serialize functionality.
This is useful when the game runs in a different scale than the tool this asset was created in
virtual bool nvidia::apex::ClothingAssetAuthoring::setMaterialLibrary | ( | NvParameterized::Interface * | materialLibrary, |
uint32_t | materialIndex, | ||
bool | transferOwnership | ||
) | [pure virtual] |
Adds a new material library to the asset.
[in] | materialLibrary | User-generated material library object. |
[in] | materialIndex | Default value for the Actor to know which material to use in the library |
[in] | transferOwnership | Hands ownership to the authoring asset. |
virtual void nvidia::apex::ClothingAssetAuthoring::setMeshes | ( | uint32_t | lod, |
RenderMeshAssetAuthoring * | graphicalMesh, | ||
ClothingPhysicalMesh * | physicalMesh, | ||
float | normalResemblance = 25 , |
||
bool | ignoreUnusedVertices = true , |
||
IProgressListener * | progress = NULL |
||
) | [pure virtual] |
Sets the graphical and physical mesh for the given graphical lod level.
[in] | lod | Identifier for that lod level. |
[in] | graphicalMesh | The graphical mesh to be rendered in that lod level. |
[in] | physicalMesh | The physical mesh to be simulated on that lod level. The reference to the same physical mesh can be given for different graphical lods. It is copied internally. Note: If the same physical mesh is used several time, the paint values are copied from the graphical mesh the first time the physical mesh is passed in here. |
[in] | normalResemblance | This angle (in degrees) specifies how similar the normal from the physical and graphical mesh need to be in order for them to be accepted as immediate mode skinning pairs. Use 90 or bigger for any resemblance. Must be in range (0, 90], but it's highly recommended to use more than 5 degrees. |
[in] | ignoreUnusedVertices | All Vertices that have the 'usedForPhysics' property set to false will be ignored when transferring the painted values from the graphical to the physical mesh |
[in] | progress | Progress bar callback class. |
virtual void nvidia::apex::ClothingAssetAuthoring::setRootBone | ( | const char * | boneName | ) | [pure virtual] |
Specifies the root bone.
[in] | boneName | The bone name. |
virtual void nvidia::apex::ClothingAssetAuthoring::setSimulationDisableCCD | ( | bool | disable | ) | [pure virtual] |
Turn off Continuous collision detection for clothing.
Fast moving objects can cause massive forces to the cloth, especially when some kinematic actors move large distances within one frame. Without CCD those collisions are not detected and thus don't influence the cloth.
virtual void nvidia::apex::ClothingAssetAuthoring::setSimulationHierarchicalLevels | ( | uint32_t | levels | ) | [pure virtual] |
Number of hierarchical levels. 0 to turn off.
If either the hierarchical solver iterations or the hierarchical levels are set to 0, this feature is turned off
virtual void nvidia::apex::ClothingAssetAuthoring::setSimulationUntangling | ( | bool | enable | ) | [pure virtual] |
EXPERIMENTAL: Turns on local untangling.
virtual void nvidia::apex::ClothingAssetAuthoring::updateBindPoses | ( | const PxMat44 * | newBindPoses, |
uint32_t | newBindPosesCount, | ||
bool | isInternalOrder, | ||
bool | maintainCollisionWorldSpace | ||
) | [pure virtual] |
Move every bone bind pose to a new position.
newBindPoses | array of matrices for the new bind poses. This must be in object space (not relative to the parent bone!) |
newBindPosesCount | number of matrices in the specified array |
isInternalOrder | using internal numbering or external numbering? |
maintainCollisionWorldSpace | The collision volumes do not move to the new bone bind pose |