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] --- .../fieldsampler/include/FieldSamplerWrapper.h | 149 +++++++++++++++++++++ 1 file changed, 149 insertions(+) create mode 100644 APEX_1.4/module/fieldsampler/include/FieldSamplerWrapper.h (limited to 'APEX_1.4/module/fieldsampler/include/FieldSamplerWrapper.h') diff --git a/APEX_1.4/module/fieldsampler/include/FieldSamplerWrapper.h b/APEX_1.4/module/fieldsampler/include/FieldSamplerWrapper.h new file mode 100644 index 00000000..4eebc10b --- /dev/null +++ b/APEX_1.4/module/fieldsampler/include/FieldSamplerWrapper.h @@ -0,0 +1,149 @@ +/* + * 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 __FIELD_SAMPLER_WRAPPER_H__ +#define __FIELD_SAMPLER_WRAPPER_H__ + +#include "Apex.h" +#include "ApexSDKHelpers.h" +#include "ApexActor.h" +#include "FieldSamplerIntl.h" + +#if APEX_CUDA_SUPPORT +#include "ApexCudaWrapper.h" +#endif + +#include "FieldSamplerSceneWrapper.h" +#include "FieldSamplerCommon.h" + +namespace nvidia +{ +namespace fieldsampler +{ + +class FieldSamplerManager; + +class FieldBoundaryWrapper; + +class FieldSamplerWrapper : public ApexResourceInterface, public ApexResource +{ +public: + // ApexResourceInterface methods + void release(); + void setListIndex(ResourceList& list, uint32_t index) + { + m_listIndex = index; + m_list = &list; + } + uint32_t getListIndex() const + { + return m_listIndex; + } + + FieldSamplerWrapper(ResourceList& list, FieldSamplerManager* manager, FieldSamplerIntl* fieldSampler, const FieldSamplerDescIntl& fieldSamplerDesc, FieldSamplerSceneWrapper* fieldSamplerSceneWrapper); + + virtual void update(); + + PX_INLINE FieldSamplerIntl* getInternalFieldSampler() const + { + return mFieldSampler; + } + PX_INLINE const FieldSamplerDescIntl& getInternalFieldSamplerDesc() const + { + return mFieldSamplerDesc; + } + PX_INLINE FieldSamplerSceneWrapper* getFieldSamplerSceneWrapper() const + { + return mSceneWrapper; + } + + bool addFieldBoundary(FieldBoundaryWrapper* wrapper); + bool removeFieldBoundary(FieldBoundaryWrapper* wrapper); + + uint32_t getFieldBoundaryCount() const + { + return mFieldBoundaryInfoArray.size(); + } + FieldBoundaryWrapper* getFieldBoundaryWrapper(uint32_t index) const + { + return mFieldBoundaryInfoArray[index]->getFieldBoundaryWrapper(); + } + + PX_INLINE const FieldShapeDescIntl& getInternalFieldSamplerShape() const + { + return mFieldSamplerShape; + } + PX_INLINE bool isFieldSamplerChanged() const + { + return mFieldSamplerShapeChanged; + } + PX_INLINE bool isEnabled() const + { + return mIsEnabled; + } + PX_INLINE bool isEnabledChanged() const + { + return (mIsEnabled != mIsEnabledLast); + } + +protected: + FieldSamplerManager* mManager; + FieldSamplerIntl* mFieldSampler; + FieldSamplerDescIntl mFieldSamplerDesc; + + FieldShapeDescIntl mFieldSamplerShape; + bool mFieldSamplerShapeChanged; + + FieldSamplerSceneWrapper* mSceneWrapper; + uint32_t mQueryRefCount; + + nvidia::Array mFieldBoundaryInfoArray; + bool mFieldBoundaryInfoArrayChanged; + + bool mIsEnabled; + bool mIsEnabledLast; + + friend class FieldSamplerManager; +}; + + +class FieldSamplerWrapperCPU : public FieldSamplerWrapper +{ +public: + FieldSamplerWrapperCPU(ResourceList& list, FieldSamplerManager* manager, FieldSamplerIntl* fieldSampler, const FieldSamplerDescIntl& fieldSamplerDesc, FieldSamplerSceneWrapper* fieldSamplerSceneWrapper); + +private: +}; + +#if APEX_CUDA_SUPPORT +class FieldSamplerWrapperGPU : public FieldSamplerWrapperCPU +{ +public: + FieldSamplerWrapperGPU(ResourceList& list, FieldSamplerManager* manager, FieldSamplerIntl* fieldSampler, const FieldSamplerDescIntl& fieldSamplerDesc, FieldSamplerSceneWrapper* fieldSamplerSceneWrapper); + + virtual void update(); + + PX_INLINE InplaceHandle getParamsHandle() const + { + PX_ASSERT(mFieldSamplerParamsHandle.isNull() == false); + return mFieldSamplerParamsHandle; + } + +private: + ApexCudaConstMemGroup mConstMemGroup; + InplaceHandle mFieldSamplerParamsHandle; +}; +#endif + +} +} // end namespace nvidia::apex + +#endif -- cgit v1.2.3