From 3dfe2108cfab31ba3ee5527e217d0d8e99a51162 Mon Sep 17 00:00:00 2001 From: git perforce import user Date: Tue, 25 Oct 2016 12:29:14 -0600 Subject: Initial commit: PhysX 3.4.0 Update @ 21294896 APEX 1.4.0 Update @ 21275617 [CL 21300167] --- .../module/basicfs/include/NoiseFSAssetPreview.h | 106 +++++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 APEX_1.4/module/basicfs/include/NoiseFSAssetPreview.h (limited to 'APEX_1.4/module/basicfs/include/NoiseFSAssetPreview.h') diff --git a/APEX_1.4/module/basicfs/include/NoiseFSAssetPreview.h b/APEX_1.4/module/basicfs/include/NoiseFSAssetPreview.h new file mode 100644 index 00000000..5bac9d02 --- /dev/null +++ b/APEX_1.4/module/basicfs/include/NoiseFSAssetPreview.h @@ -0,0 +1,106 @@ +/* + * 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 __NOISE_ASSET_PREVIEW_H__ +#define __NOISE_ASSET_PREVIEW_H__ + +#include "ApexPreview.h" +#include "ApexRWLockable.h" +#include "ApexSDKIntl.h" +#include "NoiseFSPreview.h" +#include "RenderDebugInterface.h" + +namespace nvidia +{ +namespace basicfs +{ + +class NoiseFSAsset; + +/** +\brief Descriptor for a NoiseFS Preview Asset +*/ +class NoiseFSPreviewDesc +{ +public: + NoiseFSPreviewDesc() : + mPose(PxMat44()), + mPreviewDetail(APEX_NOISE::NOISE_DRAW_FULL_DETAIL) + { + mPose = PxMat44(PxIdentity); + }; + + /** + \brief The pose that translates from preview coordinates to world coordinates. + */ + PxMat44 mPose; + /** + \brief The detail options of the preview drawing + */ + uint32_t mPreviewDetail; +}; + +/* + APEX asset preview asset. + Preview. +*/ +class NoiseFSAssetPreview : public NoiseFSPreview, public ApexResource, public ApexPreview, public ApexRWLockable +{ +public: + APEX_RW_LOCKABLE_BOILERPLATE + + NoiseFSAssetPreview(const NoiseFSPreviewDesc& PreviewDesc, ApexSDK* myApexSDK, NoiseFSAsset* myAsset, AssetPreviewScene* previewScene); + void drawNoiseFSPreview(void); + void destroy(); + + void setPose(const PxMat44& pose); // Sets the preview instance's pose. This may include scaling. + const PxMat44 getPose() const; + + // from RenderDataProvider + void lockRenderResources(void); + void unlockRenderResources(void); + void updateRenderResources(bool rewriteBuffers = false, void* userRenderData = 0); + + // from Renderable.h + void dispatchRenderResources(UserRenderer& renderer); + PxBounds3 getBounds(void) const; + + // from ApexResource.h + void release(void); + +private: + + ~NoiseFSAssetPreview(); + PxMat44 mPose; // the pose for the preview rendering + ApexSDK* mApexSDK; // pointer to the APEX SDK + NoiseFSAsset* mAsset; // our parent NoiseFS Asset + RenderDebugInterface* mApexRenderDebug; // Pointer to the RenderLines class to draw the + AssetPreviewScene* mPreviewScene; + + // preview stuff + uint32_t mPreviewDetail; // the detail options of the preview drawing + + int32_t mDrawGroupShape; + +// void setHalfLengthDimensions(PxVec3 halfLenDim); + void setDetailLevel(uint32_t detail); + + void drawPreviewAssetInfo(); + void drawShape(/*uint32_t color*/); + void toggleDrawPreview(); + void setDrawGroupsPose(); + void drawInfoLine(uint32_t lineNum, const char* str); +}; + +} +} // namespace nvidia + +#endif // __NOISE_ASSET_PREVIEW_H__ -- cgit v1.2.3