00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef CLOTHING_ACTOR_H
00031 #define CLOTHING_ACTOR_H
00032
00033 #include "Actor.h"
00034 #include "Renderable.h"
00035 #include "ClothingAsset.h"
00036
00037 namespace NvParameterized
00038 {
00039 class Interface;
00040 }
00041
00042 namespace nvidia
00043 {
00044 namespace apex
00045 {
00046
00047 PX_PUSH_PACK_DEFAULT
00048
00049 class ClothingVelocityCallback;
00050 class ClothingPlane;
00051 class ClothingConvex;
00052 class ClothingSphere;
00053 class ClothingCapsule;
00054 class ClothingTriangleMesh;
00055 class ClothingRenderProxy;
00056
00057
00061 struct ClothingTeleportMode
00062 {
00064 enum Enum
00065 {
00069 Continuous,
00070
00076 Teleport,
00077
00083 TeleportAndReset,
00084 };
00085 };
00086
00087
00088
00092 class ClothingActor : public Actor, public Renderable
00093 {
00094 protected:
00095 virtual ~ClothingActor() {}
00096 public:
00097
00103 virtual ::NvParameterized::Interface* getActorDesc() = 0;
00104
00117 virtual void updateState(const PxMat44& globalPose, const PxMat44* newBoneMatrices, uint32_t boneMatricesByteStride, uint32_t numBoneMatrices, ClothingTeleportMode::Enum teleportMode) = 0;
00118
00125 virtual void updateMaxDistanceScale(float scale, bool multipliable) = 0;
00126
00130 virtual const PxMat44& getGlobalPose() const = 0;
00131
00142 virtual void setWind(float windAdaption, const PxVec3& windVelocity) = 0;
00143
00152 virtual void setMaxDistanceBlendTime(float blendTime) = 0;
00153
00159 virtual float getMaxDistanceBlendTime() const = 0;
00160
00168 virtual void setVisible(bool enable) = 0;
00169
00174 virtual bool isVisible() const = 0;
00175
00179 virtual void setFrozen(bool enable) = 0;
00180
00184 virtual bool isFrozen() const = 0;
00185
00189 virtual ClothSolverMode::Enum getClothSolverMode() const = 0;
00190
00201 virtual void setGraphicalLOD(uint32_t lod) = 0;
00202
00207 virtual uint32_t getGraphicalLod() = 0;
00208
00220 virtual bool rayCast(const PxVec3& worldOrigin, const PxVec3& worldDirection, float& time, PxVec3& normal, uint32_t& vertexIndex) = 0;
00221
00225 virtual void attachVertexToGlobalPosition(uint32_t vertexIndex, const PxVec3& globalPosition) = 0;
00226
00230 virtual void freeVertex(uint32_t vertexIndex) = 0;
00231
00235 virtual uint32_t getClothingMaterial() const = 0;
00236
00240 virtual void setClothingMaterial(uint32_t index) = 0;
00241
00245 virtual void setOverrideMaterial(uint32_t submeshIndex, const char* overrideMaterialName) = 0;
00246
00250 virtual void setVelocityCallback(ClothingVelocityCallback* callback) = 0;
00251
00261 virtual void getPhysicalMeshPositions(void* buffer, uint32_t byteStride) = 0;
00262
00272 virtual void getPhysicalMeshNormals(void* buffer, uint32_t byteStride) = 0;
00273
00277 virtual float getMaximumSimulationBudget() const = 0;
00278
00287 virtual uint32_t getNumSimulationVertices() const = 0;
00288
00289
00297 virtual const PxVec3* getSimulationPositions() = 0;
00298
00306 virtual const PxVec3* getSimulationNormals() = 0;
00307
00317 virtual bool getSimulationVelocities(PxVec3* velocities) = 0;
00318
00326 virtual uint32_t getNumGraphicalVerticesActive(uint32_t submeshIndex) const = 0;
00327
00333 virtual PxMat44 getRenderGlobalPose() const = 0;
00334
00341 virtual const PxMat44* getCurrentBoneSkinningMatrices() const = 0;
00342
00343
00349 virtual bool isHalfPrecisionAllowed() const = 0;
00350
00360 virtual void setHalfPrecision(bool isAllowed) = 0;
00361
00362
00366 virtual ClothingPlane* createCollisionPlane(const PxPlane& plane) = 0;
00367
00371 virtual ClothingConvex* createCollisionConvex(ClothingPlane** planes, uint32_t numPlanes) = 0;
00372
00376 virtual ClothingSphere* createCollisionSphere(const PxVec3& position, float radius) = 0;
00377
00381 virtual ClothingCapsule* createCollisionCapsule(ClothingSphere& sphere1, ClothingSphere& sphere2) = 0;
00382
00386 virtual ClothingTriangleMesh* createCollisionTriangleMesh() = 0;
00387
00404 virtual ClothingRenderProxy* acquireRenderProxy() = 0;
00405
00406 #if APEX_UE4
00407
00408 virtual void simulate(PxF32 dt) = 0;
00409 #endif
00410 };
00411
00412 PX_POP_PACK
00413
00414 }
00415 }
00416
00417 #endif // CLOTHING_ACTOR_H