ClothingActor.h
00001 /*
00002  * Copyright (c) 2008-2017, NVIDIA CORPORATION.  All rights reserved.
00003  *
00004  * NVIDIA CORPORATION and its licensors retain all intellectual property
00005  * and proprietary rights in and to this software, related documentation
00006  * and any modifications thereto.  Any use, reproduction, disclosure or
00007  * distribution of this software and related documentation without an express
00008  * license agreement from NVIDIA CORPORATION is strictly prohibited.
00009  */
00010 
00011 
00012 #ifndef CLOTHING_ACTOR_H
00013 #define CLOTHING_ACTOR_H
00014 
00015 #include "Actor.h"
00016 #include "Renderable.h"
00017 #include "ClothingAsset.h"
00018 
00019 namespace NvParameterized
00020 {
00021 class Interface;
00022 }
00023 
00024 namespace nvidia
00025 {
00026 namespace apex
00027 {
00028 
00029 PX_PUSH_PACK_DEFAULT
00030 
00031 class ClothingVelocityCallback;
00032 class ClothingPlane;
00033 class ClothingConvex;
00034 class ClothingSphere;
00035 class ClothingCapsule;
00036 class ClothingTriangleMesh;
00037 class ClothingRenderProxy;
00038 
00039 
00043 struct ClothingTeleportMode
00044 {
00046     enum Enum
00047     {
00051         Continuous,
00052 
00058         Teleport,
00059 
00065         TeleportAndReset,
00066     };
00067 };
00068 
00069 
00070 
00074 class ClothingActor : public Actor, public Renderable
00075 {
00076 protected:
00077     virtual ~ClothingActor() {}
00078 public:
00079 
00085     virtual ::NvParameterized::Interface* getActorDesc() = 0;
00086 
00099     virtual void updateState(const PxMat44& globalPose, const PxMat44* newBoneMatrices, uint32_t boneMatricesByteStride, uint32_t numBoneMatrices, ClothingTeleportMode::Enum teleportMode) = 0;
00100 
00107     virtual void updateMaxDistanceScale(float scale, bool multipliable) = 0;
00108 
00112     virtual const PxMat44& getGlobalPose() const = 0;
00113 
00124     virtual void setWind(float windAdaption, const PxVec3& windVelocity) = 0;
00125 
00134     virtual void setMaxDistanceBlendTime(float blendTime) = 0;
00135 
00141     virtual float getMaxDistanceBlendTime() const = 0;
00142 
00150     virtual void setVisible(bool enable) = 0;
00151 
00156     virtual bool isVisible() const = 0;
00157 
00161     virtual void setFrozen(bool enable) = 0;
00162 
00166     virtual bool isFrozen() const = 0;
00167 
00171     virtual ClothSolverMode::Enum getClothSolverMode() const = 0;
00172 
00183     virtual void setGraphicalLOD(uint32_t lod) = 0;
00184 
00189     virtual uint32_t getGraphicalLod() = 0;
00190 
00202     virtual bool rayCast(const PxVec3& worldOrigin, const PxVec3& worldDirection, float& time, PxVec3& normal, uint32_t& vertexIndex) = 0;
00203 
00207     virtual void attachVertexToGlobalPosition(uint32_t vertexIndex, const PxVec3& globalPosition) = 0;
00208 
00212     virtual void freeVertex(uint32_t vertexIndex) = 0;
00213 
00217     virtual uint32_t getClothingMaterial() const = 0;
00218 
00222     virtual void setClothingMaterial(uint32_t index) = 0;
00223 
00227     virtual void setOverrideMaterial(uint32_t submeshIndex, const char* overrideMaterialName) = 0;
00228 
00232     virtual void setVelocityCallback(ClothingVelocityCallback* callback) = 0;
00233 
00243     virtual void getPhysicalMeshPositions(void* buffer, uint32_t byteStride) = 0;
00244 
00254     virtual void getPhysicalMeshNormals(void* buffer, uint32_t byteStride) = 0;
00255 
00259     virtual float getMaximumSimulationBudget() const = 0;
00260 
00269     virtual uint32_t getNumSimulationVertices() const = 0;
00270 
00271     
00279     virtual const PxVec3* getSimulationPositions() = 0;
00280 
00288     virtual const PxVec3* getSimulationNormals() = 0;
00289 
00299     virtual bool getSimulationVelocities(PxVec3* velocities) = 0;
00300 
00308     virtual uint32_t getNumGraphicalVerticesActive(uint32_t submeshIndex) const = 0;
00309 
00315     virtual PxMat44 getRenderGlobalPose() const = 0;
00316 
00323     virtual const PxMat44* getCurrentBoneSkinningMatrices() const = 0;
00324 
00325 
00331     virtual bool isHalfPrecisionAllowed() const = 0;
00332 
00342     virtual void setHalfPrecision(bool isAllowed) = 0;
00343 
00344 
00348     virtual ClothingPlane* createCollisionPlane(const PxPlane& plane) = 0;
00349 
00353     virtual ClothingConvex* createCollisionConvex(ClothingPlane** planes, uint32_t numPlanes) = 0;
00354 
00358     virtual ClothingSphere* createCollisionSphere(const PxVec3& position, float radius) = 0;
00359 
00363     virtual ClothingCapsule* createCollisionCapsule(ClothingSphere& sphere1, ClothingSphere& sphere2) = 0;
00364 
00368     virtual ClothingTriangleMesh* createCollisionTriangleMesh() = 0;
00369 
00386     virtual ClothingRenderProxy* acquireRenderProxy() = 0;
00387 
00388 #if APEX_UE4
00389 
00390     virtual void simulate(PxF32 dt) = 0;
00391 #endif
00392 };
00393 
00394 PX_POP_PACK
00395 
00396 }
00397 } // namespace nvidia
00398 
00399 #endif // CLOTHING_ACTOR_H

Generated on Tue Aug 1 2017 22:43:52

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