diff options
| author | git perforce import user <a@b> | 2016-10-25 12:29:14 -0600 |
|---|---|---|
| committer | Sheikh Dawood Abdul Ajees <Sheikh Dawood Abdul Ajees> | 2016-10-25 18:56:37 -0500 |
| commit | 3dfe2108cfab31ba3ee5527e217d0d8e99a51162 (patch) | |
| tree | fa6485c169e50d7415a651bf838f5bcd0fd3bfbd /APEX_1.4/module/clothing/include/ClothingRenderProxyImpl.h | |
| download | physx-3.4-3dfe2108cfab31ba3ee5527e217d0d8e99a51162.tar.xz physx-3.4-3dfe2108cfab31ba3ee5527e217d0d8e99a51162.zip | |
Initial commit:
PhysX 3.4.0 Update @ 21294896
APEX 1.4.0 Update @ 21275617
[CL 21300167]
Diffstat (limited to 'APEX_1.4/module/clothing/include/ClothingRenderProxyImpl.h')
| -rw-r--r-- | APEX_1.4/module/clothing/include/ClothingRenderProxyImpl.h | 123 |
1 files changed, 123 insertions, 0 deletions
diff --git a/APEX_1.4/module/clothing/include/ClothingRenderProxyImpl.h b/APEX_1.4/module/clothing/include/ClothingRenderProxyImpl.h new file mode 100644 index 00000000..f5a42833 --- /dev/null +++ b/APEX_1.4/module/clothing/include/ClothingRenderProxyImpl.h @@ -0,0 +1,123 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + + +#ifndef CLOTHING_RENDER_PROXY_IMPL_H +#define CLOTHING_RENDER_PROXY_IMPL_H + +#include "ClothingRenderProxy.h" +#include "PxMat44.h" +#include "PxBounds3.h" +#include "PsHashMap.h" +#include "ApexString.h" +#include "ApexRWLockable.h" + +namespace nvidia +{ +namespace apex +{ +class RenderMeshActorIntl; +class RenderMeshAssetIntl; +} +namespace clothing +{ +class ClothingActorParam; +class ClothingScene; + + +class ClothingRenderProxyImpl : public ClothingRenderProxy, public UserAllocated, public ApexRWLockable +{ +public: + APEX_RW_LOCKABLE_BOILERPLATE + + ClothingRenderProxyImpl(RenderMeshAssetIntl* rma, bool useFallbackSkinning, bool useCustomVertexBuffer, const nvidia::HashMap<uint32_t, ApexSimpleString>& overrideMaterials, const PxVec3* morphTargetNewPositions, const uint32_t* morphTargetVertexOffsets, ClothingScene* scene); + virtual ~ClothingRenderProxyImpl(); + + // from ApexInterface + virtual void release(); + + // from Renderable + virtual void dispatchRenderResources(UserRenderer& api); + virtual PxBounds3 getBounds() const + { + return mBounds; + } + void setBounds(const PxBounds3& bounds) + { + mBounds = bounds; + } + + // from RenderDataProvider.h + virtual void lockRenderResources(); + virtual void unlockRenderResources(); + virtual void updateRenderResources(bool rewriteBuffers = false, void* userRenderData = 0); + + void setPose(const PxMat44& pose) + { + mPose = pose; + } + + // from ClothingRenderProxy.h + virtual bool hasSimulatedData() const; + + RenderMeshActorIntl* getRenderMeshActor(); + RenderMeshAssetIntl* getRenderMeshAsset(); + + bool usesFallbackSkinning() const + { + return mUseFallbackSkinning; + } + + bool usesCustomVertexBuffer() const + { + return renderingDataPosition != NULL; + } + + const PxVec3* getMorphTargetBuffer() const + { + return mMorphTargetNewPositions; + } + + void setOverrideMaterial(uint32_t i, const char* overrideMaterialName); + bool overrideMaterialsEqual(const nvidia::HashMap<uint32_t, ApexSimpleString>& overrideMaterials); + + uint32_t getTimeInPool() const; + void setTimeInPool(uint32_t time); + + void notifyAssetRelease(); + + PxVec3* renderingDataPosition; + PxVec3* renderingDataNormal; + PxVec4* renderingDataTangent; + +private: + RenderMeshActorIntl* createRenderMeshActor(RenderMeshAssetIntl* renderMeshAsset, ClothingActorParam* actorDesc); + + PxBounds3 mBounds; + PxMat44 mPose; + + RenderMeshActorIntl* mRenderMeshActor; + RenderMeshAssetIntl* mRenderMeshAsset; + + ClothingScene* mScene; + + bool mUseFallbackSkinning; + HashMap<uint32_t, ApexSimpleString> mOverrideMaterials; + const PxVec3* mMorphTargetNewPositions; // just to compare, only read it in constructor (it may be released) + + uint32_t mTimeInPool; + + Mutex mRMALock; +}; + +} +} // namespace nvidia + +#endif // CLOTHING_RENDER_PROXY_IMPL_H |