diff options
| author | git perforce import user <a@b> | 2016-10-25 12:29:14 -0600 |
|---|---|---|
| committer | Sheikh Dawood Abdul Ajees <Sheikh Dawood Abdul Ajees> | 2016-10-25 18:56:37 -0500 |
| commit | 3dfe2108cfab31ba3ee5527e217d0d8e99a51162 (patch) | |
| tree | fa6485c169e50d7415a651bf838f5bcd0fd3bfbd /APEX_1.4/module/emitter/src/autogen | |
| download | physx-3.4-3dfe2108cfab31ba3ee5527e217d0d8e99a51162.tar.xz physx-3.4-3dfe2108cfab31ba3ee5527e217d0d8e99a51162.zip | |
Initial commit:
PhysX 3.4.0 Update @ 21294896
APEX 1.4.0 Update @ 21275617
[CL 21300167]
Diffstat (limited to 'APEX_1.4/module/emitter/src/autogen')
16 files changed, 9432 insertions, 0 deletions
diff --git a/APEX_1.4/module/emitter/src/autogen/ApexEmitterActorParameters.cpp b/APEX_1.4/module/emitter/src/autogen/ApexEmitterActorParameters.cpp new file mode 100644 index 00000000..7b0b69a9 --- /dev/null +++ b/APEX_1.4/module/emitter/src/autogen/ApexEmitterActorParameters.cpp @@ -0,0 +1,490 @@ +// 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 + + +#include "ApexEmitterActorParameters.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace emitter +{ + +using namespace ApexEmitterActorParametersNS; + +const char* const ApexEmitterActorParametersFactory::vptr = + NvParameterized::getVptr<ApexEmitterActorParameters, ApexEmitterActorParameters::ClassAlignment>(); + +const uint32_t NumParamDefs = 8; +static NvParameterized::DefinitionImpl* ParamDefTable; // now allocated in buildTree [NumParamDefs]; + + +static const size_t ParamLookupChildrenTable[] = +{ + 1, 2, 3, 4, 5, 6, 7, +}; + +#define TENUM(type) nvidia::##type +#define CHILDREN(index) &ParamLookupChildrenTable[index] +static const NvParameterized::ParamLookupNode ParamLookupTable[NumParamDefs] = +{ + { TYPE_STRUCT, false, 0, CHILDREN(0), 7 }, + { TYPE_TRANSFORM, false, (size_t)(&((ParametersStruct*)0)->initialPose), NULL, 0 }, // initialPose + { TYPE_F32, false, (size_t)(&((ParametersStruct*)0)->initialScale), NULL, 0 }, // initialScale + { TYPE_TRANSFORM, false, (size_t)(&((ParametersStruct*)0)->attachRelativePose), NULL, 0 }, // attachRelativePose + { TYPE_BOOL, false, (size_t)(&((ParametersStruct*)0)->emitAssetParticles), NULL, 0 }, // emitAssetParticles + { TYPE_STRING, false, (size_t)(&((ParametersStruct*)0)->overlapTestGroupMaskName), NULL, 0 }, // overlapTestGroupMaskName + { TYPE_STRING, false, (size_t)(&((ParametersStruct*)0)->overlapTestGroupsMask128Name), NULL, 0 }, // overlapTestGroupsMask128Name + { TYPE_F32, false, (size_t)(&((ParametersStruct*)0)->emitterDuration), NULL, 0 }, // emitterDuration +}; + + +bool ApexEmitterActorParameters::mBuiltFlag = false; +NvParameterized::MutexType ApexEmitterActorParameters::mBuiltFlagMutex; + +ApexEmitterActorParameters::ApexEmitterActorParameters(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &ApexEmitterActorParametersFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +ApexEmitterActorParameters::~ApexEmitterActorParameters() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void ApexEmitterActorParameters::destroy() +{ + // We cache these fields here to avoid overwrite in destructor + bool doDeallocateSelf = mDoDeallocateSelf; + NvParameterized::Traits* traits = mParameterizedTraits; + int32_t* refCount = mRefCount; + void* buf = mBuffer; + + this->~ApexEmitterActorParameters(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* ApexEmitterActorParameters::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* ApexEmitterActorParameters::getParameterDefinitionTree(void) const +{ + ApexEmitterActorParameters* tmpParam = const_cast<ApexEmitterActorParameters*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType ApexEmitterActorParameters::getParameterHandle(const char* long_name, Handle& handle) const +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +NvParameterized::ErrorType ApexEmitterActorParameters::getParameterHandle(const char* long_name, Handle& handle) +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +void ApexEmitterActorParameters::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<ApexEmitterActorParameters::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ + +void ApexEmitterActorParameters::freeParameterDefinitionTable(NvParameterized::Traits* traits) +{ + if (!traits) + { + return; + } + + if (!mBuiltFlag) // Double-checked lock + { + return; + } + + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + + if (!mBuiltFlag) + { + return; + } + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + ParamDefTable[i].~DefinitionImpl(); + } + + traits->free(ParamDefTable); + + mBuiltFlag = false; +} + +#define PDEF_PTR(index) (&ParamDefTable[index]) + +void ApexEmitterActorParameters::buildTree(void) +{ + + uint32_t allocSize = sizeof(NvParameterized::DefinitionImpl) * NumParamDefs; + ParamDefTable = (NvParameterized::DefinitionImpl*)(mParameterizedTraits->alloc(allocSize)); + memset(ParamDefTable, 0, allocSize); + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + NV_PARAM_PLACEMENT_NEW(ParamDefTable + i, NvParameterized::DefinitionImpl)(*mParameterizedTraits); + } + + // Initialize DefinitionImpl node: nodeIndex=0, longName="" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[0]; + ParamDef->init("", TYPE_STRUCT, "STRUCT", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "This class is used for creating EmitterActor instances", true); + ParamDefTable[0].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=1, longName="initialPose" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[1]; + ParamDef->init("initialPose", TYPE_TRANSFORM, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "The initial pose where the emitter actor will be put into the scene", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=2, longName="initialScale" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[2]; + ParamDef->init("initialScale", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "The space scale of the emitter", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=3, longName="attachRelativePose" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[3]; + ParamDef->init("attachRelativePose", TYPE_TRANSFORM, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "The emitter will offset this value from the attach actor pose.", true); + ParamDefTable[3].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=4, longName="emitAssetParticles" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[4]; + ParamDef->init("emitAssetParticles", TYPE_BOOL, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("longDescription", "In case this emitter has EmitterGeomExplicit geometry type, it can store a particle list in its asset and also in its actor instance.\nSo if this parameter equals to true, then both particle lists from asset and actor instance will be emitted.\nAnd if this paramater equals to false, then only particle list from actor instance will be emitterd.\n", true); + HintTable[1].init("shortDescription", "Indicates whether authored asset particle list will be emitted, defaults to true (Used only in case of EmitterGeomExplicit type)", true); + ParamDefTable[4].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=5, longName="overlapTestGroupMaskName" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[5]; + ParamDef->init("overlapTestGroupMaskName", TYPE_STRING, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("longDescription", "This name resolves to a 32-bit bitmask of collision groups for overlap tests when particles are \nspawned. It is resolved by a call to the named resource provider using the 'NSCollisionGroupMask' \nnamespace. If none is provided, the raycast will hit everything in the scene. \nThis avoids storing fragile enums in asset files. \n", true); + HintTable[1].init("shortDescription", "Overlap Test Collision Group Mask Name", true); + ParamDefTable[5].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=6, longName="overlapTestGroupsMask128Name" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[6]; + ParamDef->init("overlapTestGroupsMask128Name", TYPE_STRING, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("longDescription", "This name resolves to a 128-bit GroupsMask used for overlap tests when particles are spawned.\nIt is resolved by a call to the named resource provider using the 'NSCollisionGroup128' \n", true); + HintTable[1].init("shortDescription", "Overlap Test 128-bit Collision Groups Mask", true); + ParamDefTable[6].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=7, longName="emitterDuration" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[7]; + ParamDef->init("emitterDuration", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("min", uint64_t(0), true); + ParamDefTable[7].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("longDescription", "Specifies a duration (in seconds) that the emitter will emit for after being enabled.\nAfter the specified duration, the emitter will turn off, unless it has already been explicitly turned off via an API call.\nThe special value 0.0f means there is no duration, and the emitter will remain on until explicitly turned off.", true); + HintTable[1].init("min", uint64_t(0), true); + HintTable[2].init("shortDescription", "Emitter duration time (in seconds)", true); + ParamDefTable[7].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // SetChildren for: nodeIndex=0, longName="" + { + static Definition* Children[7]; + Children[0] = PDEF_PTR(1); + Children[1] = PDEF_PTR(2); + Children[2] = PDEF_PTR(3); + Children[3] = PDEF_PTR(4); + Children[4] = PDEF_PTR(5); + Children[5] = PDEF_PTR(6); + Children[6] = PDEF_PTR(7); + + ParamDefTable[0].setChildren(Children, 7); + } + + mBuiltFlag = true; + +} +void ApexEmitterActorParameters::initStrings(void) +{ + overlapTestGroupMaskName.isAllocated = true; + overlapTestGroupMaskName.buf = NULL; + overlapTestGroupsMask128Name.isAllocated = true; + overlapTestGroupsMask128Name.buf = NULL; +} + +void ApexEmitterActorParameters::initDynamicArrays(void) +{ +} + +void ApexEmitterActorParameters::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + initialPose = physx::PxTransform(physx::PxIdentity); + initialScale = float(1.0); + attachRelativePose = physx::PxTransform(physx::PxIdentity); + emitAssetParticles = bool(true); + emitterDuration = float(PX_MAX_F32); + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void ApexEmitterActorParameters::initReferences(void) +{ +} + +void ApexEmitterActorParameters::freeDynamicArrays(void) +{ +} + +void ApexEmitterActorParameters::freeStrings(void) +{ + + if (overlapTestGroupMaskName.isAllocated && overlapTestGroupMaskName.buf) + { + mParameterizedTraits->strfree((char*)overlapTestGroupMaskName.buf); + } + + if (overlapTestGroupsMask128Name.isAllocated && overlapTestGroupsMask128Name.buf) + { + mParameterizedTraits->strfree((char*)overlapTestGroupsMask128Name.buf); + } +} + +void ApexEmitterActorParameters::freeReferences(void) +{ +} + +} // namespace emitter +} // namespace nvidia diff --git a/APEX_1.4/module/emitter/src/autogen/ApexEmitterAssetParameters.cpp b/APEX_1.4/module/emitter/src/autogen/ApexEmitterAssetParameters.cpp new file mode 100644 index 00000000..5005f2a7 --- /dev/null +++ b/APEX_1.4/module/emitter/src/autogen/ApexEmitterAssetParameters.cpp @@ -0,0 +1,1159 @@ +// 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 + + +#include "ApexEmitterAssetParameters.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace emitter +{ + +using namespace ApexEmitterAssetParametersNS; + +const char* const ApexEmitterAssetParametersFactory::vptr = + NvParameterized::getVptr<ApexEmitterAssetParameters, ApexEmitterAssetParameters::ClassAlignment>(); + +const uint32_t NumParamDefs = 26; +static NvParameterized::DefinitionImpl* ParamDefTable; // now allocated in buildTree [NumParamDefs]; + + +static const size_t ParamLookupChildrenTable[] = +{ + 1, 2, 3, 4, 5, 6, 7, 8, 16, 17, 18, 19, 20, 21, 22, 9, 10, 11, 12, 13, 14, 15, 23, + 24, 25, +}; + +#define TENUM(type) nvidia::##type +#define CHILDREN(index) &ParamLookupChildrenTable[index] +static const NvParameterized::ParamLookupNode ParamLookupTable[NumParamDefs] = +{ + { TYPE_STRUCT, false, 0, CHILDREN(0), 15 }, + { TYPE_F32, false, (size_t)(&((ParametersStruct*)0)->density), NULL, 0 }, // density + { TYPE_F32, false, (size_t)(&((ParametersStruct*)0)->rate), NULL, 0 }, // rate + { TYPE_F32, false, (size_t)(&((ParametersStruct*)0)->lifetimeLow), NULL, 0 }, // lifetimeLow + { TYPE_F32, false, (size_t)(&((ParametersStruct*)0)->lifetimeHigh), NULL, 0 }, // lifetimeHigh + { TYPE_VEC3, false, (size_t)(&((ParametersStruct*)0)->velocityLow), NULL, 0 }, // velocityLow + { TYPE_VEC3, false, (size_t)(&((ParametersStruct*)0)->velocityHigh), NULL, 0 }, // velocityHigh + { TYPE_U32, false, (size_t)(&((ParametersStruct*)0)->maxSamples), NULL, 0 }, // maxSamples + { TYPE_STRUCT, false, (size_t)(&((ParametersStruct*)0)->lodParamDesc), CHILDREN(15), 7 }, // lodParamDesc + { TYPE_U32, false, (size_t)(&((emitterLodParamDesc_Type*)0)->version), NULL, 0 }, // lodParamDesc.version + { TYPE_F32, false, (size_t)(&((emitterLodParamDesc_Type*)0)->maxDistance), NULL, 0 }, // lodParamDesc.maxDistance + { TYPE_F32, false, (size_t)(&((emitterLodParamDesc_Type*)0)->distanceWeight), NULL, 0 }, // lodParamDesc.distanceWeight + { TYPE_F32, false, (size_t)(&((emitterLodParamDesc_Type*)0)->speedWeight), NULL, 0 }, // lodParamDesc.speedWeight + { TYPE_F32, false, (size_t)(&((emitterLodParamDesc_Type*)0)->lifeWeight), NULL, 0 }, // lodParamDesc.lifeWeight + { TYPE_F32, false, (size_t)(&((emitterLodParamDesc_Type*)0)->separationWeight), NULL, 0 }, // lodParamDesc.separationWeight + { TYPE_F32, false, (size_t)(&((emitterLodParamDesc_Type*)0)->bias), NULL, 0 }, // lodParamDesc.bias + { TYPE_REF, false, (size_t)(&((ParametersStruct*)0)->iofxAssetName), NULL, 0 }, // iofxAssetName + { TYPE_REF, false, (size_t)(&((ParametersStruct*)0)->iosAssetName), NULL, 0 }, // iosAssetName + { TYPE_REF, false, (size_t)(&((ParametersStruct*)0)->geometryType), NULL, 0 }, // geometryType + { TYPE_F32, false, (size_t)(&((ParametersStruct*)0)->emitterDuration), NULL, 0 }, // emitterDuration + { TYPE_F32, false, (size_t)(&((ParametersStruct*)0)->emitterVelocityScale), NULL, 0 }, // emitterVelocityScale + { TYPE_U32, false, (size_t)(&((ParametersStruct*)0)->minSamplingFPS), NULL, 0 }, // minSamplingFPS + { TYPE_ARRAY, true, (size_t)(&((ParametersStruct*)0)->rateVsTimeCurvePoints), CHILDREN(22), 1 }, // rateVsTimeCurvePoints + { TYPE_STRUCT, false, 1 * sizeof(rateVsTimeCurvePoint_Type), CHILDREN(23), 2 }, // rateVsTimeCurvePoints[] + { TYPE_F32, false, (size_t)(&((rateVsTimeCurvePoint_Type*)0)->x), NULL, 0 }, // rateVsTimeCurvePoints[].x + { TYPE_F32, false, (size_t)(&((rateVsTimeCurvePoint_Type*)0)->y), NULL, 0 }, // rateVsTimeCurvePoints[].y +}; + + +bool ApexEmitterAssetParameters::mBuiltFlag = false; +NvParameterized::MutexType ApexEmitterAssetParameters::mBuiltFlagMutex; + +ApexEmitterAssetParameters::ApexEmitterAssetParameters(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &ApexEmitterAssetParametersFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +ApexEmitterAssetParameters::~ApexEmitterAssetParameters() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void ApexEmitterAssetParameters::destroy() +{ + // We cache these fields here to avoid overwrite in destructor + bool doDeallocateSelf = mDoDeallocateSelf; + NvParameterized::Traits* traits = mParameterizedTraits; + int32_t* refCount = mRefCount; + void* buf = mBuffer; + + this->~ApexEmitterAssetParameters(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* ApexEmitterAssetParameters::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* ApexEmitterAssetParameters::getParameterDefinitionTree(void) const +{ + ApexEmitterAssetParameters* tmpParam = const_cast<ApexEmitterAssetParameters*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType ApexEmitterAssetParameters::getParameterHandle(const char* long_name, Handle& handle) const +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +NvParameterized::ErrorType ApexEmitterAssetParameters::getParameterHandle(const char* long_name, Handle& handle) +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +void ApexEmitterAssetParameters::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<ApexEmitterAssetParameters::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ + +void ApexEmitterAssetParameters::freeParameterDefinitionTable(NvParameterized::Traits* traits) +{ + if (!traits) + { + return; + } + + if (!mBuiltFlag) // Double-checked lock + { + return; + } + + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + + if (!mBuiltFlag) + { + return; + } + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + ParamDefTable[i].~DefinitionImpl(); + } + + traits->free(ParamDefTable); + + mBuiltFlag = false; +} + +#define PDEF_PTR(index) (&ParamDefTable[index]) + +void ApexEmitterAssetParameters::buildTree(void) +{ + + uint32_t allocSize = sizeof(NvParameterized::DefinitionImpl) * NumParamDefs; + ParamDefTable = (NvParameterized::DefinitionImpl*)(mParameterizedTraits->alloc(allocSize)); + memset(ParamDefTable, 0, allocSize); + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + NV_PARAM_PLACEMENT_NEW(ParamDefTable + i, NvParameterized::DefinitionImpl)(*mParameterizedTraits); + } + + // Initialize DefinitionImpl node: nodeIndex=0, longName="" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[0]; + ParamDef->init("", TYPE_STRUCT, "STRUCT", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("longDescription", "This class contains the parameters for the APEX Emitter asset. The APEX Emitter is sometimes described\nas a shaped APEX Emitter because it contains the box, sphere, and sphere shell shapes. It also\nincludes an explicit shape that allows for preauthored particles positions and velocities and runtime\nparticle injections.\n", true); + HintTable[1].init("shortDescription", "APEX Emitter Asset Parameters", true); + ParamDefTable[0].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=1, longName="density" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[1]; + ParamDef->init("density", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("tweakable", "true", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("longDescription", "For an explicit emitter, the density is actually a spawn probability. For the shaped emitters, it represents the density of the particles per unit volume.\n", true); + HintTable[1].init("shortDescription", "Desired density of spawned particles per unit of volume.", true); + HintTable[2].init("tweakable", "true", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=2, longName="rate" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[2]; + ParamDef->init("rate", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("tweakable", "true", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("longDescription", "TODO\n", true); + HintTable[1].init("shortDescription", "TODO", true); + HintTable[2].init("tweakable", "true", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=3, longName="lifetimeLow" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[3]; + ParamDef->init("lifetimeLow", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("tweakable", "true", true); + ParamDefTable[3].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("longDescription", "The emitter actor will create particles with a random lifetime (in seconds) within the lifetime range.\n", true); + HintTable[1].init("shortDescription", "Low value of particle lifetime", true); + HintTable[2].init("tweakable", "true", true); + ParamDefTable[3].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=4, longName="lifetimeHigh" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[4]; + ParamDef->init("lifetimeHigh", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("tweakable", "true", true); + ParamDefTable[4].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("longDescription", "The emitter actor will create particles with a random lifetime (in seconds) within the lifetime range.\n", true); + HintTable[1].init("shortDescription", "High value of particle lifetime", true); + HintTable[2].init("tweakable", "true", true); + ParamDefTable[4].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=5, longName="velocityLow" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[5]; + ParamDef->init("velocityLow", TYPE_VEC3, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("gameScale", "true", true); + HintTable[1].init("tweakable", "true", true); + ParamDefTable[5].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#else + + static HintImpl HintTable[4]; + static Hint* HintPtrTable[4] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], }; + HintTable[0].init("gameScale", "true", true); + HintTable[1].init("longDescription", "The emitter actor will create particles with a random velocity within the velocity range.\n", true); + HintTable[2].init("shortDescription", "Random velocity given within range", true); + HintTable[3].init("tweakable", "true", true); + ParamDefTable[5].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=6, longName="velocityHigh" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[6]; + ParamDef->init("velocityHigh", TYPE_VEC3, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("gameScale", "true", true); + HintTable[1].init("tweakable", "true", true); + ParamDefTable[6].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#else + + static HintImpl HintTable[4]; + static Hint* HintPtrTable[4] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], }; + HintTable[0].init("gameScale", "true", true); + HintTable[1].init("longDescription", "The emitter actor will create particles with a random velocity within the velocity range.\n", true); + HintTable[2].init("shortDescription", "Random velocity given within range", true); + HintTable[3].init("tweakable", "true", true); + ParamDefTable[6].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=7, longName="maxSamples" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[7]; + ParamDef->init("maxSamples", TYPE_U32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("defaultValue", uint64_t(0), true); + HintTable[1].init("min", uint64_t(0), true); + ParamDefTable[7].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#else + + static HintImpl HintTable[4]; + static Hint* HintPtrTable[4] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], }; + HintTable[0].init("defaultValue", uint64_t(0), true); + HintTable[1].init("longDescription", "For an explicit emitter, Max Samples is ignored. For shaped emitters, it is the maximum number of particles spawned in a step.\n", true); + HintTable[2].init("min", uint64_t(0), true); + HintTable[3].init("shortDescription", "Shaped emitter only. Max particles spawned each step.", true); + ParamDefTable[7].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=8, longName="lodParamDesc" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[8]; + ParamDef->init("lodParamDesc", TYPE_STRUCT, "emitterLodParamDesc", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("tweakable", "true", true); + ParamDefTable[8].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("shortDescription", "Bias given to this emitter when sharing IOS with another emitter", true); + HintTable[1].init("tweakable", "true", true); + ParamDefTable[8].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=9, longName="lodParamDesc.version" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[9]; + ParamDef->init("version", TYPE_U32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("defaultValue", uint64_t(0), true); + ParamDefTable[9].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("defaultValue", uint64_t(0), true); + HintTable[1].init("shortDescription", "Helpful documentation goes here", true); + ParamDefTable[9].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=10, longName="lodParamDesc.maxDistance" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[10]; + ParamDef->init("maxDistance", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("defaultValue", uint64_t(0), true); + HintTable[1].init("min", uint64_t(0), true); + ParamDefTable[10].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#else + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("defaultValue", uint64_t(0), true); + HintTable[1].init("min", uint64_t(0), true); + HintTable[2].init("shortDescription", "Objects greater than this distance from the player will be culled more aggressively", true); + ParamDefTable[10].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=11, longName="lodParamDesc.distanceWeight" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[11]; + ParamDef->init("distanceWeight", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("defaultValue", uint64_t(1), true); + HintTable[1].init("max", uint64_t(1), true); + HintTable[2].init("min", uint64_t(0), true); + ParamDefTable[11].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#else + + static HintImpl HintTable[4]; + static Hint* HintPtrTable[4] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], }; + HintTable[0].init("defaultValue", uint64_t(1), true); + HintTable[1].init("max", uint64_t(1), true); + HintTable[2].init("min", uint64_t(0), true); + HintTable[3].init("shortDescription", "Weight given to distance parameter in LOD function", true); + ParamDefTable[11].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=12, longName="lodParamDesc.speedWeight" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[12]; + ParamDef->init("speedWeight", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("defaultValue", uint64_t(0), true); + HintTable[1].init("max", uint64_t(1), true); + HintTable[2].init("min", uint64_t(0), true); + ParamDefTable[12].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#else + + static HintImpl HintTable[4]; + static Hint* HintPtrTable[4] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], }; + HintTable[0].init("defaultValue", uint64_t(0), true); + HintTable[1].init("max", uint64_t(1), true); + HintTable[2].init("min", uint64_t(0), true); + HintTable[3].init("shortDescription", "Weight given to velocity parameter in LOD function", true); + ParamDefTable[12].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=13, longName="lodParamDesc.lifeWeight" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[13]; + ParamDef->init("lifeWeight", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("defaultValue", uint64_t(0), true); + HintTable[1].init("max", uint64_t(1), true); + HintTable[2].init("min", uint64_t(0), true); + ParamDefTable[13].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#else + + static HintImpl HintTable[4]; + static Hint* HintPtrTable[4] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], }; + HintTable[0].init("defaultValue", uint64_t(0), true); + HintTable[1].init("max", uint64_t(1), true); + HintTable[2].init("min", uint64_t(0), true); + HintTable[3].init("shortDescription", "Weight given to life remain parameter in LOD function", true); + ParamDefTable[13].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=14, longName="lodParamDesc.separationWeight" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[14]; + ParamDef->init("separationWeight", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("defaultValue", uint64_t(0), true); + HintTable[1].init("max", uint64_t(1), true); + HintTable[2].init("min", uint64_t(0), true); + ParamDefTable[14].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#else + + static HintImpl HintTable[4]; + static Hint* HintPtrTable[4] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], }; + HintTable[0].init("defaultValue", uint64_t(0), true); + HintTable[1].init("max", uint64_t(1), true); + HintTable[2].init("min", uint64_t(0), true); + HintTable[3].init("shortDescription", "Weight given to separation parameter in LOD function", true); + ParamDefTable[14].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=15, longName="lodParamDesc.bias" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[15]; + ParamDef->init("bias", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("defaultValue", uint64_t(1), true); + HintTable[1].init("min", uint64_t(0), true); + ParamDefTable[15].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#else + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("defaultValue", uint64_t(1), true); + HintTable[1].init("min", uint64_t(0), true); + HintTable[2].init("shortDescription", "Bias given to objects spawned by this emitter, relative to other emitters in the same IOS", true); + ParamDefTable[15].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=16, longName="iofxAssetName" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[16]; + ParamDef->init("iofxAssetName", TYPE_REF, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("DISPLAY_NAME", "Graphics Effect (IOFX)", true); + ParamDefTable[16].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("DISPLAY_NAME", "Graphics Effect (IOFX)", true); + HintTable[1].init("shortDescription", "The name of the instanced object effects asset that will render particles", true); + ParamDefTable[16].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + static const char* const RefVariantVals[] = { "IOFX" }; + ParamDefTable[16].setRefVariantVals((const char**)RefVariantVals, 1); + + + + } + + // Initialize DefinitionImpl node: nodeIndex=17, longName="iosAssetName" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[17]; + ParamDef->init("iosAssetName", TYPE_REF, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("DISPLAY_NAME", "Particle Simulation (IOS)", true); + ParamDefTable[17].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("DISPLAY_NAME", "Particle Simulation (IOS)", true); + HintTable[1].init("shortDescription", "The asset name of the IOS and the type of IOS that will simulate particles", true); + ParamDefTable[17].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + static const char* const RefVariantVals[] = { "BasicIosAsset", "ParticleIosAsset" }; + ParamDefTable[17].setRefVariantVals((const char**)RefVariantVals, 2); + + + + } + + // Initialize DefinitionImpl node: nodeIndex=18, longName="geometryType" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[18]; + ParamDef->init("geometryType", TYPE_REF, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("INCLUDED", uint64_t(1), true); + ParamDefTable[18].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("INCLUDED", uint64_t(1), true); + HintTable[1].init("longDescription", "Specifies the geometry type of the emitter", true); + HintTable[2].init("shortDescription", "Geometry Type", true); + ParamDefTable[18].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + static const char* const RefVariantVals[] = { "EmitterGeomBoxParams", "EmitterGeomSphereParams", "EmitterGeomSphereShellParams", "EmitterGeomCylinderParams", "EmitterGeomExplicitParams" }; + ParamDefTable[18].setRefVariantVals((const char**)RefVariantVals, 5); + + + + } + + // Initialize DefinitionImpl node: nodeIndex=19, longName="emitterDuration" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[19]; + ParamDef->init("emitterDuration", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("min", uint64_t(0), true); + ParamDefTable[19].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("longDescription", "Specifies a duration (in seconds) that the emitter will emit for after being enabled.\nAfter the specified duration, the emitter will turn off, unless it has already been explicitly turned off via an API call.\nThe special value 0.0f means there is no duration, and the emitter will remain on until explicitly turned off.", true); + HintTable[1].init("min", uint64_t(0), true); + HintTable[2].init("shortDescription", "Emitter duration time (in seconds)", true); + ParamDefTable[19].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=20, longName="emitterVelocityScale" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[20]; + ParamDef->init("emitterVelocityScale", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("longDescription", "Scaling value to control how much the velocity of the emitter affects the velocity of the particles.\nA value of 0 means no effect (legacy mode). A value of 1 will add the emitter actor velocity to the velocity produced by velocityRange.", true); + HintTable[1].init("shortDescription", "Scaling value to control how much the velocity of the emitter affects the velocity of the particles.", true); + ParamDefTable[20].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=21, longName="minSamplingFPS" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[21]; + ParamDef->init("minSamplingFPS", TYPE_U32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("defaultValue", uint64_t(0), true); + HintTable[1].init("min", uint64_t(0), true); + ParamDefTable[21].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#else + + static HintImpl HintTable[4]; + static Hint* HintPtrTable[4] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], }; + HintTable[0].init("defaultValue", uint64_t(0), true); + HintTable[1].init("longDescription", "It is used to reduce discontinuity in case of fast moving Emitters, by limiting particles generation step max. time by inverse of this value.\n", true); + HintTable[2].init("min", uint64_t(0), true); + HintTable[3].init("shortDescription", "Defines minimum FPS at which particles are generating (0-value means no limit in FPS)", true); + ParamDefTable[21].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=22, longName="rateVsTimeCurvePoints" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[22]; + ParamDef->init("rateVsTimeCurvePoints", TYPE_ARRAY, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[4]; + static Hint* HintPtrTable[4] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], }; + HintTable[0].init("DISPLAY_NAME", "rateVsEmitterDurationCurvePoints", true); + HintTable[1].init("editorCurve", uint64_t(1), true); + HintTable[2].init("xAxisLabel", "Emitter Duration", true); + HintTable[3].init("yAxisLabel", "Rate", true); + ParamDefTable[22].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#else + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("DISPLAY_NAME", "rateVsEmitterDurationCurvePoints", true); + HintTable[1].init("editorCurve", uint64_t(1), true); + HintTable[2].init("shortDescription", "Control points for rate vs emitter duration curve", true); + HintTable[3].init("xAxisLabel", "Emitter Duration", true); + HintTable[4].init("yAxisLabel", "Rate", true); + ParamDefTable[22].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + ParamDef->setArraySize(-1); + } + + // Initialize DefinitionImpl node: nodeIndex=23, longName="rateVsTimeCurvePoints[]" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[23]; + ParamDef->init("rateVsTimeCurvePoints", TYPE_STRUCT, "rateVsTimeCurvePoint", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[4]; + static Hint* HintPtrTable[4] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], }; + HintTable[0].init("DISPLAY_NAME", "rateVsEmitterDurationCurvePoints", true); + HintTable[1].init("editorCurve", uint64_t(1), true); + HintTable[2].init("xAxisLabel", "Emitter Duration", true); + HintTable[3].init("yAxisLabel", "Rate", true); + ParamDefTable[23].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#else + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("DISPLAY_NAME", "rateVsEmitterDurationCurvePoints", true); + HintTable[1].init("editorCurve", uint64_t(1), true); + HintTable[2].init("shortDescription", "Control points for rate vs emitter duration curve", true); + HintTable[3].init("xAxisLabel", "Emitter Duration", true); + HintTable[4].init("yAxisLabel", "Rate", true); + ParamDefTable[23].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=24, longName="rateVsTimeCurvePoints[].x" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[24]; + ParamDef->init("x", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("max", uint64_t(1), true); + HintTable[1].init("min", uint64_t(0), true); + ParamDefTable[24].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#else + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("max", uint64_t(1), true); + HintTable[1].init("min", uint64_t(0), true); + HintTable[2].init("shortDescription", "Time", true); + ParamDefTable[24].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=25, longName="rateVsTimeCurvePoints[].y" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[25]; + ParamDef->init("y", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Rate", true); + ParamDefTable[25].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // SetChildren for: nodeIndex=0, longName="" + { + static Definition* Children[15]; + Children[0] = PDEF_PTR(1); + Children[1] = PDEF_PTR(2); + Children[2] = PDEF_PTR(3); + Children[3] = PDEF_PTR(4); + Children[4] = PDEF_PTR(5); + Children[5] = PDEF_PTR(6); + Children[6] = PDEF_PTR(7); + Children[7] = PDEF_PTR(8); + Children[8] = PDEF_PTR(16); + Children[9] = PDEF_PTR(17); + Children[10] = PDEF_PTR(18); + Children[11] = PDEF_PTR(19); + Children[12] = PDEF_PTR(20); + Children[13] = PDEF_PTR(21); + Children[14] = PDEF_PTR(22); + + ParamDefTable[0].setChildren(Children, 15); + } + + // SetChildren for: nodeIndex=8, longName="lodParamDesc" + { + static Definition* Children[7]; + Children[0] = PDEF_PTR(9); + Children[1] = PDEF_PTR(10); + Children[2] = PDEF_PTR(11); + Children[3] = PDEF_PTR(12); + Children[4] = PDEF_PTR(13); + Children[5] = PDEF_PTR(14); + Children[6] = PDEF_PTR(15); + + ParamDefTable[8].setChildren(Children, 7); + } + + // SetChildren for: nodeIndex=22, longName="rateVsTimeCurvePoints" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(23); + + ParamDefTable[22].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=23, longName="rateVsTimeCurvePoints[]" + { + static Definition* Children[2]; + Children[0] = PDEF_PTR(24); + Children[1] = PDEF_PTR(25); + + ParamDefTable[23].setChildren(Children, 2); + } + + mBuiltFlag = true; + +} +void ApexEmitterAssetParameters::initStrings(void) +{ +} + +void ApexEmitterAssetParameters::initDynamicArrays(void) +{ + rateVsTimeCurvePoints.buf = NULL; + rateVsTimeCurvePoints.isAllocated = true; + rateVsTimeCurvePoints.elementSize = sizeof(rateVsTimeCurvePoint_Type); + rateVsTimeCurvePoints.arraySizes[0] = 0; +} + +void ApexEmitterAssetParameters::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + density = float(1); + rate = float(1); + lifetimeLow = float(1); + lifetimeHigh = float(1); + velocityLow = physx::PxVec3(init(0, 0, 0)); + velocityHigh = physx::PxVec3(init(0, 0, 0)); + maxSamples = uint32_t(0); + lodParamDesc.version = uint32_t(0); + lodParamDesc.maxDistance = float(0); + lodParamDesc.distanceWeight = float(1); + lodParamDesc.speedWeight = float(0); + lodParamDesc.lifeWeight = float(0); + lodParamDesc.separationWeight = float(0); + lodParamDesc.bias = float(1); + emitterDuration = float(PX_MAX_F32); + emitterVelocityScale = float(0); + minSamplingFPS = uint32_t(0); + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void ApexEmitterAssetParameters::initReferences(void) +{ + iofxAssetName = NULL; + + iosAssetName = NULL; + + geometryType = NULL; + +} + +void ApexEmitterAssetParameters::freeDynamicArrays(void) +{ + if (rateVsTimeCurvePoints.isAllocated && rateVsTimeCurvePoints.buf) + { + mParameterizedTraits->free(rateVsTimeCurvePoints.buf); + } +} + +void ApexEmitterAssetParameters::freeStrings(void) +{ +} + +void ApexEmitterAssetParameters::freeReferences(void) +{ + if (iofxAssetName) + { + iofxAssetName->destroy(); + } + + if (iosAssetName) + { + iosAssetName->destroy(); + } + + if (geometryType) + { + geometryType->destroy(); + } + +} + +} // namespace emitter +} // namespace nvidia diff --git a/APEX_1.4/module/emitter/src/autogen/EmitterAssetPreviewParameters.cpp b/APEX_1.4/module/emitter/src/autogen/EmitterAssetPreviewParameters.cpp new file mode 100644 index 00000000..9e42d9e9 --- /dev/null +++ b/APEX_1.4/module/emitter/src/autogen/EmitterAssetPreviewParameters.cpp @@ -0,0 +1,343 @@ +// 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 + + +#include "EmitterAssetPreviewParameters.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace emitter +{ + +using namespace EmitterAssetPreviewParametersNS; + +const char* const EmitterAssetPreviewParametersFactory::vptr = + NvParameterized::getVptr<EmitterAssetPreviewParameters, EmitterAssetPreviewParameters::ClassAlignment>(); + +const uint32_t NumParamDefs = 3; +static NvParameterized::DefinitionImpl* ParamDefTable; // now allocated in buildTree [NumParamDefs]; + + +static const size_t ParamLookupChildrenTable[] = +{ + 1, 2, +}; + +#define TENUM(type) nvidia::##type +#define CHILDREN(index) &ParamLookupChildrenTable[index] +static const NvParameterized::ParamLookupNode ParamLookupTable[NumParamDefs] = +{ + { TYPE_STRUCT, false, 0, CHILDREN(0), 2 }, + { TYPE_TRANSFORM, false, (size_t)(&((ParametersStruct*)0)->pose), NULL, 0 }, // pose + { TYPE_F32, false, (size_t)(&((ParametersStruct*)0)->scale), NULL, 0 }, // scale +}; + + +bool EmitterAssetPreviewParameters::mBuiltFlag = false; +NvParameterized::MutexType EmitterAssetPreviewParameters::mBuiltFlagMutex; + +EmitterAssetPreviewParameters::EmitterAssetPreviewParameters(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &EmitterAssetPreviewParametersFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +EmitterAssetPreviewParameters::~EmitterAssetPreviewParameters() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void EmitterAssetPreviewParameters::destroy() +{ + // We cache these fields here to avoid overwrite in destructor + bool doDeallocateSelf = mDoDeallocateSelf; + NvParameterized::Traits* traits = mParameterizedTraits; + int32_t* refCount = mRefCount; + void* buf = mBuffer; + + this->~EmitterAssetPreviewParameters(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* EmitterAssetPreviewParameters::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* EmitterAssetPreviewParameters::getParameterDefinitionTree(void) const +{ + EmitterAssetPreviewParameters* tmpParam = const_cast<EmitterAssetPreviewParameters*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType EmitterAssetPreviewParameters::getParameterHandle(const char* long_name, Handle& handle) const +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +NvParameterized::ErrorType EmitterAssetPreviewParameters::getParameterHandle(const char* long_name, Handle& handle) +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +void EmitterAssetPreviewParameters::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<EmitterAssetPreviewParameters::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ + +void EmitterAssetPreviewParameters::freeParameterDefinitionTable(NvParameterized::Traits* traits) +{ + if (!traits) + { + return; + } + + if (!mBuiltFlag) // Double-checked lock + { + return; + } + + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + + if (!mBuiltFlag) + { + return; + } + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + ParamDefTable[i].~DefinitionImpl(); + } + + traits->free(ParamDefTable); + + mBuiltFlag = false; +} + +#define PDEF_PTR(index) (&ParamDefTable[index]) + +void EmitterAssetPreviewParameters::buildTree(void) +{ + + uint32_t allocSize = sizeof(NvParameterized::DefinitionImpl) * NumParamDefs; + ParamDefTable = (NvParameterized::DefinitionImpl*)(mParameterizedTraits->alloc(allocSize)); + memset(ParamDefTable, 0, allocSize); + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + NV_PARAM_PLACEMENT_NEW(ParamDefTable + i, NvParameterized::DefinitionImpl)(*mParameterizedTraits); + } + + // Initialize DefinitionImpl node: nodeIndex=0, longName="" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[0]; + ParamDef->init("", TYPE_STRUCT, "STRUCT", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "This class is used for creating APEX Emitter Preview instances (shaped, ground, or impact emitters)", true); + ParamDefTable[0].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=1, longName="pose" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[1]; + ParamDef->init("pose", TYPE_TRANSFORM, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "The preview actor's position and rotation", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=2, longName="scale" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[2]; + ParamDef->init("scale", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "The preview actor's scale", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // SetChildren for: nodeIndex=0, longName="" + { + static Definition* Children[2]; + Children[0] = PDEF_PTR(1); + Children[1] = PDEF_PTR(2); + + ParamDefTable[0].setChildren(Children, 2); + } + + mBuiltFlag = true; + +} +void EmitterAssetPreviewParameters::initStrings(void) +{ +} + +void EmitterAssetPreviewParameters::initDynamicArrays(void) +{ +} + +void EmitterAssetPreviewParameters::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + pose = physx::PxTransform(physx::PxIdentity); + scale = float(1); + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void EmitterAssetPreviewParameters::initReferences(void) +{ +} + +void EmitterAssetPreviewParameters::freeDynamicArrays(void) +{ +} + +void EmitterAssetPreviewParameters::freeStrings(void) +{ +} + +void EmitterAssetPreviewParameters::freeReferences(void) +{ +} + +} // namespace emitter +} // namespace nvidia diff --git a/APEX_1.4/module/emitter/src/autogen/EmitterDebugRenderParams.cpp b/APEX_1.4/module/emitter/src/autogen/EmitterDebugRenderParams.cpp new file mode 100644 index 00000000..b679e652 --- /dev/null +++ b/APEX_1.4/module/emitter/src/autogen/EmitterDebugRenderParams.cpp @@ -0,0 +1,756 @@ +// 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 + + +#include "EmitterDebugRenderParams.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace emitter +{ + +using namespace EmitterDebugRenderParamsNS; + +const char* const EmitterDebugRenderParamsFactory::vptr = + NvParameterized::getVptr<EmitterDebugRenderParams, EmitterDebugRenderParams::ClassAlignment>(); + +const uint32_t NumParamDefs = 20; +static NvParameterized::DefinitionImpl* ParamDefTable; // now allocated in buildTree [NumParamDefs]; + + +static const size_t ParamLookupChildrenTable[] = +{ + 1, 8, 15, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 14, 16, 17, 18, 19, +}; + +#define TENUM(type) nvidia::##type +#define CHILDREN(index) &ParamLookupChildrenTable[index] +static const NvParameterized::ParamLookupNode ParamLookupTable[NumParamDefs] = +{ + { TYPE_STRUCT, false, 0, CHILDREN(0), 3 }, + { TYPE_STRUCT, false, (size_t)(&((ParametersStruct*)0)->apexEmitterParameters), CHILDREN(3), 6 }, // apexEmitterParameters + { TYPE_BOOL, false, (size_t)(&((ApexEmitterParameters_Type*)0)->VISUALIZE_APEX_EMITTER_ACTOR), NULL, 0 }, // apexEmitterParameters.VISUALIZE_APEX_EMITTER_ACTOR + { TYPE_BOOL, false, (size_t)(&((ApexEmitterParameters_Type*)0)->VISUALIZE_TOTAL_INJECTED_AABB), NULL, 0 }, // apexEmitterParameters.VISUALIZE_TOTAL_INJECTED_AABB + { TYPE_BOOL, false, (size_t)(&((ApexEmitterParameters_Type*)0)->VISUALIZE_APEX_EMITTER_ACTOR_POSE), NULL, 0 }, // apexEmitterParameters.VISUALIZE_APEX_EMITTER_ACTOR_POSE + { TYPE_F32, false, (size_t)(&((ApexEmitterParameters_Type*)0)->THRESHOLD_DISTANCE_APEX_EMITTER_ACTOR_POSE), NULL, 0 }, // apexEmitterParameters.THRESHOLD_DISTANCE_APEX_EMITTER_ACTOR_POSE + { TYPE_BOOL, false, (size_t)(&((ApexEmitterParameters_Type*)0)->VISUALIZE_APEX_EMITTER_ACTOR_NAME), NULL, 0 }, // apexEmitterParameters.VISUALIZE_APEX_EMITTER_ACTOR_NAME + { TYPE_F32, false, (size_t)(&((ApexEmitterParameters_Type*)0)->THRESHOLD_DISTANCE_APEX_EMITTER_ACTOR_NAME), NULL, 0 }, // apexEmitterParameters.THRESHOLD_DISTANCE_APEX_EMITTER_ACTOR_NAME + { TYPE_STRUCT, false, (size_t)(&((ParametersStruct*)0)->groundEmitterParameters), CHILDREN(9), 6 }, // groundEmitterParameters + { TYPE_BOOL, false, (size_t)(&((GroundEmitterParameters_Type*)0)->VISUALIZE_GROUND_EMITTER_ACTOR), NULL, 0 }, // groundEmitterParameters.VISUALIZE_GROUND_EMITTER_ACTOR + { TYPE_BOOL, false, (size_t)(&((GroundEmitterParameters_Type*)0)->VISUALIZE_GROUND_EMITTER_SPHERE), NULL, 0 }, // groundEmitterParameters.VISUALIZE_GROUND_EMITTER_SPHERE + { TYPE_BOOL, false, (size_t)(&((GroundEmitterParameters_Type*)0)->VISUALIZE_GROUND_EMITTER_GRID), NULL, 0 }, // groundEmitterParameters.VISUALIZE_GROUND_EMITTER_GRID + { TYPE_BOOL, false, (size_t)(&((GroundEmitterParameters_Type*)0)->VISUALIZE_GROUND_EMITTER_RAYCAST), NULL, 0 }, // groundEmitterParameters.VISUALIZE_GROUND_EMITTER_RAYCAST + { TYPE_BOOL, false, (size_t)(&((GroundEmitterParameters_Type*)0)->VISUALIZE_GROUND_EMITTER_ACTOR_POSE), NULL, 0 }, // groundEmitterParameters.VISUALIZE_GROUND_EMITTER_ACTOR_POSE + { TYPE_BOOL, false, (size_t)(&((GroundEmitterParameters_Type*)0)->VISUALIZE_GROUND_EMITTER_ACTOR_NAME), NULL, 0 }, // groundEmitterParameters.VISUALIZE_GROUND_EMITTER_ACTOR_NAME + { TYPE_STRUCT, false, (size_t)(&((ParametersStruct*)0)->impactEmitterParameters), CHILDREN(15), 4 }, // impactEmitterParameters + { TYPE_BOOL, false, (size_t)(&((ImpactEmitterParameters_Type*)0)->VISUALIZE_IMPACT_EMITTER_ACTOR), NULL, 0 }, // impactEmitterParameters.VISUALIZE_IMPACT_EMITTER_ACTOR + { TYPE_BOOL, false, (size_t)(&((ImpactEmitterParameters_Type*)0)->VISUALIZE_IMPACT_EMITTER_RAYCAST), NULL, 0 }, // impactEmitterParameters.VISUALIZE_IMPACT_EMITTER_RAYCAST + { TYPE_BOOL, false, (size_t)(&((ImpactEmitterParameters_Type*)0)->VISUALIZE_IMPACT_EMITTER_ACTOR_NAME), NULL, 0 }, // impactEmitterParameters.VISUALIZE_IMPACT_EMITTER_ACTOR_NAME + { TYPE_F32, false, (size_t)(&((ImpactEmitterParameters_Type*)0)->THRESHOLD_DISTANCE_IMPACT_EMITTER_ACTOR_NAME), NULL, 0 }, // impactEmitterParameters.THRESHOLD_DISTANCE_IMPACT_EMITTER_ACTOR_NAME +}; + + +bool EmitterDebugRenderParams::mBuiltFlag = false; +NvParameterized::MutexType EmitterDebugRenderParams::mBuiltFlagMutex; + +EmitterDebugRenderParams::EmitterDebugRenderParams(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &EmitterDebugRenderParamsFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +EmitterDebugRenderParams::~EmitterDebugRenderParams() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void EmitterDebugRenderParams::destroy() +{ + // We cache these fields here to avoid overwrite in destructor + bool doDeallocateSelf = mDoDeallocateSelf; + NvParameterized::Traits* traits = mParameterizedTraits; + int32_t* refCount = mRefCount; + void* buf = mBuffer; + + this->~EmitterDebugRenderParams(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* EmitterDebugRenderParams::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* EmitterDebugRenderParams::getParameterDefinitionTree(void) const +{ + EmitterDebugRenderParams* tmpParam = const_cast<EmitterDebugRenderParams*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType EmitterDebugRenderParams::getParameterHandle(const char* long_name, Handle& handle) const +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +NvParameterized::ErrorType EmitterDebugRenderParams::getParameterHandle(const char* long_name, Handle& handle) +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +void EmitterDebugRenderParams::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<EmitterDebugRenderParams::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ + +void EmitterDebugRenderParams::freeParameterDefinitionTable(NvParameterized::Traits* traits) +{ + if (!traits) + { + return; + } + + if (!mBuiltFlag) // Double-checked lock + { + return; + } + + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + + if (!mBuiltFlag) + { + return; + } + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + ParamDefTable[i].~DefinitionImpl(); + } + + traits->free(ParamDefTable); + + mBuiltFlag = false; +} + +#define PDEF_PTR(index) (&ParamDefTable[index]) + +void EmitterDebugRenderParams::buildTree(void) +{ + + uint32_t allocSize = sizeof(NvParameterized::DefinitionImpl) * NumParamDefs; + ParamDefTable = (NvParameterized::DefinitionImpl*)(mParameterizedTraits->alloc(allocSize)); + memset(ParamDefTable, 0, allocSize); + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + NV_PARAM_PLACEMENT_NEW(ParamDefTable + i, NvParameterized::DefinitionImpl)(*mParameterizedTraits); + } + + // Initialize DefinitionImpl node: nodeIndex=0, longName="" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[0]; + ParamDef->init("", TYPE_STRUCT, "STRUCT", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "This class contains debug rendering parameters for the emitter module.", true); + ParamDefTable[0].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=1, longName="apexEmitterParameters" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[1]; + ParamDef->init("apexEmitterParameters", TYPE_STRUCT, "ApexEmitterParameters", true); + + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=2, longName="apexEmitterParameters.VISUALIZE_APEX_EMITTER_ACTOR" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[2]; + ParamDef->init("VISUALIZE_APEX_EMITTER_ACTOR", TYPE_BOOL, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Enables/Disables visualization of all emitter actors. This parameter also switches on visualization of emitter's shape (each green grid encompasses emitter).", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=3, longName="apexEmitterParameters.VISUALIZE_TOTAL_INJECTED_AABB" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[3]; + ParamDef->init("VISUALIZE_TOTAL_INJECTED_AABB", TYPE_BOOL, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Draws red box which represents AABB boundary. All new particles are injected inside it.", true); + ParamDefTable[3].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=4, longName="apexEmitterParameters.VISUALIZE_APEX_EMITTER_ACTOR_POSE" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[4]; + ParamDef->init("VISUALIZE_APEX_EMITTER_ACTOR_POSE", TYPE_BOOL, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "For visualizing emitter's position. Draws arrows which represent axes. Blue arrow stands for Z axis, green - for Y and red - X. ", true); + ParamDefTable[4].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=5, longName="apexEmitterParameters.THRESHOLD_DISTANCE_APEX_EMITTER_ACTOR_POSE" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[5]; + ParamDef->init("THRESHOLD_DISTANCE_APEX_EMITTER_ACTOR_POSE", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Defines maximum distance, from which actor's position's visualization could be seen.", true); + ParamDefTable[5].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=6, longName="apexEmitterParameters.VISUALIZE_APEX_EMITTER_ACTOR_NAME" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[6]; + ParamDef->init("VISUALIZE_APEX_EMITTER_ACTOR_NAME", TYPE_BOOL, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Draws the emitter's asset's name next to the emitter.", true); + ParamDefTable[6].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=7, longName="apexEmitterParameters.THRESHOLD_DISTANCE_APEX_EMITTER_ACTOR_NAME" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[7]; + ParamDef->init("THRESHOLD_DISTANCE_APEX_EMITTER_ACTOR_NAME", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Defines maximum distance, from which actor name's visualization could be seen.", true); + ParamDefTable[7].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=8, longName="groundEmitterParameters" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[8]; + ParamDef->init("groundEmitterParameters", TYPE_STRUCT, "GroundEmitterParameters", true); + + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=9, longName="groundEmitterParameters.VISUALIZE_GROUND_EMITTER_ACTOR" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[9]; + ParamDef->init("VISUALIZE_GROUND_EMITTER_ACTOR", TYPE_BOOL, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Enables/Disables visualization of all ground emitter actors", true); + ParamDefTable[9].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=10, longName="groundEmitterParameters.VISUALIZE_GROUND_EMITTER_SPHERE" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[10]; + ParamDef->init("VISUALIZE_GROUND_EMITTER_SPHERE", TYPE_BOOL, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Draws green sphere which bounds ground emitter. ", true); + ParamDefTable[10].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=11, longName="groundEmitterParameters.VISUALIZE_GROUND_EMITTER_GRID" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[11]; + ParamDef->init("VISUALIZE_GROUND_EMITTER_GRID", TYPE_BOOL, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Draws yellow grid which bounds ground emitter. ", true); + ParamDefTable[11].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=12, longName="groundEmitterParameters.VISUALIZE_GROUND_EMITTER_RAYCAST" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[12]; + ParamDef->init("VISUALIZE_GROUND_EMITTER_RAYCAST", TYPE_BOOL, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Draws vertical green lines where new particles are generated. ", true); + ParamDefTable[12].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=13, longName="groundEmitterParameters.VISUALIZE_GROUND_EMITTER_ACTOR_POSE" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[13]; + ParamDef->init("VISUALIZE_GROUND_EMITTER_ACTOR_POSE", TYPE_BOOL, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "For visualizing emitter's position. Draws arrows which represent axes. Blue arrow stands for Z axis, green - for Y and red - X. ", true); + ParamDefTable[13].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=14, longName="groundEmitterParameters.VISUALIZE_GROUND_EMITTER_ACTOR_NAME" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[14]; + ParamDef->init("VISUALIZE_GROUND_EMITTER_ACTOR_NAME", TYPE_BOOL, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Draws the emitter's asset's name next to the emitter.", true); + ParamDefTable[14].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=15, longName="impactEmitterParameters" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[15]; + ParamDef->init("impactEmitterParameters", TYPE_STRUCT, "ImpactEmitterParameters", true); + + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=16, longName="impactEmitterParameters.VISUALIZE_IMPACT_EMITTER_ACTOR" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[16]; + ParamDef->init("VISUALIZE_IMPACT_EMITTER_ACTOR", TYPE_BOOL, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Enables/Disables visualization of all impact emitter actors", true); + ParamDefTable[16].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=17, longName="impactEmitterParameters.VISUALIZE_IMPACT_EMITTER_RAYCAST" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[17]; + ParamDef->init("VISUALIZE_IMPACT_EMITTER_RAYCAST", TYPE_BOOL, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Draws vertical line on the point of impact. ", true); + ParamDefTable[17].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=18, longName="impactEmitterParameters.VISUALIZE_IMPACT_EMITTER_ACTOR_NAME" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[18]; + ParamDef->init("VISUALIZE_IMPACT_EMITTER_ACTOR_NAME", TYPE_BOOL, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Draws the emitter's asset's name next to the emitter.", true); + ParamDefTable[18].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=19, longName="impactEmitterParameters.THRESHOLD_DISTANCE_IMPACT_EMITTER_ACTOR_NAME" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[19]; + ParamDef->init("THRESHOLD_DISTANCE_IMPACT_EMITTER_ACTOR_NAME", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Defines maximum distance, from which actor's names's visualization could be seen.", true); + ParamDefTable[19].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // SetChildren for: nodeIndex=0, longName="" + { + static Definition* Children[3]; + Children[0] = PDEF_PTR(1); + Children[1] = PDEF_PTR(8); + Children[2] = PDEF_PTR(15); + + ParamDefTable[0].setChildren(Children, 3); + } + + // SetChildren for: nodeIndex=1, longName="apexEmitterParameters" + { + static Definition* Children[6]; + Children[0] = PDEF_PTR(2); + Children[1] = PDEF_PTR(3); + Children[2] = PDEF_PTR(4); + Children[3] = PDEF_PTR(5); + Children[4] = PDEF_PTR(6); + Children[5] = PDEF_PTR(7); + + ParamDefTable[1].setChildren(Children, 6); + } + + // SetChildren for: nodeIndex=8, longName="groundEmitterParameters" + { + static Definition* Children[6]; + Children[0] = PDEF_PTR(9); + Children[1] = PDEF_PTR(10); + Children[2] = PDEF_PTR(11); + Children[3] = PDEF_PTR(12); + Children[4] = PDEF_PTR(13); + Children[5] = PDEF_PTR(14); + + ParamDefTable[8].setChildren(Children, 6); + } + + // SetChildren for: nodeIndex=15, longName="impactEmitterParameters" + { + static Definition* Children[4]; + Children[0] = PDEF_PTR(16); + Children[1] = PDEF_PTR(17); + Children[2] = PDEF_PTR(18); + Children[3] = PDEF_PTR(19); + + ParamDefTable[15].setChildren(Children, 4); + } + + mBuiltFlag = true; + +} +void EmitterDebugRenderParams::initStrings(void) +{ +} + +void EmitterDebugRenderParams::initDynamicArrays(void) +{ +} + +void EmitterDebugRenderParams::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + apexEmitterParameters.VISUALIZE_APEX_EMITTER_ACTOR = bool(false); + apexEmitterParameters.VISUALIZE_TOTAL_INJECTED_AABB = bool(false); + apexEmitterParameters.VISUALIZE_APEX_EMITTER_ACTOR_POSE = bool(true); + apexEmitterParameters.THRESHOLD_DISTANCE_APEX_EMITTER_ACTOR_POSE = float(3.402823466e+038); + apexEmitterParameters.VISUALIZE_APEX_EMITTER_ACTOR_NAME = bool(true); + apexEmitterParameters.THRESHOLD_DISTANCE_APEX_EMITTER_ACTOR_NAME = float(3.402823466e+038); + groundEmitterParameters.VISUALIZE_GROUND_EMITTER_ACTOR = bool(true); + groundEmitterParameters.VISUALIZE_GROUND_EMITTER_SPHERE = bool(false); + groundEmitterParameters.VISUALIZE_GROUND_EMITTER_GRID = bool(false); + groundEmitterParameters.VISUALIZE_GROUND_EMITTER_RAYCAST = bool(false); + groundEmitterParameters.VISUALIZE_GROUND_EMITTER_ACTOR_POSE = bool(false); + groundEmitterParameters.VISUALIZE_GROUND_EMITTER_ACTOR_NAME = bool(false); + impactEmitterParameters.VISUALIZE_IMPACT_EMITTER_ACTOR = bool(false); + impactEmitterParameters.VISUALIZE_IMPACT_EMITTER_RAYCAST = bool(true); + impactEmitterParameters.VISUALIZE_IMPACT_EMITTER_ACTOR_NAME = bool(true); + impactEmitterParameters.THRESHOLD_DISTANCE_IMPACT_EMITTER_ACTOR_NAME = float(3.402823466e+038); + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void EmitterDebugRenderParams::initReferences(void) +{ +} + +void EmitterDebugRenderParams::freeDynamicArrays(void) +{ +} + +void EmitterDebugRenderParams::freeStrings(void) +{ +} + +void EmitterDebugRenderParams::freeReferences(void) +{ +} + +} // namespace emitter +} // namespace nvidia diff --git a/APEX_1.4/module/emitter/src/autogen/EmitterGeomBoxParams.cpp b/APEX_1.4/module/emitter/src/autogen/EmitterGeomBoxParams.cpp new file mode 100644 index 00000000..38e3b41f --- /dev/null +++ b/APEX_1.4/module/emitter/src/autogen/EmitterGeomBoxParams.cpp @@ -0,0 +1,348 @@ +// 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 + + +#include "EmitterGeomBoxParams.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace emitter +{ + +using namespace EmitterGeomBoxParamsNS; + +const char* const EmitterGeomBoxParamsFactory::vptr = + NvParameterized::getVptr<EmitterGeomBoxParams, EmitterGeomBoxParams::ClassAlignment>(); + +const uint32_t NumParamDefs = 3; +static NvParameterized::DefinitionImpl* ParamDefTable; // now allocated in buildTree [NumParamDefs]; + + +static const size_t ParamLookupChildrenTable[] = +{ + 1, 2, +}; + +#define TENUM(type) nvidia::##type +#define CHILDREN(index) &ParamLookupChildrenTable[index] +static const NvParameterized::ParamLookupNode ParamLookupTable[NumParamDefs] = +{ + { TYPE_STRUCT, false, 0, CHILDREN(0), 2 }, + { TYPE_ENUM, false, (size_t)(&((ParametersStruct*)0)->emitterType), NULL, 0 }, // emitterType + { TYPE_VEC3, false, (size_t)(&((ParametersStruct*)0)->extents), NULL, 0 }, // extents +}; + + +bool EmitterGeomBoxParams::mBuiltFlag = false; +NvParameterized::MutexType EmitterGeomBoxParams::mBuiltFlagMutex; + +EmitterGeomBoxParams::EmitterGeomBoxParams(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &EmitterGeomBoxParamsFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +EmitterGeomBoxParams::~EmitterGeomBoxParams() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void EmitterGeomBoxParams::destroy() +{ + // We cache these fields here to avoid overwrite in destructor + bool doDeallocateSelf = mDoDeallocateSelf; + NvParameterized::Traits* traits = mParameterizedTraits; + int32_t* refCount = mRefCount; + void* buf = mBuffer; + + this->~EmitterGeomBoxParams(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* EmitterGeomBoxParams::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* EmitterGeomBoxParams::getParameterDefinitionTree(void) const +{ + EmitterGeomBoxParams* tmpParam = const_cast<EmitterGeomBoxParams*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType EmitterGeomBoxParams::getParameterHandle(const char* long_name, Handle& handle) const +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +NvParameterized::ErrorType EmitterGeomBoxParams::getParameterHandle(const char* long_name, Handle& handle) +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +void EmitterGeomBoxParams::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<EmitterGeomBoxParams::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ + +void EmitterGeomBoxParams::freeParameterDefinitionTable(NvParameterized::Traits* traits) +{ + if (!traits) + { + return; + } + + if (!mBuiltFlag) // Double-checked lock + { + return; + } + + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + + if (!mBuiltFlag) + { + return; + } + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + ParamDefTable[i].~DefinitionImpl(); + } + + traits->free(ParamDefTable); + + mBuiltFlag = false; +} + +#define PDEF_PTR(index) (&ParamDefTable[index]) + +void EmitterGeomBoxParams::buildTree(void) +{ + + uint32_t allocSize = sizeof(NvParameterized::DefinitionImpl) * NumParamDefs; + ParamDefTable = (NvParameterized::DefinitionImpl*)(mParameterizedTraits->alloc(allocSize)); + memset(ParamDefTable, 0, allocSize); + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + NV_PARAM_PLACEMENT_NEW(ParamDefTable + i, NvParameterized::DefinitionImpl)(*mParameterizedTraits); + } + + // Initialize DefinitionImpl node: nodeIndex=0, longName="" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[0]; + ParamDef->init("", TYPE_STRUCT, "STRUCT", true); + + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=1, longName="emitterType" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[1]; + ParamDef->init("emitterType", TYPE_ENUM, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("defaultValue", "rate", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("defaultValue", "rate", true); + HintTable[1].init("longDescription", "rate - The emitter will emit at the rate specified by the asset's rateRange\\n\ndensityOnce - The emitter will fill the geometry according to the asset's densityRange\\n\ndensityBrush - As the emitter moves, the emitter will fill the volume that is not already covered by the previous position\\n\nfill - The emitter will fill the volume with particles based on the particle size\\n\n", true); + HintTable[2].init("shortDescription", "Emitter Type", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + static const char* const EnumVals[] = { "rate", "densityOnce", "densityBrush", "fill" }; + ParamDefTable[1].setEnumVals((const char**)EnumVals, 4); + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=2, longName="extents" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[2]; + ParamDef->init("extents", TYPE_VEC3, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("gameScale", "true", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("gameScale", "true", true); + HintTable[1].init("shortDescription", "Box Extents", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // SetChildren for: nodeIndex=0, longName="" + { + static Definition* Children[2]; + Children[0] = PDEF_PTR(1); + Children[1] = PDEF_PTR(2); + + ParamDefTable[0].setChildren(Children, 2); + } + + mBuiltFlag = true; + +} +void EmitterGeomBoxParams::initStrings(void) +{ +} + +void EmitterGeomBoxParams::initDynamicArrays(void) +{ +} + +void EmitterGeomBoxParams::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + emitterType = (const char*)"rate"; + extents = physx::PxVec3(init(1, 1, 1)); + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void EmitterGeomBoxParams::initReferences(void) +{ +} + +void EmitterGeomBoxParams::freeDynamicArrays(void) +{ +} + +void EmitterGeomBoxParams::freeStrings(void) +{ +} + +void EmitterGeomBoxParams::freeReferences(void) +{ +} + +} // namespace emitter +} // namespace nvidia diff --git a/APEX_1.4/module/emitter/src/autogen/EmitterGeomCylinderParams.cpp b/APEX_1.4/module/emitter/src/autogen/EmitterGeomCylinderParams.cpp new file mode 100644 index 00000000..92604390 --- /dev/null +++ b/APEX_1.4/module/emitter/src/autogen/EmitterGeomCylinderParams.cpp @@ -0,0 +1,387 @@ +// 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 + + +#include "EmitterGeomCylinderParams.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace emitter +{ + +using namespace EmitterGeomCylinderParamsNS; + +const char* const EmitterGeomCylinderParamsFactory::vptr = + NvParameterized::getVptr<EmitterGeomCylinderParams, EmitterGeomCylinderParams::ClassAlignment>(); + +const uint32_t NumParamDefs = 4; +static NvParameterized::DefinitionImpl* ParamDefTable; // now allocated in buildTree [NumParamDefs]; + + +static const size_t ParamLookupChildrenTable[] = +{ + 1, 2, 3, +}; + +#define TENUM(type) nvidia::##type +#define CHILDREN(index) &ParamLookupChildrenTable[index] +static const NvParameterized::ParamLookupNode ParamLookupTable[NumParamDefs] = +{ + { TYPE_STRUCT, false, 0, CHILDREN(0), 3 }, + { TYPE_ENUM, false, (size_t)(&((ParametersStruct*)0)->emitterType), NULL, 0 }, // emitterType + { TYPE_F32, false, (size_t)(&((ParametersStruct*)0)->radius), NULL, 0 }, // radius + { TYPE_F32, false, (size_t)(&((ParametersStruct*)0)->height), NULL, 0 }, // height +}; + + +bool EmitterGeomCylinderParams::mBuiltFlag = false; +NvParameterized::MutexType EmitterGeomCylinderParams::mBuiltFlagMutex; + +EmitterGeomCylinderParams::EmitterGeomCylinderParams(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &EmitterGeomCylinderParamsFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +EmitterGeomCylinderParams::~EmitterGeomCylinderParams() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void EmitterGeomCylinderParams::destroy() +{ + // We cache these fields here to avoid overwrite in destructor + bool doDeallocateSelf = mDoDeallocateSelf; + NvParameterized::Traits* traits = mParameterizedTraits; + int32_t* refCount = mRefCount; + void* buf = mBuffer; + + this->~EmitterGeomCylinderParams(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* EmitterGeomCylinderParams::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* EmitterGeomCylinderParams::getParameterDefinitionTree(void) const +{ + EmitterGeomCylinderParams* tmpParam = const_cast<EmitterGeomCylinderParams*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType EmitterGeomCylinderParams::getParameterHandle(const char* long_name, Handle& handle) const +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +NvParameterized::ErrorType EmitterGeomCylinderParams::getParameterHandle(const char* long_name, Handle& handle) +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +void EmitterGeomCylinderParams::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<EmitterGeomCylinderParams::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ + +void EmitterGeomCylinderParams::freeParameterDefinitionTable(NvParameterized::Traits* traits) +{ + if (!traits) + { + return; + } + + if (!mBuiltFlag) // Double-checked lock + { + return; + } + + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + + if (!mBuiltFlag) + { + return; + } + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + ParamDefTable[i].~DefinitionImpl(); + } + + traits->free(ParamDefTable); + + mBuiltFlag = false; +} + +#define PDEF_PTR(index) (&ParamDefTable[index]) + +void EmitterGeomCylinderParams::buildTree(void) +{ + + uint32_t allocSize = sizeof(NvParameterized::DefinitionImpl) * NumParamDefs; + ParamDefTable = (NvParameterized::DefinitionImpl*)(mParameterizedTraits->alloc(allocSize)); + memset(ParamDefTable, 0, allocSize); + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + NV_PARAM_PLACEMENT_NEW(ParamDefTable + i, NvParameterized::DefinitionImpl)(*mParameterizedTraits); + } + + // Initialize DefinitionImpl node: nodeIndex=0, longName="" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[0]; + ParamDef->init("", TYPE_STRUCT, "STRUCT", true); + + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=1, longName="emitterType" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[1]; + ParamDef->init("emitterType", TYPE_ENUM, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("defaultValue", "rate", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("defaultValue", "rate", true); + HintTable[1].init("longDescription", "rate - The emitter will emit at the rate specified by the asset's rateRange\\n\ndensityOnce - The emitter will fill the geometry according to the asset's densityRange\\n\ndensityBrush - As the emitter moves, the emitter will fill the volume that is not already covered by the previous position\\n\nfill - The emitter will fill the volume with particles based on the particle size\\n\n", true); + HintTable[2].init("shortDescription", "Emitter Type", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + static const char* const EnumVals[] = { "rate", "densityOnce", "densityBrush", "fill" }; + ParamDefTable[1].setEnumVals((const char**)EnumVals, 4); + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=2, longName="radius" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[2]; + ParamDef->init("radius", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("defaultValue", uint64_t(1), true); + HintTable[1].init("gameScale", "true", true); + HintTable[2].init("min", uint64_t(0), true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#else + + static HintImpl HintTable[4]; + static Hint* HintPtrTable[4] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], }; + HintTable[0].init("defaultValue", uint64_t(1), true); + HintTable[1].init("gameScale", "true", true); + HintTable[2].init("min", uint64_t(0), true); + HintTable[3].init("shortDescription", "Cylinder Radius", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=3, longName="height" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[3]; + ParamDef->init("height", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("defaultValue", uint64_t(1), true); + HintTable[1].init("gameScale", "true", true); + HintTable[2].init("min", uint64_t(0), true); + ParamDefTable[3].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#else + + static HintImpl HintTable[4]; + static Hint* HintPtrTable[4] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], }; + HintTable[0].init("defaultValue", uint64_t(1), true); + HintTable[1].init("gameScale", "true", true); + HintTable[2].init("min", uint64_t(0), true); + HintTable[3].init("shortDescription", "Cylinder Height", true); + ParamDefTable[3].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // SetChildren for: nodeIndex=0, longName="" + { + static Definition* Children[3]; + Children[0] = PDEF_PTR(1); + Children[1] = PDEF_PTR(2); + Children[2] = PDEF_PTR(3); + + ParamDefTable[0].setChildren(Children, 3); + } + + mBuiltFlag = true; + +} +void EmitterGeomCylinderParams::initStrings(void) +{ +} + +void EmitterGeomCylinderParams::initDynamicArrays(void) +{ +} + +void EmitterGeomCylinderParams::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + emitterType = (const char*)"rate"; + radius = float(1.0f); + height = float(1.0f); + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void EmitterGeomCylinderParams::initReferences(void) +{ +} + +void EmitterGeomCylinderParams::freeDynamicArrays(void) +{ +} + +void EmitterGeomCylinderParams::freeStrings(void) +{ +} + +void EmitterGeomCylinderParams::freeReferences(void) +{ +} + +} // namespace emitter +} // namespace nvidia diff --git a/APEX_1.4/module/emitter/src/autogen/EmitterGeomExplicitParams.cpp b/APEX_1.4/module/emitter/src/autogen/EmitterGeomExplicitParams.cpp new file mode 100644 index 00000000..162200be --- /dev/null +++ b/APEX_1.4/module/emitter/src/autogen/EmitterGeomExplicitParams.cpp @@ -0,0 +1,1150 @@ +// 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 + + +#include "EmitterGeomExplicitParams.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace emitter +{ + +using namespace EmitterGeomExplicitParamsNS; + +const char* const EmitterGeomExplicitParamsFactory::vptr = + NvParameterized::getVptr<EmitterGeomExplicitParams, EmitterGeomExplicitParams::ClassAlignment>(); + +const uint32_t NumParamDefs = 27; +static NvParameterized::DefinitionImpl* ParamDefTable; // now allocated in buildTree [NumParamDefs]; + + +static const size_t ParamLookupChildrenTable[] = +{ + 1, 2, 9, 17, 3, 7, 4, 5, 6, 8, 10, 15, 11, 12, 13, 14, 16, 18, 25, 19, 20, 21, 22, + 23, 24, 26, +}; + +#define TENUM(type) nvidia::##type +#define CHILDREN(index) &ParamLookupChildrenTable[index] +static const NvParameterized::ParamLookupNode ParamLookupTable[NumParamDefs] = +{ + { TYPE_STRUCT, false, 0, CHILDREN(0), 4 }, + { TYPE_F32, false, (size_t)(&((ParametersStruct*)0)->distance), NULL, 0 }, // distance + { TYPE_STRUCT, false, (size_t)(&((ParametersStruct*)0)->points), CHILDREN(4), 2 }, // points + { TYPE_ARRAY, true, (size_t)(&((ExplicitPoints_Type*)0)->positions), CHILDREN(6), 1 }, // points.positions + { TYPE_STRUCT, false, 1 * sizeof(PointParams_Type), CHILDREN(7), 2 }, // points.positions[] + { TYPE_VEC3, false, (size_t)(&((PointParams_Type*)0)->position), NULL, 0 }, // points.positions[].position + { TYPE_BOOL, false, (size_t)(&((PointParams_Type*)0)->doDetectOverlaps), NULL, 0 }, // points.positions[].doDetectOverlaps + { TYPE_ARRAY, true, (size_t)(&((ExplicitPoints_Type*)0)->velocities), CHILDREN(9), 1 }, // points.velocities + { TYPE_VEC3, false, 1 * sizeof(physx::PxVec3), NULL, 0 }, // points.velocities[] + { TYPE_STRUCT, false, (size_t)(&((ParametersStruct*)0)->spheres), CHILDREN(10), 2 }, // spheres + { TYPE_ARRAY, true, (size_t)(&((ExplicitSpheres_Type*)0)->positions), CHILDREN(12), 1 }, // spheres.positions + { TYPE_STRUCT, false, 1 * sizeof(SphereParams_Type), CHILDREN(13), 3 }, // spheres.positions[] + { TYPE_VEC3, false, (size_t)(&((SphereParams_Type*)0)->center), NULL, 0 }, // spheres.positions[].center + { TYPE_F32, false, (size_t)(&((SphereParams_Type*)0)->radius), NULL, 0 }, // spheres.positions[].radius + { TYPE_BOOL, false, (size_t)(&((SphereParams_Type*)0)->doDetectOverlaps), NULL, 0 }, // spheres.positions[].doDetectOverlaps + { TYPE_ARRAY, true, (size_t)(&((ExplicitSpheres_Type*)0)->velocities), CHILDREN(16), 1 }, // spheres.velocities + { TYPE_VEC3, false, 1 * sizeof(physx::PxVec3), NULL, 0 }, // spheres.velocities[] + { TYPE_STRUCT, false, (size_t)(&((ParametersStruct*)0)->ellipsoids), CHILDREN(17), 2 }, // ellipsoids + { TYPE_ARRAY, true, (size_t)(&((ExplicitEllipsoids_Type*)0)->positions), CHILDREN(19), 1 }, // ellipsoids.positions + { TYPE_STRUCT, false, 1 * sizeof(EllipsoidParams_Type), CHILDREN(20), 5 }, // ellipsoids.positions[] + { TYPE_VEC3, false, (size_t)(&((EllipsoidParams_Type*)0)->center), NULL, 0 }, // ellipsoids.positions[].center + { TYPE_F32, false, (size_t)(&((EllipsoidParams_Type*)0)->radius), NULL, 0 }, // ellipsoids.positions[].radius + { TYPE_VEC3, false, (size_t)(&((EllipsoidParams_Type*)0)->normal), NULL, 0 }, // ellipsoids.positions[].normal + { TYPE_F32, false, (size_t)(&((EllipsoidParams_Type*)0)->polarRadius), NULL, 0 }, // ellipsoids.positions[].polarRadius + { TYPE_BOOL, false, (size_t)(&((EllipsoidParams_Type*)0)->doDetectOverlaps), NULL, 0 }, // ellipsoids.positions[].doDetectOverlaps + { TYPE_ARRAY, true, (size_t)(&((ExplicitEllipsoids_Type*)0)->velocities), CHILDREN(25), 1 }, // ellipsoids.velocities + { TYPE_VEC3, false, 1 * sizeof(physx::PxVec3), NULL, 0 }, // ellipsoids.velocities[] +}; + + +bool EmitterGeomExplicitParams::mBuiltFlag = false; +NvParameterized::MutexType EmitterGeomExplicitParams::mBuiltFlagMutex; + +EmitterGeomExplicitParams::EmitterGeomExplicitParams(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &EmitterGeomExplicitParamsFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +EmitterGeomExplicitParams::~EmitterGeomExplicitParams() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void EmitterGeomExplicitParams::destroy() +{ + // We cache these fields here to avoid overwrite in destructor + bool doDeallocateSelf = mDoDeallocateSelf; + NvParameterized::Traits* traits = mParameterizedTraits; + int32_t* refCount = mRefCount; + void* buf = mBuffer; + + this->~EmitterGeomExplicitParams(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* EmitterGeomExplicitParams::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* EmitterGeomExplicitParams::getParameterDefinitionTree(void) const +{ + EmitterGeomExplicitParams* tmpParam = const_cast<EmitterGeomExplicitParams*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType EmitterGeomExplicitParams::getParameterHandle(const char* long_name, Handle& handle) const +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +NvParameterized::ErrorType EmitterGeomExplicitParams::getParameterHandle(const char* long_name, Handle& handle) +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +void EmitterGeomExplicitParams::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<EmitterGeomExplicitParams::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ + +void EmitterGeomExplicitParams::freeParameterDefinitionTable(NvParameterized::Traits* traits) +{ + if (!traits) + { + return; + } + + if (!mBuiltFlag) // Double-checked lock + { + return; + } + + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + + if (!mBuiltFlag) + { + return; + } + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + ParamDefTable[i].~DefinitionImpl(); + } + + traits->free(ParamDefTable); + + mBuiltFlag = false; +} + +#define PDEF_PTR(index) (&ParamDefTable[index]) + +void EmitterGeomExplicitParams::buildTree(void) +{ + + uint32_t allocSize = sizeof(NvParameterized::DefinitionImpl) * NumParamDefs; + ParamDefTable = (NvParameterized::DefinitionImpl*)(mParameterizedTraits->alloc(allocSize)); + memset(ParamDefTable, 0, allocSize); + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + NV_PARAM_PLACEMENT_NEW(ParamDefTable + i, NvParameterized::DefinitionImpl)(*mParameterizedTraits); + } + + // Initialize DefinitionImpl node: nodeIndex=0, longName="" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[0]; + ParamDef->init("", TYPE_STRUCT, "STRUCT", true); + + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=1, longName="distance" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[1]; + ParamDef->init("distance", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("gameScale", "true", true); + HintTable[1].init("min", double(0.0f), true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#else + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("gameScale", "true", true); + HintTable[1].init("min", double(0.0f), true); + HintTable[2].init("shortDescription", "Average distance between particles", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=2, longName="points" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[2]; + ParamDef->init("points", TYPE_STRUCT, "ExplicitPoints", true); + + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=3, longName="points.positions" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[3]; + ParamDef->init("positions", TYPE_ARRAY, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("gameScale", "true", true); + ParamDefTable[3].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("gameScale", "true", true); + HintTable[1].init("shortDescription", "List of point positions", true); + ParamDefTable[3].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + ParamDef->setArraySize(-1); + } + + // Initialize DefinitionImpl node: nodeIndex=4, longName="points.positions[]" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[4]; + ParamDef->init("positions", TYPE_STRUCT, "PointParams", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("gameScale", "true", true); + ParamDefTable[4].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("gameScale", "true", true); + HintTable[1].init("shortDescription", "List of point positions", true); + ParamDefTable[4].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=5, longName="points.positions[].position" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[5]; + ParamDef->init("position", TYPE_VEC3, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("gameScale", "true", true); + ParamDefTable[5].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("gameScale", "true", true); + HintTable[1].init("shortDescription", "Initial position", true); + ParamDefTable[5].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=6, longName="points.positions[].doDetectOverlaps" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[6]; + ParamDef->init("doDetectOverlaps", TYPE_BOOL, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("defaultValue", "false", true); + ParamDefTable[6].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("defaultValue", "false", true); + HintTable[1].init("shortDescription", "Avoid overlaps with other shapes?", true); + ParamDefTable[6].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=7, longName="points.velocities" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[7]; + ParamDef->init("velocities", TYPE_ARRAY, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("gameScale", "true", true); + ParamDefTable[7].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("gameScale", "true", true); + HintTable[1].init("shortDescription", "List of initial velocities", true); + ParamDefTable[7].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + ParamDef->setArraySize(-1); + } + + // Initialize DefinitionImpl node: nodeIndex=8, longName="points.velocities[]" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[8]; + ParamDef->init("velocities", TYPE_VEC3, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("gameScale", "true", true); + ParamDefTable[8].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("gameScale", "true", true); + HintTable[1].init("shortDescription", "List of initial velocities", true); + ParamDefTable[8].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=9, longName="spheres" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[9]; + ParamDef->init("spheres", TYPE_STRUCT, "ExplicitSpheres", true); + + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=10, longName="spheres.positions" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[10]; + ParamDef->init("positions", TYPE_ARRAY, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("gameScale", "true", true); + ParamDefTable[10].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("gameScale", "true", true); + HintTable[1].init("shortDescription", "List of sphere positions", true); + ParamDefTable[10].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + ParamDef->setArraySize(-1); + } + + // Initialize DefinitionImpl node: nodeIndex=11, longName="spheres.positions[]" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[11]; + ParamDef->init("positions", TYPE_STRUCT, "SphereParams", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("gameScale", "true", true); + ParamDefTable[11].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("gameScale", "true", true); + HintTable[1].init("shortDescription", "List of sphere positions", true); + ParamDefTable[11].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=12, longName="spheres.positions[].center" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[12]; + ParamDef->init("center", TYPE_VEC3, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("gameScale", "true", true); + ParamDefTable[12].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("gameScale", "true", true); + HintTable[1].init("shortDescription", "Sphere centers", true); + ParamDefTable[12].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=13, longName="spheres.positions[].radius" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[13]; + ParamDef->init("radius", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("gameScale", "true", true); + HintTable[1].init("min", double(0.0f), true); + ParamDefTable[13].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#else + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("gameScale", "true", true); + HintTable[1].init("min", double(0.0f), true); + HintTable[2].init("shortDescription", "Sphere radiuses", true); + ParamDefTable[13].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=14, longName="spheres.positions[].doDetectOverlaps" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[14]; + ParamDef->init("doDetectOverlaps", TYPE_BOOL, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("defaultValue", "false", true); + ParamDefTable[14].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("defaultValue", "false", true); + HintTable[1].init("shortDescription", "Avoid overlaps with other shapes?", true); + ParamDefTable[14].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=15, longName="spheres.velocities" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[15]; + ParamDef->init("velocities", TYPE_ARRAY, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("gameScale", "true", true); + ParamDefTable[15].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("gameScale", "true", true); + HintTable[1].init("shortDescription", "List of initial velocities for particles in sphere", true); + ParamDefTable[15].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + ParamDef->setArraySize(-1); + } + + // Initialize DefinitionImpl node: nodeIndex=16, longName="spheres.velocities[]" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[16]; + ParamDef->init("velocities", TYPE_VEC3, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("gameScale", "true", true); + ParamDefTable[16].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("gameScale", "true", true); + HintTable[1].init("shortDescription", "List of initial velocities for particles in sphere", true); + ParamDefTable[16].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=17, longName="ellipsoids" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[17]; + ParamDef->init("ellipsoids", TYPE_STRUCT, "ExplicitEllipsoids", true); + + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=18, longName="ellipsoids.positions" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[18]; + ParamDef->init("positions", TYPE_ARRAY, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("gameScale", "true", true); + ParamDefTable[18].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("gameScale", "true", true); + HintTable[1].init("shortDescription", "List of ellipsoid positions", true); + ParamDefTable[18].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + ParamDef->setArraySize(-1); + } + + // Initialize DefinitionImpl node: nodeIndex=19, longName="ellipsoids.positions[]" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[19]; + ParamDef->init("positions", TYPE_STRUCT, "EllipsoidParams", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("gameScale", "true", true); + ParamDefTable[19].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("gameScale", "true", true); + HintTable[1].init("shortDescription", "List of ellipsoid positions", true); + ParamDefTable[19].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=20, longName="ellipsoids.positions[].center" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[20]; + ParamDef->init("center", TYPE_VEC3, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("gameScale", "true", true); + ParamDefTable[20].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("gameScale", "true", true); + HintTable[1].init("shortDescription", "Sphere centers", true); + ParamDefTable[20].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=21, longName="ellipsoids.positions[].radius" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[21]; + ParamDef->init("radius", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("gameScale", "true", true); + HintTable[1].init("min", double(0.0f), true); + ParamDefTable[21].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#else + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("gameScale", "true", true); + HintTable[1].init("min", double(0.0f), true); + HintTable[2].init("shortDescription", "Sphere radiuses", true); + ParamDefTable[21].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=22, longName="ellipsoids.positions[].normal" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[22]; + ParamDef->init("normal", TYPE_VEC3, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Normal to equatorial planes", true); + ParamDefTable[22].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=23, longName="ellipsoids.positions[].polarRadius" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[23]; + ParamDef->init("polarRadius", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("gameScale", "true", true); + HintTable[1].init("min", double(0.0f), true); + ParamDefTable[23].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#else + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("gameScale", "true", true); + HintTable[1].init("min", double(0.0f), true); + HintTable[2].init("shortDescription", "Polar radius", true); + ParamDefTable[23].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=24, longName="ellipsoids.positions[].doDetectOverlaps" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[24]; + ParamDef->init("doDetectOverlaps", TYPE_BOOL, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("defaultValue", "false", true); + ParamDefTable[24].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("defaultValue", "false", true); + HintTable[1].init("shortDescription", "Avoid overlaps with other shapes?", true); + ParamDefTable[24].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=25, longName="ellipsoids.velocities" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[25]; + ParamDef->init("velocities", TYPE_ARRAY, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("gameScale", "true", true); + ParamDefTable[25].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("gameScale", "true", true); + HintTable[1].init("shortDescription", "List of initial velocities for particles in ellipsoid", true); + ParamDefTable[25].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + ParamDef->setArraySize(-1); + } + + // Initialize DefinitionImpl node: nodeIndex=26, longName="ellipsoids.velocities[]" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[26]; + ParamDef->init("velocities", TYPE_VEC3, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("gameScale", "true", true); + ParamDefTable[26].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("gameScale", "true", true); + HintTable[1].init("shortDescription", "List of initial velocities for particles in ellipsoid", true); + ParamDefTable[26].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // SetChildren for: nodeIndex=0, longName="" + { + static Definition* Children[4]; + Children[0] = PDEF_PTR(1); + Children[1] = PDEF_PTR(2); + Children[2] = PDEF_PTR(9); + Children[3] = PDEF_PTR(17); + + ParamDefTable[0].setChildren(Children, 4); + } + + // SetChildren for: nodeIndex=2, longName="points" + { + static Definition* Children[2]; + Children[0] = PDEF_PTR(3); + Children[1] = PDEF_PTR(7); + + ParamDefTable[2].setChildren(Children, 2); + } + + // SetChildren for: nodeIndex=3, longName="points.positions" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(4); + + ParamDefTable[3].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=4, longName="points.positions[]" + { + static Definition* Children[2]; + Children[0] = PDEF_PTR(5); + Children[1] = PDEF_PTR(6); + + ParamDefTable[4].setChildren(Children, 2); + } + + // SetChildren for: nodeIndex=7, longName="points.velocities" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(8); + + ParamDefTable[7].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=9, longName="spheres" + { + static Definition* Children[2]; + Children[0] = PDEF_PTR(10); + Children[1] = PDEF_PTR(15); + + ParamDefTable[9].setChildren(Children, 2); + } + + // SetChildren for: nodeIndex=10, longName="spheres.positions" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(11); + + ParamDefTable[10].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=11, longName="spheres.positions[]" + { + static Definition* Children[3]; + Children[0] = PDEF_PTR(12); + Children[1] = PDEF_PTR(13); + Children[2] = PDEF_PTR(14); + + ParamDefTable[11].setChildren(Children, 3); + } + + // SetChildren for: nodeIndex=15, longName="spheres.velocities" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(16); + + ParamDefTable[15].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=17, longName="ellipsoids" + { + static Definition* Children[2]; + Children[0] = PDEF_PTR(18); + Children[1] = PDEF_PTR(25); + + ParamDefTable[17].setChildren(Children, 2); + } + + // SetChildren for: nodeIndex=18, longName="ellipsoids.positions" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(19); + + ParamDefTable[18].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=19, longName="ellipsoids.positions[]" + { + static Definition* Children[5]; + Children[0] = PDEF_PTR(20); + Children[1] = PDEF_PTR(21); + Children[2] = PDEF_PTR(22); + Children[3] = PDEF_PTR(23); + Children[4] = PDEF_PTR(24); + + ParamDefTable[19].setChildren(Children, 5); + } + + // SetChildren for: nodeIndex=25, longName="ellipsoids.velocities" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(26); + + ParamDefTable[25].setChildren(Children, 1); + } + + mBuiltFlag = true; + +} +void EmitterGeomExplicitParams::initStrings(void) +{ +} + +void EmitterGeomExplicitParams::initDynamicArrays(void) +{ + points.positions.buf = NULL; + points.positions.isAllocated = true; + points.positions.elementSize = sizeof(PointParams_Type); + points.positions.arraySizes[0] = 0; + points.velocities.buf = NULL; + points.velocities.isAllocated = true; + points.velocities.elementSize = sizeof(physx::PxVec3); + points.velocities.arraySizes[0] = 0; + spheres.positions.buf = NULL; + spheres.positions.isAllocated = true; + spheres.positions.elementSize = sizeof(SphereParams_Type); + spheres.positions.arraySizes[0] = 0; + spheres.velocities.buf = NULL; + spheres.velocities.isAllocated = true; + spheres.velocities.elementSize = sizeof(physx::PxVec3); + spheres.velocities.arraySizes[0] = 0; + ellipsoids.positions.buf = NULL; + ellipsoids.positions.isAllocated = true; + ellipsoids.positions.elementSize = sizeof(EllipsoidParams_Type); + ellipsoids.positions.arraySizes[0] = 0; + ellipsoids.velocities.buf = NULL; + ellipsoids.velocities.isAllocated = true; + ellipsoids.velocities.elementSize = sizeof(physx::PxVec3); + ellipsoids.velocities.arraySizes[0] = 0; +} + +void EmitterGeomExplicitParams::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void EmitterGeomExplicitParams::initReferences(void) +{ +} + +void EmitterGeomExplicitParams::freeDynamicArrays(void) +{ + if (points.positions.isAllocated && points.positions.buf) + { + mParameterizedTraits->free(points.positions.buf); + } + if (points.velocities.isAllocated && points.velocities.buf) + { + mParameterizedTraits->free(points.velocities.buf); + } + if (spheres.positions.isAllocated && spheres.positions.buf) + { + mParameterizedTraits->free(spheres.positions.buf); + } + if (spheres.velocities.isAllocated && spheres.velocities.buf) + { + mParameterizedTraits->free(spheres.velocities.buf); + } + if (ellipsoids.positions.isAllocated && ellipsoids.positions.buf) + { + mParameterizedTraits->free(ellipsoids.positions.buf); + } + if (ellipsoids.velocities.isAllocated && ellipsoids.velocities.buf) + { + mParameterizedTraits->free(ellipsoids.velocities.buf); + } +} + +void EmitterGeomExplicitParams::freeStrings(void) +{ +} + +void EmitterGeomExplicitParams::freeReferences(void) +{ +} + +} // namespace emitter +} // namespace nvidia diff --git a/APEX_1.4/module/emitter/src/autogen/EmitterGeomSphereParams.cpp b/APEX_1.4/module/emitter/src/autogen/EmitterGeomSphereParams.cpp new file mode 100644 index 00000000..c5fb51b5 --- /dev/null +++ b/APEX_1.4/module/emitter/src/autogen/EmitterGeomSphereParams.cpp @@ -0,0 +1,389 @@ +// 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 + + +#include "EmitterGeomSphereParams.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace emitter +{ + +using namespace EmitterGeomSphereParamsNS; + +const char* const EmitterGeomSphereParamsFactory::vptr = + NvParameterized::getVptr<EmitterGeomSphereParams, EmitterGeomSphereParams::ClassAlignment>(); + +const uint32_t NumParamDefs = 4; +static NvParameterized::DefinitionImpl* ParamDefTable; // now allocated in buildTree [NumParamDefs]; + + +static const size_t ParamLookupChildrenTable[] = +{ + 1, 2, 3, +}; + +#define TENUM(type) nvidia::##type +#define CHILDREN(index) &ParamLookupChildrenTable[index] +static const NvParameterized::ParamLookupNode ParamLookupTable[NumParamDefs] = +{ + { TYPE_STRUCT, false, 0, CHILDREN(0), 3 }, + { TYPE_ENUM, false, (size_t)(&((ParametersStruct*)0)->emitterType), NULL, 0 }, // emitterType + { TYPE_F32, false, (size_t)(&((ParametersStruct*)0)->radius), NULL, 0 }, // radius + { TYPE_F32, false, (size_t)(&((ParametersStruct*)0)->hemisphere), NULL, 0 }, // hemisphere +}; + + +bool EmitterGeomSphereParams::mBuiltFlag = false; +NvParameterized::MutexType EmitterGeomSphereParams::mBuiltFlagMutex; + +EmitterGeomSphereParams::EmitterGeomSphereParams(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &EmitterGeomSphereParamsFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +EmitterGeomSphereParams::~EmitterGeomSphereParams() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void EmitterGeomSphereParams::destroy() +{ + // We cache these fields here to avoid overwrite in destructor + bool doDeallocateSelf = mDoDeallocateSelf; + NvParameterized::Traits* traits = mParameterizedTraits; + int32_t* refCount = mRefCount; + void* buf = mBuffer; + + this->~EmitterGeomSphereParams(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* EmitterGeomSphereParams::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* EmitterGeomSphereParams::getParameterDefinitionTree(void) const +{ + EmitterGeomSphereParams* tmpParam = const_cast<EmitterGeomSphereParams*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType EmitterGeomSphereParams::getParameterHandle(const char* long_name, Handle& handle) const +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +NvParameterized::ErrorType EmitterGeomSphereParams::getParameterHandle(const char* long_name, Handle& handle) +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +void EmitterGeomSphereParams::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<EmitterGeomSphereParams::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ + +void EmitterGeomSphereParams::freeParameterDefinitionTable(NvParameterized::Traits* traits) +{ + if (!traits) + { + return; + } + + if (!mBuiltFlag) // Double-checked lock + { + return; + } + + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + + if (!mBuiltFlag) + { + return; + } + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + ParamDefTable[i].~DefinitionImpl(); + } + + traits->free(ParamDefTable); + + mBuiltFlag = false; +} + +#define PDEF_PTR(index) (&ParamDefTable[index]) + +void EmitterGeomSphereParams::buildTree(void) +{ + + uint32_t allocSize = sizeof(NvParameterized::DefinitionImpl) * NumParamDefs; + ParamDefTable = (NvParameterized::DefinitionImpl*)(mParameterizedTraits->alloc(allocSize)); + memset(ParamDefTable, 0, allocSize); + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + NV_PARAM_PLACEMENT_NEW(ParamDefTable + i, NvParameterized::DefinitionImpl)(*mParameterizedTraits); + } + + // Initialize DefinitionImpl node: nodeIndex=0, longName="" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[0]; + ParamDef->init("", TYPE_STRUCT, "STRUCT", true); + + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=1, longName="emitterType" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[1]; + ParamDef->init("emitterType", TYPE_ENUM, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("defaultValue", "rate", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("defaultValue", "rate", true); + HintTable[1].init("longDescription", "rate - The emitter will emit at the rate specified by the asset's rateRange\\n\ndensityOnce - The emitter will fill the geometry according to the asset's densityRange\\n\ndensityBrush - As the emitter moves, the emitter will fill the volume that is not already covered by the previous position\\n\nfill - The emitter will fill the volume with particles based on the particle size\\n\n", true); + HintTable[2].init("shortDescription", "Emitter Type", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + static const char* const EnumVals[] = { "rate", "densityOnce", "densityBrush", "fill" }; + ParamDefTable[1].setEnumVals((const char**)EnumVals, 4); + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=2, longName="radius" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[2]; + ParamDef->init("radius", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("defaultValue", uint64_t(1), true); + HintTable[1].init("gameScale", "true", true); + HintTable[2].init("min", uint64_t(0), true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#else + + static HintImpl HintTable[4]; + static Hint* HintPtrTable[4] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], }; + HintTable[0].init("defaultValue", uint64_t(1), true); + HintTable[1].init("gameScale", "true", true); + HintTable[2].init("min", uint64_t(0), true); + HintTable[3].init("shortDescription", "Sphere Radius", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=3, longName="hemisphere" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[3]; + ParamDef->init("hemisphere", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[4]; + static Hint* HintPtrTable[4] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], }; + HintTable[0].init("defaultValue", uint64_t(0), true); + HintTable[1].init("gameScale", "false", true); + HintTable[2].init("max", uint64_t(1), true); + HintTable[3].init("min", uint64_t(0), true); + ParamDefTable[3].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#else + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("defaultValue", uint64_t(0), true); + HintTable[1].init("gameScale", "false", true); + HintTable[2].init("max", uint64_t(1), true); + HintTable[3].init("min", uint64_t(0), true); + HintTable[4].init("shortDescription", "Sphere Hemisphere", true); + ParamDefTable[3].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // SetChildren for: nodeIndex=0, longName="" + { + static Definition* Children[3]; + Children[0] = PDEF_PTR(1); + Children[1] = PDEF_PTR(2); + Children[2] = PDEF_PTR(3); + + ParamDefTable[0].setChildren(Children, 3); + } + + mBuiltFlag = true; + +} +void EmitterGeomSphereParams::initStrings(void) +{ +} + +void EmitterGeomSphereParams::initDynamicArrays(void) +{ +} + +void EmitterGeomSphereParams::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + emitterType = (const char*)"rate"; + radius = float(1.0f); + hemisphere = float(0.0f); + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void EmitterGeomSphereParams::initReferences(void) +{ +} + +void EmitterGeomSphereParams::freeDynamicArrays(void) +{ +} + +void EmitterGeomSphereParams::freeStrings(void) +{ +} + +void EmitterGeomSphereParams::freeReferences(void) +{ +} + +} // namespace emitter +} // namespace nvidia diff --git a/APEX_1.4/module/emitter/src/autogen/EmitterGeomSphereShellParams.cpp b/APEX_1.4/module/emitter/src/autogen/EmitterGeomSphereShellParams.cpp new file mode 100644 index 00000000..d100123c --- /dev/null +++ b/APEX_1.4/module/emitter/src/autogen/EmitterGeomSphereShellParams.cpp @@ -0,0 +1,424 @@ +// 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 + + +#include "EmitterGeomSphereShellParams.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace emitter +{ + +using namespace EmitterGeomSphereShellParamsNS; + +const char* const EmitterGeomSphereShellParamsFactory::vptr = + NvParameterized::getVptr<EmitterGeomSphereShellParams, EmitterGeomSphereShellParams::ClassAlignment>(); + +const uint32_t NumParamDefs = 5; +static NvParameterized::DefinitionImpl* ParamDefTable; // now allocated in buildTree [NumParamDefs]; + + +static const size_t ParamLookupChildrenTable[] = +{ + 1, 2, 3, 4, +}; + +#define TENUM(type) nvidia::##type +#define CHILDREN(index) &ParamLookupChildrenTable[index] +static const NvParameterized::ParamLookupNode ParamLookupTable[NumParamDefs] = +{ + { TYPE_STRUCT, false, 0, CHILDREN(0), 4 }, + { TYPE_ENUM, false, (size_t)(&((ParametersStruct*)0)->emitterType), NULL, 0 }, // emitterType + { TYPE_F32, false, (size_t)(&((ParametersStruct*)0)->radius), NULL, 0 }, // radius + { TYPE_F32, false, (size_t)(&((ParametersStruct*)0)->shellThickness), NULL, 0 }, // shellThickness + { TYPE_F32, false, (size_t)(&((ParametersStruct*)0)->hemisphere), NULL, 0 }, // hemisphere +}; + + +bool EmitterGeomSphereShellParams::mBuiltFlag = false; +NvParameterized::MutexType EmitterGeomSphereShellParams::mBuiltFlagMutex; + +EmitterGeomSphereShellParams::EmitterGeomSphereShellParams(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &EmitterGeomSphereShellParamsFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +EmitterGeomSphereShellParams::~EmitterGeomSphereShellParams() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void EmitterGeomSphereShellParams::destroy() +{ + // We cache these fields here to avoid overwrite in destructor + bool doDeallocateSelf = mDoDeallocateSelf; + NvParameterized::Traits* traits = mParameterizedTraits; + int32_t* refCount = mRefCount; + void* buf = mBuffer; + + this->~EmitterGeomSphereShellParams(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* EmitterGeomSphereShellParams::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* EmitterGeomSphereShellParams::getParameterDefinitionTree(void) const +{ + EmitterGeomSphereShellParams* tmpParam = const_cast<EmitterGeomSphereShellParams*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType EmitterGeomSphereShellParams::getParameterHandle(const char* long_name, Handle& handle) const +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +NvParameterized::ErrorType EmitterGeomSphereShellParams::getParameterHandle(const char* long_name, Handle& handle) +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +void EmitterGeomSphereShellParams::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<EmitterGeomSphereShellParams::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ + +void EmitterGeomSphereShellParams::freeParameterDefinitionTable(NvParameterized::Traits* traits) +{ + if (!traits) + { + return; + } + + if (!mBuiltFlag) // Double-checked lock + { + return; + } + + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + + if (!mBuiltFlag) + { + return; + } + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + ParamDefTable[i].~DefinitionImpl(); + } + + traits->free(ParamDefTable); + + mBuiltFlag = false; +} + +#define PDEF_PTR(index) (&ParamDefTable[index]) + +void EmitterGeomSphereShellParams::buildTree(void) +{ + + uint32_t allocSize = sizeof(NvParameterized::DefinitionImpl) * NumParamDefs; + ParamDefTable = (NvParameterized::DefinitionImpl*)(mParameterizedTraits->alloc(allocSize)); + memset(ParamDefTable, 0, allocSize); + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + NV_PARAM_PLACEMENT_NEW(ParamDefTable + i, NvParameterized::DefinitionImpl)(*mParameterizedTraits); + } + + // Initialize DefinitionImpl node: nodeIndex=0, longName="" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[0]; + ParamDef->init("", TYPE_STRUCT, "STRUCT", true); + + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=1, longName="emitterType" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[1]; + ParamDef->init("emitterType", TYPE_ENUM, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("defaultValue", "rate", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("defaultValue", "rate", true); + HintTable[1].init("longDescription", "rate - The emitter will emit at the rate specified by the asset's rateRange\\n\ndensityOnce - The emitter will fill the geometry according to the asset's densityRange\\n\ndensityBrush - As the emitter moves, the emitter will fill the volume that is not already covered by the previous position\\n\nfill - The emitter will fill the volume with particles based on the particle size\\n\n", true); + HintTable[2].init("shortDescription", "Emitter Type", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + static const char* const EnumVals[] = { "rate", "densityOnce", "densityBrush", "fill" }; + ParamDefTable[1].setEnumVals((const char**)EnumVals, 4); + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=2, longName="radius" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[2]; + ParamDef->init("radius", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("defaultValue", uint64_t(1), true); + HintTable[1].init("gameScale", "true", true); + HintTable[2].init("min", uint64_t(0), true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#else + + static HintImpl HintTable[4]; + static Hint* HintPtrTable[4] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], }; + HintTable[0].init("defaultValue", uint64_t(1), true); + HintTable[1].init("gameScale", "true", true); + HintTable[2].init("min", uint64_t(0), true); + HintTable[3].init("shortDescription", "Sphere Radius", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=3, longName="shellThickness" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[3]; + ParamDef->init("shellThickness", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("defaultValue", double(0.1), true); + HintTable[1].init("gameScale", "true", true); + HintTable[2].init("min", uint64_t(0), true); + ParamDefTable[3].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#else + + static HintImpl HintTable[4]; + static Hint* HintPtrTable[4] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], }; + HintTable[0].init("defaultValue", double(0.1), true); + HintTable[1].init("gameScale", "true", true); + HintTable[2].init("min", uint64_t(0), true); + HintTable[3].init("shortDescription", "Sphere Shell Thickness", true); + ParamDefTable[3].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=4, longName="hemisphere" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[4]; + ParamDef->init("hemisphere", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[4]; + static Hint* HintPtrTable[4] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], }; + HintTable[0].init("defaultValue", uint64_t(0), true); + HintTable[1].init("gameScale", "false", true); + HintTable[2].init("max", double(0.99999), true); + HintTable[3].init("min", uint64_t(0), true); + ParamDefTable[4].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#else + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("defaultValue", uint64_t(0), true); + HintTable[1].init("gameScale", "false", true); + HintTable[2].init("max", double(0.99999), true); + HintTable[3].init("min", uint64_t(0), true); + HintTable[4].init("shortDescription", "Sphere Shell Hemisphere", true); + ParamDefTable[4].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // SetChildren for: nodeIndex=0, longName="" + { + static Definition* Children[4]; + Children[0] = PDEF_PTR(1); + Children[1] = PDEF_PTR(2); + Children[2] = PDEF_PTR(3); + Children[3] = PDEF_PTR(4); + + ParamDefTable[0].setChildren(Children, 4); + } + + mBuiltFlag = true; + +} +void EmitterGeomSphereShellParams::initStrings(void) +{ +} + +void EmitterGeomSphereShellParams::initDynamicArrays(void) +{ +} + +void EmitterGeomSphereShellParams::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + emitterType = (const char*)"rate"; + radius = float(1.0f); + shellThickness = float(0.1f); + hemisphere = float(0.0f); + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void EmitterGeomSphereShellParams::initReferences(void) +{ +} + +void EmitterGeomSphereShellParams::freeDynamicArrays(void) +{ +} + +void EmitterGeomSphereShellParams::freeStrings(void) +{ +} + +void EmitterGeomSphereShellParams::freeReferences(void) +{ +} + +} // namespace emitter +} // namespace nvidia diff --git a/APEX_1.4/module/emitter/src/autogen/EmitterModuleParameters.cpp b/APEX_1.4/module/emitter/src/autogen/EmitterModuleParameters.cpp new file mode 100644 index 00000000..f70c1351 --- /dev/null +++ b/APEX_1.4/module/emitter/src/autogen/EmitterModuleParameters.cpp @@ -0,0 +1,318 @@ +// 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 + + +#include "EmitterModuleParameters.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace emitter +{ + +using namespace EmitterModuleParametersNS; + +const char* const EmitterModuleParametersFactory::vptr = + NvParameterized::getVptr<EmitterModuleParameters, EmitterModuleParameters::ClassAlignment>(); + +const uint32_t NumParamDefs = 2; +static NvParameterized::DefinitionImpl* ParamDefTable; // now allocated in buildTree [NumParamDefs]; + + +static const size_t ParamLookupChildrenTable[] = +{ + 1, +}; + +#define TENUM(type) nvidia::##type +#define CHILDREN(index) &ParamLookupChildrenTable[index] +static const NvParameterized::ParamLookupNode ParamLookupTable[NumParamDefs] = +{ + { TYPE_STRUCT, false, 0, CHILDREN(0), 1 }, + { TYPE_U32, false, (size_t)(&((ParametersStruct*)0)->unused), NULL, 0 }, // unused +}; + + +bool EmitterModuleParameters::mBuiltFlag = false; +NvParameterized::MutexType EmitterModuleParameters::mBuiltFlagMutex; + +EmitterModuleParameters::EmitterModuleParameters(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &EmitterModuleParametersFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +EmitterModuleParameters::~EmitterModuleParameters() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void EmitterModuleParameters::destroy() +{ + // We cache these fields here to avoid overwrite in destructor + bool doDeallocateSelf = mDoDeallocateSelf; + NvParameterized::Traits* traits = mParameterizedTraits; + int32_t* refCount = mRefCount; + void* buf = mBuffer; + + this->~EmitterModuleParameters(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* EmitterModuleParameters::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* EmitterModuleParameters::getParameterDefinitionTree(void) const +{ + EmitterModuleParameters* tmpParam = const_cast<EmitterModuleParameters*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType EmitterModuleParameters::getParameterHandle(const char* long_name, Handle& handle) const +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +NvParameterized::ErrorType EmitterModuleParameters::getParameterHandle(const char* long_name, Handle& handle) +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +void EmitterModuleParameters::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<EmitterModuleParameters::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ + +void EmitterModuleParameters::freeParameterDefinitionTable(NvParameterized::Traits* traits) +{ + if (!traits) + { + return; + } + + if (!mBuiltFlag) // Double-checked lock + { + return; + } + + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + + if (!mBuiltFlag) + { + return; + } + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + ParamDefTable[i].~DefinitionImpl(); + } + + traits->free(ParamDefTable); + + mBuiltFlag = false; +} + +#define PDEF_PTR(index) (&ParamDefTable[index]) + +void EmitterModuleParameters::buildTree(void) +{ + + uint32_t allocSize = sizeof(NvParameterized::DefinitionImpl) * NumParamDefs; + ParamDefTable = (NvParameterized::DefinitionImpl*)(mParameterizedTraits->alloc(allocSize)); + memset(ParamDefTable, 0, allocSize); + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + NV_PARAM_PLACEMENT_NEW(ParamDefTable + i, NvParameterized::DefinitionImpl)(*mParameterizedTraits); + } + + // Initialize DefinitionImpl node: nodeIndex=0, longName="" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[0]; + ParamDef->init("", TYPE_STRUCT, "STRUCT", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "This class is used for initializing the ModuleEmitter.", true); + ParamDefTable[0].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=1, longName="unused" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[1]; + ParamDef->init("unused", TYPE_U32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "No parameters necessary", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // SetChildren for: nodeIndex=0, longName="" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(1); + + ParamDefTable[0].setChildren(Children, 1); + } + + mBuiltFlag = true; + +} +void EmitterModuleParameters::initStrings(void) +{ +} + +void EmitterModuleParameters::initDynamicArrays(void) +{ +} + +void EmitterModuleParameters::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + unused = uint32_t(0); + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void EmitterModuleParameters::initReferences(void) +{ +} + +void EmitterModuleParameters::freeDynamicArrays(void) +{ +} + +void EmitterModuleParameters::freeStrings(void) +{ +} + +void EmitterModuleParameters::freeReferences(void) +{ +} + +} // namespace emitter +} // namespace nvidia diff --git a/APEX_1.4/module/emitter/src/autogen/GroundEmitterActorParameters.cpp b/APEX_1.4/module/emitter/src/autogen/GroundEmitterActorParameters.cpp new file mode 100644 index 00000000..d7640652 --- /dev/null +++ b/APEX_1.4/module/emitter/src/autogen/GroundEmitterActorParameters.cpp @@ -0,0 +1,550 @@ +// 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 + + +#include "GroundEmitterActorParameters.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace emitter +{ + +using namespace GroundEmitterActorParametersNS; + +const char* const GroundEmitterActorParametersFactory::vptr = + NvParameterized::getVptr<GroundEmitterActorParameters, GroundEmitterActorParameters::ClassAlignment>(); + +const uint32_t NumParamDefs = 10; +static NvParameterized::DefinitionImpl* ParamDefTable; // now allocated in buildTree [NumParamDefs]; + + +static const size_t ParamLookupChildrenTable[] = +{ + 1, 2, 3, 4, 5, 6, 7, 8, 9, +}; + +#define TENUM(type) nvidia::##type +#define CHILDREN(index) &ParamLookupChildrenTable[index] +static const NvParameterized::ParamLookupNode ParamLookupTable[NumParamDefs] = +{ + { TYPE_STRUCT, false, 0, CHILDREN(0), 9 }, + { TYPE_F32, false, (size_t)(&((ParametersStruct*)0)->density), NULL, 0 }, // density + { TYPE_F32, false, (size_t)(&((ParametersStruct*)0)->radius), NULL, 0 }, // radius + { TYPE_VEC3, false, (size_t)(&((ParametersStruct*)0)->upDirection), NULL, 0 }, // upDirection + { TYPE_F32, false, (size_t)(&((ParametersStruct*)0)->raycastHeight), NULL, 0 }, // raycastHeight + { TYPE_F32, false, (size_t)(&((ParametersStruct*)0)->spawnHeight), NULL, 0 }, // spawnHeight + { TYPE_U32, false, (size_t)(&((ParametersStruct*)0)->maxRaycastsPerFrame), NULL, 0 }, // maxRaycastsPerFrame + { TYPE_STRING, false, (size_t)(&((ParametersStruct*)0)->raycastCollisionGroupMaskName), NULL, 0 }, // raycastCollisionGroupMaskName + { TYPE_VEC3, false, (size_t)(&((ParametersStruct*)0)->attachRelativePosition), NULL, 0 }, // attachRelativePosition + { TYPE_TRANSFORM, false, (size_t)(&((ParametersStruct*)0)->globalPose), NULL, 0 }, // globalPose +}; + + +bool GroundEmitterActorParameters::mBuiltFlag = false; +NvParameterized::MutexType GroundEmitterActorParameters::mBuiltFlagMutex; + +GroundEmitterActorParameters::GroundEmitterActorParameters(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &GroundEmitterActorParametersFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +GroundEmitterActorParameters::~GroundEmitterActorParameters() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void GroundEmitterActorParameters::destroy() +{ + // We cache these fields here to avoid overwrite in destructor + bool doDeallocateSelf = mDoDeallocateSelf; + NvParameterized::Traits* traits = mParameterizedTraits; + int32_t* refCount = mRefCount; + void* buf = mBuffer; + + this->~GroundEmitterActorParameters(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* GroundEmitterActorParameters::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* GroundEmitterActorParameters::getParameterDefinitionTree(void) const +{ + GroundEmitterActorParameters* tmpParam = const_cast<GroundEmitterActorParameters*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType GroundEmitterActorParameters::getParameterHandle(const char* long_name, Handle& handle) const +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +NvParameterized::ErrorType GroundEmitterActorParameters::getParameterHandle(const char* long_name, Handle& handle) +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +void GroundEmitterActorParameters::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<GroundEmitterActorParameters::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ + +void GroundEmitterActorParameters::freeParameterDefinitionTable(NvParameterized::Traits* traits) +{ + if (!traits) + { + return; + } + + if (!mBuiltFlag) // Double-checked lock + { + return; + } + + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + + if (!mBuiltFlag) + { + return; + } + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + ParamDefTable[i].~DefinitionImpl(); + } + + traits->free(ParamDefTable); + + mBuiltFlag = false; +} + +#define PDEF_PTR(index) (&ParamDefTable[index]) + +void GroundEmitterActorParameters::buildTree(void) +{ + + uint32_t allocSize = sizeof(NvParameterized::DefinitionImpl) * NumParamDefs; + ParamDefTable = (NvParameterized::DefinitionImpl*)(mParameterizedTraits->alloc(allocSize)); + memset(ParamDefTable, 0, allocSize); + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + NV_PARAM_PLACEMENT_NEW(ParamDefTable + i, NvParameterized::DefinitionImpl)(*mParameterizedTraits); + } + + // Initialize DefinitionImpl node: nodeIndex=0, longName="" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[0]; + ParamDef->init("", TYPE_STRUCT, "STRUCT", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "This class is used for creating GroundEmitterActor instances", true); + ParamDefTable[0].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=1, longName="density" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[1]; + ParamDef->init("density", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Density", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=2, longName="radius" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[2]; + ParamDef->init("radius", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("defaultValue", uint64_t(10), true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("defaultValue", uint64_t(10), true); + HintTable[1].init("longDescription", "The ground emitter actor will create objects within a circle of size 'radius'.\n", true); + HintTable[2].init("shortDescription", "Radius", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=3, longName="upDirection" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[3]; + ParamDef->init("upDirection", TYPE_VEC3, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("longDescription", "The ground emitter asset needs to know what direction is 'up'.\n", true); + HintTable[1].init("shortDescription", "Up Direction", true); + ParamDefTable[3].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=4, longName="raycastHeight" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[4]; + ParamDef->init("raycastHeight", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("longDescription", "The height from which the ground emitter will cast rays at terrain/objects opposite of the 'upDirection'.\n", true); + HintTable[1].init("shortDescription", "Raycast Height", true); + ParamDefTable[4].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=5, longName="spawnHeight" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[5]; + ParamDef->init("spawnHeight", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("defaultValue", uint64_t(0), true); + ParamDefTable[5].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("defaultValue", uint64_t(0), true); + HintTable[1].init("longDescription", "The height above the ground to emit particles. If greater than 0, the ground emitter will refresh a disc above the player's position rather than refreshing a circle around the player's position.\n", true); + HintTable[2].init("shortDescription", "Spawn Height", true); + ParamDefTable[5].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=6, longName="maxRaycastsPerFrame" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[6]; + ParamDef->init("maxRaycastsPerFrame", TYPE_U32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("defaultValue", "UINT32_MAX", true); + ParamDefTable[6].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("defaultValue", "UINT32_MAX", true); + HintTable[1].init("longDescription", "The maximum raycasts per frame.\n", true); + HintTable[2].init("shortDescription", "Maximum Raycasts per Frame", true); + ParamDefTable[6].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=7, longName="raycastCollisionGroupMaskName" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[7]; + ParamDef->init("raycastCollisionGroupMaskName", TYPE_STRING, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("longDescription", "This name resolves to a 32-bit bitmask of collision groups for raycasts around the player. \nIt is resolved by a call to the named resource provider using the 'NSCollisionGroupMask' \nand 'NSCollisionGroup128' namespaces. If none is provided, the raycast will hit everything in the scene. \nThis avoids storing fragile enums in asset files. \n", true); + HintTable[1].init("shortDescription", "Raycast Collision Group Mask Name", true); + ParamDefTable[7].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=8, longName="attachRelativePosition" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[8]; + ParamDef->init("attachRelativePosition", TYPE_VEC3, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("longDescription", "The ground emitter will offset this value from the attach actor position.\n", true); + HintTable[1].init("shortDescription", "Attach Relative Position", true); + ParamDefTable[8].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=9, longName="globalPose" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[9]; + ParamDef->init("globalPose", TYPE_TRANSFORM, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("longDescription", "An identity rotation matrix will result in a +Y up ground emitter, provide a rotation if another orientation is desired.\n", true); + HintTable[1].init("shortDescription", "The actor's pose", true); + ParamDefTable[9].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // SetChildren for: nodeIndex=0, longName="" + { + static Definition* Children[9]; + Children[0] = PDEF_PTR(1); + Children[1] = PDEF_PTR(2); + Children[2] = PDEF_PTR(3); + Children[3] = PDEF_PTR(4); + Children[4] = PDEF_PTR(5); + Children[5] = PDEF_PTR(6); + Children[6] = PDEF_PTR(7); + Children[7] = PDEF_PTR(8); + Children[8] = PDEF_PTR(9); + + ParamDefTable[0].setChildren(Children, 9); + } + + mBuiltFlag = true; + +} +void GroundEmitterActorParameters::initStrings(void) +{ + raycastCollisionGroupMaskName.isAllocated = true; + raycastCollisionGroupMaskName.buf = NULL; +} + +void GroundEmitterActorParameters::initDynamicArrays(void) +{ +} + +void GroundEmitterActorParameters::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + density = float(1); + radius = float(10.0f); + upDirection = physx::PxVec3(init(0, 1, 0)); + raycastHeight = float(10.0f); + spawnHeight = float(0.0f); + maxRaycastsPerFrame = uint32_t(UINT32_MAX); + attachRelativePosition = physx::PxVec3(init(0, 0, 0)); + globalPose = physx::PxTransform(physx::PxIdentity); + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void GroundEmitterActorParameters::initReferences(void) +{ +} + +void GroundEmitterActorParameters::freeDynamicArrays(void) +{ +} + +void GroundEmitterActorParameters::freeStrings(void) +{ + + if (raycastCollisionGroupMaskName.isAllocated && raycastCollisionGroupMaskName.buf) + { + mParameterizedTraits->strfree((char*)raycastCollisionGroupMaskName.buf); + } +} + +void GroundEmitterActorParameters::freeReferences(void) +{ +} + +} // namespace emitter +} // namespace nvidia diff --git a/APEX_1.4/module/emitter/src/autogen/GroundEmitterAssetParameters.cpp b/APEX_1.4/module/emitter/src/autogen/GroundEmitterAssetParameters.cpp new file mode 100644 index 00000000..0923dd10 --- /dev/null +++ b/APEX_1.4/module/emitter/src/autogen/GroundEmitterAssetParameters.cpp @@ -0,0 +1,1099 @@ +// 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 + + +#include "GroundEmitterAssetParameters.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace emitter +{ + +using namespace GroundEmitterAssetParametersNS; + +const char* const GroundEmitterAssetParametersFactory::vptr = + NvParameterized::getVptr<GroundEmitterAssetParameters, GroundEmitterAssetParameters::ClassAlignment>(); + +const uint32_t NumParamDefs = 26; +static NvParameterized::DefinitionImpl* ParamDefTable; // now allocated in buildTree [NumParamDefs]; + + +static const size_t ParamLookupChildrenTable[] = +{ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, +}; + +#define TENUM(type) nvidia::##type +#define CHILDREN(index) &ParamLookupChildrenTable[index] +static const NvParameterized::ParamLookupNode ParamLookupTable[NumParamDefs] = +{ + { TYPE_STRUCT, false, 0, CHILDREN(0), 11 }, + { TYPE_F32, false, (size_t)(&((ParametersStruct*)0)->density), NULL, 0 }, // density + { TYPE_F32, false, (size_t)(&((ParametersStruct*)0)->lifetimeLow), NULL, 0 }, // lifetimeLow + { TYPE_F32, false, (size_t)(&((ParametersStruct*)0)->lifetimeHigh), NULL, 0 }, // lifetimeHigh + { TYPE_VEC3, false, (size_t)(&((ParametersStruct*)0)->velocityLow), NULL, 0 }, // velocityLow + { TYPE_VEC3, false, (size_t)(&((ParametersStruct*)0)->velocityHigh), NULL, 0 }, // velocityHigh + { TYPE_F32, false, (size_t)(&((ParametersStruct*)0)->radius), NULL, 0 }, // radius + { TYPE_F32, false, (size_t)(&((ParametersStruct*)0)->raycastHeight), NULL, 0 }, // raycastHeight + { TYPE_F32, false, (size_t)(&((ParametersStruct*)0)->spawnHeight), NULL, 0 }, // spawnHeight + { TYPE_U32, false, (size_t)(&((ParametersStruct*)0)->maxRaycastsPerFrame), NULL, 0 }, // maxRaycastsPerFrame + { TYPE_STRING, false, (size_t)(&((ParametersStruct*)0)->raycastCollisionGroupMaskName), NULL, 0 }, // raycastCollisionGroupMaskName + { TYPE_ARRAY, true, (size_t)(&((ParametersStruct*)0)->materialFactoryMapList), CHILDREN(11), 1 }, // materialFactoryMapList + { TYPE_STRUCT, false, 1 * sizeof(materialFactoryMapping_Type), CHILDREN(12), 6 }, // materialFactoryMapList[] + { TYPE_REF, false, (size_t)(&((materialFactoryMapping_Type*)0)->iofxAssetName), NULL, 0 }, // materialFactoryMapList[].iofxAssetName + { TYPE_REF, false, (size_t)(&((materialFactoryMapping_Type*)0)->iosAssetName), NULL, 0 }, // materialFactoryMapList[].iosAssetName + { TYPE_STRING, false, (size_t)(&((materialFactoryMapping_Type*)0)->physMatName), NULL, 0 }, // materialFactoryMapList[].physMatName + { TYPE_F32, false, (size_t)(&((materialFactoryMapping_Type*)0)->weight), NULL, 0 }, // materialFactoryMapList[].weight + { TYPE_F32, false, (size_t)(&((materialFactoryMapping_Type*)0)->maxSlopeAngle), NULL, 0 }, // materialFactoryMapList[].maxSlopeAngle + { TYPE_STRUCT, false, (size_t)(&((materialFactoryMapping_Type*)0)->lodParamDesc), CHILDREN(18), 7 }, // materialFactoryMapList[].lodParamDesc + { TYPE_U32, false, (size_t)(&((emitterLodParamDesc_Type*)0)->version), NULL, 0 }, // materialFactoryMapList[].lodParamDesc.version + { TYPE_F32, false, (size_t)(&((emitterLodParamDesc_Type*)0)->maxDistance), NULL, 0 }, // materialFactoryMapList[].lodParamDesc.maxDistance + { TYPE_F32, false, (size_t)(&((emitterLodParamDesc_Type*)0)->distanceWeight), NULL, 0 }, // materialFactoryMapList[].lodParamDesc.distanceWeight + { TYPE_F32, false, (size_t)(&((emitterLodParamDesc_Type*)0)->speedWeight), NULL, 0 }, // materialFactoryMapList[].lodParamDesc.speedWeight + { TYPE_F32, false, (size_t)(&((emitterLodParamDesc_Type*)0)->lifeWeight), NULL, 0 }, // materialFactoryMapList[].lodParamDesc.lifeWeight + { TYPE_F32, false, (size_t)(&((emitterLodParamDesc_Type*)0)->separationWeight), NULL, 0 }, // materialFactoryMapList[].lodParamDesc.separationWeight + { TYPE_F32, false, (size_t)(&((emitterLodParamDesc_Type*)0)->bias), NULL, 0 }, // materialFactoryMapList[].lodParamDesc.bias +}; + + +bool GroundEmitterAssetParameters::mBuiltFlag = false; +NvParameterized::MutexType GroundEmitterAssetParameters::mBuiltFlagMutex; + +GroundEmitterAssetParameters::GroundEmitterAssetParameters(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &GroundEmitterAssetParametersFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +GroundEmitterAssetParameters::~GroundEmitterAssetParameters() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void GroundEmitterAssetParameters::destroy() +{ + // We cache these fields here to avoid overwrite in destructor + bool doDeallocateSelf = mDoDeallocateSelf; + NvParameterized::Traits* traits = mParameterizedTraits; + int32_t* refCount = mRefCount; + void* buf = mBuffer; + + this->~GroundEmitterAssetParameters(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* GroundEmitterAssetParameters::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* GroundEmitterAssetParameters::getParameterDefinitionTree(void) const +{ + GroundEmitterAssetParameters* tmpParam = const_cast<GroundEmitterAssetParameters*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType GroundEmitterAssetParameters::getParameterHandle(const char* long_name, Handle& handle) const +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +NvParameterized::ErrorType GroundEmitterAssetParameters::getParameterHandle(const char* long_name, Handle& handle) +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +void GroundEmitterAssetParameters::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<GroundEmitterAssetParameters::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ +/* [1,0] - materialFactoryMapList.iofxAssetName */ +/* [1,1] - materialFactoryMapList.iosAssetName */ +/* [1,2] - materialFactoryMapList.physMatName */ + +void GroundEmitterAssetParameters::freeParameterDefinitionTable(NvParameterized::Traits* traits) +{ + if (!traits) + { + return; + } + + if (!mBuiltFlag) // Double-checked lock + { + return; + } + + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + + if (!mBuiltFlag) + { + return; + } + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + ParamDefTable[i].~DefinitionImpl(); + } + + traits->free(ParamDefTable); + + mBuiltFlag = false; +} + +#define PDEF_PTR(index) (&ParamDefTable[index]) + +void GroundEmitterAssetParameters::buildTree(void) +{ + + uint32_t allocSize = sizeof(NvParameterized::DefinitionImpl) * NumParamDefs; + ParamDefTable = (NvParameterized::DefinitionImpl*)(mParameterizedTraits->alloc(allocSize)); + memset(ParamDefTable, 0, allocSize); + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + NV_PARAM_PLACEMENT_NEW(ParamDefTable + i, NvParameterized::DefinitionImpl)(*mParameterizedTraits); + } + + // Initialize DefinitionImpl node: nodeIndex=0, longName="" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[0]; + ParamDef->init("", TYPE_STRUCT, "STRUCT", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "This class is parameter storage for the GroundEmitterAsset", true); + ParamDefTable[0].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=1, longName="density" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[1]; + ParamDef->init("density", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("longDescription", "The ground emitter actor will use the maximum density in the range, but it will back off to the minimum density if the actor is LOD resource limited.\n", true); + HintTable[1].init("shortDescription", "Desired density of spawned particles per unit of volume.", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=2, longName="lifetimeLow" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[2]; + ParamDef->init("lifetimeLow", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("tweakable", "true", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("longDescription", "The emitter actor will create particles with a random lifetime (in seconds) within the lifetime range.\n", true); + HintTable[1].init("shortDescription", "Low value of particle lifetime", true); + HintTable[2].init("tweakable", "true", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=3, longName="lifetimeHigh" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[3]; + ParamDef->init("lifetimeHigh", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("tweakable", "true", true); + ParamDefTable[3].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("longDescription", "The emitter actor will create particles with a random lifetime (in seconds) within the lifetime range.\n", true); + HintTable[1].init("shortDescription", "High value of particle lifetime", true); + HintTable[2].init("tweakable", "true", true); + ParamDefTable[3].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=4, longName="velocityLow" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[4]; + ParamDef->init("velocityLow", TYPE_VEC3, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("gameScale", "true", true); + HintTable[1].init("tweakable", "true", true); + ParamDefTable[4].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#else + + static HintImpl HintTable[4]; + static Hint* HintPtrTable[4] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], }; + HintTable[0].init("gameScale", "true", true); + HintTable[1].init("longDescription", "The emitter actor will create particles with a random velocity within the velocity range.\n", true); + HintTable[2].init("shortDescription", "Random velocity given within range", true); + HintTable[3].init("tweakable", "true", true); + ParamDefTable[4].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=5, longName="velocityHigh" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[5]; + ParamDef->init("velocityHigh", TYPE_VEC3, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("gameScale", "true", true); + HintTable[1].init("tweakable", "true", true); + ParamDefTable[5].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#else + + static HintImpl HintTable[4]; + static Hint* HintPtrTable[4] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], }; + HintTable[0].init("gameScale", "true", true); + HintTable[1].init("longDescription", "The emitter actor will create particles with a random velocity within the velocity range.\n", true); + HintTable[2].init("shortDescription", "Random velocity given within range", true); + HintTable[3].init("tweakable", "true", true); + ParamDefTable[5].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=6, longName="radius" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[6]; + ParamDef->init("radius", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("defaultValue", uint64_t(10), true); + HintTable[1].init("min", uint64_t(0), true); + ParamDefTable[6].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#else + + static HintImpl HintTable[4]; + static Hint* HintPtrTable[4] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], }; + HintTable[0].init("defaultValue", uint64_t(10), true); + HintTable[1].init("longDescription", "The ground emitter actor will create objects within a circle of size 'radius'.\n", true); + HintTable[2].init("min", uint64_t(0), true); + HintTable[3].init("shortDescription", "Radius", true); + ParamDefTable[6].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=7, longName="raycastHeight" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[7]; + ParamDef->init("raycastHeight", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("min", uint64_t(0), true); + ParamDefTable[7].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("longDescription", "The height from which the ground emitter will cast rays at terrain/objects opposite of the 'upDirection'.\n", true); + HintTable[1].init("min", uint64_t(0), true); + HintTable[2].init("shortDescription", "Raycast Height", true); + ParamDefTable[7].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=8, longName="spawnHeight" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[8]; + ParamDef->init("spawnHeight", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("defaultValue", uint64_t(0), true); + HintTable[1].init("min", uint64_t(0), true); + ParamDefTable[8].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#else + + static HintImpl HintTable[4]; + static Hint* HintPtrTable[4] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], }; + HintTable[0].init("defaultValue", uint64_t(0), true); + HintTable[1].init("longDescription", "The height above the ground to emit particles. If greater than 0, the ground emitter will refresh a disc above the player's position rather than refreshing a circle around the player's position.\n", true); + HintTable[2].init("min", uint64_t(0), true); + HintTable[3].init("shortDescription", "Spawn Height", true); + ParamDefTable[8].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=9, longName="maxRaycastsPerFrame" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[9]; + ParamDef->init("maxRaycastsPerFrame", TYPE_U32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("longDescription", "The maximum raycasts per frame.\n", true); + HintTable[1].init("shortDescription", "Maximum Raycasts per Frame", true); + ParamDefTable[9].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=10, longName="raycastCollisionGroupMaskName" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[10]; + ParamDef->init("raycastCollisionGroupMaskName", TYPE_STRING, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("longDescription", "Defines a bitmask of collision groups for the raycasts around the player. If none is provided, \nthe raycast will hit everything in the scene. This name will be resolved into a bitmask of \ncollision group IDs by a call to the named resource provider using both the 'NSCollisionGroupMask' \nand 'NSCollisionGroup128' namespaces. This avoids storing fragile enums in asset files. The collision \ngroups and collision group mask and 128 bit GroupsMask can be set directly on GroundEmitterActors.\n", true); + HintTable[1].init("shortDescription", "Raycast Collision Group Mask Name", true); + ParamDefTable[10].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=11, longName="materialFactoryMapList" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[11]; + ParamDef->init("materialFactoryMapList", TYPE_ARRAY, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("longDescription", "This dynamic array contains a list of IOFX/IOS to PhysX Material mappings.\n", true); + HintTable[1].init("shortDescription", "Material Factory Map List", true); + ParamDefTable[11].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + ParamDef->setArraySize(-1); + static const uint8_t dynHandleIndices[6] = { 1, 0, 1, 1, 1, 2, }; + ParamDef->setDynamicHandleIndicesMap(dynHandleIndices, 6); + + } + + // Initialize DefinitionImpl node: nodeIndex=12, longName="materialFactoryMapList[]" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[12]; + ParamDef->init("materialFactoryMapList", TYPE_STRUCT, "materialFactoryMapping", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("longDescription", "This dynamic array contains a list of IOFX/IOS to PhysX Material mappings.\n", true); + HintTable[1].init("shortDescription", "Material Factory Map List", true); + ParamDefTable[12].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=13, longName="materialFactoryMapList[].iofxAssetName" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[13]; + ParamDef->init("iofxAssetName", TYPE_REF, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "The name of the instanced object effects asset that will render your particles", true); + ParamDefTable[13].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + static const char* const RefVariantVals[] = { "IOFX" }; + ParamDefTable[13].setRefVariantVals((const char**)RefVariantVals, 1); + + + + } + + // Initialize DefinitionImpl node: nodeIndex=14, longName="materialFactoryMapList[].iosAssetName" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[14]; + ParamDef->init("iosAssetName", TYPE_REF, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "The asset name of the particle system that will simulate your particles", true); + ParamDefTable[14].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + static const char* const RefVariantVals[] = { "BasicIosAsset", "ParticleIosAsset" }; + ParamDefTable[14].setRefVariantVals((const char**)RefVariantVals, 2); + + + + } + + // Initialize DefinitionImpl node: nodeIndex=15, longName="materialFactoryMapList[].physMatName" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[15]; + ParamDef->init("physMatName", TYPE_STRING, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "User defined material name. The ground emitter will convert this name into an * MaterialID at runtime by a getResource() call to the named resource provider under the namespace \"NSPhysicalMaterial\" * Note this is the physical material, not rendering material.", true); + ParamDefTable[15].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=16, longName="materialFactoryMapList[].weight" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[16]; + ParamDef->init("weight", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("defaultValue", uint64_t(1), true); + HintTable[1].init("min", uint64_t(0), true); + ParamDefTable[16].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#else + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("defaultValue", uint64_t(1), true); + HintTable[1].init("min", uint64_t(0), true); + HintTable[2].init("shortDescription", "The weight of this factory relative to other factories on the same material", true); + ParamDefTable[16].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=17, longName="materialFactoryMapList[].maxSlopeAngle" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[17]; + ParamDef->init("maxSlopeAngle", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("defaultValue", uint64_t(90), true); + HintTable[1].init("min", uint64_t(0), true); + ParamDefTable[17].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#else + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("defaultValue", uint64_t(90), true); + HintTable[1].init("min", uint64_t(0), true); + HintTable[2].init("shortDescription", "The maximum slope at which particles will be added to the surface in degrees where 0 is horizontal and 90 is vertical.", true); + ParamDefTable[17].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=18, longName="materialFactoryMapList[].lodParamDesc" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[18]; + ParamDef->init("lodParamDesc", TYPE_STRUCT, "emitterLodParamDesc", true); + + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=19, longName="materialFactoryMapList[].lodParamDesc.version" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[19]; + ParamDef->init("version", TYPE_U32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("defaultValue", uint64_t(0), true); + ParamDefTable[19].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("defaultValue", uint64_t(0), true); + HintTable[1].init("shortDescription", "Helpful documentation goes here", true); + ParamDefTable[19].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=20, longName="materialFactoryMapList[].lodParamDesc.maxDistance" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[20]; + ParamDef->init("maxDistance", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("defaultValue", uint64_t(0), true); + HintTable[1].init("min", uint64_t(0), true); + ParamDefTable[20].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#else + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("defaultValue", uint64_t(0), true); + HintTable[1].init("min", uint64_t(0), true); + HintTable[2].init("shortDescription", "Objects greater than this distance from the player will be culled more aggressively", true); + ParamDefTable[20].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=21, longName="materialFactoryMapList[].lodParamDesc.distanceWeight" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[21]; + ParamDef->init("distanceWeight", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("defaultValue", uint64_t(1), true); + HintTable[1].init("max", uint64_t(1), true); + HintTable[2].init("min", uint64_t(0), true); + ParamDefTable[21].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#else + + static HintImpl HintTable[4]; + static Hint* HintPtrTable[4] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], }; + HintTable[0].init("defaultValue", uint64_t(1), true); + HintTable[1].init("max", uint64_t(1), true); + HintTable[2].init("min", uint64_t(0), true); + HintTable[3].init("shortDescription", "Weight given to distance parameter in LOD function", true); + ParamDefTable[21].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=22, longName="materialFactoryMapList[].lodParamDesc.speedWeight" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[22]; + ParamDef->init("speedWeight", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("defaultValue", uint64_t(0), true); + HintTable[1].init("max", uint64_t(1), true); + HintTable[2].init("min", uint64_t(0), true); + ParamDefTable[22].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#else + + static HintImpl HintTable[4]; + static Hint* HintPtrTable[4] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], }; + HintTable[0].init("defaultValue", uint64_t(0), true); + HintTable[1].init("max", uint64_t(1), true); + HintTable[2].init("min", uint64_t(0), true); + HintTable[3].init("shortDescription", "Weight given to velocity parameter in LOD function", true); + ParamDefTable[22].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=23, longName="materialFactoryMapList[].lodParamDesc.lifeWeight" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[23]; + ParamDef->init("lifeWeight", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("defaultValue", uint64_t(0), true); + HintTable[1].init("max", uint64_t(1), true); + HintTable[2].init("min", uint64_t(0), true); + ParamDefTable[23].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#else + + static HintImpl HintTable[4]; + static Hint* HintPtrTable[4] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], }; + HintTable[0].init("defaultValue", uint64_t(0), true); + HintTable[1].init("max", uint64_t(1), true); + HintTable[2].init("min", uint64_t(0), true); + HintTable[3].init("shortDescription", "Weight given to life remain parameter in LOD function", true); + ParamDefTable[23].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=24, longName="materialFactoryMapList[].lodParamDesc.separationWeight" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[24]; + ParamDef->init("separationWeight", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("defaultValue", uint64_t(0), true); + HintTable[1].init("max", uint64_t(1), true); + HintTable[2].init("min", uint64_t(0), true); + ParamDefTable[24].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#else + + static HintImpl HintTable[4]; + static Hint* HintPtrTable[4] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], }; + HintTable[0].init("defaultValue", uint64_t(0), true); + HintTable[1].init("max", uint64_t(1), true); + HintTable[2].init("min", uint64_t(0), true); + HintTable[3].init("shortDescription", "Weight given to separation parameter in LOD function", true); + ParamDefTable[24].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=25, longName="materialFactoryMapList[].lodParamDesc.bias" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[25]; + ParamDef->init("bias", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("defaultValue", uint64_t(1), true); + HintTable[1].init("min", uint64_t(0), true); + ParamDefTable[25].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#else + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("defaultValue", uint64_t(1), true); + HintTable[1].init("min", uint64_t(0), true); + HintTable[2].init("shortDescription", "Bias given to objects spawned by this emitter, relative to other emitters in the same IOS", true); + ParamDefTable[25].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // SetChildren for: nodeIndex=0, longName="" + { + static Definition* Children[11]; + Children[0] = PDEF_PTR(1); + Children[1] = PDEF_PTR(2); + Children[2] = PDEF_PTR(3); + Children[3] = PDEF_PTR(4); + Children[4] = PDEF_PTR(5); + Children[5] = PDEF_PTR(6); + Children[6] = PDEF_PTR(7); + Children[7] = PDEF_PTR(8); + Children[8] = PDEF_PTR(9); + Children[9] = PDEF_PTR(10); + Children[10] = PDEF_PTR(11); + + ParamDefTable[0].setChildren(Children, 11); + } + + // SetChildren for: nodeIndex=11, longName="materialFactoryMapList" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(12); + + ParamDefTable[11].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=12, longName="materialFactoryMapList[]" + { + static Definition* Children[6]; + Children[0] = PDEF_PTR(13); + Children[1] = PDEF_PTR(14); + Children[2] = PDEF_PTR(15); + Children[3] = PDEF_PTR(16); + Children[4] = PDEF_PTR(17); + Children[5] = PDEF_PTR(18); + + ParamDefTable[12].setChildren(Children, 6); + } + + // SetChildren for: nodeIndex=18, longName="materialFactoryMapList[].lodParamDesc" + { + static Definition* Children[7]; + Children[0] = PDEF_PTR(19); + Children[1] = PDEF_PTR(20); + Children[2] = PDEF_PTR(21); + Children[3] = PDEF_PTR(22); + Children[4] = PDEF_PTR(23); + Children[5] = PDEF_PTR(24); + Children[6] = PDEF_PTR(25); + + ParamDefTable[18].setChildren(Children, 7); + } + + mBuiltFlag = true; + +} +void GroundEmitterAssetParameters::initStrings(void) +{ + raycastCollisionGroupMaskName.isAllocated = true; + raycastCollisionGroupMaskName.buf = NULL; +} + +void GroundEmitterAssetParameters::initDynamicArrays(void) +{ + materialFactoryMapList.buf = NULL; + materialFactoryMapList.isAllocated = true; + materialFactoryMapList.elementSize = sizeof(materialFactoryMapping_Type); + materialFactoryMapList.arraySizes[0] = 0; +} + +void GroundEmitterAssetParameters::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + density = float(1); + lifetimeLow = float(1); + lifetimeHigh = float(1); + velocityLow = physx::PxVec3(init(0, 0, 0)); + velocityHigh = physx::PxVec3(init(0, 0, 0)); + radius = float(10.0f); + raycastHeight = float(10.0f); + spawnHeight = float(0.0f); + maxRaycastsPerFrame = uint32_t(0xffffffff); + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void GroundEmitterAssetParameters::initReferences(void) +{ +} + +void GroundEmitterAssetParameters::freeDynamicArrays(void) +{ + if (materialFactoryMapList.isAllocated && materialFactoryMapList.buf) + { + mParameterizedTraits->free(materialFactoryMapList.buf); + } +} + +void GroundEmitterAssetParameters::freeStrings(void) +{ + + if (raycastCollisionGroupMaskName.isAllocated && raycastCollisionGroupMaskName.buf) + { + mParameterizedTraits->strfree((char*)raycastCollisionGroupMaskName.buf); + } + + for (int i = 0; i < materialFactoryMapList.arraySizes[0]; ++i) + { + if (materialFactoryMapList.buf[i].physMatName.isAllocated && materialFactoryMapList.buf[i].physMatName.buf) + { + mParameterizedTraits->strfree((char*)materialFactoryMapList.buf[i].physMatName.buf); + } + } +} + +void GroundEmitterAssetParameters::freeReferences(void) +{ + + for (int i = 0; i < materialFactoryMapList.arraySizes[0]; i++) + { + if (materialFactoryMapList.buf[i].iofxAssetName) + { + materialFactoryMapList.buf[i].iofxAssetName->destroy(); + } + if (materialFactoryMapList.buf[i].iosAssetName) + { + materialFactoryMapList.buf[i].iosAssetName->destroy(); + } + } +} + +} // namespace emitter +} // namespace nvidia diff --git a/APEX_1.4/module/emitter/src/autogen/ImpactEmitterActorParameters.cpp b/APEX_1.4/module/emitter/src/autogen/ImpactEmitterActorParameters.cpp new file mode 100644 index 00000000..cf8c8cc9 --- /dev/null +++ b/APEX_1.4/module/emitter/src/autogen/ImpactEmitterActorParameters.cpp @@ -0,0 +1,333 @@ +// 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 + + +#include "ImpactEmitterActorParameters.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace emitter +{ + +using namespace ImpactEmitterActorParametersNS; + +const char* const ImpactEmitterActorParametersFactory::vptr = + NvParameterized::getVptr<ImpactEmitterActorParameters, ImpactEmitterActorParameters::ClassAlignment>(); + +const uint32_t NumParamDefs = 2; +static NvParameterized::DefinitionImpl* ParamDefTable; // now allocated in buildTree [NumParamDefs]; + + +static const size_t ParamLookupChildrenTable[] = +{ + 1, +}; + +#define TENUM(type) nvidia::##type +#define CHILDREN(index) &ParamLookupChildrenTable[index] +static const NvParameterized::ParamLookupNode ParamLookupTable[NumParamDefs] = +{ + { TYPE_STRUCT, false, 0, CHILDREN(0), 1 }, + { TYPE_REF, false, (size_t)(&((ParametersStruct*)0)->explosionEnv), NULL, 0 }, // explosionEnv +}; + + +bool ImpactEmitterActorParameters::mBuiltFlag = false; +NvParameterized::MutexType ImpactEmitterActorParameters::mBuiltFlagMutex; + +ImpactEmitterActorParameters::ImpactEmitterActorParameters(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &ImpactEmitterActorParametersFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +ImpactEmitterActorParameters::~ImpactEmitterActorParameters() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void ImpactEmitterActorParameters::destroy() +{ + // We cache these fields here to avoid overwrite in destructor + bool doDeallocateSelf = mDoDeallocateSelf; + NvParameterized::Traits* traits = mParameterizedTraits; + int32_t* refCount = mRefCount; + void* buf = mBuffer; + + this->~ImpactEmitterActorParameters(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* ImpactEmitterActorParameters::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* ImpactEmitterActorParameters::getParameterDefinitionTree(void) const +{ + ImpactEmitterActorParameters* tmpParam = const_cast<ImpactEmitterActorParameters*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType ImpactEmitterActorParameters::getParameterHandle(const char* long_name, Handle& handle) const +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +NvParameterized::ErrorType ImpactEmitterActorParameters::getParameterHandle(const char* long_name, Handle& handle) +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +void ImpactEmitterActorParameters::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<ImpactEmitterActorParameters::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ + +void ImpactEmitterActorParameters::freeParameterDefinitionTable(NvParameterized::Traits* traits) +{ + if (!traits) + { + return; + } + + if (!mBuiltFlag) // Double-checked lock + { + return; + } + + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + + if (!mBuiltFlag) + { + return; + } + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + ParamDefTable[i].~DefinitionImpl(); + } + + traits->free(ParamDefTable); + + mBuiltFlag = false; +} + +#define PDEF_PTR(index) (&ParamDefTable[index]) + +void ImpactEmitterActorParameters::buildTree(void) +{ + + uint32_t allocSize = sizeof(NvParameterized::DefinitionImpl) * NumParamDefs; + ParamDefTable = (NvParameterized::DefinitionImpl*)(mParameterizedTraits->alloc(allocSize)); + memset(ParamDefTable, 0, allocSize); + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + NV_PARAM_PLACEMENT_NEW(ParamDefTable + i, NvParameterized::DefinitionImpl)(*mParameterizedTraits); + } + + // Initialize DefinitionImpl node: nodeIndex=0, longName="" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[0]; + ParamDef->init("", TYPE_STRUCT, "STRUCT", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "This class is used for creating ImpactEmitterActor instances", true); + ParamDefTable[0].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=1, longName="explosionEnv" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[1]; + ParamDef->init("explosionEnv", TYPE_REF, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("INCLUDED", uint64_t(1), true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("INCLUDED", uint64_t(1), true); + HintTable[1].init("longDescription", "Explosion actors created by this impact emitter actor will be passed these parameters", true); + HintTable[2].init("shortDescription", "Explosion Actor Environment Settings", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + static const char* const RefVariantVals[] = { "ExplosionEnvParameters" }; + ParamDefTable[1].setRefVariantVals((const char**)RefVariantVals, 1); + + + + } + + // SetChildren for: nodeIndex=0, longName="" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(1); + + ParamDefTable[0].setChildren(Children, 1); + } + + mBuiltFlag = true; + +} +void ImpactEmitterActorParameters::initStrings(void) +{ +} + +void ImpactEmitterActorParameters::initDynamicArrays(void) +{ +} + +void ImpactEmitterActorParameters::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void ImpactEmitterActorParameters::initReferences(void) +{ + explosionEnv = NULL; + +} + +void ImpactEmitterActorParameters::freeDynamicArrays(void) +{ +} + +void ImpactEmitterActorParameters::freeStrings(void) +{ +} + +void ImpactEmitterActorParameters::freeReferences(void) +{ + if (explosionEnv) + { + explosionEnv->destroy(); + } + +} + +} // namespace emitter +} // namespace nvidia diff --git a/APEX_1.4/module/emitter/src/autogen/ImpactEmitterAssetParameters.cpp b/APEX_1.4/module/emitter/src/autogen/ImpactEmitterAssetParameters.cpp new file mode 100644 index 00000000..f3076227 --- /dev/null +++ b/APEX_1.4/module/emitter/src/autogen/ImpactEmitterAssetParameters.cpp @@ -0,0 +1,386 @@ +// 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 + + +#include "ImpactEmitterAssetParameters.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace emitter +{ + +using namespace ImpactEmitterAssetParametersNS; + +const char* const ImpactEmitterAssetParametersFactory::vptr = + NvParameterized::getVptr<ImpactEmitterAssetParameters, ImpactEmitterAssetParameters::ClassAlignment>(); + +const uint32_t NumParamDefs = 3; +static NvParameterized::DefinitionImpl* ParamDefTable; // now allocated in buildTree [NumParamDefs]; + + +static const size_t ParamLookupChildrenTable[] = +{ + 1, 2, +}; + +#define TENUM(type) nvidia::##type +#define CHILDREN(index) &ParamLookupChildrenTable[index] +static const NvParameterized::ParamLookupNode ParamLookupTable[NumParamDefs] = +{ + { TYPE_STRUCT, false, 0, CHILDREN(0), 1 }, + { TYPE_ARRAY, true, (size_t)(&((ParametersStruct*)0)->eventSetList), CHILDREN(1), 1 }, // eventSetList + { TYPE_REF, false, 1 * sizeof(NvParameterized::Interface*), NULL, 0 }, // eventSetList[] +}; + + +bool ImpactEmitterAssetParameters::mBuiltFlag = false; +NvParameterized::MutexType ImpactEmitterAssetParameters::mBuiltFlagMutex; + +ImpactEmitterAssetParameters::ImpactEmitterAssetParameters(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &ImpactEmitterAssetParametersFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +ImpactEmitterAssetParameters::~ImpactEmitterAssetParameters() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void ImpactEmitterAssetParameters::destroy() +{ + // We cache these fields here to avoid overwrite in destructor + bool doDeallocateSelf = mDoDeallocateSelf; + NvParameterized::Traits* traits = mParameterizedTraits; + int32_t* refCount = mRefCount; + void* buf = mBuffer; + + this->~ImpactEmitterAssetParameters(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* ImpactEmitterAssetParameters::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* ImpactEmitterAssetParameters::getParameterDefinitionTree(void) const +{ + ImpactEmitterAssetParameters* tmpParam = const_cast<ImpactEmitterAssetParameters*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType ImpactEmitterAssetParameters::getParameterHandle(const char* long_name, Handle& handle) const +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +NvParameterized::ErrorType ImpactEmitterAssetParameters::getParameterHandle(const char* long_name, Handle& handle) +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +void ImpactEmitterAssetParameters::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<ImpactEmitterAssetParameters::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ +/* [0] - eventSetList (not an array of structs) */ + +void ImpactEmitterAssetParameters::freeParameterDefinitionTable(NvParameterized::Traits* traits) +{ + if (!traits) + { + return; + } + + if (!mBuiltFlag) // Double-checked lock + { + return; + } + + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + + if (!mBuiltFlag) + { + return; + } + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + ParamDefTable[i].~DefinitionImpl(); + } + + traits->free(ParamDefTable); + + mBuiltFlag = false; +} + +#define PDEF_PTR(index) (&ParamDefTable[index]) + +void ImpactEmitterAssetParameters::buildTree(void) +{ + + uint32_t allocSize = sizeof(NvParameterized::DefinitionImpl) * NumParamDefs; + ParamDefTable = (NvParameterized::DefinitionImpl*)(mParameterizedTraits->alloc(allocSize)); + memset(ParamDefTable, 0, allocSize); + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + NV_PARAM_PLACEMENT_NEW(ParamDefTable + i, NvParameterized::DefinitionImpl)(*mParameterizedTraits); + } + + // Initialize DefinitionImpl node: nodeIndex=0, longName="" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[0]; + ParamDef->init("", TYPE_STRUCT, "STRUCT", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "This class is parameter storage for the Impact Emitter", true); + ParamDefTable[0].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=1, longName="eventSetList" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[1]; + ParamDef->init("eventSetList", TYPE_ARRAY, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("INCLUDED", uint64_t(1), true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("INCLUDED", uint64_t(1), true); + HintTable[1].init("longDescription", "This dynamic array contains a list of events (particle or explosion spawning).", true); + HintTable[2].init("shortDescription", "Event Set List", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + static const char* const RefVariantVals[] = { "ImpactObjectEvent", "ImpactExplosionEvent" }; + ParamDefTable[1].setRefVariantVals((const char**)RefVariantVals, 2); + + + ParamDef->setArraySize(-1); + static const uint8_t dynHandleIndices[1] = { 0, }; + ParamDef->setDynamicHandleIndicesMap(dynHandleIndices, 1); + + } + + // Initialize DefinitionImpl node: nodeIndex=2, longName="eventSetList[]" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[2]; + ParamDef->init("eventSetList", TYPE_REF, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("INCLUDED", uint64_t(1), true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("INCLUDED", uint64_t(1), true); + HintTable[1].init("longDescription", "This dynamic array contains a list of events (particle or explosion spawning).", true); + HintTable[2].init("shortDescription", "Event Set List", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + static const char* const RefVariantVals[] = { "ImpactObjectEvent", "ImpactExplosionEvent" }; + ParamDefTable[2].setRefVariantVals((const char**)RefVariantVals, 2); + + + + } + + // SetChildren for: nodeIndex=0, longName="" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(1); + + ParamDefTable[0].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=1, longName="eventSetList" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(2); + + ParamDefTable[1].setChildren(Children, 1); + } + + mBuiltFlag = true; + +} +void ImpactEmitterAssetParameters::initStrings(void) +{ +} + +void ImpactEmitterAssetParameters::initDynamicArrays(void) +{ + eventSetList.buf = NULL; + eventSetList.isAllocated = true; + eventSetList.elementSize = sizeof(NvParameterized::Interface*); + eventSetList.arraySizes[0] = 0; +} + +void ImpactEmitterAssetParameters::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void ImpactEmitterAssetParameters::initReferences(void) +{ +} + +void ImpactEmitterAssetParameters::freeDynamicArrays(void) +{ + if (eventSetList.isAllocated && eventSetList.buf) + { + mParameterizedTraits->free(eventSetList.buf); + } +} + +void ImpactEmitterAssetParameters::freeStrings(void) +{ +} + +void ImpactEmitterAssetParameters::freeReferences(void) +{ + + for (int i = 0; i < eventSetList.arraySizes[0]; ++i) + { + if (eventSetList.buf[i]) + { + eventSetList.buf[i]->destroy(); + } + } +} + +} // namespace emitter +} // namespace nvidia diff --git a/APEX_1.4/module/emitter/src/autogen/ImpactExplosionEvent.cpp b/APEX_1.4/module/emitter/src/autogen/ImpactExplosionEvent.cpp new file mode 100644 index 00000000..0c2559d3 --- /dev/null +++ b/APEX_1.4/module/emitter/src/autogen/ImpactExplosionEvent.cpp @@ -0,0 +1,413 @@ +// 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 + + +#include "ImpactExplosionEvent.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace emitter +{ + +using namespace ImpactExplosionEventNS; + +const char* const ImpactExplosionEventFactory::vptr = + NvParameterized::getVptr<ImpactExplosionEvent, ImpactExplosionEvent::ClassAlignment>(); + +const uint32_t NumParamDefs = 5; +static NvParameterized::DefinitionImpl* ParamDefTable; // now allocated in buildTree [NumParamDefs]; + + +static const size_t ParamLookupChildrenTable[] = +{ + 1, 2, 3, 4, +}; + +#define TENUM(type) nvidia::##type +#define CHILDREN(index) &ParamLookupChildrenTable[index] +static const NvParameterized::ParamLookupNode ParamLookupTable[NumParamDefs] = +{ + { TYPE_STRUCT, false, 0, CHILDREN(0), 4 }, + { TYPE_STRING, false, (size_t)(&((ParametersStruct*)0)->eventSetName), NULL, 0 }, // eventSetName + { TYPE_REF, false, (size_t)(&((ParametersStruct*)0)->explosionAssetName), NULL, 0 }, // explosionAssetName + { TYPE_F32, false, (size_t)(&((ParametersStruct*)0)->delay), NULL, 0 }, // delay + { TYPE_F32, false, (size_t)(&((ParametersStruct*)0)->duration), NULL, 0 }, // duration +}; + + +bool ImpactExplosionEvent::mBuiltFlag = false; +NvParameterized::MutexType ImpactExplosionEvent::mBuiltFlagMutex; + +ImpactExplosionEvent::ImpactExplosionEvent(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &ImpactExplosionEventFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +ImpactExplosionEvent::~ImpactExplosionEvent() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void ImpactExplosionEvent::destroy() +{ + // We cache these fields here to avoid overwrite in destructor + bool doDeallocateSelf = mDoDeallocateSelf; + NvParameterized::Traits* traits = mParameterizedTraits; + int32_t* refCount = mRefCount; + void* buf = mBuffer; + + this->~ImpactExplosionEvent(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* ImpactExplosionEvent::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* ImpactExplosionEvent::getParameterDefinitionTree(void) const +{ + ImpactExplosionEvent* tmpParam = const_cast<ImpactExplosionEvent*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType ImpactExplosionEvent::getParameterHandle(const char* long_name, Handle& handle) const +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +NvParameterized::ErrorType ImpactExplosionEvent::getParameterHandle(const char* long_name, Handle& handle) +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +void ImpactExplosionEvent::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<ImpactExplosionEvent::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ + +void ImpactExplosionEvent::freeParameterDefinitionTable(NvParameterized::Traits* traits) +{ + if (!traits) + { + return; + } + + if (!mBuiltFlag) // Double-checked lock + { + return; + } + + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + + if (!mBuiltFlag) + { + return; + } + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + ParamDefTable[i].~DefinitionImpl(); + } + + traits->free(ParamDefTable); + + mBuiltFlag = false; +} + +#define PDEF_PTR(index) (&ParamDefTable[index]) + +void ImpactExplosionEvent::buildTree(void) +{ + + uint32_t allocSize = sizeof(NvParameterized::DefinitionImpl) * NumParamDefs; + ParamDefTable = (NvParameterized::DefinitionImpl*)(mParameterizedTraits->alloc(allocSize)); + memset(ParamDefTable, 0, allocSize); + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + NV_PARAM_PLACEMENT_NEW(ParamDefTable + i, NvParameterized::DefinitionImpl)(*mParameterizedTraits); + } + + // Initialize DefinitionImpl node: nodeIndex=0, longName="" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[0]; + ParamDef->init("", TYPE_STRUCT, "STRUCT", true); + + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=1, longName="eventSetName" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[1]; + ParamDef->init("eventSetName", TYPE_STRING, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "The name of the event set (you can put multiple events in an event set)", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=2, longName="explosionAssetName" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[2]; + ParamDef->init("explosionAssetName", TYPE_REF, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "The asset name of the explosion that will optionally accompany the impact event", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + static const char* const RefVariantVals[] = { "ExplosionAsset" }; + ParamDefTable[2].setRefVariantVals((const char**)RefVariantVals, 1); + + + + } + + // Initialize DefinitionImpl node: nodeIndex=3, longName="delay" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[3]; + ParamDef->init("delay", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("defaultValue", uint64_t(0), true); + HintTable[1].init("min", uint64_t(0), true); + ParamDefTable[3].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#else + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("defaultValue", uint64_t(0), true); + HintTable[1].init("min", uint64_t(0), true); + HintTable[2].init("shortDescription", "The delay (in seconds) after impact to wait before triggering", true); + ParamDefTable[3].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=4, longName="duration" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[4]; + ParamDef->init("duration", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("defaultValue", uint64_t(1), true); + HintTable[1].init("min", uint64_t(0), true); + ParamDefTable[4].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#else + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("defaultValue", uint64_t(1), true); + HintTable[1].init("min", uint64_t(0), true); + HintTable[2].init("shortDescription", "The length (in seconds) of the explosion", true); + ParamDefTable[4].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // SetChildren for: nodeIndex=0, longName="" + { + static Definition* Children[4]; + Children[0] = PDEF_PTR(1); + Children[1] = PDEF_PTR(2); + Children[2] = PDEF_PTR(3); + Children[3] = PDEF_PTR(4); + + ParamDefTable[0].setChildren(Children, 4); + } + + mBuiltFlag = true; + +} +void ImpactExplosionEvent::initStrings(void) +{ + eventSetName.isAllocated = true; + eventSetName.buf = NULL; +} + +void ImpactExplosionEvent::initDynamicArrays(void) +{ +} + +void ImpactExplosionEvent::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + delay = float(0); + duration = float(1); + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void ImpactExplosionEvent::initReferences(void) +{ + explosionAssetName = NULL; + +} + +void ImpactExplosionEvent::freeDynamicArrays(void) +{ +} + +void ImpactExplosionEvent::freeStrings(void) +{ + + if (eventSetName.isAllocated && eventSetName.buf) + { + mParameterizedTraits->strfree((char*)eventSetName.buf); + } +} + +void ImpactExplosionEvent::freeReferences(void) +{ + if (explosionAssetName) + { + explosionAssetName->destroy(); + } + +} + +} // namespace emitter +} // namespace nvidia diff --git a/APEX_1.4/module/emitter/src/autogen/ImpactObjectEvent.cpp b/APEX_1.4/module/emitter/src/autogen/ImpactObjectEvent.cpp new file mode 100644 index 00000000..3baea436 --- /dev/null +++ b/APEX_1.4/module/emitter/src/autogen/ImpactObjectEvent.cpp @@ -0,0 +1,887 @@ +// 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 + + +#include "ImpactObjectEvent.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace emitter +{ + +using namespace ImpactObjectEventNS; + +const char* const ImpactObjectEventFactory::vptr = + NvParameterized::getVptr<ImpactObjectEvent, ImpactObjectEvent::ClassAlignment>(); + +const uint32_t NumParamDefs = 21; +static NvParameterized::DefinitionImpl* ParamDefTable; // now allocated in buildTree [NumParamDefs]; + + +static const size_t ParamLookupChildrenTable[] = +{ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, +}; + +#define TENUM(type) nvidia::##type +#define CHILDREN(index) &ParamLookupChildrenTable[index] +static const NvParameterized::ParamLookupNode ParamLookupTable[NumParamDefs] = +{ + { TYPE_STRUCT, false, 0, CHILDREN(0), 13 }, + { TYPE_STRING, false, (size_t)(&((ParametersStruct*)0)->eventSetName), NULL, 0 }, // eventSetName + { TYPE_REF, false, (size_t)(&((ParametersStruct*)0)->iofxAssetName), NULL, 0 }, // iofxAssetName + { TYPE_REF, false, (size_t)(&((ParametersStruct*)0)->iosAssetName), NULL, 0 }, // iosAssetName + { TYPE_F32, false, (size_t)(&((ParametersStruct*)0)->angleLow), NULL, 0 }, // angleLow + { TYPE_F32, false, (size_t)(&((ParametersStruct*)0)->angleHigh), NULL, 0 }, // angleHigh + { TYPE_F32, false, (size_t)(&((ParametersStruct*)0)->speedLow), NULL, 0 }, // speedLow + { TYPE_F32, false, (size_t)(&((ParametersStruct*)0)->speedHigh), NULL, 0 }, // speedHigh + { TYPE_F32, false, (size_t)(&((ParametersStruct*)0)->lifeLow), NULL, 0 }, // lifeLow + { TYPE_F32, false, (size_t)(&((ParametersStruct*)0)->lifeHigh), NULL, 0 }, // lifeHigh + { TYPE_F32, false, (size_t)(&((ParametersStruct*)0)->delay), NULL, 0 }, // delay + { TYPE_U32, false, (size_t)(&((ParametersStruct*)0)->particleSpawnCount), NULL, 0 }, // particleSpawnCount + { TYPE_ENUM, false, (size_t)(&((ParametersStruct*)0)->impactAxis), NULL, 0 }, // impactAxis + { TYPE_STRUCT, false, (size_t)(&((ParametersStruct*)0)->lodParamDesc), CHILDREN(13), 7 }, // lodParamDesc + { TYPE_U32, false, (size_t)(&((emitterLodParamDesc_Type*)0)->version), NULL, 0 }, // lodParamDesc.version + { TYPE_F32, false, (size_t)(&((emitterLodParamDesc_Type*)0)->maxDistance), NULL, 0 }, // lodParamDesc.maxDistance + { TYPE_F32, false, (size_t)(&((emitterLodParamDesc_Type*)0)->distanceWeight), NULL, 0 }, // lodParamDesc.distanceWeight + { TYPE_F32, false, (size_t)(&((emitterLodParamDesc_Type*)0)->speedWeight), NULL, 0 }, // lodParamDesc.speedWeight + { TYPE_F32, false, (size_t)(&((emitterLodParamDesc_Type*)0)->lifeWeight), NULL, 0 }, // lodParamDesc.lifeWeight + { TYPE_F32, false, (size_t)(&((emitterLodParamDesc_Type*)0)->separationWeight), NULL, 0 }, // lodParamDesc.separationWeight + { TYPE_F32, false, (size_t)(&((emitterLodParamDesc_Type*)0)->bias), NULL, 0 }, // lodParamDesc.bias +}; + + +bool ImpactObjectEvent::mBuiltFlag = false; +NvParameterized::MutexType ImpactObjectEvent::mBuiltFlagMutex; + +ImpactObjectEvent::ImpactObjectEvent(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &ImpactObjectEventFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +ImpactObjectEvent::~ImpactObjectEvent() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void ImpactObjectEvent::destroy() +{ + // We cache these fields here to avoid overwrite in destructor + bool doDeallocateSelf = mDoDeallocateSelf; + NvParameterized::Traits* traits = mParameterizedTraits; + int32_t* refCount = mRefCount; + void* buf = mBuffer; + + this->~ImpactObjectEvent(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* ImpactObjectEvent::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* ImpactObjectEvent::getParameterDefinitionTree(void) const +{ + ImpactObjectEvent* tmpParam = const_cast<ImpactObjectEvent*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType ImpactObjectEvent::getParameterHandle(const char* long_name, Handle& handle) const +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +NvParameterized::ErrorType ImpactObjectEvent::getParameterHandle(const char* long_name, Handle& handle) +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +void ImpactObjectEvent::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<ImpactObjectEvent::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ + +void ImpactObjectEvent::freeParameterDefinitionTable(NvParameterized::Traits* traits) +{ + if (!traits) + { + return; + } + + if (!mBuiltFlag) // Double-checked lock + { + return; + } + + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + + if (!mBuiltFlag) + { + return; + } + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + ParamDefTable[i].~DefinitionImpl(); + } + + traits->free(ParamDefTable); + + mBuiltFlag = false; +} + +#define PDEF_PTR(index) (&ParamDefTable[index]) + +void ImpactObjectEvent::buildTree(void) +{ + + uint32_t allocSize = sizeof(NvParameterized::DefinitionImpl) * NumParamDefs; + ParamDefTable = (NvParameterized::DefinitionImpl*)(mParameterizedTraits->alloc(allocSize)); + memset(ParamDefTable, 0, allocSize); + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + NV_PARAM_PLACEMENT_NEW(ParamDefTable + i, NvParameterized::DefinitionImpl)(*mParameterizedTraits); + } + + // Initialize DefinitionImpl node: nodeIndex=0, longName="" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[0]; + ParamDef->init("", TYPE_STRUCT, "STRUCT", true); + + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=1, longName="eventSetName" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[1]; + ParamDef->init("eventSetName", TYPE_STRING, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "The name of the event set (you can put multiple events in an event set)", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=2, longName="iofxAssetName" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[2]; + ParamDef->init("iofxAssetName", TYPE_REF, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "The name of the instanced object effects asset that will render the particles", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + static const char* const RefVariantVals[] = { "IOFX" }; + ParamDefTable[2].setRefVariantVals((const char**)RefVariantVals, 1); + + + + } + + // Initialize DefinitionImpl node: nodeIndex=3, longName="iosAssetName" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[3]; + ParamDef->init("iosAssetName", TYPE_REF, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "The asset name of the particle system that will simulate the particles", true); + ParamDefTable[3].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + static const char* const RefVariantVals[] = { "BasicIosAsset", "ParticleIosAsset" }; + ParamDefTable[3].setRefVariantVals((const char**)RefVariantVals, 2); + + + + } + + // Initialize DefinitionImpl node: nodeIndex=4, longName="angleLow" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[4]; + ParamDef->init("angleLow", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "The particle emission angle range in degrees", true); + ParamDefTable[4].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=5, longName="angleHigh" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[5]; + ParamDef->init("angleHigh", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "The particle emission angle range in degrees", true); + ParamDefTable[5].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=6, longName="speedLow" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[6]; + ParamDef->init("speedLow", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "The particle emission speed range", true); + ParamDefTable[6].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=7, longName="speedHigh" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[7]; + ParamDef->init("speedHigh", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "The particle emission speed range", true); + ParamDefTable[7].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=8, longName="lifeLow" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[8]; + ParamDef->init("lifeLow", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "The particle life range in seconds", true); + ParamDefTable[8].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=9, longName="lifeHigh" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[9]; + ParamDef->init("lifeHigh", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "The particle life range in seconds", true); + ParamDefTable[9].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=10, longName="delay" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[10]; + ParamDef->init("delay", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("defaultValue", uint64_t(0), true); + HintTable[1].init("min", uint64_t(0), true); + ParamDefTable[10].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#else + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("defaultValue", uint64_t(0), true); + HintTable[1].init("min", uint64_t(0), true); + HintTable[2].init("shortDescription", "The delay (in seconds) after impact to wait before triggering", true); + ParamDefTable[10].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=11, longName="particleSpawnCount" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[11]; + ParamDef->init("particleSpawnCount", TYPE_U32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("defaultValue", uint64_t(10), true); + HintTable[1].init("min", uint64_t(0), true); + ParamDefTable[11].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#else + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("defaultValue", uint64_t(10), true); + HintTable[1].init("min", uint64_t(0), true); + HintTable[2].init("shortDescription", "The number of particles emitted per impact", true); + ParamDefTable[11].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=12, longName="impactAxis" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[12]; + ParamDef->init("impactAxis", TYPE_ENUM, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("defaultValue", "reflection", true); + ParamDefTable[12].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("defaultValue", "reflection", true); + HintTable[1].init("shortDescription", "The method used to emit particles at the point of impact", true); + ParamDefTable[12].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + static const char* const EnumVals[] = { "incident", "normal", "reflection" }; + ParamDefTable[12].setEnumVals((const char**)EnumVals, 3); + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=13, longName="lodParamDesc" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[13]; + ParamDef->init("lodParamDesc", TYPE_STRUCT, "emitterLodParamDesc", true); + + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=14, longName="lodParamDesc.version" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[14]; + ParamDef->init("version", TYPE_U32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("defaultValue", uint64_t(0), true); + ParamDefTable[14].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("defaultValue", uint64_t(0), true); + HintTable[1].init("shortDescription", "Helpful documentation goes here", true); + ParamDefTable[14].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=15, longName="lodParamDesc.maxDistance" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[15]; + ParamDef->init("maxDistance", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("defaultValue", uint64_t(0), true); + HintTable[1].init("min", uint64_t(0), true); + ParamDefTable[15].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#else + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("defaultValue", uint64_t(0), true); + HintTable[1].init("min", uint64_t(0), true); + HintTable[2].init("shortDescription", "Objects greater than this distance from the player will be culled more aggressively", true); + ParamDefTable[15].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=16, longName="lodParamDesc.distanceWeight" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[16]; + ParamDef->init("distanceWeight", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("defaultValue", uint64_t(1), true); + HintTable[1].init("max", uint64_t(1), true); + HintTable[2].init("min", uint64_t(0), true); + ParamDefTable[16].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#else + + static HintImpl HintTable[4]; + static Hint* HintPtrTable[4] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], }; + HintTable[0].init("defaultValue", uint64_t(1), true); + HintTable[1].init("max", uint64_t(1), true); + HintTable[2].init("min", uint64_t(0), true); + HintTable[3].init("shortDescription", "Weight given to distance parameter in LOD function", true); + ParamDefTable[16].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=17, longName="lodParamDesc.speedWeight" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[17]; + ParamDef->init("speedWeight", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("defaultValue", uint64_t(0), true); + HintTable[1].init("max", uint64_t(1), true); + HintTable[2].init("min", uint64_t(0), true); + ParamDefTable[17].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#else + + static HintImpl HintTable[4]; + static Hint* HintPtrTable[4] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], }; + HintTable[0].init("defaultValue", uint64_t(0), true); + HintTable[1].init("max", uint64_t(1), true); + HintTable[2].init("min", uint64_t(0), true); + HintTable[3].init("shortDescription", "Weight given to velocity parameter in LOD function", true); + ParamDefTable[17].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=18, longName="lodParamDesc.lifeWeight" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[18]; + ParamDef->init("lifeWeight", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("defaultValue", uint64_t(0), true); + HintTable[1].init("max", uint64_t(1), true); + HintTable[2].init("min", uint64_t(0), true); + ParamDefTable[18].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#else + + static HintImpl HintTable[4]; + static Hint* HintPtrTable[4] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], }; + HintTable[0].init("defaultValue", uint64_t(0), true); + HintTable[1].init("max", uint64_t(1), true); + HintTable[2].init("min", uint64_t(0), true); + HintTable[3].init("shortDescription", "Weight given to life remain parameter in LOD function", true); + ParamDefTable[18].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=19, longName="lodParamDesc.separationWeight" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[19]; + ParamDef->init("separationWeight", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("defaultValue", uint64_t(0), true); + HintTable[1].init("max", uint64_t(1), true); + HintTable[2].init("min", uint64_t(0), true); + ParamDefTable[19].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#else + + static HintImpl HintTable[4]; + static Hint* HintPtrTable[4] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], }; + HintTable[0].init("defaultValue", uint64_t(0), true); + HintTable[1].init("max", uint64_t(1), true); + HintTable[2].init("min", uint64_t(0), true); + HintTable[3].init("shortDescription", "Weight given to separation parameter in LOD function", true); + ParamDefTable[19].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=20, longName="lodParamDesc.bias" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[20]; + ParamDef->init("bias", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("defaultValue", uint64_t(1), true); + HintTable[1].init("min", uint64_t(0), true); + ParamDefTable[20].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#else + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("defaultValue", uint64_t(1), true); + HintTable[1].init("min", uint64_t(0), true); + HintTable[2].init("shortDescription", "Bias given to objects spawned by this emitter, relative to other emitters in the same IOS", true); + ParamDefTable[20].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // SetChildren for: nodeIndex=0, longName="" + { + static Definition* Children[13]; + Children[0] = PDEF_PTR(1); + Children[1] = PDEF_PTR(2); + Children[2] = PDEF_PTR(3); + Children[3] = PDEF_PTR(4); + Children[4] = PDEF_PTR(5); + Children[5] = PDEF_PTR(6); + Children[6] = PDEF_PTR(7); + Children[7] = PDEF_PTR(8); + Children[8] = PDEF_PTR(9); + Children[9] = PDEF_PTR(10); + Children[10] = PDEF_PTR(11); + Children[11] = PDEF_PTR(12); + Children[12] = PDEF_PTR(13); + + ParamDefTable[0].setChildren(Children, 13); + } + + // SetChildren for: nodeIndex=13, longName="lodParamDesc" + { + static Definition* Children[7]; + Children[0] = PDEF_PTR(14); + Children[1] = PDEF_PTR(15); + Children[2] = PDEF_PTR(16); + Children[3] = PDEF_PTR(17); + Children[4] = PDEF_PTR(18); + Children[5] = PDEF_PTR(19); + Children[6] = PDEF_PTR(20); + + ParamDefTable[13].setChildren(Children, 7); + } + + mBuiltFlag = true; + +} +void ImpactObjectEvent::initStrings(void) +{ + eventSetName.isAllocated = true; + eventSetName.buf = NULL; +} + +void ImpactObjectEvent::initDynamicArrays(void) +{ +} + +void ImpactObjectEvent::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + angleLow = float(0); + angleHigh = float(90); + speedLow = float(0); + speedHigh = float(1); + lifeLow = float(5); + lifeHigh = float(10); + delay = float(0); + particleSpawnCount = uint32_t(10); + impactAxis = (const char*)"reflection"; + lodParamDesc.version = uint32_t(0); + lodParamDesc.maxDistance = float(0); + lodParamDesc.distanceWeight = float(1); + lodParamDesc.speedWeight = float(0); + lodParamDesc.lifeWeight = float(0); + lodParamDesc.separationWeight = float(0); + lodParamDesc.bias = float(1); + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void ImpactObjectEvent::initReferences(void) +{ + iofxAssetName = NULL; + + iosAssetName = NULL; + +} + +void ImpactObjectEvent::freeDynamicArrays(void) +{ +} + +void ImpactObjectEvent::freeStrings(void) +{ + + if (eventSetName.isAllocated && eventSetName.buf) + { + mParameterizedTraits->strfree((char*)eventSetName.buf); + } +} + +void ImpactObjectEvent::freeReferences(void) +{ + if (iofxAssetName) + { + iofxAssetName->destroy(); + } + + if (iosAssetName) + { + iosAssetName->destroy(); + } + +} + +} // namespace emitter +} // namespace nvidia |