diff options
| author | sschirm <[email protected]> | 2016-12-23 14:20:36 +0100 |
|---|---|---|
| committer | sschirm <[email protected]> | 2016-12-23 14:56:17 +0100 |
| commit | ef6937e69e8ee3f409cf9d460d5ad300a65d5924 (patch) | |
| tree | 710426e8daa605551ce3f34b581897011101c30f /APEX_1.4/module/pxparticleios/include | |
| parent | Initial commit: (diff) | |
| download | physx-3.4-ef6937e69e8ee3f409cf9d460d5ad300a65d5924.tar.xz physx-3.4-ef6937e69e8ee3f409cf9d460d5ad300a65d5924.zip | |
PhysX 3.4 / APEX 1.4 release candidate @21506124
Diffstat (limited to 'APEX_1.4/module/pxparticleios/include')
16 files changed, 0 insertions, 3043 deletions
diff --git a/APEX_1.4/module/pxparticleios/include/ModuleEventDefs.h b/APEX_1.4/module/pxparticleios/include/ModuleEventDefs.h deleted file mode 100644 index c04700f7..00000000 --- a/APEX_1.4/module/pxparticleios/include/ModuleEventDefs.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * 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. - */ - - -// This file is used to define a list of AgPerfMon events. -// -// This file is included exclusively by AgPerfMonEventSrcAPI.h -// and by AgPerfMonEventSrcAPI.cpp, for the purpose of building -// an enumeration (enum xx) and an array of strings () -// that contain the list of events. -// -// This file should only contain event definitions, using the -// DEFINE_EVENT macro. E.g.: -// -// DEFINE_EVENT(sample_name_1) -// DEFINE_EVENT(sample_name_2) -// DEFINE_EVENT(sample_name_3) - -DEFINE_EVENT(ParticleIosSceneFetchResults) -DEFINE_EVENT(ParticleIosCreateObjects) -DEFINE_EVENT(ParticleIosFetchResults) - - diff --git a/APEX_1.4/module/pxparticleios/include/ModuleParticleIosImpl.h b/APEX_1.4/module/pxparticleios/include/ModuleParticleIosImpl.h deleted file mode 100644 index 8ed0600a..00000000 --- a/APEX_1.4/module/pxparticleios/include/ModuleParticleIosImpl.h +++ /dev/null @@ -1,141 +0,0 @@ -/* - * 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 __MODULE_PARTICLEIOS_IMPL_H__ -#define __MODULE_PARTICLEIOS_IMPL_H__ - -#include "Apex.h" -#include "ModuleParticleIos.h" -#include "ApexSDKIntl.h" -#include "ModuleBase.h" -#include "ModuleIntl.h" -#include "ResourceProviderIntl.h" -#include "ApexSharedUtils.h" -#include "ApexSDKHelpers.h" -#include "ModulePerfScope.h" -#include "ApexAuthorableObject.h" -#include "ParticleIosAssetImpl.h" -#include "ModuleParticleIosRegistration.h" -#include "ApexRWLockable.h" - -namespace nvidia -{ -namespace apex -{ -class ModuleIofxIntl; -class ModuleFieldSamplerIntl; -class ParticleIosActor; -} -namespace pxparticleios -{ - -class ParticleIosScene; - - -/** -\brief ModuleBase descriptor for ParticleIOS module -*/ -class ModuleParticleIosDesc : public ApexDesc -{ -public: - - /** - \brief constructor sets to default. - */ - PX_INLINE ModuleParticleIosDesc() : ApexDesc() - { - init(); - } - - /** - \brief sets members to default values. - */ - PX_INLINE void setToDefault() - { - ApexDesc::setToDefault(); - init(); - } - - /** - \brief checks if this is a valid descriptor. - */ - PX_INLINE bool isValid() const - { - bool retVal = ApexDesc::isValid(); - return retVal; - } - -private: - - PX_INLINE void init() - { - } -}; - -class ModuleParticleIosImpl : public ModuleParticleIos, public ModuleIntl, public ModuleBase, public ApexRWLockable -{ -public: - APEX_RW_LOCKABLE_BOILERPLATE - - ModuleParticleIosImpl(ApexSDKIntl* sdk); - ~ModuleParticleIosImpl(); - - void init(const ModuleParticleIosDesc& desc); - - // base class methods - void init(NvParameterized::Interface&); - NvParameterized::Interface* getDefaultModuleDesc(); - void release() - { - ModuleBase::release(); - } - void destroy(); - const char* getName() const - { - READ_ZONE(); - return ModuleBase::getName(); - } - - //ParticleIosActor * getApexActor( Scene* scene, AuthObjTypeID type ) const; - ApexActor* getApexActor(Actor* nxactor, AuthObjTypeID type) const; - - ModuleSceneIntl* createInternalModuleScene(SceneIntl&, RenderDebugInterface*); - void releaseModuleSceneIntl(ModuleSceneIntl&); - uint32_t forceLoadAssets(); - AuthObjTypeID getModuleID() const; - RenderableIterator* createRenderableIterator(const Scene&); - - virtual const char* getParticleIosTypeName(); - - ParticleIosScene* getParticleIosScene(const Scene& scene); - const ParticleIosScene* getParticleIosScene(const Scene& scene) const; - - ModuleIofxIntl* getInternalModuleIofx(); - ModuleFieldSamplerIntl* getInternalModuleFieldSampler(); - -protected: - - ResourceList mParticleIosSceneList; - ResourceList mAuthorableObjects; - - friend class ParticleIosScene; -private: - - ParticleIosModuleParameters* mModuleParams; - - ModuleIofxIntl* mIofxModule; - ModuleFieldSamplerIntl* mFieldSamplerModule; -}; - -} -} // namespace nvidia - -#endif // __MODULE_PARTICLEIOS_IMPL_H__ diff --git a/APEX_1.4/module/pxparticleios/include/ModulePerfScope.h b/APEX_1.4/module/pxparticleios/include/ModulePerfScope.h deleted file mode 100644 index 5dc8faa0..00000000 --- a/APEX_1.4/module/pxparticleios/include/ModulePerfScope.h +++ /dev/null @@ -1,18 +0,0 @@ -/* - * 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 __MODULE_PERF_SCOPE_H___ -#define __MODULE_PERF_SCOPE_H___ - -#define MODULE_NAMESPACE pxparticleios -#include "ModuleProfileCommon.h" - -#endif
\ No newline at end of file diff --git a/APEX_1.4/module/pxparticleios/include/ParticleIosActorCPU.h b/APEX_1.4/module/pxparticleios/include/ParticleIosActorCPU.h deleted file mode 100644 index 4f924875..00000000 --- a/APEX_1.4/module/pxparticleios/include/ParticleIosActorCPU.h +++ /dev/null @@ -1,104 +0,0 @@ -/* - * 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 __PARTICLE_IOS_ACTOR_CPU_H__ -#define __PARTICLE_IOS_ACTOR_CPU_H__ - -#include "Apex.h" - -#include "ParticleIosActorImpl.h" -#include "ParticleIosAssetImpl.h" -#include "InstancedObjectSimulationIntl.h" -#include "ParticleIosScene.h" -#include "ApexActor.h" -#include "ApexContext.h" -#include "ApexFIFO.h" - -#include "PxTask.h" - -namespace nvidia -{ - -namespace iofx -{ -class RenderVolume; -class IofxAsset; -} - -namespace pxparticleios -{ - -class ParticleIosActorCPU : public ParticleIosActorImpl -{ -public: - APEX_RW_LOCKABLE_BOILERPLATE - - ParticleIosActorCPU(ResourceList&, ParticleIosAssetImpl&, ParticleIosScene&, IofxAsset&); - ~ParticleIosActorCPU(); - - virtual PxTaskID submitTasks(PxTaskManager* tm); - virtual void setTaskDependencies(PxTaskID taskStartAfterID, PxTaskID taskFinishBeforeID); - -private: - /* Internal utility functions */ - void simulateParticles(); - - static const uint32_t HISTOGRAM_BIN_COUNT = 1024; - uint32_t computeHistogram(uint32_t dataCount, float dataMin, float dataMax, uint32_t& bound); - - /* particle data (output to the IOFX actors, and some state) */ - - struct NewParticleData - { - uint32_t destIndex; - PxVec3 position; - PxVec3 velocity; - }; - physx::Array<uint32_t> mNewIndices; - physx::Array<uint32_t> mRemovedParticleList; - physx::Array<NewParticleData> mAddedParticleList; - physx::PxParticleExt::IndexPool* mIndexPool; - - /* Field sampler update velocity */ - physx::Array<uint32_t> mUpdateIndexBuffer; - physx::Array<PxVec3> mUpdateVelocityBuffer; - - class SimulateTask : public PxTask - { - public: - SimulateTask(ParticleIosActorCPU& actor) : mActor(actor) {} - - const char* getName() const - { - return "ParticleIosActorCPU::SimulateTask"; - } - void run() - { - mActor.simulateParticles(); - } - - protected: - ParticleIosActorCPU& mActor; - - private: - SimulateTask& operator=(const SimulateTask&); - }; - SimulateTask mSimulateTask; - - nvidia::apex::ApexCpuInplaceStorage mSimulationStorage; - - friend class ParticleIosAssetImpl; -}; - -} -} // namespace nvidia - -#endif // __PARTICLE_IOS_ACTOR_CPU_H__ diff --git a/APEX_1.4/module/pxparticleios/include/ParticleIosActorGPU.h b/APEX_1.4/module/pxparticleios/include/ParticleIosActorGPU.h deleted file mode 100644 index b7339c46..00000000 --- a/APEX_1.4/module/pxparticleios/include/ParticleIosActorGPU.h +++ /dev/null @@ -1,131 +0,0 @@ -/* - * 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 __PARTICLE_IOS_ACTOR_GPU_H__ -#define __PARTICLE_IOS_ACTOR_GPU_H__ - -#include "Apex.h" - -#include "ParticleIosActorImpl.h" -#include "ParticleIosAssetImpl.h" -#include "InstancedObjectSimulationIntl.h" -#include "ParticleIosScene.h" -#include "ApexActor.h" -#include "ApexContext.h" -#include "ApexFIFO.h" -#include "FieldSamplerQueryIntl.h" - -#include "PxGpuTask.h" - -namespace nvidia -{ - -namespace iofx -{ -class IofxActor; -class RenderVolume; -} - -namespace pxparticleios -{ - -class ParticleIosActorGPU; - -class ParticleIosActorGPU : public ParticleIosActorImpl -{ -public: - ParticleIosActorGPU(ResourceList&, ParticleIosAssetImpl&, ParticleIosScene&, IofxAsset&); - ~ParticleIosActorGPU(); - - virtual PxTaskID submitTasks(PxTaskManager* tm); - virtual void setTaskDependencies(PxTaskID taskStartAfterID, PxTaskID taskFinishBeforeID); - virtual void fetchResults(); - -private: - bool launch(CUstream stream, int kernelIndex); - void trigger(); - -#if APEX_CUDA_SUPPORT - CUevent mCuSyncEvent; - PxGpuCopyDescQueue mCopyQueue; -#endif - - ApexMirroredArray<uint32_t> mHoleScanSum; - ApexMirroredArray<uint32_t> mMoveIndices; - - ApexMirroredArray<uint32_t> mTmpReduce; - ApexMirroredArray<uint32_t> mTmpHistogram; - ApexMirroredArray<uint32_t> mTmpScan; - ApexMirroredArray<uint32_t> mTmpScan1; - - ApexMirroredArray<uint32_t> mTmpOutput; // 0:STATUS_LASTACTIVECOUNT, ... - ApexMirroredArray<uint32_t> mTmpBoundParams; // min, max - - class LaunchTask : public PxGpuTask - { - public: - LaunchTask(ParticleIosActorGPU& actor) : mActor(actor) {} - const char* getName() const - { - return "ParticleIosActorGPU::LaunchTask"; - } - void run() - { - PX_ALWAYS_ASSERT(); - } - bool launchInstance(CUstream stream, int kernelIndex) - { - return mActor.launch(stream, kernelIndex); - } - PxGpuTaskHint::Enum getTaskHint() const - { - return PxGpuTaskHint::Kernel; - } - - protected: - ParticleIosActorGPU& mActor; - - private: - LaunchTask& operator=(const LaunchTask&); - }; - class TriggerTask : public PxTask - { - public: - TriggerTask(ParticleIosActorGPU& actor) : mActor(actor) {} - - const char* getName() const - { - return "ParticleIosActorGPU::TriggerTask"; - } - void run() - { - mActor.trigger(); - } - - protected: - ParticleIosActorGPU& mActor; - - private: - TriggerTask& operator=(const TriggerTask&); - }; - - - static PX_CUDA_CALLABLE PX_INLINE PxMat44 inverse(const PxMat44& in); - static float distance(PxVec4 a, PxVec4 b); - - LaunchTask mLaunchTask; - TriggerTask mTriggerTask; -}; - -} -} // namespace nvidia - -#endif // __PARTICLE_IOS_ACTOR_GPU_H__ diff --git a/APEX_1.4/module/pxparticleios/include/ParticleIosActorImpl.h b/APEX_1.4/module/pxparticleios/include/ParticleIosActorImpl.h deleted file mode 100644 index 51d52341..00000000 --- a/APEX_1.4/module/pxparticleios/include/ParticleIosActorImpl.h +++ /dev/null @@ -1,321 +0,0 @@ -/* - * 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 __PARTICLE_IOS_ACTOR_IMPL_H__ -#define __PARTICLE_IOS_ACTOR_IMPL_H__ - -#include "Apex.h" - -#include "ParticleIosActor.h" -#include "iofx/IofxActor.h" -#include "ParticleIosAssetImpl.h" -#include "InstancedObjectSimulationIntl.h" -#include "ParticleIosScene.h" -#include "ApexActor.h" -#include "ApexContext.h" -#include "ApexFIFO.h" -#include "ParticleIosCommonCode.h" -#include "InplaceStorage.h" -#include "ApexMirroredArray.h" -#include "PxParticleExt.h" -#include "ApexRWLockable.h" - -namespace nvidia -{ -namespace apex -{ -class FieldSamplerQueryIntl; -class FieldSamplerCallbackIntl; -} -namespace pxparticleios -{ - -/* Class for managing the interactions with each emitter */ -class ParticleParticleInjector : public IosInjectorIntl, public ApexResourceInterface, public ApexResource, public ApexRWLockable -{ -public: - APEX_RW_LOCKABLE_BOILERPLATE - - void setPreferredRenderVolume(RenderVolume* volume); - float getLeastBenefitValue() const - { - return 0.0f; - } - bool isBacklogged() const - { - return false; - } - - void createObjects(uint32_t count, const IosNewObject* createList); -#if APEX_CUDA_SUPPORT - void createObjects(ApexMirroredArray<const IosNewObject>& createArray); -#endif - - void setLODWeights(float maxDistance, float distanceWeight, float speedWeight, float lifeWeight, float separationWeight, float bias); - - PxTaskID getCompletionTaskID() const; - - void release(); - void destroy(); - - // ApexResourceInterface methods - void setListIndex(ResourceList& list, uint32_t index); - - uint32_t getListIndex() const - { - return m_listIndex; - } - - virtual void setPhysXScene(PxScene*) {} - virtual PxScene* getPhysXScene() const - { - return NULL; - } - - void assignSimParticlesCount(uint32_t input) - { - mSimulatedParticlesCount = input; - } - - virtual uint32_t getSimParticlesCount() const - { - return mSimulatedParticlesCount; - } - - virtual uint32_t getActivePaticleCount() const; - - virtual void setObjectScale(float objectScale); - -protected: - ParticleIosActorImpl* mIosActor; - IofxManagerClientIntl* mIofxClient; - RenderVolume* mVolume; - physx::Array<uint16_t> mRandomActorClassIDs; - uint32_t mLastRandomID; - uint16_t mVolumeID; - - uint32_t mInjectorID; - uint32_t mSimulatedParticlesCount; - - - /* insertion buffer */ - ApexFIFO<IosNewObject> mInjectedParticles; - - ParticleParticleInjector(ResourceList& list, ParticleIosActorImpl& actor, uint32_t injectorID); - ~ParticleParticleInjector() {} - - void init(IofxAsset* iofxAsset); - - friend class ParticleIosActorImpl; -}; - - -class ParticleIosActorImpl : public InstancedObjectSimulationIntl, - public ParticleIosActor, - public ApexResourceInterface, - public ApexResource, - public ApexRWLockable -{ -public: - APEX_RW_LOCKABLE_BOILERPLATE - - ParticleIosActorImpl(ResourceList& list, ParticleIosAssetImpl& asset, ParticleIosScene& scene, IofxAsset& iofxAsset, bool isDataOnDevice); - ~ParticleIosActorImpl(); - - // ApexInterface API - void release(); - void destroy(); - - // Actor API - void setPhysXScene(PxScene* s); - PxScene* getPhysXScene() const; - virtual void putInScene(PxScene* scene); - - Asset* getOwner() const - { - READ_ZONE(); - return (Asset*) mAsset; - } - - // ApexContext - void getLodRange(float& min, float& max, bool& intOnly) const; - float getActiveLod() const; - void forceLod(float lod); - /** - \brief Selectively enables/disables debug visualization of a specific APEX actor. Default value it true. - */ - virtual void setEnableDebugVisualization(bool state) - { - WRITE_ZONE(); - ApexActor::setEnableDebugVisualization(state); - } - - // ApexResourceInterface methods - void setListIndex(ResourceList& list, uint32_t index) - { - m_listIndex = index; - m_list = &list; - } - uint32_t getListIndex() const - { - return m_listIndex; - } - - // IOSIntl - float getObjectRadius() const - { - return getParticleRadius(); - } - float getObjectDensity() const - { - return 1.0f; - } // mAsset->getRestDensity(); } - - // ParticleIosActor - float getParticleRadius() const - { - return mAsset->getParticleRadius(); - } - //float getRestDensity() const { return mAsset->getRestDensity();} - uint32_t getParticleCount() const - { - return mParticleCount; - } - - PX_INLINE void setOnStartFSCallback(FieldSamplerCallbackIntl* callback) - { - if (mFieldSamplerQuery) - { - mFieldSamplerQuery->setOnStartCallback(callback); - } - } - PX_INLINE void setOnFinishIOFXCallback(IofxManagerCallbackIntl* callback) - { - if (mIofxMgr) - { - mIofxMgr->setOnFinishCallback(callback); - } - } - - const PxVec3* getRecentPositions(uint32_t& count, uint32_t& stride) const; - - void visualize(); - virtual PxTaskID submitTasks(PxTaskManager* tm) = 0; - virtual void setTaskDependencies(PxTaskID taskStartAfterID, PxTaskID taskFinishBeforeID) = 0; - virtual void fetchResults(); - - IosInjectorIntl* allocateInjector(IofxAsset* iofxAsset); - void releaseInjector(IosInjectorIntl&); - - virtual void setDensityOrigin(const PxVec3& v) - { - mDensityOrigin = v; - } - -protected: - virtual void removeFromScene(); - - void injectNewParticles(); - bool isParticleDescValid( const ParticleIosAssetParam* desc) const; - void initStorageGroups(InplaceStorage& storage); - - void setTaskDependencies(PxTaskID taskStartAfterID, PxTaskID taskFinishBeforeID, PxTask* iosTask, bool isDataOnDevice); - - ParticleIosAssetImpl* mAsset; - ParticleIosScene* mParticleIosScene; - bool mIsParticleSystem; // true:SimpleParticleSystemParams , false:FluidParticleSystemParams - PxActor* mParticleActor; - - IofxManagerIntl* mIofxMgr; - IosBufferDescIntl mBufDesc; - - ResourceList mInjectorList; - - physx::Array<IofxAsset*> mIofxAssets; - physx::Array<uint32_t> mIofxAssetRefs; - - PxVec3 mUp; - float mGravity; - float mTotalElapsedTime; //AM: People, methinks this will backfire eventually due to floating point precision loss! - - uint32_t mMaxParticleCount; - uint32_t mMaxTotalParticleCount; - - uint32_t mParticleCount; - uint32_t mParticleBudget; - - uint32_t mInjectedCount; - float mInjectedBenefitSum; - float mInjectedBenefitMin; - float mInjectedBenefitMax; - - uint32_t mLastActiveCount; - float mLastBenefitSum; - float mLastBenefitMin; - float mLastBenefitMax; - - ApexMirroredArray<float> mLifeSpan; - ApexMirroredArray<float> mLifeTime; - ApexMirroredArray<uint32_t> mInjector; - ApexMirroredArray<float> mBenefit; - ApexMirroredArray<uint32_t> mInjectorsCounters; - ApexMirroredArray<uint32_t> mInputIdToParticleIndex; - - ApexMirroredArray<float> mGridDensityGrid; - ApexMirroredArray<float> mGridDensityGridLowPass; - - // Only for use by the IOS Asset, the actor is unaware of this - bool mIsMesh; - - FieldSamplerQueryIntl* mFieldSamplerQuery; - ApexMirroredArray<PxVec4> mField; - - InplaceStorageGroup mSimulationStorageGroup; - - class InjectTask : public PxTask - { - public: - InjectTask(ParticleIosActorImpl& actor) : mActor(actor) {} - - const char* getName() const - { - return "ParticleIosActorImpl::InjectTask"; - } - void run() - { - mActor.injectNewParticles(); - } - - protected: - ParticleIosActorImpl& mActor; - - private: - InjectTask& operator=(const InjectTask&); - }; - InjectTask mInjectTask; - - // Particle Density Origin - PxVec3 mDensityOrigin; - PxMat44 mDensityDebugMatInv; - - GridDensityParams mGridDensityParams; - - FieldSamplerCallbackIntl* mOnStartCallback; - IofxManagerCallbackIntl* mOnFinishCallback; - - friend class ParticleIosAssetImpl; - friend class ParticleParticleInjector; -}; - -} -} // namespace nvidia - -#endif // __PARTICLE_IOS_ACTOR_IMPL_H__ diff --git a/APEX_1.4/module/pxparticleios/include/ParticleIosAssetImpl.h b/APEX_1.4/module/pxparticleios/include/ParticleIosAssetImpl.h deleted file mode 100644 index daea8d91..00000000 --- a/APEX_1.4/module/pxparticleios/include/ParticleIosAssetImpl.h +++ /dev/null @@ -1,332 +0,0 @@ -/* - * 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 PARTICLE_IOS_ASSET_IMPL_H -#define PARTICLE_IOS_ASSET_IMPL_H - -#include "Apex.h" -#include "iofx/IofxAsset.h" -#include "ParticleIosAsset.h" -#include "InstancedObjectSimulationIntl.h" -#include "ApexSDKHelpers.h" -#include "ApexAssetAuthoring.h" -#include "ApexString.h" -#include "ResourceProviderIntl.h" -#include "ApexAuthorableObject.h" -#include "ParticleIosAssetParam.h" -#include "ApexAssetTracker.h" -#include "ApexUsingNamespace.h" -#include "ApexRWLockable.h" -#include "ReadCheck.h" -#include "WriteCheck.h" -#include "ApexAuthorableObject.h" - -namespace nvidia -{ - -namespace iofx -{ -class IofxAsset; -} - -namespace pxparticleios -{ - -class ModuleParticleIosImpl; -class ParticleIosActorImpl; - - -/** -\brief Descriptor needed to create a ParticleIOS Actor -*/ -class ParticleIosActorDesc : public ApexDesc -{ -public: - ///Radius of a particle (overrides authered value) - float radius; - ///Density of a particle (overrides authered value) - float density; - - /** - \brief constructor sets to default. - */ - PX_INLINE ParticleIosActorDesc() : ApexDesc() - { - init(); - } - - /** - \brief sets members to default values. - */ - PX_INLINE void setToDefault() - { - ApexDesc::setToDefault(); - init(); - } - - /** - \brief checks if this is a valid descriptor. - */ - PX_INLINE bool isValid() const - { - if (!ApexDesc::isValid()) - { - return false; - } - - return true; - } - -private: - - PX_INLINE void init() - { - // authored values will be used where these default values remain - radius = 0.0f; - density = 0.0f; - } -}; - -class ParticleIosAssetImpl : public ParticleIosAsset, - public ApexResourceInterface, - public ApexResource, - public ApexRWLockable -{ - friend class ParticleIosAssetDummyAuthoring; -public: - APEX_RW_LOCKABLE_BOILERPLATE - - ParticleIosAssetImpl(ModuleParticleIosImpl*, ResourceList&, const char*); - ParticleIosAssetImpl(ModuleParticleIosImpl* module, ResourceList&, NvParameterized::Interface*, const char*); - ~ParticleIosAssetImpl(); - - // Asset - void release(); - const char* getName(void) const - { - return mName.c_str(); - } - AuthObjTypeID getObjTypeID() const - { - return mAssetTypeID; - } - const char* getObjTypeName() const - { - return getClassName(); - } - uint32_t forceLoadAssets(); - - Actor* createIosActor(Scene& scene, IofxAsset* iofxAsset); - void releaseIosActor(Actor&); - bool getSupportsDensity() const - { - READ_ZONE(); - return mParams->DensityBuffer; - } - bool isValidForActorCreation(const ::NvParameterized::Interface& /*actorParams*/, Scene& /*apexScene*/) const - { - return true; - } - - bool isDirty() const - { - return false; - } - - - // Private API for this module only - ParticleIosActorImpl* getIosActorInScene(Scene& scene, bool mesh) const; - - // ApexResourceInterface methods - void setListIndex(ResourceList& list, uint32_t index) - { - m_listIndex = index; - m_list = &list; - } - uint32_t getListIndex() const - { - return m_listIndex; - } - - float getParticleRadius() const - { - READ_ZONE(); - return mParams->particleRadius; - } - //float getRestDensity() const { return mParams->restDensity; } - float getMaxInjectedParticleCount() const - { - READ_ZONE(); - return mParams->maxInjectedParticleCount; - } - uint32_t getMaxParticleCount() const - { - READ_ZONE(); - return mParams->maxParticleCount; - } - const char* getParticleTypeClassName() const - { - return mParams->particleType->className(); - } - const ParticleIosAssetParam* getParticleDesc() const - { - return mParams; - } - float getParticleMass() const - { - READ_ZONE(); - return mParams->particleMass; - } - - const NvParameterized::Interface* getAssetNvParameterized() const - { - READ_ZONE(); - return mParams; - } - /** - * \brief Releases the ApexAsset but returns the NvParameterized::Interface and *ownership* to the caller. - */ - virtual NvParameterized::Interface* releaseAndReturnNvParameterizedInterface(void) - { - NvParameterized::Interface* ret = mParams; - mParams = NULL; - release(); - return ret; - } - - NvParameterized::Interface* getDefaultActorDesc() - { - READ_ZONE(); - APEX_INVALID_OPERATION("Not yet implemented!"); - return NULL; - } - - NvParameterized::Interface* getDefaultAssetPreviewDesc() - { - READ_ZONE(); - APEX_INVALID_OPERATION("Not yet implemented!"); - return NULL; - } - - virtual Actor* createApexActor(const NvParameterized::Interface& /*parms*/, Scene& /*apexScene*/) - { - WRITE_ZONE(); - APEX_INVALID_OPERATION("Not yet implemented!"); - return NULL; - } - - virtual AssetPreview* createApexAssetPreview(const NvParameterized::Interface& /*params*/, AssetPreviewScene* /*previewScene*/) - { - WRITE_ZONE(); - APEX_INVALID_OPERATION("Not yet implemented!"); - return NULL; - } - -protected: - virtual void destroy(); - - static AuthObjTypeID mAssetTypeID; - static const char* getClassName() - { - return PARTICLE_IOS_AUTHORING_TYPE_NAME; - } - - ResourceList mIosActorList; - - ModuleParticleIosImpl* mModule; - ApexSimpleString mName; - - ParticleIosAssetParam* mParams; - - friend class ModuleParticleIosImpl; - friend class ParticleIosActorImpl; - friend class ParticleIosActorCPU; - friend class ParticleIosActorGPU; - template <class T_Module, class T_Asset, class T_AssetAuthoring> friend class nvidia::apex::ApexAuthorableObject; - friend class ParticleIosAuthorableObject; -}; - -#ifndef WITHOUT_APEX_AUTHORING -class ParticleIosAssetAuthoringImpl : public ParticleIosAssetAuthoring, public ApexAssetAuthoring, public ParticleIosAssetImpl -{ -public: - APEX_RW_LOCKABLE_BOILERPLATE - - ParticleIosAssetAuthoringImpl(ModuleParticleIosImpl* module, ResourceList& list); - ParticleIosAssetAuthoringImpl(ModuleParticleIosImpl* module, ResourceList& list, const char* name); - ParticleIosAssetAuthoringImpl(ModuleParticleIosImpl* module, ResourceList& list, NvParameterized::Interface* params, const char* name); - - virtual void release(); - - const char* getName(void) const - { - READ_ZONE(); - return mName.c_str(); - } - const char* getObjTypeName() const - { - READ_ZONE(); - return ParticleIosAssetImpl::getClassName(); - } - virtual bool prepareForPlatform(nvidia::apex::PlatformTag) - { - WRITE_ZONE(); - APEX_INVALID_OPERATION("Not Implemented."); - return false; - } - void setToolString(const char* toolName, const char* toolVersion, uint32_t toolChangelist) - { - WRITE_ZONE(); - ApexAssetAuthoring::setToolString(toolName, toolVersion, toolChangelist); - } - - void setParticleRadius(float radius) - { - mParams->particleRadius = radius; - } - //void setRestDensity( float density ) { mParams->restDensity = density; } - void setMaxInjectedParticleCount(float count) - { - mParams->maxInjectedParticleCount = count; - } - void setMaxParticleCount(uint32_t count) - { - mParams->maxParticleCount = count; - } - void setParticleMass(float mass) - { - mParams->particleMass = mass; - } - - void setCollisionGroupName(const char* collisionGroupName); - void setCollisionGroupMaskName(const char* collisionGroupMaskName); - - NvParameterized::Interface* getNvParameterized() const - { - return (NvParameterized::Interface*)getAssetNvParameterized(); - } - /** - * \brief Releases the ApexAsset but returns the NvParameterized::Interface and *ownership* to the caller. - */ - virtual NvParameterized::Interface* releaseAndReturnNvParameterizedInterface(void) - { - NvParameterized::Interface* ret = mParams; - mParams = NULL; - release(); - return ret; - } -}; -#endif - -} -} // namespace nvidia - -#endif // PARTICLE_IOS_ASSET_IMPL_H diff --git a/APEX_1.4/module/pxparticleios/include/ParticleIosCommon.h b/APEX_1.4/module/pxparticleios/include/ParticleIosCommon.h deleted file mode 100644 index c63ac26d..00000000 --- a/APEX_1.4/module/pxparticleios/include/ParticleIosCommon.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - * 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 __PARTICLE_IOS_COMMON_H__ -#define __PARTICLE_IOS_COMMON_H__ - -#include "PxBounds3.h" -#include "PxVec3.h" -#include "InplaceTypes.h" - -const unsigned int INVALID_PARTICLE_INDEX = (unsigned int)-1; - -namespace nvidia -{ -namespace pxparticleios -{ - -//struct Px3InjectorParams -#define INPLACE_TYPE_STRUCT_NAME Px3InjectorParams -#define INPLACE_TYPE_STRUCT_FIELDS \ - INPLACE_TYPE_FIELD(float, mLODMaxDistance) \ - INPLACE_TYPE_FIELD(float, mLODDistanceWeight) \ - INPLACE_TYPE_FIELD(float, mLODSpeedWeight) \ - INPLACE_TYPE_FIELD(float, mLODLifeWeight) \ - INPLACE_TYPE_FIELD(float, mLODBias) \ - INPLACE_TYPE_FIELD(uint32_t, mLocalIndex) -#include INPLACE_TYPE_BUILD() - -typedef InplaceArray<Px3InjectorParams> InjectorParamsArray; - - -struct GridDensityParams -{ - bool Enabled; - float GridSize; - uint32_t GridMaxCellCount; - uint32_t GridResolution; - PxVec3 DensityOrigin; - GridDensityParams(): Enabled(false) {} -}; - -struct GridDensityFrustumParams -{ - float nearDimX; - float farDimX; - float nearDimY; - float farDimY; - float dimZ; -}; - -} -} // namespace nvidia - -#endif diff --git a/APEX_1.4/module/pxparticleios/include/ParticleIosCommonCode.h b/APEX_1.4/module/pxparticleios/include/ParticleIosCommonCode.h deleted file mode 100644 index 86278a0f..00000000 --- a/APEX_1.4/module/pxparticleios/include/ParticleIosCommonCode.h +++ /dev/null @@ -1,288 +0,0 @@ -/* - * 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 __PARTICLE_IOS_COMMON_CODE_H__ -#define __PARTICLE_IOS_COMMON_CODE_H__ - -#include "ParticleIosCommon.h" - - -namespace nvidia -{ -namespace pxparticleios -{ - -#ifdef __CUDACC__ - -#define SIM_FETCH(name, idx) tex1Dfetch(KERNEL_TEX_REF(name), idx) -#define SIM_FLOAT4 float4 -#define SIM_INT_AS_FLOAT(x) *(const float*)(&x) -#define SIM_INJECTOR_ARRAY const InjectorParamsArray& -#define SIM_FETCH_INJECTOR(injectorArray, injParams, injector) injectorArray.fetchElem(INPLACE_STORAGE_ARGS_VAL, injParams, injector) - -PX_CUDA_CALLABLE PX_INLINE float splitFloat4(PxVec3& v3, const SIM_FLOAT4& f4) -{ - v3.x = f4.x; - v3.y = f4.y; - v3.z = f4.z; - return f4.w; -} -PX_CUDA_CALLABLE PX_INLINE SIM_FLOAT4 combineFloat4(const PxVec3& v3, float w) -{ - return make_float4(v3.x, v3.y, v3.z, w); -} - -struct PxInternalParticleFlagGpu -{ - enum Enum - { - //reserved (1<<0), - //reserved (1<<1), - //reserved (1<<2), - //reserved (1<<3), - //reserved (1<<4), - //reserved (1<<5), - eCUDA_NOTIFY_CREATE = (1 << 6), - eCUDA_NOTIFY_SET_POSITION = (1 << 7), - }; -}; -struct PxParticleFlag -{ - enum Enum - { - eVALID = (1 << 0), - eCOLLISION_WITH_STATIC = (1 << 1), - eCOLLISION_WITH_DYNAMIC = (1 << 2), - eCOLLISION_WITH_DRAIN = (1 << 3), - eSPATIAL_DATA_STRUCTURE_OVERFLOW = (1 << 4), - }; -}; -struct PxParticleFlagGpu -{ - uint16_t api; // PxParticleFlag - uint16_t low; // PxInternalParticleFlagGpu -}; - -#else - -#define SIM_FETCH(name, idx) mem##name[idx] -#define SIM_FLOAT4 PxVec4 -#define SIM_INT_AS_FLOAT(x) *(const float*)(&x) -#define SIM_INJECTOR_ARRAY const Px3InjectorParams* -#define SIM_FETCH_INJECTOR(injectorArray, injParams, injector) { injParams = injectorArray[injector]; } - -PX_INLINE float splitFloat4(PxVec3& v3, const SIM_FLOAT4& f4) -{ - v3 = f4.getXYZ(); - return f4.w; -} -PX_INLINE SIM_FLOAT4 combineFloat4(const PxVec3& v3, float w) -{ - return PxVec4(v3.x, v3.y, v3.z, w); -} - -#endif - - -APEX_CUDA_CALLABLE PX_INLINE float calcParticleBenefit( - const Px3InjectorParams& inj, const PxVec3& eyePos, - const PxVec3& pos, const PxVec3& vel, float life) -{ - float benefit = inj.mLODBias; - //distance term - float distance = (eyePos - pos).magnitude(); - benefit += inj.mLODDistanceWeight * (1.0f - PxMin(1.0f, distance / inj.mLODMaxDistance)); - //velocity term, TODO: clamp velocity - float velMag = vel.magnitude(); - benefit += inj.mLODSpeedWeight * velMag; - //life term - benefit += inj.mLODLifeWeight * life; - - return PxClamp(benefit, 0.0f, 1.0f); -} - - - -INPLACE_TEMPL_VA_ARGS_DEF(typename FieldAccessor) -APEX_CUDA_CALLABLE PX_INLINE float simulateParticle( - INPLACE_STORAGE_ARGS_DEF, SIM_INJECTOR_ARRAY injectorArray, - float deltaTime, - PxVec3 eyePos, - bool isNewParticle, - unsigned int srcIdx, - unsigned int dstIdx, - SIM_FLOAT4* memPositionMass, - SIM_FLOAT4* memVelocityLife, - SIM_FLOAT4* memCollisionNormalFlags, - uint32_t* memUserData, - IofxActorIDIntl* memIofxActorIDs, - float* memLifeSpan, - float* memLifeTime, - float* memDensity, - unsigned int* memInjector, - FieldAccessor& fieldAccessor, - unsigned int &injIndex, - const GridDensityParams params, -#ifdef __CUDACC__ - SIM_FLOAT4* memPxPosition, - SIM_FLOAT4* memPxVelocity, - SIM_FLOAT4* memPxCollision, - float* memPxDensity, - unsigned int* memNvFlags -#else - PxVec3& position, - PxVec3& velocity, - PxVec3& collisionNormal, - uint32_t& particleFlags, - float& density -#endif -) -{ - CPU_INPLACE_STORAGE_ARGS_UNUSED - PX_UNUSED(memCollisionNormalFlags); - PX_UNUSED(memDensity); - PX_UNUSED(fieldAccessor); - PX_UNUSED(params); - - float mass; -#ifdef __CUDACC__ - PxVec3 position; - PxVec3 velocity; - PxVec3 collisionNormal; - uint32_t particleFlags; - float density; -#endif - - //read - float lifeSpan = SIM_FETCH(LifeSpan, srcIdx); - unsigned int injector = SIM_FETCH(Injector, srcIdx); - IofxActorIDIntl iofxActorID = IofxActorIDIntl(SIM_FETCH(IofxActorIDs, srcIdx)); - - float lifeTime = lifeSpan; - if (!isNewParticle) - { - lifeTime = SIM_FETCH(LifeTime, srcIdx); - lifeTime = PxMax(lifeTime - deltaTime, 0.0f); - -#ifndef __CUDACC__ - mass = memPositionMass[srcIdx].w; - - /* Apply field sampler velocity */ - fieldAccessor(srcIdx, velocity); -#endif - } - else - { - collisionNormal = PxVec3(0.0f); - particleFlags = 0; - density = 0.0f; - splitFloat4(velocity, SIM_FETCH(VelocityLife, srcIdx)); -#ifdef __CUDACC__ - } - { -#endif - mass = splitFloat4(position, SIM_FETCH(PositionMass, srcIdx)); - } - -#ifdef __CUDACC__ - if (isNewParticle) - { - memPxPosition[dstIdx] = combineFloat4(position, 0); - memPxVelocity[dstIdx] = combineFloat4(velocity, 0); - - PxParticleFlagGpu flags; - flags.api = PxParticleFlag::eVALID; - flags.low = PxInternalParticleFlagGpu::eCUDA_NOTIFY_CREATE; - memNvFlags[dstIdx] = *((unsigned int*)&flags); - } - else - { - const SIM_FLOAT4 pxPosition = SIM_FETCH(PxPosition, srcIdx); - const SIM_FLOAT4 pxVelocity = SIM_FETCH(PxVelocity, srcIdx); - - if (memPxDensity) - { - density = SIM_FETCH(PxDensity, srcIdx); - memPxDensity[dstIdx] = density; - } - splitFloat4(position, pxPosition); - splitFloat4(velocity, pxVelocity); - - PxParticleFlagGpu flags; - *((uint32_t*)&flags) = SIM_FETCH(NvFlags, srcIdx); - - /* Apply field sampler velocity */ - fieldAccessor(srcIdx, velocity); - memPxVelocity[dstIdx] = combineFloat4(velocity, pxVelocity.w); - - splitFloat4(collisionNormal, SIM_FETCH(PxCollision, srcIdx)); - particleFlags = flags.api; - - if (dstIdx != srcIdx) - { - memPxPosition[dstIdx] = pxPosition; - - flags.low |= PxInternalParticleFlagGpu::eCUDA_NOTIFY_SET_POSITION; - memNvFlags[dstIdx] = *((uint32_t*)&flags); - } - } -#endif - - Px3InjectorParams injParams; - SIM_FETCH_INJECTOR(injectorArray, injParams, injector); - injIndex = injParams.mLocalIndex; - // injParams.mLODBias == FLT_MAX if injector was released! - // and IOFX returns IofxActorIDIntl::NO_VOLUME for homeless/dead particles - bool validActorID = (injParams.mLODBias < FLT_MAX) - && (isNewParticle || (iofxActorID.getVolumeID() != IofxActorIDIntl::NO_VOLUME)) - && position.isFinite() && velocity.isFinite(); - if (!validActorID) - { - iofxActorID.setActorClassID(IofxActorIDIntl::IPX_ACTOR); - injIndex = UINT32_MAX; - } - - //write - memLifeTime[dstIdx] = lifeTime; - memPositionMass[dstIdx] = combineFloat4(position, mass); - memVelocityLife[dstIdx] = combineFloat4(velocity, lifeTime / lifeSpan); - - const uint32_t collisionFlags = (particleFlags & uint32_t(PxParticleFlag::eCOLLISION_WITH_STATIC | PxParticleFlag::eCOLLISION_WITH_DYNAMIC)); - memCollisionNormalFlags[dstIdx] = combineFloat4(collisionNormal, SIM_INT_AS_FLOAT(collisionFlags)); - if (memDensity != 0) - { - memDensity[dstIdx] = density; - } - - if (!validActorID || dstIdx != srcIdx) - { - memIofxActorIDs[dstIdx] = iofxActorID; - } - if (dstIdx != srcIdx) - { - memLifeSpan[dstIdx] = lifeSpan; - memInjector[dstIdx] = injector; - - memUserData[dstIdx] = SIM_FETCH(UserData,srcIdx); - } - - float benefit = -FLT_MAX; - if (validActorID && lifeTime > 0.0f) - { - benefit = calcParticleBenefit(injParams, eyePos, position, velocity, lifeTime / lifeSpan); - } - return benefit; -} - -} -} // namespace nvidia - -#endif diff --git a/APEX_1.4/module/pxparticleios/include/ParticleIosScene.h b/APEX_1.4/module/pxparticleios/include/ParticleIosScene.h deleted file mode 100644 index f1a131dd..00000000 --- a/APEX_1.4/module/pxparticleios/include/ParticleIosScene.h +++ /dev/null @@ -1,287 +0,0 @@ -/* - * 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 __PARTICLE_IOS_SCENE_H__ -#define __PARTICLE_IOS_SCENE_H__ - -#include "Apex.h" -#include "ModuleParticleIos.h" -#include "ApexSDKIntl.h" -#include "ModuleIntl.h" -#include "ModuleParticleIosImpl.h" -#include "ApexSharedUtils.h" -#include "ApexSDKHelpers.h" -#include "ApexContext.h" -#include "ApexActor.h" -#include "ModulePerfScope.h" - -#include "PsTime.h" - -#include "DebugRenderParams.h" -#include "ParticleIosDebugRenderParams.h" - -#include "ParticleIosCommon.h" - -#include "FieldSamplerQueryIntl.h" - -#if APEX_CUDA_SUPPORT -#include "ApexCudaWrapper.h" -#include "ApexCuda.h" -#include "CudaModuleScene.h" - -#include "../cuda/include/common.h" - -#define SCENE_CUDA_OBJ(scene, name) static_cast<ParticleIosSceneGPU&>(scene).APEX_CUDA_OBJ_NAME(name) - -#endif - -namespace nvidia -{ -namespace apex -{ -class RenderDebugInterface; -class FieldSamplerManagerIntl; -} - -namespace pxparticleios -{ - -class ParticleIosInjectorStorage -{ -public: - virtual bool growInjectorStorage(uint32_t newSize) = 0; -}; -class ParticleIosInjectorAllocator -{ -public: - ParticleIosInjectorAllocator(ParticleIosInjectorStorage* storage) : mStorage(storage) - { - mFreeInjectorListStart = NULL_INJECTOR_INDEX; - mReleasedInjectorListStart = NULL_INJECTOR_INDEX; - } - - uint32_t allocateInjectorID(); - void releaseInjectorID(uint32_t); - void flushReleased(); - - static const uint32_t NULL_INJECTOR_INDEX = 0xFFFFFFFFu; - static const uint32_t USED_INJECTOR_INDEX = 0xFFFFFFFEu; - -private: - ParticleIosInjectorStorage* mStorage; - - physx::Array<uint32_t> mInjectorList; - uint32_t mFreeInjectorListStart; - uint32_t mReleasedInjectorListStart; -}; - - -class ParticleIosScene : public ModuleSceneIntl, public ApexContext, public ApexResourceInterface, public ApexResource, protected ParticleIosInjectorStorage -{ -public: - ParticleIosScene(ModuleParticleIosImpl& module, SceneIntl& scene, RenderDebugInterface* renderDebug, ResourceList& list); - ~ParticleIosScene(); - - /* ModuleSceneIntl */ - void release() - { - mModule->releaseModuleSceneIntl(*this); - } - - PxScene* getModulePhysXScene() const - { - return mPhysXScene; - } - void setModulePhysXScene(PxScene*); - PxScene* mPhysXScene; - - void visualize(); - - virtual Module* getModule() - { - return mModule; - } - - virtual SceneStats* getStats() - { - return 0; - } - - bool lockRenderResources() - { - renderLockAllActors(); // Lock options not implemented yet - return true; - } - - bool unlockRenderResources() - { - renderUnLockAllActors(); // Lock options not implemented yet - return true; - } - - /* ApexResourceInterface */ - uint32_t getListIndex() const - { - return m_listIndex; - } - void setListIndex(ResourceList& list, uint32_t index) - { - m_listIndex = index; - m_list = &list; - } - - virtual ParticleIosActorImpl* createIosActor(ResourceList& list, ParticleIosAssetImpl& asset, IofxAsset& iofxAsset) = 0; - - void submitTasks(float elapsedTime, float substepSize, uint32_t numSubSteps); - void setTaskDependencies(); - void fetchResults(); - - FieldSamplerManagerIntl* getInternalFieldSamplerManager(); - SceneIntl& getApexScene() const - { - return *mApexScene; - } - PX_INLINE ParticleIosInjectorAllocator& getInjectorAllocator() - { - return mInjectorAllocator; - } - virtual void fetchInjectorParams(uint32_t injectorID, Px3InjectorParams& injParams) = 0; - virtual void updateInjectorParams(uint32_t injectorID, const Px3InjectorParams& injParams) = 0; - -protected: - virtual void onSimulationStart() {} - virtual void onSimulationFinish() - { - mInjectorAllocator.flushReleased(); - } - - void destroy(); - float computeAABBDistanceSquared(const PxBounds3& aabb); - - ModuleParticleIosImpl* mModule; - SceneIntl* mApexScene; - - RenderDebugInterface* mRenderDebug; - float mSumBenefit; - - DebugRenderParams* mDebugRenderParams; - ParticleIosDebugRenderParams* mParticleIosDebugRenderParams; - - FieldSamplerManagerIntl* mFieldSamplerManager; - - ParticleIosInjectorAllocator mInjectorAllocator; - - friend class ParticleIosActorImpl; - friend class ParticleIosAssetImpl; - friend class ModuleParticleIosImpl; -}; - -class ParticleIosSceneCPU : public ParticleIosScene -{ - class TimerCallback : public FieldSamplerCallbackIntl, public IofxManagerCallbackIntl, public UserAllocated - { - shdfnd::Time mTimer; - float mMinTime, mMaxTime; - public: - TimerCallback() {} - void operator()(void* stream = NULL); - void reset(); - float getElapsedTime() const; - }; -public: - ParticleIosSceneCPU(ModuleParticleIosImpl& module, SceneIntl& scene, RenderDebugInterface* debugRender, ResourceList& list); - ~ParticleIosSceneCPU(); - - virtual ParticleIosActorImpl* createIosActor(ResourceList& list, ParticleIosAssetImpl& asset, IofxAsset& iofxAsset); - - virtual void fetchInjectorParams(uint32_t injectorID, Px3InjectorParams& injParams) - { - PX_ASSERT(injectorID < mInjectorParamsArray.size()); - injParams = mInjectorParamsArray[ injectorID ]; - } - virtual void updateInjectorParams(uint32_t injectorID, const Px3InjectorParams& injParams) - { - PX_ASSERT(injectorID < mInjectorParamsArray.size()); - mInjectorParamsArray[ injectorID ] = injParams; - } - - void fetchResults(); - -protected: - virtual bool growInjectorStorage(uint32_t newSize) - { - mInjectorParamsArray.resize(newSize); - return true; - } - -private: - physx::Array<Px3InjectorParams> mInjectorParamsArray; - TimerCallback mTimerCallback; - - friend class ParticleIosActorCPU; -}; - -#if APEX_CUDA_SUPPORT -class ParticleIosSceneGPU : public ParticleIosScene, public CudaModuleScene -{ - class EventCallback : public FieldSamplerCallbackIntl, public IofxManagerCallbackIntl, public UserAllocated - { - void* mEvent; - public: - EventCallback(); - void init(); - virtual ~EventCallback(); - void operator()(void* stream); - PX_INLINE void* getEvent() - { - return mEvent; - } - bool mIsCalled; - }; -public: - ParticleIosSceneGPU(ModuleParticleIosImpl& module, SceneIntl& scene, RenderDebugInterface* debugRender, ResourceList& list); - ~ParticleIosSceneGPU(); - - virtual ParticleIosActorImpl* createIosActor(ResourceList& list, ParticleIosAssetImpl& asset, IofxAsset& iofxAsset); - - virtual void fetchInjectorParams(uint32_t injectorID, Px3InjectorParams& injParams); - virtual void updateInjectorParams(uint32_t injectorID, const Px3InjectorParams& injParams); - - void fetchResults(); - - void* getHeadCudaObj() - { - return CudaModuleScene::getHeadCudaObj(); - } -//CUDA module objects -#include "../cuda/include/moduleList.h" - -protected: - virtual bool growInjectorStorage(uint32_t newSize); - - void onSimulationStart(); - -private: - ApexCudaConstMemGroup mInjectorConstMemGroup; - InplaceHandle<InjectorParamsArray> mInjectorParamsArrayHandle; - - EventCallback mOnSimulationStart; - physx::Array<EventCallback*> mOnStartCallbacks; - physx::Array<EventCallback*> mOnFinishCallbacks; - - friend class ParticleIosActorGPU; -}; -#endif - -} -} // namespace nvidia - -#endif // __PARTICLE_IOS_SCENE_H__ diff --git a/APEX_1.4/module/pxparticleios/include/autogen/FluidParticleSystemParams.h b/APEX_1.4/module/pxparticleios/include/autogen/FluidParticleSystemParams.h deleted file mode 100644 index 3644a323..00000000 --- a/APEX_1.4/module/pxparticleios/include/autogen/FluidParticleSystemParams.h +++ /dev/null @@ -1,232 +0,0 @@ -// This code contains NVIDIA Confidential Information and is disclosed to you -// under a form of NVIDIA software license agreement provided separately to you. -// -// Notice -// NVIDIA Corporation and its licensors retain all intellectual property and -// proprietary rights in and to this software and 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. -// -// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES -// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO -// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, -// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. -// -// Information and code furnished is believed to be accurate and reliable. -// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such -// information or for any infringement of patents or other rights of third parties that may -// result from its use. No license is granted by implication or otherwise under any patent -// or patent rights of NVIDIA Corporation. Details are subject to change without notice. -// This code supersedes and replaces all information previously supplied. -// NVIDIA Corporation products are not authorized for use as critical -// components in life support devices or systems without express written approval of -// NVIDIA Corporation. -// -// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. - -// This file was generated by NvParameterized/scripts/GenParameterized.pl - - -#ifndef HEADER_FluidParticleSystemParams_h -#define HEADER_FluidParticleSystemParams_h - -#include "NvParametersTypes.h" - -#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS -#include "nvparameterized/NvParameterized.h" -#include "nvparameterized/NvParameterizedTraits.h" -#include "NvParameters.h" -#include "NvTraitsInternal.h" -#endif - -namespace nvidia -{ -namespace pxparticleios -{ - -#if PX_VC -#pragma warning(push) -#pragma warning(disable: 4324) // structure was padded due to __declspec(align()) -#endif - -namespace FluidParticleSystemParamsNS -{ - - - -struct ParametersStruct -{ - - float restParticleDistance; - float stiffness; - float viscosity; - -}; - -static const uint32_t checksum[] = { 0x986c06bb, 0x7de711a7, 0xa8681094, 0x8ee8ef0b, }; - -} // namespace FluidParticleSystemParamsNS - -#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS -class FluidParticleSystemParams : public NvParameterized::NvParameters, public FluidParticleSystemParamsNS::ParametersStruct -{ -public: - FluidParticleSystemParams(NvParameterized::Traits* traits, void* buf = 0, int32_t* refCount = 0); - - virtual ~FluidParticleSystemParams(); - - virtual void destroy(); - - static const char* staticClassName(void) - { - return("FluidParticleSystemParams"); - } - - const char* className(void) const - { - return(staticClassName()); - } - - static const uint32_t ClassVersion = ((uint32_t)0 << 16) + (uint32_t)0; - - static uint32_t staticVersion(void) - { - return ClassVersion; - } - - uint32_t version(void) const - { - return(staticVersion()); - } - - static const uint32_t ClassAlignment = 8; - - static const uint32_t* staticChecksum(uint32_t& bits) - { - bits = 8 * sizeof(FluidParticleSystemParamsNS::checksum); - return FluidParticleSystemParamsNS::checksum; - } - - static void freeParameterDefinitionTable(NvParameterized::Traits* traits); - - const uint32_t* checksum(uint32_t& bits) const - { - return staticChecksum(bits); - } - - const FluidParticleSystemParamsNS::ParametersStruct& parameters(void) const - { - FluidParticleSystemParams* tmpThis = const_cast<FluidParticleSystemParams*>(this); - return *(static_cast<FluidParticleSystemParamsNS::ParametersStruct*>(tmpThis)); - } - - FluidParticleSystemParamsNS::ParametersStruct& parameters(void) - { - return *(static_cast<FluidParticleSystemParamsNS::ParametersStruct*>(this)); - } - - virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle) const; - virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle); - - void initDefaults(void); - -protected: - - virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void); - virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void) const; - - - virtual void getVarPtr(const NvParameterized::Handle& handle, void*& ptr, size_t& offset) const; - -private: - - void buildTree(void); - void initDynamicArrays(void); - void initStrings(void); - void initReferences(void); - void freeDynamicArrays(void); - void freeStrings(void); - void freeReferences(void); - - static bool mBuiltFlag; - static NvParameterized::MutexType mBuiltFlagMutex; -}; - -class FluidParticleSystemParamsFactory : public NvParameterized::Factory -{ - static const char* const vptr; - -public: - - virtual void freeParameterDefinitionTable(NvParameterized::Traits* traits) - { - FluidParticleSystemParams::freeParameterDefinitionTable(traits); - } - - virtual NvParameterized::Interface* create(NvParameterized::Traits* paramTraits) - { - // placement new on this class using mParameterizedTraits - - void* newPtr = paramTraits->alloc(sizeof(FluidParticleSystemParams), FluidParticleSystemParams::ClassAlignment); - if (!NvParameterized::IsAligned(newPtr, FluidParticleSystemParams::ClassAlignment)) - { - NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class FluidParticleSystemParams"); - paramTraits->free(newPtr); - return 0; - } - - memset(newPtr, 0, sizeof(FluidParticleSystemParams)); // always initialize memory allocated to zero for default values - return NV_PARAM_PLACEMENT_NEW(newPtr, FluidParticleSystemParams)(paramTraits); - } - - virtual NvParameterized::Interface* finish(NvParameterized::Traits* paramTraits, void* bufObj, void* bufStart, int32_t* refCount) - { - if (!NvParameterized::IsAligned(bufObj, FluidParticleSystemParams::ClassAlignment) - || !NvParameterized::IsAligned(bufStart, FluidParticleSystemParams::ClassAlignment)) - { - NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class FluidParticleSystemParams"); - return 0; - } - - // Init NvParameters-part - // We used to call empty constructor of FluidParticleSystemParams here - // but it may call default constructors of members and spoil the data - NV_PARAM_PLACEMENT_NEW(bufObj, NvParameterized::NvParameters)(paramTraits, bufStart, refCount); - - // Init vtable (everything else is already initialized) - *(const char**)bufObj = vptr; - - return (FluidParticleSystemParams*)bufObj; - } - - virtual const char* getClassName() - { - return (FluidParticleSystemParams::staticClassName()); - } - - virtual uint32_t getVersion() - { - return (FluidParticleSystemParams::staticVersion()); - } - - virtual uint32_t getAlignment() - { - return (FluidParticleSystemParams::ClassAlignment); - } - - virtual const uint32_t* getChecksum(uint32_t& bits) - { - return (FluidParticleSystemParams::staticChecksum(bits)); - } -}; -#endif // NV_PARAMETERIZED_ONLY_LAYOUTS - -} // namespace pxparticleios -} // namespace nvidia - -#if PX_VC -#pragma warning(pop) -#endif - -#endif diff --git a/APEX_1.4/module/pxparticleios/include/autogen/ModuleParticleIosRegistration.h b/APEX_1.4/module/pxparticleios/include/autogen/ModuleParticleIosRegistration.h deleted file mode 100644 index 0b61d5b6..00000000 --- a/APEX_1.4/module/pxparticleios/include/autogen/ModuleParticleIosRegistration.h +++ /dev/null @@ -1,126 +0,0 @@ -/* - * 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 MODULE_MODULEPARTICLEIOSREGISTRATIONH_H -#define MODULE_MODULEPARTICLEIOSREGISTRATIONH_H - -#include "PsAllocator.h" -#include "NvRegistrationsForTraitsBase.h" -#include "nvparameterized/NvParameterizedTraits.h" -#include "PxAssert.h" -#include <stdint.h> - -// INCLUDE GENERATED FACTORIES -#include "ParticleIosModuleParameters.h" -#include "ParticleIosAssetParam.h" -#include "SimpleParticleSystemParams.h" -#include "FluidParticleSystemParams.h" -#include "ParticleIosDebugRenderParams.h" - - -// INCLUDE GENERATED CONVERSION - - -namespace nvidia { -namespace pxparticleios { - - -class ModuleParticleIosRegistration : public NvParameterized::RegistrationsForTraitsBase -{ -public: - static void invokeRegistration(NvParameterized::Traits* parameterizedTraits) - { - if (parameterizedTraits) - { - ModuleParticleIosRegistration().registerAll(*parameterizedTraits); - } - } - - static void invokeUnregistration(NvParameterized::Traits* parameterizedTraits) - { - if (parameterizedTraits) - { - ModuleParticleIosRegistration().unregisterAll(*parameterizedTraits); - } - } - - void registerAvailableFactories(NvParameterized::Traits& parameterizedTraits) - { - ::NvParameterized::Factory* factoriesToRegister[] = { -// REGISTER GENERATED FACTORIES - new nvidia::pxparticleios::ParticleIosModuleParametersFactory(), - new nvidia::pxparticleios::ParticleIosAssetParamFactory(), - new nvidia::pxparticleios::SimpleParticleSystemParamsFactory(), - new nvidia::pxparticleios::FluidParticleSystemParamsFactory(), - new nvidia::pxparticleios::ParticleIosDebugRenderParamsFactory(), - - }; - - for (size_t i = 0; i < sizeof(factoriesToRegister)/sizeof(factoriesToRegister[0]); ++i) - { - parameterizedTraits.registerFactory(*factoriesToRegister[i]); - } - } - - virtual void registerAvailableConverters(NvParameterized::Traits& parameterizedTraits) - { -// REGISTER GENERATED CONVERSION -PX_UNUSED(parameterizedTraits); - - } - - void unregisterAvailableFactories(NvParameterized::Traits& parameterizedTraits) - { - struct FactoryDesc - { - const char* name; - uint32_t version; - }; - - ::NvParameterized::Factory* factoriesToUnregister[] = { -// UNREGISTER GENERATED FACTORIES - new nvidia::pxparticleios::ParticleIosModuleParametersFactory(), - new nvidia::pxparticleios::ParticleIosAssetParamFactory(), - new nvidia::pxparticleios::SimpleParticleSystemParamsFactory(), - new nvidia::pxparticleios::FluidParticleSystemParamsFactory(), - new nvidia::pxparticleios::ParticleIosDebugRenderParamsFactory(), - - }; - - for (size_t i = 0; i < sizeof(factoriesToUnregister)/sizeof(factoriesToUnregister[0]); ++i) - { - ::NvParameterized::Factory* removedFactory = parameterizedTraits.removeFactory(factoriesToUnregister[i]->getClassName(), factoriesToUnregister[i]->getVersion()); - if (!removedFactory) - { - PX_ASSERT_WITH_MESSAGE(0, "Factory can not be removed!"); - } - else - { - removedFactory->freeParameterDefinitionTable(¶meterizedTraits); - delete removedFactory; - delete factoriesToUnregister[i]; - } - } - } - - virtual void unregisterAvailableConverters(NvParameterized::Traits& parameterizedTraits) - { -// UNREGISTER GENERATED CONVERSION -PX_UNUSED(parameterizedTraits); - - } - -}; - - -} -} //nvidia::pxparticleios - -#endif diff --git a/APEX_1.4/module/pxparticleios/include/autogen/ParticleIosAssetParam.h b/APEX_1.4/module/pxparticleios/include/autogen/ParticleIosAssetParam.h deleted file mode 100644 index b0c021c7..00000000 --- a/APEX_1.4/module/pxparticleios/include/autogen/ParticleIosAssetParam.h +++ /dev/null @@ -1,272 +0,0 @@ -// This code contains NVIDIA Confidential Information and is disclosed to you -// under a form of NVIDIA software license agreement provided separately to you. -// -// Notice -// NVIDIA Corporation and its licensors retain all intellectual property and -// proprietary rights in and to this software and 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. -// -// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES -// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO -// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, -// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. -// -// Information and code furnished is believed to be accurate and reliable. -// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such -// information or for any infringement of patents or other rights of third parties that may -// result from its use. No license is granted by implication or otherwise under any patent -// or patent rights of NVIDIA Corporation. Details are subject to change without notice. -// This code supersedes and replaces all information previously supplied. -// NVIDIA Corporation products are not authorized for use as critical -// components in life support devices or systems without express written approval of -// NVIDIA Corporation. -// -// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. - -// This file was generated by NvParameterized/scripts/GenParameterized.pl - - -#ifndef HEADER_ParticleIosAssetParam_h -#define HEADER_ParticleIosAssetParam_h - -#include "NvParametersTypes.h" - -#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS -#include "nvparameterized/NvParameterized.h" -#include "nvparameterized/NvParameterizedTraits.h" -#include "NvParameters.h" -#include "NvTraitsInternal.h" -#endif - -namespace nvidia -{ -namespace pxparticleios -{ - -#if PX_VC -#pragma warning(push) -#pragma warning(disable: 4324) // structure was padded due to __declspec(align()) -#endif - -namespace ParticleIosAssetParamNS -{ - -struct ParticleToGridCouplingParams_Type; -struct GridToParticleCouplingParams_Type; - -struct ParticleToGridCouplingParams_Type -{ - float accelTimeConstant; - float decelTimeConstant; - float thresholdMultiplier; -}; -struct GridToParticleCouplingParams_Type -{ - float accelTimeConstant; - float decelTimeConstant; - float thresholdMultiplier; -}; - -struct ParametersStruct -{ - - NvParameterized::Interface* particleType; - uint32_t maxParticleCount; - float particleRadius; - float maxInjectedParticleCount; - float maxMotionDistance; - float contactOffset; - float restOffset; - float gridSize; - float damping; - physx::PxVec3 externalAcceleration; - physx::PxVec3 projectionPlaneNormal; - float projectionPlaneDistance; - float particleMass; - float restitution; - float dynamicFriction; - float staticFriction; - NvParameterized::DummyStringStruct simulationFilterData; - NvParameterized::DummyStringStruct fieldSamplerFilterData; - bool CollisionTwoway; - bool CollisionWithDynamicActors; - bool Enable; - bool ProjectToPlane; - bool PerParticleRestOffset; - bool PerParticleCollisionCacheHint; - bool DensityBuffer; - bool enableTemperatureBuffer; - bool enableCouplingOverride; - ParticleToGridCouplingParams_Type particleToGridCoupling; - GridToParticleCouplingParams_Type gridToParticleCoupling; - -}; - -static const uint32_t checksum[] = { 0x2fe48a73, 0x7f6aafee, 0x621cd7cd, 0x20a3c0e5, }; - -} // namespace ParticleIosAssetParamNS - -#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS -class ParticleIosAssetParam : public NvParameterized::NvParameters, public ParticleIosAssetParamNS::ParametersStruct -{ -public: - ParticleIosAssetParam(NvParameterized::Traits* traits, void* buf = 0, int32_t* refCount = 0); - - virtual ~ParticleIosAssetParam(); - - virtual void destroy(); - - static const char* staticClassName(void) - { - return("ParticleIosAssetParam"); - } - - const char* className(void) const - { - return(staticClassName()); - } - - static const uint32_t ClassVersion = ((uint32_t)0 << 16) + (uint32_t)4; - - static uint32_t staticVersion(void) - { - return ClassVersion; - } - - uint32_t version(void) const - { - return(staticVersion()); - } - - static const uint32_t ClassAlignment = 8; - - static const uint32_t* staticChecksum(uint32_t& bits) - { - bits = 8 * sizeof(ParticleIosAssetParamNS::checksum); - return ParticleIosAssetParamNS::checksum; - } - - static void freeParameterDefinitionTable(NvParameterized::Traits* traits); - - const uint32_t* checksum(uint32_t& bits) const - { - return staticChecksum(bits); - } - - const ParticleIosAssetParamNS::ParametersStruct& parameters(void) const - { - ParticleIosAssetParam* tmpThis = const_cast<ParticleIosAssetParam*>(this); - return *(static_cast<ParticleIosAssetParamNS::ParametersStruct*>(tmpThis)); - } - - ParticleIosAssetParamNS::ParametersStruct& parameters(void) - { - return *(static_cast<ParticleIosAssetParamNS::ParametersStruct*>(this)); - } - - virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle) const; - virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle); - - void initDefaults(void); - -protected: - - virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void); - virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void) const; - - - virtual void getVarPtr(const NvParameterized::Handle& handle, void*& ptr, size_t& offset) const; - -private: - - void buildTree(void); - void initDynamicArrays(void); - void initStrings(void); - void initReferences(void); - void freeDynamicArrays(void); - void freeStrings(void); - void freeReferences(void); - - static bool mBuiltFlag; - static NvParameterized::MutexType mBuiltFlagMutex; -}; - -class ParticleIosAssetParamFactory : public NvParameterized::Factory -{ - static const char* const vptr; - -public: - - virtual void freeParameterDefinitionTable(NvParameterized::Traits* traits) - { - ParticleIosAssetParam::freeParameterDefinitionTable(traits); - } - - virtual NvParameterized::Interface* create(NvParameterized::Traits* paramTraits) - { - // placement new on this class using mParameterizedTraits - - void* newPtr = paramTraits->alloc(sizeof(ParticleIosAssetParam), ParticleIosAssetParam::ClassAlignment); - if (!NvParameterized::IsAligned(newPtr, ParticleIosAssetParam::ClassAlignment)) - { - NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class ParticleIosAssetParam"); - paramTraits->free(newPtr); - return 0; - } - - memset(newPtr, 0, sizeof(ParticleIosAssetParam)); // always initialize memory allocated to zero for default values - return NV_PARAM_PLACEMENT_NEW(newPtr, ParticleIosAssetParam)(paramTraits); - } - - virtual NvParameterized::Interface* finish(NvParameterized::Traits* paramTraits, void* bufObj, void* bufStart, int32_t* refCount) - { - if (!NvParameterized::IsAligned(bufObj, ParticleIosAssetParam::ClassAlignment) - || !NvParameterized::IsAligned(bufStart, ParticleIosAssetParam::ClassAlignment)) - { - NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class ParticleIosAssetParam"); - return 0; - } - - // Init NvParameters-part - // We used to call empty constructor of ParticleIosAssetParam here - // but it may call default constructors of members and spoil the data - NV_PARAM_PLACEMENT_NEW(bufObj, NvParameterized::NvParameters)(paramTraits, bufStart, refCount); - - // Init vtable (everything else is already initialized) - *(const char**)bufObj = vptr; - - return (ParticleIosAssetParam*)bufObj; - } - - virtual const char* getClassName() - { - return (ParticleIosAssetParam::staticClassName()); - } - - virtual uint32_t getVersion() - { - return (ParticleIosAssetParam::staticVersion()); - } - - virtual uint32_t getAlignment() - { - return (ParticleIosAssetParam::ClassAlignment); - } - - virtual const uint32_t* getChecksum(uint32_t& bits) - { - return (ParticleIosAssetParam::staticChecksum(bits)); - } -}; -#endif // NV_PARAMETERIZED_ONLY_LAYOUTS - -} // namespace pxparticleios -} // namespace nvidia - -#if PX_VC -#pragma warning(pop) -#endif - -#endif diff --git a/APEX_1.4/module/pxparticleios/include/autogen/ParticleIosDebugRenderParams.h b/APEX_1.4/module/pxparticleios/include/autogen/ParticleIosDebugRenderParams.h deleted file mode 100644 index 5e223141..00000000 --- a/APEX_1.4/module/pxparticleios/include/autogen/ParticleIosDebugRenderParams.h +++ /dev/null @@ -1,231 +0,0 @@ -// This code contains NVIDIA Confidential Information and is disclosed to you -// under a form of NVIDIA software license agreement provided separately to you. -// -// Notice -// NVIDIA Corporation and its licensors retain all intellectual property and -// proprietary rights in and to this software and 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. -// -// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES -// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO -// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, -// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. -// -// Information and code furnished is believed to be accurate and reliable. -// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such -// information or for any infringement of patents or other rights of third parties that may -// result from its use. No license is granted by implication or otherwise under any patent -// or patent rights of NVIDIA Corporation. Details are subject to change without notice. -// This code supersedes and replaces all information previously supplied. -// NVIDIA Corporation products are not authorized for use as critical -// components in life support devices or systems without express written approval of -// NVIDIA Corporation. -// -// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. - -// This file was generated by NvParameterized/scripts/GenParameterized.pl - - -#ifndef HEADER_ParticleIosDebugRenderParams_h -#define HEADER_ParticleIosDebugRenderParams_h - -#include "NvParametersTypes.h" - -#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS -#include "nvparameterized/NvParameterized.h" -#include "nvparameterized/NvParameterizedTraits.h" -#include "NvParameters.h" -#include "NvTraitsInternal.h" -#endif - -namespace nvidia -{ -namespace pxparticleios -{ - -#if PX_VC -#pragma warning(push) -#pragma warning(disable: 4324) // structure was padded due to __declspec(align()) -#endif - -namespace ParticleIosDebugRenderParamsNS -{ - - - -struct ParametersStruct -{ - - bool VISUALIZE_PARTICLE_IOS_ACTOR; - bool VISUALIZE_PARTICLE_IOS_GRID_DENSITY; - -}; - -static const uint32_t checksum[] = { 0x271c2489, 0x3bbc0436, 0x9f681969, 0x1c05e617, }; - -} // namespace ParticleIosDebugRenderParamsNS - -#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS -class ParticleIosDebugRenderParams : public NvParameterized::NvParameters, public ParticleIosDebugRenderParamsNS::ParametersStruct -{ -public: - ParticleIosDebugRenderParams(NvParameterized::Traits* traits, void* buf = 0, int32_t* refCount = 0); - - virtual ~ParticleIosDebugRenderParams(); - - virtual void destroy(); - - static const char* staticClassName(void) - { - return("ParticleIosDebugRenderParams"); - } - - const char* className(void) const - { - return(staticClassName()); - } - - static const uint32_t ClassVersion = ((uint32_t)0 << 16) + (uint32_t)0; - - static uint32_t staticVersion(void) - { - return ClassVersion; - } - - uint32_t version(void) const - { - return(staticVersion()); - } - - static const uint32_t ClassAlignment = 8; - - static const uint32_t* staticChecksum(uint32_t& bits) - { - bits = 8 * sizeof(ParticleIosDebugRenderParamsNS::checksum); - return ParticleIosDebugRenderParamsNS::checksum; - } - - static void freeParameterDefinitionTable(NvParameterized::Traits* traits); - - const uint32_t* checksum(uint32_t& bits) const - { - return staticChecksum(bits); - } - - const ParticleIosDebugRenderParamsNS::ParametersStruct& parameters(void) const - { - ParticleIosDebugRenderParams* tmpThis = const_cast<ParticleIosDebugRenderParams*>(this); - return *(static_cast<ParticleIosDebugRenderParamsNS::ParametersStruct*>(tmpThis)); - } - - ParticleIosDebugRenderParamsNS::ParametersStruct& parameters(void) - { - return *(static_cast<ParticleIosDebugRenderParamsNS::ParametersStruct*>(this)); - } - - virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle) const; - virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle); - - void initDefaults(void); - -protected: - - virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void); - virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void) const; - - - virtual void getVarPtr(const NvParameterized::Handle& handle, void*& ptr, size_t& offset) const; - -private: - - void buildTree(void); - void initDynamicArrays(void); - void initStrings(void); - void initReferences(void); - void freeDynamicArrays(void); - void freeStrings(void); - void freeReferences(void); - - static bool mBuiltFlag; - static NvParameterized::MutexType mBuiltFlagMutex; -}; - -class ParticleIosDebugRenderParamsFactory : public NvParameterized::Factory -{ - static const char* const vptr; - -public: - - virtual void freeParameterDefinitionTable(NvParameterized::Traits* traits) - { - ParticleIosDebugRenderParams::freeParameterDefinitionTable(traits); - } - - virtual NvParameterized::Interface* create(NvParameterized::Traits* paramTraits) - { - // placement new on this class using mParameterizedTraits - - void* newPtr = paramTraits->alloc(sizeof(ParticleIosDebugRenderParams), ParticleIosDebugRenderParams::ClassAlignment); - if (!NvParameterized::IsAligned(newPtr, ParticleIosDebugRenderParams::ClassAlignment)) - { - NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class ParticleIosDebugRenderParams"); - paramTraits->free(newPtr); - return 0; - } - - memset(newPtr, 0, sizeof(ParticleIosDebugRenderParams)); // always initialize memory allocated to zero for default values - return NV_PARAM_PLACEMENT_NEW(newPtr, ParticleIosDebugRenderParams)(paramTraits); - } - - virtual NvParameterized::Interface* finish(NvParameterized::Traits* paramTraits, void* bufObj, void* bufStart, int32_t* refCount) - { - if (!NvParameterized::IsAligned(bufObj, ParticleIosDebugRenderParams::ClassAlignment) - || !NvParameterized::IsAligned(bufStart, ParticleIosDebugRenderParams::ClassAlignment)) - { - NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class ParticleIosDebugRenderParams"); - return 0; - } - - // Init NvParameters-part - // We used to call empty constructor of ParticleIosDebugRenderParams here - // but it may call default constructors of members and spoil the data - NV_PARAM_PLACEMENT_NEW(bufObj, NvParameterized::NvParameters)(paramTraits, bufStart, refCount); - - // Init vtable (everything else is already initialized) - *(const char**)bufObj = vptr; - - return (ParticleIosDebugRenderParams*)bufObj; - } - - virtual const char* getClassName() - { - return (ParticleIosDebugRenderParams::staticClassName()); - } - - virtual uint32_t getVersion() - { - return (ParticleIosDebugRenderParams::staticVersion()); - } - - virtual uint32_t getAlignment() - { - return (ParticleIosDebugRenderParams::ClassAlignment); - } - - virtual const uint32_t* getChecksum(uint32_t& bits) - { - return (ParticleIosDebugRenderParams::staticChecksum(bits)); - } -}; -#endif // NV_PARAMETERIZED_ONLY_LAYOUTS - -} // namespace pxparticleios -} // namespace nvidia - -#if PX_VC -#pragma warning(pop) -#endif - -#endif diff --git a/APEX_1.4/module/pxparticleios/include/autogen/ParticleIosModuleParameters.h b/APEX_1.4/module/pxparticleios/include/autogen/ParticleIosModuleParameters.h deleted file mode 100644 index 7cb8f445..00000000 --- a/APEX_1.4/module/pxparticleios/include/autogen/ParticleIosModuleParameters.h +++ /dev/null @@ -1,230 +0,0 @@ -// This code contains NVIDIA Confidential Information and is disclosed to you -// under a form of NVIDIA software license agreement provided separately to you. -// -// Notice -// NVIDIA Corporation and its licensors retain all intellectual property and -// proprietary rights in and to this software and 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. -// -// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES -// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO -// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, -// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. -// -// Information and code furnished is believed to be accurate and reliable. -// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such -// information or for any infringement of patents or other rights of third parties that may -// result from its use. No license is granted by implication or otherwise under any patent -// or patent rights of NVIDIA Corporation. Details are subject to change without notice. -// This code supersedes and replaces all information previously supplied. -// NVIDIA Corporation products are not authorized for use as critical -// components in life support devices or systems without express written approval of -// NVIDIA Corporation. -// -// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. - -// This file was generated by NvParameterized/scripts/GenParameterized.pl - - -#ifndef HEADER_ParticleIosModuleParameters_h -#define HEADER_ParticleIosModuleParameters_h - -#include "NvParametersTypes.h" - -#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS -#include "nvparameterized/NvParameterized.h" -#include "nvparameterized/NvParameterizedTraits.h" -#include "NvParameters.h" -#include "NvTraitsInternal.h" -#endif - -namespace nvidia -{ -namespace pxparticleios -{ - -#if PX_VC -#pragma warning(push) -#pragma warning(disable: 4324) // structure was padded due to __declspec(align()) -#endif - -namespace ParticleIosModuleParametersNS -{ - - - -struct ParametersStruct -{ - - uint32_t unused; - -}; - -static const uint32_t checksum[] = { 0x53933c71, 0xf953550b, 0x814f74ec, 0x33f15b05, }; - -} // namespace ParticleIosModuleParametersNS - -#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS -class ParticleIosModuleParameters : public NvParameterized::NvParameters, public ParticleIosModuleParametersNS::ParametersStruct -{ -public: - ParticleIosModuleParameters(NvParameterized::Traits* traits, void* buf = 0, int32_t* refCount = 0); - - virtual ~ParticleIosModuleParameters(); - - virtual void destroy(); - - static const char* staticClassName(void) - { - return("ParticleIosModuleParameters"); - } - - const char* className(void) const - { - return(staticClassName()); - } - - static const uint32_t ClassVersion = ((uint32_t)0 << 16) + (uint32_t)0; - - static uint32_t staticVersion(void) - { - return ClassVersion; - } - - uint32_t version(void) const - { - return(staticVersion()); - } - - static const uint32_t ClassAlignment = 8; - - static const uint32_t* staticChecksum(uint32_t& bits) - { - bits = 8 * sizeof(ParticleIosModuleParametersNS::checksum); - return ParticleIosModuleParametersNS::checksum; - } - - static void freeParameterDefinitionTable(NvParameterized::Traits* traits); - - const uint32_t* checksum(uint32_t& bits) const - { - return staticChecksum(bits); - } - - const ParticleIosModuleParametersNS::ParametersStruct& parameters(void) const - { - ParticleIosModuleParameters* tmpThis = const_cast<ParticleIosModuleParameters*>(this); - return *(static_cast<ParticleIosModuleParametersNS::ParametersStruct*>(tmpThis)); - } - - ParticleIosModuleParametersNS::ParametersStruct& parameters(void) - { - return *(static_cast<ParticleIosModuleParametersNS::ParametersStruct*>(this)); - } - - virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle) const; - virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle); - - void initDefaults(void); - -protected: - - virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void); - virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void) const; - - - virtual void getVarPtr(const NvParameterized::Handle& handle, void*& ptr, size_t& offset) const; - -private: - - void buildTree(void); - void initDynamicArrays(void); - void initStrings(void); - void initReferences(void); - void freeDynamicArrays(void); - void freeStrings(void); - void freeReferences(void); - - static bool mBuiltFlag; - static NvParameterized::MutexType mBuiltFlagMutex; -}; - -class ParticleIosModuleParametersFactory : public NvParameterized::Factory -{ - static const char* const vptr; - -public: - - virtual void freeParameterDefinitionTable(NvParameterized::Traits* traits) - { - ParticleIosModuleParameters::freeParameterDefinitionTable(traits); - } - - virtual NvParameterized::Interface* create(NvParameterized::Traits* paramTraits) - { - // placement new on this class using mParameterizedTraits - - void* newPtr = paramTraits->alloc(sizeof(ParticleIosModuleParameters), ParticleIosModuleParameters::ClassAlignment); - if (!NvParameterized::IsAligned(newPtr, ParticleIosModuleParameters::ClassAlignment)) - { - NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class ParticleIosModuleParameters"); - paramTraits->free(newPtr); - return 0; - } - - memset(newPtr, 0, sizeof(ParticleIosModuleParameters)); // always initialize memory allocated to zero for default values - return NV_PARAM_PLACEMENT_NEW(newPtr, ParticleIosModuleParameters)(paramTraits); - } - - virtual NvParameterized::Interface* finish(NvParameterized::Traits* paramTraits, void* bufObj, void* bufStart, int32_t* refCount) - { - if (!NvParameterized::IsAligned(bufObj, ParticleIosModuleParameters::ClassAlignment) - || !NvParameterized::IsAligned(bufStart, ParticleIosModuleParameters::ClassAlignment)) - { - NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class ParticleIosModuleParameters"); - return 0; - } - - // Init NvParameters-part - // We used to call empty constructor of ParticleIosModuleParameters here - // but it may call default constructors of members and spoil the data - NV_PARAM_PLACEMENT_NEW(bufObj, NvParameterized::NvParameters)(paramTraits, bufStart, refCount); - - // Init vtable (everything else is already initialized) - *(const char**)bufObj = vptr; - - return (ParticleIosModuleParameters*)bufObj; - } - - virtual const char* getClassName() - { - return (ParticleIosModuleParameters::staticClassName()); - } - - virtual uint32_t getVersion() - { - return (ParticleIosModuleParameters::staticVersion()); - } - - virtual uint32_t getAlignment() - { - return (ParticleIosModuleParameters::ClassAlignment); - } - - virtual const uint32_t* getChecksum(uint32_t& bits) - { - return (ParticleIosModuleParameters::staticChecksum(bits)); - } -}; -#endif // NV_PARAMETERIZED_ONLY_LAYOUTS - -} // namespace pxparticleios -} // namespace nvidia - -#if PX_VC -#pragma warning(pop) -#endif - -#endif diff --git a/APEX_1.4/module/pxparticleios/include/autogen/SimpleParticleSystemParams.h b/APEX_1.4/module/pxparticleios/include/autogen/SimpleParticleSystemParams.h deleted file mode 100644 index bcc9f129..00000000 --- a/APEX_1.4/module/pxparticleios/include/autogen/SimpleParticleSystemParams.h +++ /dev/null @@ -1,238 +0,0 @@ -// This code contains NVIDIA Confidential Information and is disclosed to you -// under a form of NVIDIA software license agreement provided separately to you. -// -// Notice -// NVIDIA Corporation and its licensors retain all intellectual property and -// proprietary rights in and to this software and 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. -// -// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES -// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO -// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, -// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. -// -// Information and code furnished is believed to be accurate and reliable. -// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such -// information or for any infringement of patents or other rights of third parties that may -// result from its use. No license is granted by implication or otherwise under any patent -// or patent rights of NVIDIA Corporation. Details are subject to change without notice. -// This code supersedes and replaces all information previously supplied. -// NVIDIA Corporation products are not authorized for use as critical -// components in life support devices or systems without express written approval of -// NVIDIA Corporation. -// -// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. - -// This file was generated by NvParameterized/scripts/GenParameterized.pl - - -#ifndef HEADER_SimpleParticleSystemParams_h -#define HEADER_SimpleParticleSystemParams_h - -#include "NvParametersTypes.h" - -#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS -#include "nvparameterized/NvParameterized.h" -#include "nvparameterized/NvParameterizedTraits.h" -#include "NvParameters.h" -#include "NvTraitsInternal.h" -#endif - -namespace nvidia -{ -namespace pxparticleios -{ - -#if PX_VC -#pragma warning(push) -#pragma warning(disable: 4324) // structure was padded due to __declspec(align()) -#endif - -namespace SimpleParticleSystemParamsNS -{ - -struct GridDensityParams_Type; - -struct GridDensityParams_Type -{ - bool Enabled; - const char* Resolution; - float GridSize; - uint32_t MaxCellCount; -}; - -struct ParametersStruct -{ - - GridDensityParams_Type GridDensity; - -}; - -static const uint32_t checksum[] = { 0xf872dc0a, 0x0e40cb32, 0x1627d31b, 0xfa23979d, }; - -} // namespace SimpleParticleSystemParamsNS - -#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS -class SimpleParticleSystemParams : public NvParameterized::NvParameters, public SimpleParticleSystemParamsNS::ParametersStruct -{ -public: - SimpleParticleSystemParams(NvParameterized::Traits* traits, void* buf = 0, int32_t* refCount = 0); - - virtual ~SimpleParticleSystemParams(); - - virtual void destroy(); - - static const char* staticClassName(void) - { - return("SimpleParticleSystemParams"); - } - - const char* className(void) const - { - return(staticClassName()); - } - - static const uint32_t ClassVersion = ((uint32_t)0 << 16) + (uint32_t)3; - - static uint32_t staticVersion(void) - { - return ClassVersion; - } - - uint32_t version(void) const - { - return(staticVersion()); - } - - static const uint32_t ClassAlignment = 8; - - static const uint32_t* staticChecksum(uint32_t& bits) - { - bits = 8 * sizeof(SimpleParticleSystemParamsNS::checksum); - return SimpleParticleSystemParamsNS::checksum; - } - - static void freeParameterDefinitionTable(NvParameterized::Traits* traits); - - const uint32_t* checksum(uint32_t& bits) const - { - return staticChecksum(bits); - } - - const SimpleParticleSystemParamsNS::ParametersStruct& parameters(void) const - { - SimpleParticleSystemParams* tmpThis = const_cast<SimpleParticleSystemParams*>(this); - return *(static_cast<SimpleParticleSystemParamsNS::ParametersStruct*>(tmpThis)); - } - - SimpleParticleSystemParamsNS::ParametersStruct& parameters(void) - { - return *(static_cast<SimpleParticleSystemParamsNS::ParametersStruct*>(this)); - } - - virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle) const; - virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle); - - void initDefaults(void); - -protected: - - virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void); - virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void) const; - - - virtual void getVarPtr(const NvParameterized::Handle& handle, void*& ptr, size_t& offset) const; - -private: - - void buildTree(void); - void initDynamicArrays(void); - void initStrings(void); - void initReferences(void); - void freeDynamicArrays(void); - void freeStrings(void); - void freeReferences(void); - - static bool mBuiltFlag; - static NvParameterized::MutexType mBuiltFlagMutex; -}; - -class SimpleParticleSystemParamsFactory : public NvParameterized::Factory -{ - static const char* const vptr; - -public: - - virtual void freeParameterDefinitionTable(NvParameterized::Traits* traits) - { - SimpleParticleSystemParams::freeParameterDefinitionTable(traits); - } - - virtual NvParameterized::Interface* create(NvParameterized::Traits* paramTraits) - { - // placement new on this class using mParameterizedTraits - - void* newPtr = paramTraits->alloc(sizeof(SimpleParticleSystemParams), SimpleParticleSystemParams::ClassAlignment); - if (!NvParameterized::IsAligned(newPtr, SimpleParticleSystemParams::ClassAlignment)) - { - NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class SimpleParticleSystemParams"); - paramTraits->free(newPtr); - return 0; - } - - memset(newPtr, 0, sizeof(SimpleParticleSystemParams)); // always initialize memory allocated to zero for default values - return NV_PARAM_PLACEMENT_NEW(newPtr, SimpleParticleSystemParams)(paramTraits); - } - - virtual NvParameterized::Interface* finish(NvParameterized::Traits* paramTraits, void* bufObj, void* bufStart, int32_t* refCount) - { - if (!NvParameterized::IsAligned(bufObj, SimpleParticleSystemParams::ClassAlignment) - || !NvParameterized::IsAligned(bufStart, SimpleParticleSystemParams::ClassAlignment)) - { - NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class SimpleParticleSystemParams"); - return 0; - } - - // Init NvParameters-part - // We used to call empty constructor of SimpleParticleSystemParams here - // but it may call default constructors of members and spoil the data - NV_PARAM_PLACEMENT_NEW(bufObj, NvParameterized::NvParameters)(paramTraits, bufStart, refCount); - - // Init vtable (everything else is already initialized) - *(const char**)bufObj = vptr; - - return (SimpleParticleSystemParams*)bufObj; - } - - virtual const char* getClassName() - { - return (SimpleParticleSystemParams::staticClassName()); - } - - virtual uint32_t getVersion() - { - return (SimpleParticleSystemParams::staticVersion()); - } - - virtual uint32_t getAlignment() - { - return (SimpleParticleSystemParams::ClassAlignment); - } - - virtual const uint32_t* getChecksum(uint32_t& bits) - { - return (SimpleParticleSystemParams::staticChecksum(bits)); - } -}; -#endif // NV_PARAMETERIZED_ONLY_LAYOUTS - -} // namespace pxparticleios -} // namespace nvidia - -#if PX_VC -#pragma warning(pop) -#endif - -#endif |