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/particles/src | |
| 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/particles/src')
44 files changed, 39071 insertions, 0 deletions
diff --git a/APEX_1.4/module/particles/src/EffectPackageActorImpl.cpp b/APEX_1.4/module/particles/src/EffectPackageActorImpl.cpp new file mode 100644 index 00000000..77bfb300 --- /dev/null +++ b/APEX_1.4/module/particles/src/EffectPackageActorImpl.cpp @@ -0,0 +1,3186 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + + +#include "EffectPackageActorImpl.h" +#include "FloatMath.h" +#include "ParticlesScene.h" +#include "SceneIntl.h" +#include "EmitterActor.h" +#include "EmitterAsset.h" +#include "TurbulenceFSActor.h" +#include "AttractorFSActor.h" +#include "JetFSActor.h" +#include "WindFSActor.h" +#include "NoiseFSActor.h" +#include "VortexFSActor.h" +#include "nvparameterized/NvParamUtils.h" +#include "ImpactEmitterActor.h" +#include "GroundEmitterActor.h" +#include "TurbulenceFSAsset.h" +#include "BasicIosAsset.h" +#include "RenderDebugInterface.h" +#include "BasicFSAsset.h" +#include "RenderDebugInterface.h" +#include "SceneIntl.h" +#include "ForceFieldAsset.h" +#include "ForceFieldActor.h" +#include "HeatSourceAsset.h" +#include "HeatSourceActor.h" +#include "HeatSourceAssetParams.h" + +#include "ApexEmitterActorParameters.h" +#include "ApexEmitterAssetParameters.h" + +#include "SubstanceSourceAsset.h" +#include "SubstanceSourceActor.h" +#include "SubstanceSourceAsset.h" +#include "SubstanceSourceAssetParams.h" + +#include "VelocitySourceAsset.h" +#include "VelocitySourceActor.h" +#include "VelocitySourceAssetParams.h" + +#include "FlameEmitterAsset.h" +#include "FlameEmitterActor.h" +#include "FlameEmitterAssetParams.h" + +#include "TurbulenceFSAssetParams.h" + +#include "ScopedPhysXLock.h" + +#include "PxPhysics.h" +#include "PxScene.h" +#include "ApexResourceHelper.h" +#include "PsMathUtils.h" + + +#pragma warning(disable:4100) + +namespace nvidia +{ +namespace particles +{ + using namespace physx; + +static PxTransform _getPose(float x, float y, float z, float rotX, float rotY, float rotZ) +{ + PxTransform ret; + ret.p = PxVec3(x, y, z); + fm_eulerToQuat(rotX * FM_DEG_TO_RAD, rotY * FM_DEG_TO_RAD, rotZ * FM_DEG_TO_RAD, &ret.q.x); + return ret; +} + +void _getRot(const PxQuat& q, float& rotX, float& rotY, float& rotZ) +{ + fm_quatToEuler((float*)&q, rotX, rotY, rotZ); + rotX *= FM_RAD_TO_DEG; + rotY *= FM_RAD_TO_DEG; + rotZ *= FM_RAD_TO_DEG; +} + +static float ranf(void) +{ + uint32_t r = (uint32_t)::rand(); + r &= 0x7FFF; + return (float)r * (1.0f / 32768.0f); +} + +static float ranf(float min, float max) +{ + return ranf() * (max - min) + min; +} + +EffectPackageActorImpl::EffectPackageActorImpl(EffectPackageAsset* apexAsset, + const EffectPackageAssetParams* assetParams, + const EffectPackageActorParams* actorParams, + nvidia::apex::ApexSDK& sdk, + nvidia::apex::Scene& scene, + ParticlesScene& dynamicSystemScene, + ModuleTurbulenceFS* moduleTurbulenceFS) +{ + mRigidBodyChange = false; + mRenderVolume = NULL; + mEmitterValidateCallback = NULL; + mAlive = true; + mSimTime = 0; + mCurrentLifeTime = 0; + mFadeIn = false; + mFadeInTime = 0; + mFadeInDuration = 0; + mFadeOut = false; + mFadeOutTime = 0; + mFadeOutDuration = 0; + mFirstFrame = true; + mData = assetParams; + mAsset = apexAsset; + mScene = &scene; + mModuleTurbulenceFS = moduleTurbulenceFS; + mEnabled = actorParams->Enabled; + mVisible = false; + mEverVisible = false; + mOffScreenTime = 0; + mVisState = VS_ON_SCREEN; + mFadeTime = 0; + mNotVisibleTime = 0; + mPose = actorParams->InitialPose; + mObjectScale = actorParams->objectScale; + mEffectPath = PX_NEW(EffectPath); + { + RigidBodyEffectNS::EffectPath_Type *path = (RigidBodyEffectNS::EffectPath_Type *)&mData->Path; + if ( !mEffectPath->init(*path)) + { + delete mEffectPath; + mEffectPath = NULL; + } + } + + for (int32_t i = 0; i < mData->Effects.arraySizes[0]; i++) + { + NvParameterized::Interface* iface = mData->Effects.buf[i]; + PX_ASSERT(iface); + if (iface) + { + EffectType type = getEffectType(iface); + switch (type) + { + case ET_EMITTER: + { + EmitterEffect* ed = static_cast< EmitterEffect*>(iface); + if (ed->Emitter) + { + EffectEmitter* ee = PX_NEW(EffectEmitter)(ed->Emitter->name(), ed, sdk, scene, dynamicSystemScene, mPose, mEnabled); + ee->setCurrentScale(mObjectScale,mEffectPath); + mEffects.pushBack(static_cast< EffectData*>(ee)); + } + } + break; + case ET_HEAT_SOURCE: + { + HeatSourceEffect* ed = static_cast< HeatSourceEffect*>(iface); + EffectHeatSource* ee = PX_NEW(EffectHeatSource)(ed->HeatSource->name(), ed, sdk, scene, dynamicSystemScene, moduleTurbulenceFS, mPose, mEnabled); + ee->setCurrentScale(mObjectScale,mEffectPath); + mEffects.pushBack(static_cast< EffectData*>(ee)); + } + break; + case ET_SUBSTANCE_SOURCE: + { + SubstanceSourceEffect* ed = static_cast< SubstanceSourceEffect*>(iface); + EffectSubstanceSource* ee = PX_NEW(EffectSubstanceSource)(ed->SubstanceSource->name(), ed, sdk, scene, dynamicSystemScene, moduleTurbulenceFS, mPose, mEnabled); + ee->setCurrentScale(mObjectScale,mEffectPath); + mEffects.pushBack(static_cast< EffectData*>(ee)); + } + break; + case ET_VELOCITY_SOURCE: + { + VelocitySourceEffect* ed = static_cast< VelocitySourceEffect*>(iface); + EffectVelocitySource* ee = PX_NEW(EffectVelocitySource)(ed->VelocitySource->name(), ed, sdk, scene, dynamicSystemScene, moduleTurbulenceFS, mPose, mEnabled); + ee->setCurrentScale(mObjectScale,mEffectPath); + mEffects.pushBack(static_cast< EffectData*>(ee)); + } + break; + case ET_FLAME_EMITTER: + { + FlameEmitterEffect* ed = static_cast< FlameEmitterEffect*>(iface); + EffectFlameEmitter* ee = PX_NEW(EffectFlameEmitter)(ed->FlameEmitter->name(), ed, sdk, scene, dynamicSystemScene, moduleTurbulenceFS, mPose, mEnabled); + ee->setCurrentScale(mObjectScale,mEffectPath); + mEffects.pushBack(static_cast< EffectData*>(ee)); + } + break; + case ET_TURBULENCE_FS: + { + TurbulenceFieldSamplerEffect* ed = static_cast< TurbulenceFieldSamplerEffect*>(iface); + EffectTurbulenceFS* ee = PX_NEW(EffectTurbulenceFS)(ed->TurbulenceFieldSampler->name(), ed, sdk, scene, dynamicSystemScene, moduleTurbulenceFS, mPose, mEnabled); + ee->setCurrentScale(mObjectScale,mEffectPath); + mEffects.pushBack(static_cast< EffectData*>(ee)); + } + break; + case ET_JET_FS: + { + JetFieldSamplerEffect* ed = static_cast< JetFieldSamplerEffect*>(iface); + EffectJetFS* ee = PX_NEW(EffectJetFS)(ed->JetFieldSampler->name(), ed, sdk, scene, dynamicSystemScene, mPose, mEnabled); + ee->setCurrentScale(mObjectScale,mEffectPath); + mEffects.pushBack(static_cast< EffectData*>(ee)); + } + break; + case ET_WIND_FS: + { + WindFieldSamplerEffect* ed = static_cast< WindFieldSamplerEffect*>(iface); + EffectWindFS* ee = PX_NEW(EffectWindFS)(ed->WindFieldSampler->name(), ed, sdk, scene, dynamicSystemScene, mPose, mEnabled); + ee->setCurrentScale(mObjectScale,mEffectPath); + mEffects.pushBack(static_cast< EffectData*>(ee)); + } + break; + case ET_RIGID_BODY: + { + RigidBodyEffect* ed = static_cast< RigidBodyEffect*>(iface); + EffectRigidBody* ee = PX_NEW(EffectRigidBody)("RigidBody", ed, sdk, scene, dynamicSystemScene, mPose, mEnabled); + ee->setCurrentScale(mObjectScale,mEffectPath); + mEffects.pushBack(static_cast< EffectData*>(ee)); + } + break; + case ET_NOISE_FS: + { + NoiseFieldSamplerEffect* ed = static_cast< NoiseFieldSamplerEffect*>(iface); + EffectNoiseFS* ee = PX_NEW(EffectNoiseFS)(ed->NoiseFieldSampler->name(), ed, sdk, scene, dynamicSystemScene, mPose, mEnabled); + ee->setCurrentScale(mObjectScale,mEffectPath); + mEffects.pushBack(static_cast< EffectData*>(ee)); + } + break; + case ET_VORTEX_FS: + { + VortexFieldSamplerEffect* ed = static_cast< VortexFieldSamplerEffect*>(iface); + EffectVortexFS* ee = PX_NEW(EffectVortexFS)(ed->VortexFieldSampler->name(), ed, sdk, scene, dynamicSystemScene, mPose, mEnabled); + ee->setCurrentScale(mObjectScale,mEffectPath); + mEffects.pushBack(static_cast< EffectData*>(ee)); + } + break; + case ET_ATTRACTOR_FS: + { + AttractorFieldSamplerEffect* ed = static_cast< AttractorFieldSamplerEffect*>(iface); + EffectAttractorFS* ee = PX_NEW(EffectAttractorFS)(ed->AttractorFieldSampler->name(), ed, sdk, scene, dynamicSystemScene, mPose, mEnabled); + ee->setCurrentScale(mObjectScale,mEffectPath); + mEffects.pushBack(static_cast< EffectData*>(ee)); + } + break; + case ET_FORCE_FIELD: + { + ForceFieldEffect* ed = static_cast< ForceFieldEffect*>(iface); + EffectForceField* ee = PX_NEW(EffectForceField)(ed->ForceField->name(), ed, sdk, scene, dynamicSystemScene, mPose, mEnabled); + ee->setCurrentScale(mObjectScale,mEffectPath); + mEffects.pushBack(static_cast< EffectData*>(ee)); + } + break; + default: + PX_ALWAYS_ASSERT(); + break; + } + } + } + addSelfToContext(*dynamicSystemScene.mApexScene->getApexContext()); // Add self to ApexScene + addSelfToContext(dynamicSystemScene); // Add self to ParticlesScene's list of actors +} + +EffectPackageActorImpl::~EffectPackageActorImpl(void) +{ + for (uint32_t i = 0; i < mEffects.size(); i++) + { + EffectData* ed = mEffects[i]; + delete ed; + } + delete mEffectPath; +} + +EffectType EffectPackageActorImpl::getEffectType(const NvParameterized::Interface* iface) +{ + EffectType ret = ET_LAST; + + if (nvidia::strcmp(iface->className(), EmitterEffect::staticClassName()) == 0) + { + ret = ET_EMITTER; + } + else if (nvidia::strcmp(iface->className(), HeatSourceEffect::staticClassName()) == 0) + { + ret = ET_HEAT_SOURCE; + } + else if (nvidia::strcmp(iface->className(), SubstanceSourceEffect::staticClassName()) == 0) + { + ret = ET_SUBSTANCE_SOURCE; + } + else if (nvidia::strcmp(iface->className(), VelocitySourceEffect::staticClassName()) == 0) + { + ret = ET_VELOCITY_SOURCE; + } + else if (nvidia::strcmp(iface->className(), FlameEmitterEffect::staticClassName()) == 0) + { + ret = ET_FLAME_EMITTER; + } + else if (nvidia::strcmp(iface->className(), ForceFieldEffect::staticClassName()) == 0) + { + ret = ET_FORCE_FIELD; + } + else if (nvidia::strcmp(iface->className(), JetFieldSamplerEffect::staticClassName()) == 0) + { + ret = ET_JET_FS; + } + else if (nvidia::strcmp(iface->className(), WindFieldSamplerEffect::staticClassName()) == 0) + { + ret = ET_WIND_FS; + } + else if (nvidia::strcmp(iface->className(), RigidBodyEffect::staticClassName()) == 0) + { + ret = ET_RIGID_BODY; + } + else if (nvidia::strcmp(iface->className(), NoiseFieldSamplerEffect::staticClassName()) == 0) + { + ret = ET_NOISE_FS; + } + else if (nvidia::strcmp(iface->className(), VortexFieldSamplerEffect::staticClassName()) == 0) + { + ret = ET_VORTEX_FS; + } + else if (nvidia::strcmp(iface->className(), AttractorFieldSamplerEffect::staticClassName()) == 0) + { + ret = ET_ATTRACTOR_FS; + } + else if (nvidia::strcmp(iface->className(), TurbulenceFieldSamplerEffect::staticClassName()) == 0) + { + ret = ET_TURBULENCE_FS; + } + else + { + PX_ALWAYS_ASSERT(); + } + + return ret; +} + +const PxTransform& EffectPackageActorImpl::getPose(void) const +{ + READ_ZONE(); + return mPose; +} + +void EffectPackageActorImpl::visualize(RenderDebugInterface* callback, bool solid) const +{ + using RENDER_DEBUG::DebugRenderState; + if ( !mEnableDebugVisualization ) return; + RENDER_DEBUG_IFACE(callback)->pushRenderState(); + + RENDER_DEBUG_IFACE(callback)->addToCurrentState(DebugRenderState::CameraFacing); + RENDER_DEBUG_IFACE(callback)->addToCurrentState(DebugRenderState::CenterText); + + RENDER_DEBUG_IFACE(callback)->debugText(mPose.p - PxVec3(0, 0.35f, 0), mAsset->getName()); + + RENDER_DEBUG_IFACE(callback)->debugAxes(PxMat44(mPose)); + + for (uint32_t i = 0; i < mEffects.size(); i++) + { + mEffects[i]->visualize(callback, solid); + } + + RENDER_DEBUG_IFACE(callback)->popRenderState(); +} + +void EffectPackageActorImpl::setPose(const PxTransform& pose) +{ + WRITE_ZONE(); + mPose = pose; + + for (uint32_t i = 0; i < mEffects.size(); i++) + { + mEffects[i]->refresh(mPose, mEnabled, true, mRenderVolume,mEmitterValidateCallback); + } +} + +void EffectPackageActorImpl::refresh(void) +{ + WRITE_ZONE(); + for (uint32_t i = 0; i < mEffects.size(); i++) + { + EffectData* ed = mEffects[i]; + + if (ed->getEffectActor() ) + { + ed->refresh(mPose, mEnabled, true, mRenderVolume,mEmitterValidateCallback); + } + else if ( ed->getType() == ET_RIGID_BODY ) + { + EffectRigidBody *erb = static_cast< EffectRigidBody *>(ed); + if ( erb->mRigidDynamic ) + { + ed->refresh(mPose, mEnabled, true, mRenderVolume,mEmitterValidateCallback); + } + } + } +} + +void EffectPackageActorImpl::release(void) +{ + delete this; +} + +const char* EffectPackageActorImpl::getName(void) const +{ + READ_ZONE(); + return mAsset ? mAsset->getName() : NULL; +} + + +uint32_t EffectPackageActorImpl::getEffectCount(void) const // returns the number of effects in the effect package +{ + READ_ZONE(); + return mEffects.size(); +} + +EffectType EffectPackageActorImpl::getEffectType(uint32_t effectIndex) const // return the type of effect. +{ + READ_ZONE(); + EffectType ret = ET_LAST; + + if (effectIndex < mEffects.size()) + { + EffectData* ed = mEffects[effectIndex]; + ret = ed->getType(); + } + + return ret; +} + +Actor* EffectPackageActorImpl::getEffectActor(uint32_t effectIndex) const // return the base Actor pointer +{ + READ_ZONE(); + Actor* ret = NULL; + + if (effectIndex < mEffects.size()) + { + EffectData* ed = mEffects[effectIndex]; + ret = ed->getEffectActor(); + } + + + return ret; +} +void EffectPackageActorImpl::setEmitterState(bool state) // set the state for all emitters in this effect package. +{ + WRITE_ZONE(); + for (uint32_t i = 0; i < mEffects.size(); i++) + { + if (mEffects[i]->getType() == ET_EMITTER) + { + Actor* a = mEffects[i]->getEffectActor(); + if (a) + { + EmitterActor* ae = static_cast< EmitterActor*>(a); + if (state) + { + ae->startEmit(false); + } + else + { + ae->stopEmit(); + } + } + } + } +} + +uint32_t EffectPackageActorImpl::getActiveParticleCount(void) const // return the total number of particles still active in this effect package. +{ + READ_ZONE(); + uint32_t ret = 0; + + for (uint32_t i = 0; i < mEffects.size(); i++) + { + if (mEffects[i]->getType() == ET_EMITTER) + { + Actor* a = mEffects[i]->getEffectActor(); + if (a) + { + EmitterActor* ae = static_cast< EmitterActor*>(a); + ret += ae->getActiveParticleCount(); + } + } + } + return ret; +} + +bool EffectPackageActorImpl::isStillEmitting(void) const // return true if any emitters are still actively emitting particles. +{ + READ_ZONE(); + bool ret = false; + + for (uint32_t i = 0; i < mEffects.size(); i++) + { + if (mEffects[i]->getType() == ET_EMITTER) + { + Actor* a = mEffects[i]->getEffectActor(); + if (a) + { + EmitterActor* ae = static_cast< EmitterActor*>(a); + if (ae->isEmitting()) + { + ret = true; + break; + } + } + } + } + return ret; +} + +// Effect class implementations + +EffectEmitter::EffectEmitter(const char* parentName, + const EmitterEffect* data, + ApexSDK& sdk, + Scene& scene, + ParticlesScene& dscene, + const PxTransform& rootPose, + bool parentEnabled) : mData(data), EffectData(ET_EMITTER, &sdk, + &scene, + &dscene, + parentName, + EMITTER_AUTHORING_TYPE_NAME, + *(RigidBodyEffectNS::EffectProperties_Type *)(&data->EffectProperties)) +{ + mEmitterVelocity = PxVec3(0, 0, 0); + mFirstVelocityFrame = true; + mHaveSetPosition = false; + mVelocityTime = 0; + mLastEmitterPosition = PxVec3(0, 0, 0); +} + +EffectEmitter::~EffectEmitter(void) +{ +} + +EffectTurbulenceFS::EffectTurbulenceFS(const char* parentName, + TurbulenceFieldSamplerEffect* data, + ApexSDK& sdk, + Scene& scene, + ParticlesScene& dscene, + ModuleTurbulenceFS* moduleTurbulenceFS, + const PxTransform& rootPose, + bool parentEnabled) : + mData(data), + mModuleTurbulenceFS(moduleTurbulenceFS), + EffectData(ET_TURBULENCE_FS, &sdk, &scene, &dscene, parentName, TURBULENCE_FS_AUTHORING_TYPE_NAME, *(RigidBodyEffectNS::EffectProperties_Type *)(&data->EffectProperties)) +{ +} + +EffectTurbulenceFS::~EffectTurbulenceFS(void) +{ +} + +EffectJetFS::EffectJetFS(const char* parentName, + JetFieldSamplerEffect* data, + ApexSDK& sdk, + Scene& scene, + ParticlesScene& dscene, + const PxTransform& rootPose, + bool parentEnabled) : mData(data), EffectData(ET_JET_FS, &sdk, &scene, &dscene, parentName, JET_FS_AUTHORING_TYPE_NAME, *(RigidBodyEffectNS::EffectProperties_Type *)(&data->EffectProperties)) +{ +} + +EffectJetFS::~EffectJetFS(void) +{ +} + +EffectWindFS::EffectWindFS(const char* parentName, + WindFieldSamplerEffect* data, + ApexSDK& sdk, + Scene& scene, + ParticlesScene& dscene, + const PxTransform& rootPose, + bool parentEnabled) : mData(data), EffectData(ET_WIND_FS, &sdk, &scene, &dscene, parentName, WIND_FS_AUTHORING_TYPE_NAME, *(RigidBodyEffectNS::EffectProperties_Type *)(&data->EffectProperties)) +{ +} + +EffectWindFS::~EffectWindFS(void) +{ +} + + + +EffectAttractorFS::EffectAttractorFS(const char* parentName, + AttractorFieldSamplerEffect* data, + ApexSDK& sdk, + Scene& scene, + ParticlesScene& dscene, + const PxTransform& rootPose, + bool parentEnabled) : mData(data), EffectData(ET_ATTRACTOR_FS, &sdk, &scene, &dscene, parentName, ATTRACTOR_FS_AUTHORING_TYPE_NAME, *(RigidBodyEffectNS::EffectProperties_Type *)(&data->EffectProperties)) +{ +} + +EffectAttractorFS::~EffectAttractorFS(void) +{ +} + +void EffectEmitter::visualize(RenderDebugInterface* callback, bool solid) const +{ + RENDER_DEBUG_IFACE(callback)->debugText(mPose.p, mData->Emitter->name()); + RENDER_DEBUG_IFACE(callback)->debugAxes(PxMat44(mPose)); + +} + + + +EffectHeatSource::EffectHeatSource(const char* parentName, + HeatSourceEffect* data, + ApexSDK& sdk, + Scene& scene, + ParticlesScene& dscene, + ModuleTurbulenceFS* moduleTurbulenceFS, + const PxTransform& rootPose, + bool parentEnabled) : mData(data), + mModuleTurbulenceFS(moduleTurbulenceFS), + EffectData(ET_HEAT_SOURCE, &sdk, &scene, &dscene, parentName, HEAT_SOURCE_AUTHORING_TYPE_NAME, *(RigidBodyEffectNS::EffectProperties_Type *)(&data->EffectProperties)) +{ +} + +EffectHeatSource::~EffectHeatSource(void) +{ +} + +void EffectHeatSource::visualize(RenderDebugInterface* callback, bool solid) const +{ +} + +bool EffectHeatSource::refresh(const PxTransform& parent, bool parentEnabled, bool fromSetPose, RenderVolume* renderVolume,EmitterActor::EmitterValidateCallback *callback) +{ + bool ret = false; + if (parentEnabled && mEnabled && mAsset) + { + PxTransform localPose = mLocalPose; + localPose.p*=mObjectScale*getSampleScaleSpline(); + PxTransform myPose(parent * localPose); + getSamplePoseSpline(myPose); + + if (mActor == NULL && mAsset && !fromSetPose) + { + NvParameterized::Interface* descParams = mAsset->getDefaultActorDesc(); + if (descParams) + { + PxTransform pose(myPose); + bool ok = NvParameterized::setParamTransform(*descParams, "initialPose", pose); + PX_ASSERT(ok); + ok = NvParameterized::setParamF32(*descParams, "initialScale", mObjectScale*getSampleScaleSpline() ); + PX_ASSERT(ok); + PX_UNUSED(ok); + mActor = mAsset->createApexActor(*descParams, *mApexScene); + ret = true; + } + const NvParameterized::Interface* iface = mAsset->getAssetNvParameterized(); + const turbulencefs::HeatSourceAssetParams* hap = static_cast< const turbulencefs::HeatSourceAssetParams*>(iface); + mAverageTemperature = hap->averageTemperature; + mStandardDeviationTemperature = hap->stdTemperature; + } + else if (mActor) + { + HeatSourceActor* a = static_cast< HeatSourceActor*>(mActor); + nvidia::apex::Shape *s = a->getShape(); + s->setPose(myPose); + a->setCurrentScale(mObjectScale*getSampleScaleSpline()); + } + } + else + { + if ( mActor ) + { + releaseActor(); + ret = true; + } + } + return ret; +} + +EffectSubstanceSource::EffectSubstanceSource(const char* parentName, + SubstanceSourceEffect* data, + ApexSDK& sdk, + Scene& scene, + ParticlesScene& dscene, + ModuleTurbulenceFS* moduleTurbulenceFS, + const PxTransform& rootPose, + bool parentEnabled) : mData(data), + mModuleTurbulenceFS(moduleTurbulenceFS), + EffectData(ET_SUBSTANCE_SOURCE, &sdk, &scene, &dscene, parentName, SUBSTANCE_SOURCE_AUTHORING_TYPE_NAME, *(RigidBodyEffectNS::EffectProperties_Type *)(&data->EffectProperties)) +{ +} + +EffectSubstanceSource::~EffectSubstanceSource(void) +{ +} + +void EffectSubstanceSource::visualize(RenderDebugInterface* callback, bool solid) const +{ +} + +bool EffectSubstanceSource::refresh(const PxTransform& parent, bool parentEnabled, bool fromSetPose, RenderVolume* renderVolume,EmitterActor::EmitterValidateCallback *callback) +{ + bool ret = false; + if (parentEnabled && mEnabled && mAsset) + { + PxTransform localPose = mLocalPose; + localPose.p*=mObjectScale*getSampleScaleSpline(); + PxTransform myPose(parent * localPose); + getSamplePoseSpline(myPose); + + if (mActor == NULL && mAsset && !fromSetPose) + { + NvParameterized::Interface* descParams = mAsset->getDefaultActorDesc(); + if (descParams) + { + PxTransform pose(myPose); + bool ok = NvParameterized::setParamTransform(*descParams, "initialPose", pose); + PX_ASSERT(ok); + ok = NvParameterized::setParamF32(*descParams, "initialScale", mObjectScale*getSampleScaleSpline() ); + PX_ASSERT(ok); + PX_UNUSED(ok); + mActor = mAsset->createApexActor(*descParams, *mApexScene); + ret = true; + } + const NvParameterized::Interface* iface = mAsset->getAssetNvParameterized(); + const turbulencefs::SubstanceSourceAssetParams* hap = static_cast< const turbulencefs::SubstanceSourceAssetParams*>(iface); + mAverageDensity = hap->averageDensity; + mStandardDeviationDensity = hap->stdDensity; + } + else if (mActor) + { + SubstanceSourceActor* a = static_cast< SubstanceSourceActor*>(mActor); + a->setCurrentScale(mObjectScale*getSampleScaleSpline()); + nvidia::apex::Shape *s = a->getShape(); + s->setPose(myPose); + } + } + else + { + if ( mActor ) + { + ret = true; + releaseActor(); + } + } + return ret; +} + +EffectVelocitySource::EffectVelocitySource(const char* parentName, + VelocitySourceEffect* data, + ApexSDK& sdk, + Scene& scene, + ParticlesScene& dscene, + ModuleTurbulenceFS* moduleTurbulenceFS, + const PxTransform& rootPose, + bool parentEnabled) : mData(data), + mModuleTurbulenceFS(moduleTurbulenceFS), + EffectData(ET_VELOCITY_SOURCE, &sdk, &scene, &dscene, parentName, VELOCITY_SOURCE_AUTHORING_TYPE_NAME, *(RigidBodyEffectNS::EffectProperties_Type *)(&data->EffectProperties)) +{ +} + +EffectVelocitySource::~EffectVelocitySource(void) +{ +} + +void EffectVelocitySource::visualize(RenderDebugInterface* callback, bool solid) const +{ +} + +bool EffectVelocitySource::refresh(const PxTransform& parent, bool parentEnabled, bool fromSetPose, RenderVolume* renderVolume,EmitterActor::EmitterValidateCallback *callback) +{ + bool ret = false; + if (parentEnabled && mEnabled && mAsset) + { + PxTransform localPose = mLocalPose; + localPose.p*=mObjectScale*getSampleScaleSpline(); + PxTransform myPose(parent * localPose); + getSamplePoseSpline(myPose); + + if (mActor == NULL && mAsset && !fromSetPose) + { + NvParameterized::Interface* descParams = mAsset->getDefaultActorDesc(); + if (descParams) + { + PxTransform pose(myPose); + bool ok = NvParameterized::setParamTransform(*descParams, "initialPose", pose); + PX_ASSERT(ok); + ok = NvParameterized::setParamF32(*descParams, "initialScale", mObjectScale*getSampleScaleSpline() ); + PX_ASSERT(ok); + PX_UNUSED(ok); + mActor = mAsset->createApexActor(*descParams, *mApexScene); + ret = true; + } + const NvParameterized::Interface* iface = mAsset->getAssetNvParameterized(); + const turbulencefs::VelocitySourceAssetParams* hap = static_cast< const turbulencefs::VelocitySourceAssetParams*>(iface); + mAverageVelocity = hap->averageVelocity; + mStandardDeviationVelocity = hap->stdVelocity; + } + else if (mActor) + { + VelocitySourceActor* a = static_cast< VelocitySourceActor*>(mActor); + a->setCurrentScale(mObjectScale*getSampleScaleSpline()); + nvidia::apex::Shape *s = a->getShape(); + s->setPose(myPose); + } + } + else + { + if ( mActor ) + { + ret = true; + releaseActor(); + } + } + return ret; +} + + +EffectFlameEmitter::EffectFlameEmitter(const char* parentName, + FlameEmitterEffect* data, + ApexSDK& sdk, + Scene& scene, + ParticlesScene& dscene, + ModuleTurbulenceFS* moduleTurbulenceFS, + const PxTransform& rootPose, + bool parentEnabled) : mData(data), + mModuleTurbulenceFS(moduleTurbulenceFS), + EffectData(ET_FLAME_EMITTER, &sdk, &scene, &dscene, parentName, FLAME_EMITTER_AUTHORING_TYPE_NAME, *(RigidBodyEffectNS::EffectProperties_Type *)(&data->EffectProperties)) +{ +} + +EffectFlameEmitter::~EffectFlameEmitter(void) +{ +} + +void EffectFlameEmitter::visualize(RenderDebugInterface* callback, bool solid) const +{ +} + +bool EffectFlameEmitter::refresh(const PxTransform& parent, bool parentEnabled, bool fromSetPose, RenderVolume* renderVolume,EmitterActor::EmitterValidateCallback *callback) +{ + bool ret = false; + if (parentEnabled && mEnabled && mAsset) + { + PxTransform localPose = mLocalPose; + localPose.p*=mObjectScale*getSampleScaleSpline(); + PxTransform myPose(parent * localPose); + getSamplePoseSpline(myPose); + + if (mActor == NULL && mAsset && !fromSetPose) + { + NvParameterized::Interface* descParams = mAsset->getDefaultActorDesc(); + if (descParams) + { + PxTransform pose(myPose); + bool ok = NvParameterized::setParamTransform(*descParams, "initialPose", pose); + PX_ASSERT(ok); + ok = NvParameterized::setParamF32(*descParams, "initialScale", mObjectScale*getSampleScaleSpline() ); + PX_ASSERT(ok); + PX_UNUSED(ok); + mActor = mAsset->createApexActor(*descParams, *mApexScene); + ret = true; + } + } + else if (mActor) + { + FlameEmitterActor* a = static_cast< FlameEmitterActor*>(mActor); + a->setCurrentScale(mObjectScale*getSampleScaleSpline()); + a->setPose(myPose); + } + } + else + { + if ( mActor ) + { + ret = true; + releaseActor(); + } + } + return ret; +} + + +void EffectTurbulenceFS::visualize(RenderDebugInterface* callback, bool solid) const +{ + +} + +void EffectJetFS::visualize(RenderDebugInterface* callback, bool solid) const +{ + +} + +void EffectWindFS::visualize(RenderDebugInterface* callback, bool solid) const +{ + +} + +void EffectAttractorFS::visualize(RenderDebugInterface* callback, bool solid) const +{ + +} + +void EffectEmitter::computeVelocity(float dtime) +{ + mVelocityTime += dtime; + if (mFirstVelocityFrame) + { + if (mActor) + { + mFirstVelocityFrame = false; + mVelocityTime = 0; + EmitterActor* ea = static_cast< EmitterActor*>(mActor); + mLastEmitterPosition = ea->getGlobalPose().getPosition(); + } + } + else if (mHaveSetPosition && mActor) + { + mHaveSetPosition = false; + EmitterActor* ea = static_cast< EmitterActor*>(mActor); + PxVec3 newPos = ea->getGlobalPose().getPosition(); + mEmitterVelocity = (newPos - mLastEmitterPosition) * (1.0f / mVelocityTime); + mLastEmitterPosition = newPos; + mVelocityTime = 0; + } +} + +bool EffectEmitter::refresh(const PxTransform& parent, + bool parentEnabled, + bool fromSetPose, + RenderVolume* renderVolume, + EmitterActor::EmitterValidateCallback *callback) +{ + bool ret = false; + if (parentEnabled && mEnabled && mAsset) + { + PxTransform localPose = mLocalPose; + localPose.p*=mObjectScale*getSampleScaleSpline(); + + mPose = parent * localPose; + getSamplePoseSpline(mPose); + + if (mActor == NULL && mAsset && !fromSetPose) + { + mFirstVelocityFrame = true; + mHaveSetPosition = false; + NvParameterized::Interface* descParams = mAsset->getDefaultActorDesc(); + if (descParams) + { + bool ok = NvParameterized::setParamTransform(*descParams, "initialPose", mPose); + PX_UNUSED(ok); + PX_ASSERT(ok); + ok = NvParameterized::setParamF32(*descParams, "initialScale", mObjectScale*getSampleScaleSpline() ); + PX_ASSERT(ok); + ok = NvParameterized::setParamBool(*descParams, "emitAssetParticles", true); + PX_ASSERT(ok); + EmitterAsset* easset = static_cast< EmitterAsset*>(mAsset); + EmitterActor* ea = mParticlesScene->getEmitterFromPool(easset); + if (ea) + { + ea->setCurrentPose(mPose); + ea->setCurrentScale(mObjectScale*getSampleScaleSpline()); + mActor = static_cast< Actor*>(ea); + } + else + { + mActor = mAsset->createApexActor(*descParams, *mApexScene); + } + if (mActor) + { + const NvParameterized::Interface* iface = mAsset->getAssetNvParameterized(); + const char* className = iface->className(); + if (nvidia::strcmp(className, "ApexEmitterAssetParameters") == 0) + { + const emitter::ApexEmitterAssetParameters* ap = static_cast<const emitter::ApexEmitterAssetParameters*>(iface); + mRate = ap->rate; + mLifetimeLow = ap->lifetimeLow; + mLifetimeHigh = ap->lifetimeHigh; + EmitterActor* ea = static_cast< EmitterActor*>(mActor); + ea->setRate(mRate); + ea->setLifetimeLow(mLifetimeLow); + ea->setLifetimeHigh(mLifetimeHigh); + ea->startEmit(false); + ea->setPreferredRenderVolume(renderVolume); + ea->setApexEmitterValidateCallback(callback); + } + ret = true; + } + } + } + else if (mActor) + { + EmitterActor* ea = static_cast< EmitterActor*>(mActor); + mHaveSetPosition = true; // set semaphore for computing the velocity. + ea->setCurrentPose(mPose); + ea->setObjectScale(mObjectScale*getSampleScaleSpline()); + ea->setPreferredRenderVolume(renderVolume); + } + } + else + { + if ( mActor ) + { + releaseActor(); + ret = true; + } + } + return ret; +} + + +bool EffectTurbulenceFS::refresh(const PxTransform& parent, bool parentEnabled, bool fromSetPose, RenderVolume* renderVolume,EmitterActor::EmitterValidateCallback *callback) +{ + bool ret = false; + if (parentEnabled && mEnabled && mAsset) + { + PxTransform localPose = mLocalPose; + localPose.p*=mObjectScale*getSampleScaleSpline(); + PxTransform myPose(parent * localPose); + getSamplePoseSpline(myPose); + + if (mActor == NULL && mAsset && !fromSetPose) + { + NvParameterized::Interface* descParams = mAsset->getDefaultActorDesc(); + if (descParams) + { + bool ok = NvParameterized::setParamTransform(*descParams, "initialPose", myPose); + PX_UNUSED(ok); + PX_ASSERT(ok); + ok = NvParameterized::setParamF32(*descParams, "initialScale", mObjectScale*getSampleScaleSpline() ); + PX_ASSERT(ok); + mActor = mAsset->createApexActor(*descParams, *mApexScene); + ret = true; + } + } + else if (mActor) + { + TurbulenceFSActor* a = static_cast< TurbulenceFSActor*>(mActor); + a->setPose(myPose); + a->setCurrentScale(mObjectScale*getSampleScaleSpline()); + } + } + else + { + if ( mActor ) + { + releaseActor(); + ret = true; + } + } + return ret; +} + +bool EffectJetFS::refresh(const PxTransform& parent, bool parentEnabled, bool fromSetPose, RenderVolume* renderVolume,EmitterActor::EmitterValidateCallback *callback) +{ + bool ret = false; + if (parentEnabled && mEnabled && mAsset) + { + PxTransform localPose = mLocalPose; + localPose.p*=mObjectScale*getSampleScaleSpline(); + + PxTransform myPose(parent * localPose); + getSamplePoseSpline(myPose); + + if (mActor == NULL && mAsset && !fromSetPose) + { + NvParameterized::Interface* descParams = mAsset->getDefaultActorDesc(); + if (descParams) + { + bool ok = NvParameterized::setParamF32(*descParams, "initialScale", mObjectScale*getSampleScaleSpline() ); + PX_ASSERT(ok); + PX_UNUSED(ok); + mActor = mAsset->createApexActor(*descParams, *mApexScene); + if (mActor) + { + JetFSActor* fs = static_cast< JetFSActor*>(mActor); + if (fs) + { + fs->setCurrentPose(myPose); + fs->setCurrentScale(mObjectScale*getSampleScaleSpline()); + } + ret = true; + } + } + } + else if (mActor) + { + JetFSActor* a = static_cast< JetFSActor*>(mActor); + a->setCurrentPose(myPose); + a->setCurrentScale(mObjectScale*getSampleScaleSpline()); + } + } + else + { + if ( mActor ) + { + releaseActor(); + ret = true; + } + } + return ret; +} + +bool EffectWindFS::refresh(const PxTransform& parent, bool parentEnabled, bool fromSetPose, RenderVolume* renderVolume,EmitterActor::EmitterValidateCallback *callback) +{ + bool ret = false; + if (parentEnabled && mEnabled && mAsset) + { + PxTransform localPose = mLocalPose; + localPose.p*=mObjectScale*getSampleScaleSpline(); + PxTransform myPose(parent * localPose); + getSamplePoseSpline(myPose); + + if (mActor == NULL && mAsset && !fromSetPose) + { + NvParameterized::Interface* descParams = mAsset->getDefaultActorDesc(); + if (descParams) + { + bool ok = NvParameterized::setParamF32(*descParams, "initialScale", mObjectScale*getSampleScaleSpline() ); + PX_ASSERT(ok); + PX_UNUSED(ok); + mActor = mAsset->createApexActor(*descParams, *mApexScene); + if (mActor) + { + WindFSActor* fs = static_cast< WindFSActor*>(mActor); + if (fs) + { + fs->setCurrentPose(myPose); + fs->setCurrentScale(mObjectScale*getSampleScaleSpline()); + } + ret = true; + } + } + } + else if (mActor) + { + WindFSActor* a = static_cast< WindFSActor*>(mActor); + a->setCurrentPose(myPose); + a->setCurrentScale(mObjectScale*getSampleScaleSpline()); + } + } + else + { + if ( mActor ) + { + releaseActor(); + ret = true; + } + } + return ret; +} + +bool EffectAttractorFS::refresh(const PxTransform& parent, bool parentEnabled, bool fromSetPose, RenderVolume* renderVolume,EmitterActor::EmitterValidateCallback *callback) +{ + bool ret = false; + if (parentEnabled && mEnabled && mAsset) + { + PxTransform initialPose = _getPose(mData->EffectProperties.Position.TranslateX*mObjectScale*getSampleScaleSpline(), + mData->EffectProperties.Position.TranslateY*mObjectScale*getSampleScaleSpline(), + mData->EffectProperties.Position.TranslateZ*mObjectScale*getSampleScaleSpline(), + mData->EffectProperties.Orientation.RotateX, + mData->EffectProperties.Orientation.RotateY, + mData->EffectProperties.Orientation.RotateZ); + + PxTransform myPose(parent * initialPose); + getSamplePoseSpline(myPose); + + if (mActor == NULL && mAsset && !fromSetPose) + { + NvParameterized::Interface* descParams = mAsset->getDefaultActorDesc(); + if (descParams) + { + + bool ok = NvParameterized::setParamTransform(*descParams, "initialPose", myPose); + PX_UNUSED(ok); + PX_ASSERT(ok); + ok = NvParameterized::setParamF32(*descParams, "initialScale", mObjectScale*getSampleScaleSpline() ); + PX_ASSERT(ok); + mActor = mAsset->createApexActor(*descParams, *mApexScene); + ret = true; + } + } + else if (mActor) + { + AttractorFSActor* a = static_cast< AttractorFSActor*>(mActor); + a->setCurrentPosition(myPose.p); + a->setCurrentScale(mObjectScale*getSampleScaleSpline()); + } + } + else + { + if ( mActor ) + { + releaseActor(); + ret = true; + } + } + return ret; +} + + +EffectForceField::EffectForceField(const char* parentName, ForceFieldEffect* data, ApexSDK& sdk, Scene& scene, ParticlesScene& dscene, const PxTransform& rootPose, bool parentEnabled) : mData(data), EffectData(ET_FORCE_FIELD, &sdk, &scene, &dscene, parentName, FORCEFIELD_AUTHORING_TYPE_NAME, *(RigidBodyEffectNS::EffectProperties_Type *)(&data->EffectProperties)) +{ +} + +EffectForceField::~EffectForceField(void) +{ +} + +void EffectForceField::visualize(RenderDebugInterface* callback, bool solid) const +{ + +} + +bool EffectForceField::refresh(const PxTransform& parent, bool parentEnabled, bool fromSetPose, RenderVolume* renderVolume,EmitterActor::EmitterValidateCallback *callback) +{ + bool ret = false; + if (parentEnabled && mEnabled && mAsset) + { + PxTransform initialPose = _getPose(mData->EffectProperties.Position.TranslateX*mObjectScale*getSampleScaleSpline(), + mData->EffectProperties.Position.TranslateY*mObjectScale*getSampleScaleSpline(), + mData->EffectProperties.Position.TranslateZ*mObjectScale*getSampleScaleSpline(), + mData->EffectProperties.Orientation.RotateX, + mData->EffectProperties.Orientation.RotateY, + mData->EffectProperties.Orientation.RotateZ); + PxTransform myPose(parent * initialPose); + getSamplePoseSpline(myPose); + if (mActor == NULL && mAsset && !fromSetPose) + { + NvParameterized::Interface* descParams = mAsset->getDefaultActorDesc(); + if (descParams) + { + bool ok = NvParameterized::setParamF32(*descParams, "scale", mObjectScale*getSampleScaleSpline() ); + PX_ASSERT(ok); + PX_UNUSED(ok); + mActor = mAsset->createApexActor(*descParams, *mApexScene); + if (mActor) + { + ForceFieldActor* fs = static_cast< ForceFieldActor*>(mActor); + if (fs) + { + fs->setPose(myPose); + fs->setCurrentScale(mObjectScale*getSampleScaleSpline()); + } + ret = true; + } + } + } + else if (mActor) + { + ForceFieldActor* a = static_cast< ForceFieldActor*>(mActor); + a->setPose(myPose); + a->setCurrentScale(mObjectScale*getSampleScaleSpline()); + } + } + else + { + if ( mActor ) + { + releaseActor(); + ret = true; + } + } + return ret; +} + +// Returns true if this is a type which has a named resource asset which needs to be resolved. RigidBody effects do not; all of their properties are embedded +static bool isNamedResourceType(EffectType type) +{ + bool ret = true; + + if ( type == ET_RIGID_BODY ) + { + ret = false; + } + + return ret; +} + +EffectData::EffectData(EffectType type, + ApexSDK* sdk, + Scene* scene, + ParticlesScene* dscene, + const char* assetName, + const char* nameSpace, + RigidBodyEffectNS::EffectProperties_Type &effectProperties) +{ + mEffectPath = NULL; + mParentPath = NULL; + mObjectScale = 1; + + mLocalPose = _getPose(effectProperties.Position.TranslateX, + effectProperties.Position.TranslateY, + effectProperties.Position.TranslateZ, + effectProperties.Orientation.RotateX, + effectProperties.Orientation.RotateY, + effectProperties.Orientation.RotateZ); + + mEffectPath = PX_NEW(EffectPath); + if ( !mEffectPath->init(effectProperties.Path) ) + { + delete mEffectPath; + mEffectPath = NULL; + } + + mEnabled = effectProperties.Enable; + mRandomDeviation = effectProperties.RandomizeRepeatTime; + mForceRenableEmitter = false; + mUseEmitterPool = dscene->getModuleParticles()->getUseEmitterPool(); + mFirstRate = true; + mType = type; + mState = ES_INITIAL_DELAY; + mStateTime = getRandomTime(effectProperties.InitialDelayTime); + mSimulationTime = 0; + mStateCount = 0; + mParticlesScene = dscene; + mInitialDelayTime = effectProperties.InitialDelayTime; + mDuration = effectProperties.Duration; + mRepeatCount = effectProperties.RepeatCount; + mRepeatDelay = effectProperties.RepeatDelay; + mApexSDK = sdk; + mApexScene = scene; + mActor = NULL; + mNameSpace = nameSpace; + mAsset = NULL; + if ( isNamedResourceType(mType) ) + { + mAsset = (nvidia::apex::Asset*)mApexSDK->getNamedResourceProvider()->getResource(mNameSpace, assetName); + if (mAsset) + { + if (mType == ET_EMITTER) + { + if (!mUseEmitterPool) + { + mApexSDK->getNamedResourceProvider()->setResource(mNameSpace, assetName, mAsset, true); + } + } + else + { + mApexSDK->getNamedResourceProvider()->setResource(mNameSpace, assetName, mAsset, true); + } + } + } +} + +EffectData::~EffectData(void) +{ + releaseActor(); + + delete mEffectPath; + + if (mAsset) + { + if (mType == ET_EMITTER) + { + if (!mUseEmitterPool) + { + mApexSDK->getNamedResourceProvider()->releaseResource(mNameSpace, mAsset->getName()); + } + } + else + { + mApexSDK->getNamedResourceProvider()->releaseResource(mNameSpace, mAsset->getName()); + } + } +} + +void EffectData::releaseActor(void) +{ + if (mActor) + { + if (mType == ET_EMITTER && mUseEmitterPool) + { + EmitterActor* ae = static_cast< EmitterActor*>(mActor); + mParticlesScene->addToEmitterPool(ae); + } + else + { + mActor->release(); + } + mActor = NULL; + } +} + +float EffectData::getRandomTime(float baseTime) +{ + float deviation = baseTime * mRandomDeviation; + return ranf(baseTime - deviation, baseTime + deviation); +} + +bool EffectData::simulate(float dtime, bool& reset) +{ + bool ret = false; + + if (!mEnabled) + { + return false; + } + + switch (mState) + { + case ES_INITIAL_DELAY: + mStateTime -= dtime; + if (mStateTime <= 0) + { + mState = ES_ACTIVE; // once past the initial delay, it is now active + mStateTime = getRandomTime(mDuration); // Time to the next state change... + ret = true; // set ret to true because the effect is alive + } + break; + case ES_ACTIVE: + ret = true; // it's still active.. + mStateTime -= dtime; // decrement delta time to next state change. + mSimulationTime+=dtime; + if (mStateTime <= 0) // if it's time for a state change. + { + if (mDuration == 0) // if the + { + if (mRepeatDelay > 0) // if there is a delay until the time we repeate + { + mStateTime = getRandomTime(mRepeatDelay); // set time until repeat delay + mState = ES_REPEAT_DELAY; // change state to repeat delay + } + else + { + mStateTime = getRandomTime(mDuration); // if there is no repeat delay; just continue + if (mRepeatCount > 1) + { + reset = true; // looped.. + } + } + } + else + { + mStateCount++; // increment the state change counter. + if (mStateCount >= mRepeatCount && mRepeatCount != 9999) // have we hit the total number repeat counts. + { + mState = ES_DONE; // then we are completely done; the actor is no longer alive + ret = false; + } + else + { + if (mRepeatDelay > 0) // is there a repeat delay? + { + mStateTime = getRandomTime(mRepeatDelay); + mState = ES_REPEAT_DELAY; + } + else + { + mStateTime = getRandomTime(mDuration); + reset = true; + } + } + } + } + else + { + if ( mEffectPath && mDuration != 0 ) + { + mEffectPath->computeSampleTime(mStateTime,mDuration); + } + } + if ( mDuration == 0 && mEffectPath ) + { + mEffectPath->computeSampleTime(mSimulationTime,mEffectPath->getPathDuration()); + } + break; + case ES_REPEAT_DELAY: + mStateTime -= dtime; + if (mStateTime < 0) + { + mState = ES_ACTIVE; + mStateTime = getRandomTime(mDuration); + reset = true; + ret = true; + } + break; + case ES_DONE: + break; + default: + //PX_ASSERT(0); + break; + } + + return ret; +} + +void EffectPackageActorImpl::updateParticles(float dtime) +{ + mSimTime = dtime; + mCurrentLifeTime += mSimTime; + + // If there has been some state change on one of the emitters, then we rebuild the emitter list! + if ( mRigidBodyChange ) + { + mRigidBodyChange = false; + } +} + +float EffectPackageActorImpl::internalGetDuration(void) +{ + float duration = 1000; + for (uint32_t i = 0; i < mEffects.size(); i++) + { + EffectData* ed = mEffects[i]; + if (ed->getDuration() < duration) + { + duration = ed->getDuration(); + } + } + return duration; +} + +// applies velocity adjustment to this range +static float processVelocityAdjust(const particles::EmitterEffectNS::EmitterVelocityAdjust_Type& vprops, + const PxVec3& velocity) +{ + + float r = 1; + float v = velocity.magnitude(); // compute the absolute magnitude of the current emitter velocity + if (v <= vprops.VelocityLow) // if the velocity is less than the minimum velocity adjustment range + { + r = vprops.LowValue; // Use the 'low-value' ratio adjustment + } + else if (v >= vprops.VelocityHigh) // If the velocity is greater than the high range + { + r = vprops.HighValue; // then clamp tot he high value adjustment + } + else + { + float ratio = 1; + float diff = vprops.VelocityHigh - vprops.VelocityLow; // Compute the velocity differntial + if (diff > 0) + { + ratio = 1.0f / diff; // compute the inverse velocity differential + } + float l = (v - vprops.VelocityLow) * ratio; // find out the velocity lerp rate + r = (vprops.HighValue - vprops.LowValue) * l + vprops.LowValue; + } + return r; +} + + +void EffectPackageActorImpl::updatePoseAndBounds(bool screenCulling, bool znegative) +{ + if (!mEnabled) + { + for (uint32_t i = 0; i < mEffects.size(); i++) + { + EffectData* ed = mEffects[i]; + if (ed->getEffectActor()) + { + ed->releaseActor(); + } + else if ( ed->getType() == ET_RIGID_BODY ) + { + EffectRigidBody *erb = static_cast< EffectRigidBody *>(ed); + erb->releaseRigidBody(); + } + } + mAlive = false; + return; + } + + float ZCOMPARE = -1; + if (znegative) + { + ZCOMPARE *= -1; + } + + // + bool prevVisible = mVisible; + mVisible = true; // default visibile state is based on whether or not this effect is enabled. + float emitterRate = 1; + mVisState = VS_ON_SCREEN; // default value + if (mVisible) // if it's considered visible/enabled then let's do the LOD cacluation + { + const PxMat44& viewMatrix = mScene->getViewMatrix(); + PxVec3 pos = viewMatrix.transform(mPose.p); + float magnitudeSquared = pos.magnitudeSquared(); + if (mData->LODSettings.CullByDistance) // if distance culling is enabled + { + + // If the effect is past the maximum distance then mark it is no longer visible. + if (magnitudeSquared > mData->LODSettings.FadeDistanceEnd * mData->LODSettings.FadeDistanceEnd) + { + mVisible = false; + mVisState = VS_OFF_SCREEN; + } // if the effect is within the fade range; then compute the lerp value for it along that range as 'emitterRate' + else if (magnitudeSquared > mData->LODSettings.FadeDistanceEnd * mData->LODSettings.FadeDistanceBegin) + { + float distance = PxSqrt(magnitudeSquared); + float delta = mData->LODSettings.FadeDistanceEnd - mData->LODSettings.FadeDistanceBegin; + if (delta > 0) + { + emitterRate = 1.0f - ((distance - mData->LODSettings.FadeDistanceBegin) / delta); + } + } + } + // If it's still considered visible (i.e. in range) and off screen culling is enabled; let's test it's status on/off screen + if (mVisible && mData->LODSettings.CullOffScreen && screenCulling) + { + if (magnitudeSquared < (mData->LODSettings.ScreenCullDistance * mData->LODSettings.ScreenCullDistance)) + { + mVisState = VS_TOO_CLOSE; + } + else if (pos.z * ZCOMPARE > 0) + { + mVisState = VS_BEHIND_SCREEN; + } + else + { + const PxMat44& projMatrix = mScene->getProjMatrix(); + PxVec4 p(pos.x, pos.y, pos.z, 1); + p = projMatrix.transform(p); + float recipW = 1.0f / p.w; + + p.x = p.x * recipW; + p.y = p.y * recipW; + p.z = p.z * recipW; + + float smin = -1 - mData->LODSettings.ScreenCullSize; + float smax = 1 + mData->LODSettings.ScreenCullSize; + + if (p.x >= smin && p.x <= smax && p.y >= smin && p.y <= smax) + { + mVisState = VS_ON_SCREEN; + } + else + { + mVisState = VS_OFF_SCREEN; + } + } + } + } + if (mVisState == VS_ON_SCREEN || mVisState == VS_TOO_CLOSE) + { + mOffScreenTime = 0; + } + else + { + mOffScreenTime += mSimTime; + if (mOffScreenTime > mData->LODSettings.OffScreenCullTime) + { + mVisible = false; // mark it as non-visible due to it being off sceen too long. + mAlive = false; + } + else + { + mVisible = mEverVisible; // was it ever visible? + } + } + + if ( mEffectPath ) + { + mEffectPath->computeSampleTime(mCurrentLifeTime,mData->Path.PathDuration); + } + + if (mFirstFrame && !mVisible && screenCulling) + { + if (getDuration() != 0) + { + mEnabled = false; + return; + } + } + + + if (mVisible) + { + mEverVisible = true; + } + + + bool aliveState = mVisible; + + // do the fade in/fade out over time logic... + if (mData->LODSettings.FadeOutRate > 0) // If there is a fade in/out time. + { + if (aliveState) // if the effect is considered alive/visible then attenuate the emitterRate based on that fade in time value + { + mFadeTime += mSimTime; + if (mFadeTime < mData->LODSettings.FadeOutRate) + { + emitterRate = emitterRate * mFadeTime / mData->LODSettings.FadeOutRate; + } + else + { + mFadeTime = mData->LODSettings.FadeOutRate; + } + } + else // if the effect is not visible then attenuate it based on the fade out time + { + mFadeTime -= mSimTime; + if (mFadeTime > 0) + { + emitterRate = emitterRate * mFadeTime / mData->LODSettings.FadeOutRate; + aliveState = true; // still alive because it hasn't finsihed fading out... + } + else + { + mFadeTime = 0; + } + } + } + + if (mFadeIn) + { + mFadeInDuration += mSimTime; + if (mFadeInDuration > mFadeInTime) + { + mFadeIn = false; + } + else + { + float fadeScale = (mFadeInDuration / mFadeInTime); + emitterRate *= fadeScale; + } + } + + if (mFadeOut) + { + mFadeOutDuration += mSimTime; + if (mFadeOutDuration > mFadeOutTime) + { + aliveState = mVisible = false; + } + else + { + float fadeScale = 1.0f - (mFadeOutDuration / mFadeOutTime); + emitterRate *= fadeScale; + } + } + + if (mVisible) + { + mNotVisibleTime = 0; + } + else + { + mNotVisibleTime += mSimTime; + } + + bool anyAlive = false; + bool rigidBodyChange = false; + + for (uint32_t i = 0; i < mEffects.size(); i++) + { + bool alive = aliveState; + EffectData* ed = mEffects[i]; + // only emitters can handle a 'repeat' count. + // others have an initial delay + bool reset = false; + + if (ed->getDuration() == 0) + { + reset = !prevVisible; // if it was not previously visible then force a reset to bring it back to life. + } + if (alive) + { + alive = ed->simulate(mSimTime, reset); + if ( alive ) + { + anyAlive = true; + } + } + if (ed->isDead()) // if it's lifetime has completely expired kill it! + { + if (ed->getEffectActor()) + { + ed->releaseActor(); + } + else if ( ed->getType() == ET_RIGID_BODY ) + { + EffectRigidBody *erb = static_cast< EffectRigidBody *>(ed); + erb->releaseRigidBody(); + rigidBodyChange = true; + } + } + else + { + switch (ed->getType()) + { + case ET_EMITTER: + { + EffectEmitter* ee = static_cast< EffectEmitter*>(ed); + ee->computeVelocity(mSimTime); + EmitterActor* ea = static_cast< EmitterActor*>(ed->getEffectActor()); + // if there is already an emitter actor... + if (ea) + { + if (alive) // is it alive? + { + if ( ed->getForceRenableEmitterSemaphore() && !ea->isEmitting() ) + { + reset = true; + } + if (reset) // is it time to reset it's condition? + { + ea->startEmit(false); + } + if (mData->LODSettings.FadeEmitterRate || mData->LODSettings.RandomizeEmitterRate || mFadeOut || mFadeIn) + { + // attenuate the emitter rate range based on the previously computed LOD lerp value + if (mData->LODSettings.RandomizeEmitterRate && ee->mFirstRate) + { + ee->mFirstRate = false; + } + if (mData->LODSettings.FadeEmitterRate || + mFadeOut || + mFadeIn || + ee->mData->EmitterVelocityChanges.AdjustEmitterRate.AdjustEnabled || + ee->mData->EmitterVelocityChanges.AdjustLifetime.AdjustEnabled) + { + float rate = ee->mRate * emitterRate; + if (ee->mData->EmitterVelocityChanges.AdjustEmitterRate.AdjustEnabled) + { + rate *= processVelocityAdjust(ee->mData->EmitterVelocityChanges.AdjustEmitterRate, ee->mEmitterVelocity); + } + ea->setRate(rate); + if (ee->mData->EmitterVelocityChanges.AdjustLifetime.AdjustEnabled) + { + float va = processVelocityAdjust(ee->mData->EmitterVelocityChanges.AdjustLifetime, ee->mEmitterVelocity); + ea->setLifetimeLow(ee->mLifetimeLow * va); + ea->setLifetimeLow(ee->mLifetimeHigh * va); + } + } + } + + if ( ee->activePath() ) + { + ea->setCurrentScale(ee->mObjectScale*ee->getSampleScaleSpline()); + + PxTransform pose = mPose; + ee->getSamplePoseSpline(pose); + ea->setCurrentPose(pose); + } + + } + else + { + if (mNotVisibleTime > mData->LODSettings.NonVisibleDeleteTime) // if it's been non-visible for a long time; delete it, don't just disable it! + { + if (ed->getEffectActor()) + { + ed->releaseActor(); + } + } + else + { + if (ea->isEmitting()) + { + ea->stopEmit(); // just stop emitting but don't destroy the actor. + } + } + } + } + else + { + if (alive) // if it is now alive but was not previously; start the initial instance. + { + ed->refresh(mPose, true, false, mRenderVolume,mEmitterValidateCallback); + } + } + } + break; + case ET_ATTRACTOR_FS: + { + EffectAttractorFS *ee = static_cast< EffectAttractorFS *>(ed); + AttractorFSActor* ea = static_cast< AttractorFSActor*>(ed->getEffectActor()); + // if there is already an emitter actor... + if (ea) + { + if (alive) // is it alive? + { + if (reset) // is it time to reset it's condition? + { + ea->setEnabled(true); + } + if (mData->LODSettings.FadeAttractorFieldStrength) + { + // TODO + } + if ( ee->activePath() ) + { + PxTransform pose = mPose; + ee->getSamplePoseSpline(pose); + ea->setCurrentPosition(pose.p); + ea->setCurrentScale(ee->mObjectScale*ee->getSampleScaleSpline()); + } + } + else + { + if (mNotVisibleTime > mData->LODSettings.NonVisibleDeleteTime) // if it's been non-visible for a long time; delete it, don't just disable it! + { + + if (ed->getEffectActor()) + { + ed->releaseActor(); + } + } + else + { + ea->setEnabled(false); + } + } + } + else + { + if (alive) // if it is now alive but was not previously; start the initial instance. + { + ed->refresh(mPose, true, false, mRenderVolume,mEmitterValidateCallback); + } + } + } + break; + case ET_JET_FS: + { + EffectJetFS *ee = static_cast< EffectJetFS *>(ed); + JetFSActor* ea = static_cast< JetFSActor*>(ed->getEffectActor()); + // if there is already an emitter actor... + if (ea) + { + if (alive) // is it alive? + { + if (reset) // is it time to reset it's condition? + { + ea->setEnabled(true); + } + if (mData->LODSettings.FadeJetFieldStrength) + { + // TODO + } + if ( ee->activePath() ) + { + PxTransform pose = mPose; + ee->getSamplePoseSpline(pose); + ea->setCurrentPose(pose); + ea->setCurrentScale(ee->mObjectScale*ee->getSampleScaleSpline()); + } + } + else + { + if (mNotVisibleTime > mData->LODSettings.NonVisibleDeleteTime) // if it's been non-visible for a long time; delete it, don't just disable it! + { + if (ed->getEffectActor()) + { + ed->releaseActor(); + } + } + else + { + ea->setEnabled(false); + } + } + } + else + { + if (alive) // if it is now alive but was not previously; start the initial instance. + { + ed->refresh(mPose, true, false, mRenderVolume,mEmitterValidateCallback); + } + } + } + break; + case ET_RIGID_BODY: + { + EffectRigidBody *erb = static_cast< EffectRigidBody *>(ed); + if ( alive ) + { + if ( ed->refresh(mPose, true, reset, mRenderVolume,mEmitterValidateCallback) ) + { + rigidBodyChange = true; + } + } + else + { + if ( erb->mRigidDynamic ) + { + erb->releaseRigidBody(); + rigidBodyChange = true; + } + } + } + break; + case ET_WIND_FS: + { + EffectWindFS *ee = static_cast< EffectWindFS *>(ed); + WindFSActor* ea = static_cast< WindFSActor*>(ed->getEffectActor()); + // if there is already an emitter actor... + if (ea) + { + if (alive) // is it alive? + { + if (reset) // is it time to reset it's condition? + { + ea->setEnabled(true); + } + if ( ee->activePath() ) + { + PxTransform pose = mPose; + ee->getSamplePoseSpline(pose); + ea->setCurrentPose(pose); + ea->setCurrentScale(ee->mObjectScale*ee->getSampleScaleSpline()); + } + } + else + { + if (mNotVisibleTime > mData->LODSettings.NonVisibleDeleteTime) // if it's been non-visible for a long time; delete it, don't just disable it! + { + if (ed->getEffectActor()) + { + ed->releaseActor(); + } + } + else + { + ea->setEnabled(false); + } + } + } + else + { + if (alive) // if it is now alive but was not previously; start the initial instance. + { + ed->refresh(mPose, true, false, mRenderVolume,mEmitterValidateCallback); + } + } + } + break; + case ET_NOISE_FS: + { + EffectNoiseFS *ee = static_cast< EffectNoiseFS *>(ed); + NoiseFSActor* ea = static_cast< NoiseFSActor*>(ed->getEffectActor()); + // if there is already an emitter actor... + if (ea) + { + if (alive) // is it alive? + { + if (reset) // is it time to reset it's condition? + { + ea->setEnabled(true); + } + if ( ee->activePath() ) + { + PxTransform pose = mPose; + ee->getSamplePoseSpline(pose); + ea->setCurrentPose(pose); + ea->setCurrentScale(ee->mObjectScale*ee->getSampleScaleSpline()); + } + } + else + { + if (mNotVisibleTime > mData->LODSettings.NonVisibleDeleteTime) // if it's been non-visible for a long time; delete it, don't just disable it! + { + if (ed->getEffectActor()) + { + ed->releaseActor(); + } + } + else + { + ea->setEnabled(false); + } + } + } + else + { + if (alive) // if it is now alive but was not previously; start the initial instance. + { + ed->refresh(mPose, true, false, mRenderVolume,mEmitterValidateCallback); + } + } + } + break; + case ET_VORTEX_FS: + { + EffectVortexFS *ee = static_cast< EffectVortexFS *>(ed); + VortexFSActor* ea = static_cast< VortexFSActor*>(ed->getEffectActor()); + // if there is already an emitter actor... + if (ea) + { + if (alive) // is it alive? + { + if (reset) // is it time to reset it's condition? + { + ea->setEnabled(true); + } + if ( ee->activePath() ) + { + PxTransform pose = mPose; + ee->getSamplePoseSpline(pose); + ea->setCurrentPose(pose); + ea->setCurrentScale(ee->mObjectScale*ee->getSampleScaleSpline()); + } + } + else + { + if (mNotVisibleTime > mData->LODSettings.NonVisibleDeleteTime) // if it's been non-visible for a long time; delete it, don't just disable it! + { + if (ed->getEffectActor()) + { + ed->releaseActor(); + } + } + else + { + ea->setEnabled(false); + } + } + } + else + { + if (alive) // if it is now alive but was not previously; start the initial instance. + { + ed->refresh(mPose, true, false, mRenderVolume,mEmitterValidateCallback); + } + } + } + break; + case ET_TURBULENCE_FS: + { + EffectTurbulenceFS *ee = static_cast< EffectTurbulenceFS *>(ed); + TurbulenceFSActor* ea = static_cast< TurbulenceFSActor*>(ed->getEffectActor()); + // if there is already an emitter actor... + if (ea) + { + if (alive) // is it alive? + { + if (reset) // is it time to reset it's condition? + { + ea->setEnabled(true); + } + if (mData->LODSettings.FadeTurbulenceNoise) + { + // TODO + } + if ( ee->activePath() ) + { + PxTransform pose = mPose; + ee->getSamplePoseSpline(pose); + ea->setPose(pose); + ea->setCurrentScale(ee->mObjectScale*ee->getSampleScaleSpline()); + } + } + else + { + if (mNotVisibleTime > mData->LODSettings.NonVisibleDeleteTime) // if it's been non-visible for a long time; delete it, don't just disable it! + { + if (ed->getEffectActor()) + { + ed->releaseActor(); + } + } + else + { + ea->setEnabled(false); + } + } + } + else + { + if (alive) // if it is now alive but was not previously; start the initial instance. + { + ed->refresh(mPose, true, false, mRenderVolume,mEmitterValidateCallback); + } + } + } + break; + case ET_FORCE_FIELD: + { + EffectForceField *ee = static_cast< EffectForceField *>(ed); + ForceFieldActor* ea = static_cast< ForceFieldActor*>(ed->getEffectActor()); + // if there is already an emitter actor... + if (ea) + { + if (alive) // is it alive? + { + if (reset) // is it time to reset it's condition? + { + ea->enable(); + } + if (mData->LODSettings.FadeForceFieldStrength) + { + // TODO + } + if ( ee->activePath() ) + { + PxTransform pose = mPose; + ee->getSamplePoseSpline(pose); + ea->setPose(pose); + ea->setCurrentScale(ee->mObjectScale*ee->getSampleScaleSpline()); + } + } + else + { + if (mNotVisibleTime > mData->LODSettings.NonVisibleDeleteTime) // if it's been non-visible for a long time; delete it, don't just disable it! + { + if (ed->getEffectActor()) + { + ed->releaseActor(); + } + } + else + { + if (ea->isEnable()) + { + ea->disable(); + } + } + } + } + else + { + if (alive) // if it is now alive but was not previously; start the initial instance. + { + ed->refresh(mPose, true, false, mRenderVolume,mEmitterValidateCallback); + } + } + } + break; + case ET_HEAT_SOURCE: + { + EffectHeatSource* ee = static_cast< EffectHeatSource*>(ed); + HeatSourceActor* ea = static_cast< HeatSourceActor*>(ed->getEffectActor()); + // if there is already an emitter actor... + if (ea) + { + if (alive) // is it alive? + { + if (reset) // is it time to reset it's condition? + { + ea->setTemperature(ee->mAverageTemperature, ee->mStandardDeviationTemperature); + //ea->enable(); + //TODO! + } + if (mData->LODSettings.FadeHeatSourceTemperature) + { + // TODO + } + if ( ee->activePath() ) + { + PxTransform pose = mPose; + ee->getSamplePoseSpline(pose); + ea->setPose(pose); + ea->setCurrentScale(ee->mObjectScale*ee->getSampleScaleSpline()); + } + } + else + { + ed->releaseActor(); + } + } + else + { + if (alive) // if it is now alive but was not previously; start the initial instance. + { + ed->refresh(mPose, true, false, mRenderVolume,mEmitterValidateCallback); + } + } + } + break; + case ET_SUBSTANCE_SOURCE: + { + EffectSubstanceSource* ee = static_cast< EffectSubstanceSource*>(ed); + SubstanceSourceActor* ea = static_cast< SubstanceSourceActor*>(ed->getEffectActor()); + // if there is already an emitter actor... + if (ea) + { + if (alive) // is it alive? + { + if (reset) // is it time to reset it's condition? + { + ea->setDensity(ee->mAverageDensity, ee->mStandardDeviationDensity); + //ea->enable(); + //TODO! + } + if (mData->LODSettings.FadeHeatSourceTemperature) + { + // TODO + } + if ( ee->activePath() ) + { + PxTransform pose = mPose; + ee->getSamplePoseSpline(pose); + nvidia::apex::Shape *shape = ea->getShape(); + shape->setPose(pose); + ea->setCurrentScale(ee->mObjectScale*ee->getSampleScaleSpline()); + } + } + else + { + ed->releaseActor(); + } + } + else + { + if (alive) // if it is now alive but was not previously; start the initial instance. + { + ed->refresh(mPose, true, false, mRenderVolume,mEmitterValidateCallback); + } + } + } + break; + case ET_VELOCITY_SOURCE: + { + EffectVelocitySource* ee = static_cast< EffectVelocitySource*>(ed); + VelocitySourceActor* ea = static_cast< VelocitySourceActor*>(ed->getEffectActor()); + // if there is already an emitter actor... + if (ea) + { + if (alive) // is it alive? + { + if (reset) // is it time to reset it's condition? + { + ea->setVelocity(ee->mAverageVelocity, ee->mStandardDeviationVelocity); + //ea->enable(); + //TODO! + } + if (mData->LODSettings.FadeHeatSourceTemperature) + { + // TODO + } + if ( ee->activePath() ) + { + PxTransform pose = mPose; + ee->getSamplePoseSpline(pose); + ea->setPose(pose); + ea->setCurrentScale(ee->mObjectScale*ee->getSampleScaleSpline()); + } + } + else + { + ed->releaseActor(); + } + } + else + { + if (alive) // if it is now alive but was not previously; start the initial instance. + { + ed->refresh(mPose, true, false, mRenderVolume,mEmitterValidateCallback); + } + } + } + break; + case ET_FLAME_EMITTER: + { + EffectFlameEmitter* ee = static_cast< EffectFlameEmitter*>(ed); + FlameEmitterActor* ea = static_cast< FlameEmitterActor*>(ed->getEffectActor()); + // if there is already an emitter actor... + if (ea) + { + if (alive) // is it alive? + { + if (reset) // is it time to reset it's condition? + { + ea->setEnabled(true); + } + if ( ee->activePath() ) + { + PxTransform pose = mPose; + ee->getSamplePoseSpline(pose); + ea->setPose(pose); + ea->setCurrentScale(ee->mObjectScale*ee->getSampleScaleSpline()); + } + } + else + { + ed->releaseActor(); + } + } + else + { + if (alive) // if it is now alive but was not previously; start the initial instance. + { + ed->refresh(mPose, true, false, mRenderVolume,mEmitterValidateCallback); + } + } + } + break; + default: + PX_ALWAYS_ASSERT(); // effect type not handled! + break; + } + } + } + if ( rigidBodyChange ) + { + mRigidBodyChange = true; + } + mAlive = anyAlive; + mFirstFrame = false; +} + + +/** +\brief Returns the name of the effect at this index. + +\param [in] effectIndex : The effect number to refer to; must be less than the result of getEffectCount +*/ +const char* EffectPackageActorImpl::getEffectName(uint32_t effectIndex) const +{ + READ_ZONE(); + const char* ret = NULL; + if (effectIndex < mEffects.size()) + { + EffectData* ed = mEffects[effectIndex]; + ret = ed->getEffectAsset()->getName(); + } + return ret; +} + +/** +\brief Returns true if this sub-effect is currently enabled. + +\param [in] effectIndex : The effect number to refer to; must be less than the result of getEffectCount +*/ +bool EffectPackageActorImpl::isEffectEnabled(uint32_t effectIndex) const +{ + READ_ZONE(); + bool ret = false; + if (effectIndex < mEffects.size()) + { + EffectData* ed = mEffects[effectIndex]; + ret = ed->isEnabled(); + } + return ret; +} + +/** +\brief Set's the enabled state of this sub-effect + +\param [in] effectIndex : The effect number to refer to; must be less than the result of getEffectCount +\param [in] state : Whether the effect should be enabled or not. +*/ +bool EffectPackageActorImpl::setEffectEnabled(uint32_t effectIndex, bool state) +{ + WRITE_ZONE(); + bool ret = false; + + if (effectIndex < mEffects.size()) + { + EffectData* ed = mEffects[effectIndex]; + ed->setEnabled(state); + if ( ed->getType() == ET_EMITTER ) + { + ed->setForceRenableEmitter(state); // set the re-enable semaphore + } + ret = true; + } + + return ret; +} + +/** +\brief Returns the pose of this sub-effect; returns as a a bool the active state of this effect. + +\param [in] effectIndex : The effect number to refer to; must be less than the result of getEffectCount +\param [pose] : Contains the pose requested +\param [worldSpace] : Whether to return the pose in world-space or in parent-relative space. +*/ +bool EffectPackageActorImpl::getEffectPose(uint32_t effectIndex, PxTransform& pose, bool worldSpace) +{ + READ_ZONE(); + bool ret = false; + + if (effectIndex < mEffects.size()) + { + EffectData* ed = mEffects[effectIndex]; + + if (worldSpace) + { + pose = ed->getWorldPose(); + } + else + { + pose = ed->getLocalPose(); + } + ret = true; + } + + return ret; +} + +void EffectPackageActorImpl::setCurrentScale(float scale) +{ + WRITE_ZONE(); + mObjectScale = scale; + for (uint32_t i = 0; i < mEffects.size(); i++) + { + EffectData* ed = mEffects[i]; + ed->setCurrentScale(mObjectScale,mEffectPath); + ed->refresh(mPose, mEnabled, true, mRenderVolume,mEmitterValidateCallback); + } +} + +/** +\brief Sets the pose of this sub-effect; returns as a a bool the active state of this effect. + +\param [in] effectIndex : The effect number to refer to; must be less than the result of getEffectCount +\param [pose] : Contains the pose to be set +\param [worldSpace] : Whether to return the pose in world-space or in parent-relative space. +*/ +bool EffectPackageActorImpl::setEffectPose(uint32_t effectIndex, const PxTransform& pose, bool worldSpace) +{ + WRITE_ZONE(); + bool ret = false; + + if (effectIndex < mEffects.size()) + { + EffectData* ed = mEffects[effectIndex]; + if (worldSpace) + { + PxTransform p = getPose(); // get root pose + PxTransform i = p.getInverse(); + PxTransform l = i * pose; + ed->setLocalPose(pose); // change the local pose + setPose(p); + } + else + { + ed->setLocalPose(pose); // change the local pose + PxTransform p = getPose(); + setPose(p); + } + ret = true; + } + return ret; +} + +/** +\brief Returns the current lifetime of the particle. +*/ +float EffectPackageActorImpl::getCurrentLife(void) const +{ + READ_ZONE(); + return mCurrentLifeTime; +} + +float EffectData::getRealDuration(void) const +{ + float ret = 0; + + if (mDuration != 0 && mRepeatCount != 9999) // if it's not an infinite lifespan... + { + ret = mInitialDelayTime + mRepeatCount * mDuration + mRepeatCount * mRepeatDelay; + } + + return ret; +} + +float EffectPackageActorImpl::getDuration(void) const +{ + READ_ZONE(); + float ret = 0; + + for (uint32_t i = 0; i < mEffects.size(); i++) + { + EffectData* ed = mEffects[i]; + if (ed->getType() == ET_EMITTER) // if it's an emitter + { + float v = ed->getRealDuration(); + if (v > ret) + { + ret = v; + } + } + } + return ret; +} + +void EffectPackageActorImpl::setPreferredRenderVolume(RenderVolume* volume) +{ + WRITE_ZONE(); + mRenderVolume = volume; + for (uint32_t i = 0; i < mEffects.size(); i++) + { + EffectData* ed = mEffects[i]; + if (ed->getType() == ET_EMITTER) // if it's an emitter + { + EffectEmitter* ee = static_cast< EffectEmitter*>(ed); + if (ee->getEffectActor()) + { + EmitterActor* ea = static_cast< EmitterActor*>(ee->getEffectActor()); + ea->setPreferredRenderVolume(volume); + } + } + } + +} + + +EffectNoiseFS::EffectNoiseFS(const char* parentName, + NoiseFieldSamplerEffect* data, + ApexSDK& sdk, + Scene& scene, + ParticlesScene& dscene, + const PxTransform& rootPose, + bool parentEnabled) : mData(data), EffectData(ET_NOISE_FS, &sdk, &scene, &dscene, parentName, NOISE_FS_AUTHORING_TYPE_NAME,*(RigidBodyEffectNS::EffectProperties_Type *)(&data->EffectProperties) ) +{ +} + +EffectNoiseFS::~EffectNoiseFS(void) +{ +} + +void EffectNoiseFS::visualize(RenderDebugInterface* callback, bool solid) const +{ + +} + +bool EffectNoiseFS::refresh(const PxTransform& parent, bool parentEnabled, bool fromSetPose, RenderVolume* renderVolume,EmitterActor::EmitterValidateCallback *callback) +{ + bool ret = false; + if (parentEnabled && mEnabled && mAsset) + { + PxTransform localPose = mLocalPose; + localPose.p*=mObjectScale*getSampleScaleSpline(); + PxTransform myPose(parent * localPose); + getSamplePoseSpline(myPose); + + if (mActor == NULL && mAsset && !fromSetPose) + { + NvParameterized::Interface* descParams = mAsset->getDefaultActorDesc(); + if (descParams) + { + bool ok = NvParameterized::setParamF32(*descParams, "initialScale", mObjectScale*getSampleScaleSpline() ); + PX_ASSERT(ok); + PX_UNUSED(ok); + mActor = mAsset->createApexActor(*descParams, *mApexScene); + if (mActor) + { + NoiseFSActor* fs = static_cast< NoiseFSActor*>(mActor); + if (fs) + { + fs->setCurrentPose(myPose); + fs->setCurrentScale(mObjectScale*getSampleScaleSpline()); + } + ret = true; + } + } + } + else if (mActor) + { + NoiseFSActor* a = static_cast< NoiseFSActor*>(mActor); + a->setCurrentPose(myPose); + a->setCurrentScale(mObjectScale*getSampleScaleSpline()); + } + } + else + { + if ( mActor ) + { + releaseActor(); + ret = true; + } + } + return ret; +} + +EffectVortexFS::EffectVortexFS(const char* parentName, + VortexFieldSamplerEffect* data, + ApexSDK& sdk, + Scene& scene, + ParticlesScene& dscene, + const PxTransform& rootPose, + bool parentEnabled) : mData(data), EffectData(ET_VORTEX_FS, &sdk, &scene, &dscene, parentName, VORTEX_FS_AUTHORING_TYPE_NAME, *(RigidBodyEffectNS::EffectProperties_Type *)(&data->EffectProperties)) +{ +} + +EffectVortexFS::~EffectVortexFS(void) +{ +} + +void EffectVortexFS::visualize(RenderDebugInterface* callback, bool solid) const +{ + +} + +bool EffectVortexFS::refresh(const PxTransform& parent, bool parentEnabled, bool fromSetPose, RenderVolume* renderVolume,EmitterActor::EmitterValidateCallback *callback) +{ + bool ret = false; + + if (parentEnabled && mEnabled && mAsset) + { + PxTransform localPose = mLocalPose; + localPose.p*=mObjectScale*getSampleScaleSpline(); + PxTransform myPose(parent * localPose); + getSamplePoseSpline(myPose); + + if (mActor == NULL && mAsset && !fromSetPose) + { + NvParameterized::Interface* descParams = mAsset->getDefaultActorDesc(); + if (descParams) + { + bool ok = NvParameterized::setParamF32(*descParams, "initialScale", mObjectScale*getSampleScaleSpline() ); + PX_ASSERT(ok); + PX_UNUSED(ok); + mActor = mAsset->createApexActor(*descParams, *mApexScene); + if (mActor) + { + VortexFSActor* fs = static_cast< VortexFSActor*>(mActor); + if (fs) + { + fs->setCurrentPose(myPose); + fs->setCurrentScale(mObjectScale*getSampleScaleSpline()); + } + ret = true; + } + } + } + else if (mActor) + { + VortexFSActor* a = static_cast< VortexFSActor*>(mActor); + a->setCurrentPose(myPose); + a->setCurrentScale(mObjectScale*getSampleScaleSpline()); + } + } + else + { + if ( mActor ) + { + releaseActor(); + ret = true; + } + } + return ret; +} + +const char * EffectPackageActorImpl::hasVolumeRenderMaterial(uint32_t &index) const +{ + READ_ZONE(); + const char *ret = NULL; + + for (uint32_t i=0; i<mEffects.size(); i++) + { + EffectData *d = mEffects[i]; + if ( d->getType() == ET_TURBULENCE_FS ) + { + const NvParameterized::Interface *iface = d->getAsset()->getAssetNvParameterized(); + const turbulencefs::TurbulenceFSAssetParams *ap = static_cast< const turbulencefs::TurbulenceFSAssetParams *>(iface); + if ( ap->volumeRenderMaterialName ) + { + if ( strlen(ap->volumeRenderMaterialName->name()) > 0 ) + { + index = i; + ret = ap->volumeRenderMaterialName->name(); + break; + } + } + } + } + + return ret; +} + +EffectRigidBody::EffectRigidBody(const char* parentName, + RigidBodyEffect* data, + ApexSDK& sdk, + Scene& scene, + ParticlesScene& dscene, + const PxTransform& rootPose, + bool parentEnabled) : mData(data), EffectData(ET_RIGID_BODY, &sdk, &scene, &dscene, parentName, NULL, *(RigidBodyEffectNS::EffectProperties_Type *)(&data->EffectProperties)) +{ + mRigidDynamic = NULL; +} + +EffectRigidBody::~EffectRigidBody(void) +{ + releaseRigidBody(); +} + + +void EffectRigidBody::visualize(RenderDebugInterface* callback, bool solid) const +{ + +} + +bool EffectRigidBody::refresh(const PxTransform& parent, + bool parentEnabled, + bool fromSetPose, + RenderVolume* renderVolume, + EmitterActor::EmitterValidateCallback *callback) +{ + bool ret = false; + SCOPED_PHYSX_LOCK_WRITE(mApexScene); + if (parentEnabled && mEnabled ) + { + PxTransform localPose = mLocalPose; + localPose.p*=mObjectScale*getSampleScaleSpline(); + PxTransform myPose = parent * localPose; + getSamplePoseSpline(myPose); + + if (mRigidDynamic == NULL && !fromSetPose) + { + PxScene * scene = mApexScene->getPhysXScene(); + PxPhysics &sdk = scene->getPhysics(); + PxMaterial * material = mParticlesScene->getModuleParticles()->getDefaultMaterial(); + RigidBodyEffect *rbe = static_cast< RigidBodyEffect *>(mData); + physx::PxFilterData data = ApexResourceHelper::resolveCollisionGroup128(rbe->CollisionFilterDataName.buf); + mRigidDynamic = sdk.createRigidDynamic(myPose); + ret = true; + if ( mRigidDynamic ) + { + mRigidDynamic->setLinearVelocity(rbe->InitialLinearVelocity); + mRigidDynamic->setAngularVelocity(rbe->InitialAngularVelocity); + mRigidDynamic->setMass(rbe->Mass); + mRigidDynamic->setLinearDamping(rbe->LinearDamping); + mRigidDynamic->setAngularDamping(rbe->AngularDamping); + mRigidDynamic->setRigidBodyFlag(PxRigidBodyFlag::eKINEMATIC,!rbe->Dynamic); + + physx::PxShape *shape = NULL; + if ( nvidia::strcmp(rbe->Type,"SPHERE") == 0 ) + { + PxSphereGeometry sphere; + sphere.radius = rbe->Extents.x*getSampleScaleSpline(); + shape = mRigidDynamic->createShape(sphere,*material); + shape->setLocalPose(localPose); + } + else if ( nvidia::strcmp(rbe->Type,"CAPSULE") == 0 ) + { + PxCapsuleGeometry capsule; + capsule.radius = rbe->Extents.x*getSampleScaleSpline(); + capsule.halfHeight = rbe->Extents.y*getSampleScaleSpline(); + shape = mRigidDynamic->createShape(capsule,*material); + shape->setLocalPose(localPose); + } + else if ( nvidia::strcmp(rbe->Type,"BOX") == 0 ) + { + PxBoxGeometry box; + box.halfExtents.x = rbe->Extents.x*0.5f*getSampleScaleSpline(); + box.halfExtents.y = rbe->Extents.y*0.5f*getSampleScaleSpline(); + box.halfExtents.z = rbe->Extents.z*0.5f*getSampleScaleSpline(); + shape = mRigidDynamic->createShape(box,*material); + shape->setLocalPose(localPose); + } + else + { + PX_ALWAYS_ASSERT(); + } + if ( shape ) + { + // do stuff here... + shape->setSimulationFilterData(data); + shape->setQueryFilterData(data); + shape->setFlag(PxShapeFlag::eSIMULATION_SHAPE,true); + shape->setMaterials(&material,1); + } + mRigidDynamic->setActorFlag(PxActorFlag::eDISABLE_GRAVITY,!rbe->Gravity); + mRigidDynamic->setActorFlag(PxActorFlag::eDISABLE_SIMULATION,false); + mRigidDynamic->setActorFlag(PxActorFlag::eVISUALIZATION,true); + scene->addActor(*mRigidDynamic); + } + } + else if (mRigidDynamic && fromSetPose ) + { + if ( mRigidDynamic->getRigidBodyFlags() & PxRigidBodyFlag::eKINEMATIC ) + { + mRigidDynamic->setKinematicTarget(myPose); + } + else + { + mRigidDynamic->setGlobalPose(myPose); + } + } + if ( activePath() && mRigidDynamic ) + { + // if we are sampling a spline curve to control the scale of the object.. + RigidBodyEffect *rbe = static_cast< RigidBodyEffect *>(mData); + physx::PxShape *shape = NULL; + mRigidDynamic->getShapes(&shape,1,0); + if ( shape ) + { + if ( nvidia::strcmp(rbe->Type,"SPHERE") == 0 ) + { + PxSphereGeometry sphere; + sphere.radius = rbe->Extents.x*getSampleScaleSpline(); + shape->setGeometry(sphere); + } + else if ( nvidia::strcmp(rbe->Type,"CAPSULE") == 0 ) + { + PxCapsuleGeometry capsule; + capsule.radius = rbe->Extents.x*getSampleScaleSpline(); + capsule.halfHeight = rbe->Extents.y*getSampleScaleSpline(); + shape->setGeometry(capsule); + } + else if ( nvidia::strcmp(rbe->Type,"BOX") == 0 ) + { + PxBoxGeometry box; + box.halfExtents.x = rbe->Extents.x*0.5f*getSampleScaleSpline(); + box.halfExtents.y = rbe->Extents.y*0.5f*getSampleScaleSpline(); + box.halfExtents.z = rbe->Extents.z*0.5f*getSampleScaleSpline(); + shape->setGeometry(box); + } + } + if ( mRigidDynamic->getRigidBodyFlags() & PxRigidBodyFlag::eKINEMATIC ) + { + mRigidDynamic->setKinematicTarget(myPose); + } + else + { + mRigidDynamic->setGlobalPose(myPose); + } + } + } + else + { + //releaseActor(); + } + return ret; +} + +PxRigidDynamic* EffectPackageActorImpl::getEffectRigidDynamic(uint32_t effectIndex) const +{ + READ_ZONE(); + PxRigidDynamic *ret = NULL; + + if (effectIndex < mEffects.size()) + { + EffectData* ed = mEffects[effectIndex]; + if ( ed->getType() == ET_RIGID_BODY ) + { + EffectRigidBody *erd = static_cast< EffectRigidBody *>(ed); + ret = erd->mRigidDynamic; + } + } + + + return ret; +} + +void EffectRigidBody::releaseRigidBody(void) +{ + if ( mRigidDynamic ) + { + SCOPED_PHYSX_LOCK_WRITE(mApexScene); + mRigidDynamic->release(); + mRigidDynamic = NULL; + } +} + +EffectPath::EffectPath(void) +{ + mRotations = NULL; + mPathSpline = NULL; + mScaleSpline = NULL; + mSampleScaleSpline = 1.0f; + mSpeedSpline = NULL; + mPathDuration = 1; +} + +EffectPath::~EffectPath(void) +{ + delete mScaleSpline; + delete mSpeedSpline; + delete mPathSpline; + PX_FREE(mRotations); +} + +bool EffectPath::init(RigidBodyEffectNS::EffectPath_Type &path) +{ + bool ret = path.Scale.arraySizes[0] > 2; + + mPathDuration = path.PathDuration; + mMode = EM_LOOP; + if ( nvidia::strcmp(path.PlaybackMode,"LOOP") == 0 ) + { + mMode = EM_LOOP; + } + else if ( nvidia::strcmp(path.PlaybackMode,"PLAY_ONCE") == 0 ) + { + mMode = EM_PLAY_ONCE; + } + else if ( nvidia::strcmp(path.PlaybackMode,"PING_PONG") == 0 ) + { + mMode = EM_PING_PONG; + } + + delete mScaleSpline; + mScaleSpline = NULL; + + if ( path.Scale.arraySizes[0] == 2 ) + { + if ( path.Scale.buf[0].y != 1 || + path.Scale.buf[1].y != 1 ) + { + ret = true; + } + } + else if ( path.Scale.arraySizes[0] > 2 ) + { + ret = true; + } + + if ( ret ) + { + mScaleSpline = PX_NEW(Spline); + int32_t scount = path.Scale.arraySizes[0]; + mScaleSpline->Reserve(scount); + for (int32_t i=0; i<scount; i++) + { + float x = path.Scale.buf[i].x; + float y = path.Scale.buf[i].y; + mScaleSpline->AddNode(x,y); + } + mScaleSpline->ComputeSpline(); + uint32_t index; + float t; + mSampleScaleSpline = mScaleSpline->Evaluate(0,index,t); + } + + + bool hasSpeed = false; + + if ( path.Speed.arraySizes[0] == 2 ) + { + if ( path.Speed.buf[0].y != 1 || + path.Speed.buf[1].y != 1 ) + { + hasSpeed = true; + } + } + else if ( path.Speed.arraySizes[0] > 2 ) + { + hasSpeed = true; + } + + delete mSpeedSpline; + mSpeedSpline = NULL; + + if ( hasSpeed ) + { + ret = true; + + Spline speed; + int32_t scount = path.Speed.arraySizes[0]; + speed.Reserve(scount); + for (int32_t i=0; i<scount; i++) + { + float x = path.Speed.buf[i].x; + float y = path.Speed.buf[i].y; + speed.AddNode(x,y); + } + speed.ComputeSpline(); + + float distance = 0; + uint32_t index; + for (int32_t i=0; i<32; i++) + { + float t = (float)i/32.0f; + float fraction; + float dt = speed.Evaluate(t,index,fraction); + distance+=dt; + } + float recipDistance = 1.0f / distance; + mSpeedSpline = PX_NEW(Spline); + mSpeedSpline->Reserve(32); + distance = 0; + for (int32_t i=0; i<32; i++) + { + float t = (float)i/32.0f; + float fraction; + float dt = speed.Evaluate(t,index,fraction); + distance+=dt; + float d = distance*recipDistance; + mSpeedSpline->AddNode(t,d); + } + mSpeedSpline->ComputeSpline(); + float fraction; + mSampleSpeedSpline = mSpeedSpline->Evaluate(0,index,fraction); + } + + + PX_FREE(mRotations); + mRotations = NULL; + delete mPathSpline; + mPathSpline = NULL; + + if ( path.ControlPoints.arraySizes[0] >= 3 ) + { + mPathSpline = PX_NEW(SplineCurve); + int32_t count = path.ControlPoints.arraySizes[0]; + PxVec3Vector points; + mRotationCount = (uint32_t)count-1; + mRotations = (PxQuat *)PX_ALLOC(sizeof(PxQuat)*(count-1),"PathRotations"); + mPathRoot = path.ControlPoints.buf[0]; + for (int32_t i=1; i<count; i++) + { + const PxTransform &t = path.ControlPoints.buf[i]; + mRotations[i-1] = t.q; + points.pushBack(t.p); + } + mPathSpline->setControlPoints(points); + + float fraction; + uint32_t index; + mSamplePoseSpline.p = mPathSpline->Evaluate(0,index,fraction); + mSamplePoseSpline.q = PxQuat(PxIdentity); + mSamplePoseSpline = mPathRoot * mSamplePoseSpline; + ret = true; + } + + + + return ret; +} + +float EffectPath::sampleSpline(float x) +{ + if ( mScaleSpline ) + { + uint32_t index; + float fraction; + mSampleScaleSpline = mScaleSpline->Evaluate(x,index,fraction); + if ( mSampleScaleSpline < 0.001f ) + { + mSampleScaleSpline = 0.001f; + } + } + if ( mPathSpline ) + { + uint32_t index; + float fraction; + if ( mSpeedSpline ) + { + x = mSpeedSpline->Evaluate(x,index,fraction); + } + float duration = mPathSpline->GetLength(); + duration*=x; + mSamplePoseSpline.p = mPathSpline->Evaluate(duration,index,fraction); + PX_ASSERT( index < mRotationCount ); + PxQuat q0 = mRotations[index]; + uint32_t index2 = index+1; + if ( index2 >= mRotationCount ) + { + index2 = 0; + } + PxQuat q1 = mRotations[index2]; + + PxQuat q = physx::shdfnd::slerp(fraction,q0,q1); + + mSamplePoseSpline.q = q; + mSamplePoseSpline = mPathRoot * mSamplePoseSpline; + } + + return mSampleScaleSpline; +} + +void EffectPath::computeSampleTime(float ctime,float duration) +{ + float sampleTime=0; + switch ( mMode ) + { + case EM_PLAY_ONCE: + if ( ctime >= duration ) + { + sampleTime = 1; + } + else + { + sampleTime = ctime / duration; + } + break; + case EM_LOOP: + sampleTime = fmodf(ctime,duration) / duration; + break; + case EM_PING_PONG: + sampleTime = fmodf(ctime,duration*2) / duration; + if ( sampleTime > 1 ) + { + sampleTime = 2.0f - sampleTime; + } + break; + default: + PX_ALWAYS_ASSERT(); + break; + } + sampleSpline(sampleTime); +} +} // end of particles namespace +} // end of nvidia namespace diff --git a/APEX_1.4/module/particles/src/EffectPackageAssetImpl.cpp b/APEX_1.4/module/particles/src/EffectPackageAssetImpl.cpp new file mode 100644 index 00000000..926a1c32 --- /dev/null +++ b/APEX_1.4/module/particles/src/EffectPackageAssetImpl.cpp @@ -0,0 +1,188 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + + +#include "EffectPackageAssetImpl.h" +#include "EffectPackageActorParams.h" +#include "EffectPackageActorImpl.h" +#include "ModuleParticlesImpl.h" +#include "EmitterEffect.h" +#include "ReadCheck.h" +#include "WriteCheck.h" + +#pragma warning(disable:4100) + +namespace nvidia +{ + +namespace particles +{ + +EffectPackageAssetImpl::EffectPackageAssetImpl(ModuleParticlesImpl*, ResourceList&, const char* name) +{ + PX_ALWAYS_ASSERT(); +} + +EffectPackageAssetImpl::EffectPackageAssetImpl(ModuleParticlesImpl* moduleParticles, ResourceList& resourceList, NvParameterized::Interface* params, const char* name) +{ + mDefaultActorParams = NULL; + mName = name; + mModule = moduleParticles; + mParams = static_cast< EffectPackageAssetParams*>(params); + initializeAssetNameTable(); + resourceList.add(*this); +} + +EffectPackageAssetImpl::~EffectPackageAssetImpl() +{ +} + +uint32_t EffectPackageAssetImpl::forceLoadAssets() +{ + WRITE_ZONE(); + return 0; +} + +NvParameterized::Interface* EffectPackageAssetImpl::getDefaultActorDesc() +{ + READ_ZONE(); + NvParameterized::Traits* traits = GetInternalApexSDK()->getParameterizedTraits(); + PX_ASSERT(traits); + if (!traits) + { + return NULL; + } + // create if not yet created + if (!mDefaultActorParams) + { + const char* className = EffectPackageActorParams::staticClassName(); + NvParameterized::Interface* param = traits->createNvParameterized(className); + NvParameterized::Handle h(param); + mDefaultActorParams = static_cast<EffectPackageActorParams*>(param); + PX_ASSERT(param); + if (!param) + { + return NULL; + } + } + return mDefaultActorParams; + +} + +void EffectPackageAssetImpl::release() +{ + mModule->mSdk->releaseAsset(*this); +} + + +NvParameterized::Interface* EffectPackageAssetImpl::getDefaultAssetPreviewDesc() +{ + READ_ZONE(); + PX_ALWAYS_ASSERT(); + return NULL; +} + +Actor* EffectPackageAssetImpl::createApexActor(const NvParameterized::Interface& parms, Scene& apexScene) +{ + WRITE_ZONE(); + Actor* ret = NULL; + + ParticlesScene* ds = mModule->getParticlesScene(apexScene); + if (ds) + { + const EffectPackageAssetParams* assetParams = mParams; + const EffectPackageActorParams* actorParams = static_cast<const EffectPackageActorParams*>(&parms); + EffectPackageActorImpl* ea = PX_NEW(EffectPackageActorImpl)(this, assetParams, actorParams, + *GetInternalApexSDK(), + apexScene, + *ds, + mModule->getModuleTurbulenceFS()); + + ret = static_cast< Actor*>(ea); + } + return ret; +} + +void EffectPackageAssetImpl::destroy() +{ + if (mDefaultActorParams) + { + mDefaultActorParams->destroy(); + mDefaultActorParams = 0; + } + + if (mParams) + { + mParams->destroy(); + mParams = NULL; + } + + /* Actors are automatically cleaned up on deletion by ResourceList dtor */ + delete this; + +} + +void EffectPackageAssetImpl::initializeAssetNameTable() +{ +} + +float EffectPackageAssetImpl::getDuration() const +{ + READ_ZONE(); + float ret = 0; + + for (int32_t i = 0; i < mParams->Effects.arraySizes[0]; i++) + { + NvParameterized::Interface* iface = mParams->Effects.buf[i]; + if (iface && nvidia::strcmp(iface->className(), EmitterEffect::staticClassName()) == 0) + { + EmitterEffect* ee = static_cast< EmitterEffect*>(iface); + float v = 0; + if (ee->EffectProperties.Duration != 0 && ee->EffectProperties.RepeatCount != 9999) + { + v = ee->EffectProperties.InitialDelayTime + ee->EffectProperties.RepeatCount * ee->EffectProperties.Duration + ee->EffectProperties.RepeatCount * ee->EffectProperties.RepeatDelay; + } + if (v == 0) // any infinite lifespan sub-effect means the entire effect package has an infinite life + { + ret = 0; + break; + } + else if (v > ret) + { + ret = v; + } + } + } + + return ret; +} + +bool EffectPackageAssetImpl::useUniqueRenderVolume() const +{ + READ_ZONE(); + return mParams ? mParams->LODSettings.UniqueRenderVolume : false; +} + +void EffectPackageAssetAuthoringImpl::setToolString(const char* toolString) +{ + if (mParams != NULL) + { + NvParameterized::Handle handle(*mParams, "toolString"); + PX_ASSERT(handle.isValid()); + if (handle.isValid()) + { + PX_ASSERT(handle.parameterDefinition()->type() == NvParameterized::TYPE_STRING); + handle.setParamString(toolString); + } + } +} + +} // end of particles namespace +} // end of nvidia namespace diff --git a/APEX_1.4/module/particles/src/ModuleParticlesImpl.cpp b/APEX_1.4/module/particles/src/ModuleParticlesImpl.cpp new file mode 100644 index 00000000..79f2024a --- /dev/null +++ b/APEX_1.4/module/particles/src/ModuleParticlesImpl.cpp @@ -0,0 +1,4341 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + + + +#include "ApexDefs.h" + +#define SAFE_MODULE_RELEASE(x) if ( x ) { ModuleIntl *m = mSdk->getInternalModule(x); PX_ASSERT(m); m->setParent(NULL); x->release(); x = NULL; } + +/* === ModuleParticlesImpl DLL Setup === */ + +#pragma warning(disable:4505) + +#include "ModuleParticlesImpl.h" +#include "ModuleParticlesRegistration.h" +#include "ModulePerfScope.h" +#include "ParticlesScene.h" +#include "SceneIntl.h" +#include "PxMaterial.h" +#include "ModuleTurbulenceFS.h" +#include "PsMemoryBuffer.h" + +#include "ApexSDKIntl.h" +#include "ApexUsingNamespace.h" +#include "Apex.h" +#include "nvparameterized/NvParamUtils.h" +#include "ApexEmitterAssetParameters.h" +#include "EmitterGeomSphereParams.h" +#include "IofxAssetParameters.h" +#include "SpriteIofxParameters.h" +#include "ViewDirectionSortingModifierParams.h" +#include "SimpleScaleModifierParams.h" +#include "InitialColorModifierParams.h" +#include "TurbulenceFSAssetParams.h" +#include "BasicIOSAssetParam.h" +#include "EmitterAsset.h" +#include "GroundEmitterAsset.h" +#include "ImpactEmitterAsset.h" +#include "IofxAsset.h" +#include "BasicIosAsset.h" +#include "ParticleIosAsset.h" +#include "TurbulenceFSAsset.h" +#include "EmitterGeomBoxParams.h" +#include "RandomScaleModifierParams.h" +#include "RandomRotationModifierParams.h" +#include "ColorVsLifeCompositeModifierParams.h" +#include "ScaleVsLife2DModifierParams.h" +#include "FloatMath.h" +#include "JetFSActor.h" +#include "WindFSActor.h" +#include "AttractorFSActor.h" +#include "BasicFSAsset.h" +#include "JetFSAssetParams.h" +#include "WindFSAssetParams.h" +#include "NoiseFSAssetParams.h" +#include "VortexFSAssetParams.h" +#include "OrientScaleAlongScreenVelocityModifierParams.h" +#include "RandomRotationModifierParams.h" +#include "RotationRateModifierParams.h" +#include "RotationRateVsLifeModifierParams.h" +#include "EffectPackageActorImpl.h" +#include "AttractorFSAssetParams.h" +#include "FluidParticleSystemParams.h" +#include "ModuleParticleIosRegistration.h" +#include "MeshIofxParameters.h" +#include "SimpleScaleModifierParams.h" +#include "RotationModifierParams.h" +#include "ScaleVsLife3DModifierParams.h" +#include "ForceFieldAssetParams.h" +#include "RadialForceFieldKernelParams.h" +#include "ForceFieldFalloffParams.h" +#include "ForceFieldNoiseParams.h" +#include "HeatSourceAsset.h" +#include "SubstanceSourceAsset.h" +#include "VelocitySourceAsset.h" +#include "ForceFieldAsset.h" +#include "EffectPackageAssetParams.h" +#include "FlameEmitterAsset.h" +#include "FlameEmitterAssetParams.h" + +#include "ViewDirectionSortingModifierParams.h" +#include "RandomSubtextureModifierParams.h" +#include "UserOpaqueMesh.h" +#include "HeatSourceAssetParams.h" +#include "HeatSourceGeomSphereParams.h" +#include "SubstanceSourceAssetParams.h" +#include "VelocitySourceAssetParams.h" +#include "PxPhysics.h" +#include "EffectPackageData.h" + +#define SAFE_DESTROY(x) if ( x ) { x->destroy(); x = NULL; } + + +#if PX_X86 + +#define LINK_KERNEL(name) "/include:_"#name +#define LINK_S2_KERNEL(name) "/include:_"#name"_templ$0 /include:_"#name"_templ$1" + +#elif PX_X64 + +#define LINK_KERNEL(name) "/include:"#name +#define LINK_S2_KERNEL(name) "/include:"#name"_templ$0 /include:"#name"_templ$1" + +#endif + +#if APEX_CUDA_SUPPORT + +#pragma comment(linker, LINK_S2_KERNEL(BasicFS_fieldSamplerGridKernel)) +#pragma comment(linker, LINK_S2_KERNEL(BasicFS_fieldSamplerPointsKernel)) + +#pragma comment(linker, LINK_KERNEL(BasicIOS_compactKernel)) +#pragma comment(linker, LINK_KERNEL(BasicIOS_histogramKernel)) +#pragma comment(linker, LINK_KERNEL(BasicIOS_mergeHistogramKernel)) +#pragma comment(linker, LINK_KERNEL(BasicIOS_reduceKernel)) +#pragma comment(linker, LINK_KERNEL(BasicIOS_scanKernel)) +#pragma comment(linker, LINK_S2_KERNEL(BasicIOS_simulateApplyFieldKernel)) +#pragma comment(linker, LINK_S2_KERNEL(BasicIOS_simulateKernel)) +#pragma comment(linker, LINK_KERNEL(BasicIOS_stateKernel)) + +#pragma comment(linker, LINK_KERNEL(FieldSampler_applyParticlesKernel)) +#pragma comment(linker, LINK_KERNEL(FieldSampler_clearGridKernel)) +#pragma comment(linker, LINK_KERNEL(FieldSampler_clearKernel)) +#pragma comment(linker, LINK_KERNEL(FieldSampler_composeKernel)) + +#pragma comment(linker, LINK_S2_KERNEL(ForceField_fieldSamplerGridKernel)) +#pragma comment(linker, LINK_S2_KERNEL(ForceField_fieldSamplerPointsKernel)) + +#pragma comment(linker, LINK_KERNEL(IOFX_actorRangeKernel)) +#pragma comment(linker, LINK_KERNEL(IOFX_bboxKernel)) +#pragma comment(linker, LINK_S2_KERNEL(IOFX_meshModifiersKernel)) +#pragma comment(linker, LINK_KERNEL(IOFX_newRadixSortBlockKernel)) +#pragma comment(linker, LINK_KERNEL(IOFX_newRadixSortStepKernel)) +#pragma comment(linker, LINK_KERNEL(IOFX_radixSortStepKernel)) +#pragma comment(linker, LINK_S2_KERNEL(IOFX_makeSortKeys)) +#pragma comment(linker, LINK_S2_KERNEL(IOFX_remapKernel)) +#pragma comment(linker, LINK_S2_KERNEL(IOFX_spriteModifiersKernel)) +#pragma comment(linker, LINK_S2_KERNEL(IOFX_spriteTextureModifiersKernel)) +#pragma comment(linker, LINK_S2_KERNEL(IOFX_volumeMigrationKernel)) + +#pragma comment(linker, LINK_KERNEL(ParticleIOS_compactKernel)) +#pragma comment(linker, LINK_KERNEL(ParticleIOS_histogramKernel)) +#pragma comment(linker, LINK_KERNEL(ParticleIOS_mergeHistogramKernel)) +#pragma comment(linker, LINK_KERNEL(ParticleIOS_reduceKernel)) +#pragma comment(linker, LINK_KERNEL(ParticleIOS_scanKernel)) +#pragma comment(linker, LINK_S2_KERNEL(ParticleIOS_simulateApplyFieldKernel)) +#pragma comment(linker, LINK_S2_KERNEL(ParticleIOS_simulateKernel)) +#pragma comment(linker, LINK_KERNEL(ParticleIOS_stateKernel)) + +#endif + +namespace nvidia +{ +namespace apex +{ + + +void instantiateModuleBasicIos(); +void instantiateModuleEmitter(); +void instantiateModuleIofx(); +void instantiateModuleFieldSampler(); +void instantiateModuleParticleIos(); +void instantiateModuleForceField(); +void instantiateModuleBasicFS(); + +static const char* getAuthoringTypeName(const char* className) +{ + const char* ret = NULL; + + if (nvidia::strcmp(className, "BasicIOSAssetParam") == 0) + { + ret = BASIC_IOS_AUTHORING_TYPE_NAME; + } + else if (nvidia::strcmp(className, "IofxAssetParameters") == 0) + { + ret = IOFX_AUTHORING_TYPE_NAME; + } + else if (nvidia::strcmp(className, "ParticleIosAssetParam") == 0) + { + ret = PARTICLE_IOS_AUTHORING_TYPE_NAME; + } + + + PX_ASSERT(ret); + return ret; +} + +#if defined(_USRDLL) + +/* Modules don't have to link against the framework, they keep their own */ +ApexSDKIntl* gApexSdk = 0; +ApexSDK* GetApexSDK() +{ + return gApexSdk; +} +ApexSDKIntl* GetInternalApexSDK() +{ + return gApexSdk; +} + +static PxTransform getPose(float x, float y, float z, float rotX, float rotY, float rotZ) +{ + PxTransform ret; + ret.p = PxVec3(x, y, z); + fm_eulerToQuat(rotX * FM_DEG_TO_RAD, rotY * FM_DEG_TO_RAD, rotZ * FM_DEG_TO_RAD, &ret.q.x); + return ret; +} + +APEX_API Module* CALL_CONV createModule( + ApexSDKIntl* inSdk, + ModuleIntl** niRef, + uint32_t APEXsdkVersion, + uint32_t PhysXsdkVersion, + ApexCreateError* errorCode) +{ + if (APEXsdkVersion != APEX_SDK_VERSION) + { + if (errorCode) + { + *errorCode = APEX_CE_WRONG_VERSION; + } + return NULL; + } + + if (PhysXsdkVersion != PX_PHYSICS_VERSION) + { + if (errorCode) + { + *errorCode = APEX_CE_WRONG_VERSION; + } + return NULL; + } + + /* Setup common module global variables */ + gApexSdk = inSdk; + particles::ModuleParticlesImpl* impl = PX_NEW(particles::ModuleParticlesImpl)(inSdk); + *niRef = (ModuleIntl*) impl; + return (Module*) impl; +} + +#else +/* Statically linking entry function */ +void instantiateModuleParticles() +{ + ApexSDKIntl* sdk = GetInternalApexSDK(); + particles::ModuleParticlesImpl* impl = PX_NEW(particles::ModuleParticlesImpl)(sdk); + sdk->registerExternalModule((Module*) impl, (ModuleIntl*) impl); +} +#endif // `defined(_USRDLL) + +} + +namespace particles +{ + +/* === ModuleParticlesImpl Implementation === */ + +#ifdef WITHOUT_APEX_AUTHORING + +class ParticlesAssetDummyAuthoring : public AssetAuthoring, public UserAllocated +{ +public: + ParticlesAssetDummyAuthoring(ModuleParticlesImpl* module, ResourceList& list, NvParameterized::Interface* params, const char* name) + { + PX_UNUSED(module); + PX_UNUSED(list); + PX_UNUSED(params); + PX_UNUSED(name); + } + + ParticlesAssetDummyAuthoring(ModuleParticlesImpl* module, ResourceList& list, const char* name) + { + PX_UNUSED(module); + PX_UNUSED(list); + PX_UNUSED(name); + } + + ParticlesAssetDummyAuthoring(ModuleParticlesImpl* module, ResourceList& list) + { + PX_UNUSED(module); + PX_UNUSED(list); + } + + virtual void release() + { + destroy(); + } + + // internal + void destroy() + { + delete this; + } + + const char* getName(void) const + { + return NULL; + } + + + /** + * \brief Prepares a fully authored Asset Authoring object for a specified platform + */ + virtual bool prepareForPlatform(nvidia::apex::PlatformTag) + { + PX_ASSERT(0); + return false; + } + + /** + * \brief Save asset's NvParameterized interface, may return NULL + */ + virtual NvParameterized::Interface* getNvParameterized() + { + PX_ASSERT(0); + return NULL; + } + + virtual NvParameterized::Interface* releaseAndReturnNvParameterizedInterface(void) + { + PX_ALWAYS_ASSERT(); + return NULL; + } + + virtual void setToolString(const char* toolName, const char* toolVersion, uint32_t toolChangelist) + { + PX_ALWAYS_ASSERT(); + PX_UNUSED(toolName); + PX_UNUSED(toolVersion); + PX_UNUSED(toolChangelist); + } +}; + +typedef ApexAuthorableObject<ModuleParticlesImpl, ParticlesAsset, ParticlesAssetDummyAuthoring> ParticlesAO; + +#else +typedef ApexAuthorableObject<ModuleParticlesImpl, ParticlesAsset, ParticlesAssetAuthoring> ParticlesAO; +#endif + + +AuthObjTypeID EffectPackageAssetImpl::mAssetTypeID; // Static class member of ParticlesAsset + +#ifdef WITHOUT_APEX_AUTHORING + +class EffectPackageAssetDummyAuthoring : public AssetAuthoring, public UserAllocated +{ +public: + EffectPackageAssetDummyAuthoring(ModuleParticlesImpl* module, ResourceList& list, NvParameterized::Interface* params, const char* name) + { + PX_UNUSED(module); + PX_UNUSED(list); + PX_UNUSED(params); + PX_UNUSED(name); + } + + EffectPackageAssetDummyAuthoring(ModuleParticlesImpl* module, ResourceList& list, const char* name) + { + PX_UNUSED(module); + PX_UNUSED(list); + PX_UNUSED(name); + } + + EffectPackageAssetDummyAuthoring(ModuleParticlesImpl* module, ResourceList& list) + { + PX_UNUSED(module); + PX_UNUSED(list); + } + + virtual void release() + { + destroy(); + } + + // internal + void destroy() + { + delete this; + } + + const char* getName(void) const + { + return NULL; + } + + /** + * \brief Returns the name of this APEX authorable object type + */ + virtual const char* getObjTypeName() const + { + return EffectPackageAssetImpl::getClassName(); + } + + /** + * \brief Prepares a fully authored Asset Authoring object for a specified platform + */ + virtual bool prepareForPlatform(nvidia::apex::PlatformTag) + { + PX_ASSERT(0); + return false; + } + + /** + * \brief Save asset's NvParameterized interface, may return NULL + */ + virtual NvParameterized::Interface* getNvParameterized() + { + PX_ASSERT(0); + return NULL; + } + + virtual NvParameterized::Interface* releaseAndReturnNvParameterizedInterface(void) + { + PX_ALWAYS_ASSERT(); + return NULL; + } + + virtual void setToolString(const char* toolName, const char* toolVersion, uint32_t toolChangelist) + { + PX_ALWAYS_ASSERT(); + PX_UNUSED(toolName); + PX_UNUSED(toolVersion); + PX_UNUSED(toolChangelist); + } +}; + +typedef ApexAuthorableObject<ModuleParticlesImpl, EffectPackageAssetImpl, EffectPackageAssetDummyAuthoring> EffectPackageAO; + +#else +typedef ApexAuthorableObject<ModuleParticlesImpl, EffectPackageAssetImpl, EffectPackageAssetAuthoringImpl> EffectPackageAO; +#endif + + +//******************************************************************** + +#define MODULE_PARENT(x) if ( x ) { ModuleIntl *m = mSdk->getInternalModule(x); PX_ASSERT(m); m->setParent(this); m->setCreateOk(false); } + +ModuleParticlesImpl::ModuleParticlesImpl(ApexSDKIntl* inSdk) +{ + mSdk = inSdk; + + PxPhysics *sdk = mSdk->getPhysXSDK(); + mDefaultMaterial = sdk->createMaterial(1, 1, 1); + + instantiateModuleBasicIos(); // Instantiate the BasicIOS module statically + mModuleBasicIos = mSdk->createModule("BasicIOS"); + PX_ASSERT(mModuleBasicIos); + MODULE_PARENT(mModuleBasicIos); + + instantiateModuleEmitter(); // Instantiate the Emitter module statically + mModuleEmitter = mSdk->createModule("Emitter"); + PX_ASSERT(mModuleEmitter); + MODULE_PARENT(mModuleEmitter); + + instantiateModuleIofx(); // Instantiate the IOFX module statically + mModuleIofx = mSdk->createModule("IOFX"); + PX_ASSERT(mModuleIofx); + MODULE_PARENT(mModuleIofx); + + instantiateModuleFieldSampler(); // Instantiate the field sampler module statically + mModuleFieldSampler = mSdk->createModule("FieldSampler"); + PX_ASSERT(mModuleFieldSampler); + MODULE_PARENT(mModuleFieldSampler); + + instantiateModuleBasicFS(); // Instantiate the BasicFS module statically + mModuleBasicFS = mSdk->createModule("BasicFS"); + PX_ASSERT(mModuleBasicFS); + MODULE_PARENT(mModuleBasicFS); + + instantiateModuleParticleIos(); // PhysX 3.x only : Instantiate the ParticleIOS module + mModuleParticleIos = mSdk->createModule("ParticleIOS"); + PX_ASSERT(mModuleParticleIos); + MODULE_PARENT(mModuleParticleIos); + + instantiateModuleForceField(); // PhysX 3.x only : Instantiate the ForceField module + mModuleForceField = mSdk->createModule("ForceField"); + PX_ASSERT(mModuleForceField); + MODULE_PARENT(mModuleForceField); + + + mName = "Particles"; + mApiProxy = this; + mModuleParams = NULL; + mTurbulenceModule = NULL; + mGraphicsMaterialsDatabase = NULL; + mEnableScreenCulling = false; + mZnegative = false; + mUseEmitterPool = false; + + mEffectPackageIOSDatabaseParams = NULL; + mEffectPackageIOFXDatabaseParams = NULL; + mEffectPackageEmitterDatabaseParams = NULL; + mEffectPackageDatabaseParams = NULL; + mEffectPackageFieldSamplerDatabaseParams = NULL; + + { + /* Register asset type and create a namespace for it's assets */ + const char* pName = EffectPackageAssetParams::staticClassName(); + EffectPackageAO* eAO = PX_NEW(EffectPackageAO)(this, mEffectPackageAuthorableObjects, pName); + EffectPackageAssetImpl::mAssetTypeID = eAO->getResID(); + } + + /* Register the NvParameterized factories */ + NvParameterized::Traits* traits = mSdk->getParameterizedTraits(); + ModuleParticlesRegistration::invokeRegistration(traits); + + { + uint32_t count = mSdk->getNbModules(); + Module** modules = mSdk->getModules(); + for (uint32_t i = 0; i < count; i++) + { + Module* m = modules[i]; + const char* name = m->getName(); + if (nvidia::strcmp(name, "TurbulenceFS") == 0) + { + mTurbulenceModule = static_cast< ModuleTurbulenceFS*>(m); + break; + } + } + } +} + +ModuleParticlesImpl::~ModuleParticlesImpl() +{ + if ( mDefaultMaterial ) + { + mDefaultMaterial->release(); + } +} + +void ModuleParticlesImpl::destroy() +{ + // release the NvParameterized factory + NvParameterized::Traits* traits = mSdk->getParameterizedTraits(); + + if (mModuleParams) + { + mModuleParams->destroy(); + mModuleParams = NULL; + } + + SAFE_DESTROY(mEffectPackageIOSDatabaseParams); + SAFE_DESTROY(mEffectPackageIOFXDatabaseParams); + SAFE_DESTROY(mEffectPackageEmitterDatabaseParams); + SAFE_DESTROY(mEffectPackageDatabaseParams); + SAFE_DESTROY(mEffectPackageFieldSamplerDatabaseParams); + SAFE_DESTROY(mGraphicsMaterialsDatabase); + + ModuleBase::destroy(); + + if (traits) + { + /* Remove the NvParameterized factories */ + ModuleParticlesRegistration::invokeUnregistration(traits); + } + + SAFE_MODULE_RELEASE(mModuleBasicIos); + SAFE_MODULE_RELEASE(mModuleEmitter); + SAFE_MODULE_RELEASE(mModuleIofx); + SAFE_MODULE_RELEASE(mModuleFieldSampler); + SAFE_MODULE_RELEASE(mModuleBasicFS); + SAFE_MODULE_RELEASE(mModuleParticleIos); // PhysX 3.x only : Instantiate the ParticleIOS module + SAFE_MODULE_RELEASE(mModuleForceField); // PhysX 3.x only : Instantiate the ForceField module + + // clear before deletion, so that we don't call back into releaseModuleSceneIntl during "delete this" + mParticlesScenes.clear(); + + delete this; + + +} + +NvParameterized::Interface* ModuleParticlesImpl::getDefaultModuleDesc() +{ + WRITE_ZONE(); + NvParameterized::Traits* traits = mSdk->getParameterizedTraits(); + + if (!mModuleParams) + { + mModuleParams = DYNAMIC_CAST(ParticlesModuleParameters*) + (traits->createNvParameterized("ParticlesModuleParameters")); + PX_ASSERT(mModuleParams); + } + else + { + mModuleParams->initDefaults(); + } + + return mModuleParams; +} + +void ModuleParticlesImpl::init(const ModuleParticlesDesc& expDesc) +{ + WRITE_ZONE(); + mModuleValue = expDesc.moduleValue; +} + +AuthObjTypeID ModuleParticlesImpl::getParticlesAssetTypeID() const +{ +// TODO return ParticlesAsset::mAssetTypeID; + return 0; +} +AuthObjTypeID ModuleParticlesImpl::getModuleID() const +{ + READ_ZONE(); +// return ParticlesAsset::mAssetTypeID; +// TODO + return 0; +} + + +/* == Particles Scene methods == */ +ModuleSceneIntl* ModuleParticlesImpl::createInternalModuleScene(SceneIntl& scene, RenderDebugInterface* renderDebug) +{ + ModuleSceneIntl* ret = PX_NEW(ParticlesScene)(*this, scene, renderDebug, mParticlesScenes); + mScenes.pushBack(ret); + + return ret; +} + +void ModuleParticlesImpl::releaseModuleSceneIntl(ModuleSceneIntl& scene) +{ + for (uint32_t i = 0; i < mScenes.size(); ++i) + { + if (mScenes[i] == &scene) + { + mScenes.remove(i); + break; + } + } + ParticlesScene* es = DYNAMIC_CAST(ParticlesScene*)(&scene); + es->destroy(); + +} + +uint32_t ModuleParticlesImpl::forceLoadAssets() +{ + uint32_t loadedAssetCount = 0; + + for (uint32_t i = 0; i < mAuthorableObjects.getSize(); i++) + { + AuthorableObjectIntl* ao = static_cast<AuthorableObjectIntl*>(mAuthorableObjects.getResource(i)); + loadedAssetCount += ao->forceLoadAssets(); + } + + for (uint32_t i = 0; i < mEffectPackageAuthorableObjects.getSize(); i++) + { + AuthorableObjectIntl* ao = static_cast<AuthorableObjectIntl*>(mEffectPackageAuthorableObjects.getResource(i)); + loadedAssetCount += ao->forceLoadAssets(); + } + + + return loadedAssetCount; +} + +ParticlesScene* ModuleParticlesImpl::getParticlesScene(const Scene& apexScene) +{ + for (uint32_t i = 0 ; i < mParticlesScenes.getSize() ; i++) + { + ParticlesScene* es = DYNAMIC_CAST(ParticlesScene*)(mParticlesScenes.getResource(i)); + if (es->mApexScene == &apexScene) + { + return es; + } + } + + PX_ASSERT(!"Unable to locate an appropriate ParticlesScene"); + return NULL; +} + +RenderableIterator* ModuleParticlesImpl::createRenderableIterator(const Scene& apexScene) +{ + WRITE_ZONE(); + ParticlesScene* es = getParticlesScene(apexScene); + if (es) + { + return es->createRenderableIterator(); + } + + return NULL; +} + +const NvParameterized::Interface* ModuleParticlesImpl::locateVolumeRenderMaterialData(const char* name) const +{ + const NvParameterized::Interface* ret = NULL; + + if (mGraphicsMaterialsDatabase) + { + EffectPackageGraphicsMaterialsParams* d = static_cast< EffectPackageGraphicsMaterialsParams*>(mGraphicsMaterialsDatabase); + for (int32_t i = 0; i < d->GraphicsMaterials.arraySizes[0]; i++) + { + NvParameterized::Interface *ei = d->GraphicsMaterials.buf[i]; + if ( ei && nvidia::strcmp(ei->className(),"VolumeRenderMaterialData") == 0 ) + { + VolumeRenderMaterialData* e = static_cast< VolumeRenderMaterialData*>(ei); + if (e) + { + if (e->Name && nvidia::stricmp(e->Name, name) == 0) + { + ret = e; + break; + } + } + } + } + } + return ret; +} + + + +const NvParameterized::Interface* ModuleParticlesImpl::locateGraphicsMaterialData(const char* name) const +{ + READ_ZONE(); + const NvParameterized::Interface* ret = NULL; + + if (mGraphicsMaterialsDatabase) + { + EffectPackageGraphicsMaterialsParams* d = static_cast< EffectPackageGraphicsMaterialsParams*>(mGraphicsMaterialsDatabase); + for (int32_t i = 0; i < d->GraphicsMaterials.arraySizes[0]; i++) + { + NvParameterized::Interface *ei = d->GraphicsMaterials.buf[i]; + if ( ei && nvidia::strcmp(ei->className(),"GraphicsMaterialData") == 0 || nvidia::strcmp(ei->className(),"VolumeRenderMaterialData") == 0 ) + { + GraphicsMaterialData* e = static_cast< GraphicsMaterialData*>(ei); + if (e) + { + if (e->Name && nvidia::stricmp(e->Name, name) == 0) + { + ret = e; + break; + } + } + } + } + } + return ret; +} + +static bool isUnique(Array< const char* > &nameList, const char* baseName) +{ + bool ret = true; + for (uint32_t i = 0; i < nameList.size(); i++) + { + if (nvidia::stricmp(baseName, nameList[i]) == 0) + { + ret = false; + break; + } + } + return ret; +} + +static const char* getUniqueName(Array< const char* > &nameList, const char* baseName) +{ + const char* ret = baseName; + + if (baseName == NULL || strlen(baseName) == 0) + { + baseName = "default"; + } + if (!isUnique(nameList, baseName)) + { + static char uniqueName[512]; + strncpy(uniqueName, baseName, 512); + for (uint32_t i = 1; i < 1000; i++) + { + sprintf_s(uniqueName, 512, "%s%d", baseName, i); + if (isUnique(nameList, uniqueName)) + { + ret = uniqueName; + break; + } + } + } + return ret; +} + + +bool ModuleParticlesImpl::setEffectPackageGraphicsMaterialsDatabase(const NvParameterized::Interface* dataBase) +{ + WRITE_ZONE(); + bool ret = false; + if (dataBase) + { + NvParameterized::Traits* traits = mSdk->getParameterizedTraits(); + if (nvidia::strcmp(dataBase->className(), EffectPackageGraphicsMaterialsParams::staticClassName()) == 0 && dataBase != mGraphicsMaterialsDatabase) + { + if (mGraphicsMaterialsDatabase) + { + mGraphicsMaterialsDatabase->destroy(); + mGraphicsMaterialsDatabase = NULL; + } + dataBase->clone(mGraphicsMaterialsDatabase); + if ( mGraphicsMaterialsDatabase == NULL ) + { + APEX_DEBUG_WARNING("Failed to clone asset."); + mGraphicsMaterialsDatabase = traits->createNvParameterized(EffectPackageGraphicsMaterialsParams::staticClassName()); + } + ret = true; + } + else + { + // add it to the end of the existing array.. + if (nvidia::strcmp(dataBase->className(), GraphicsMaterialData::staticClassName()) == 0 || nvidia::strcmp(dataBase->className(), VolumeRenderMaterialData::staticClassName()) == 0 ) + { + bool revised = false; + const char* itemName = dataBase->name(); + EffectPackageGraphicsMaterialsParams* d = static_cast< EffectPackageGraphicsMaterialsParams*>(mGraphicsMaterialsDatabase); + if ( d ) + { + for (uint32_t i = 0; i < (uint32_t)d->GraphicsMaterials.arraySizes[0]; i++) + { + NvParameterized::Interface* ei = d->GraphicsMaterials.buf[i]; + if (!ei) + { + continue; + } + const char *materialName=NULL; + if ( nvidia::strcmp(ei->className(),"GraphicsMaterialData") == 0 ) + { + GraphicsMaterialData* ed = static_cast< GraphicsMaterialData*>(ei); + materialName = ed->Name.buf; + } + else if ( nvidia::strcmp(ei->className(),"VolumeRenderMaterialData") == 0 ) + { + VolumeRenderMaterialData* ed = static_cast< VolumeRenderMaterialData*>(ei); + materialName = ed->Name.buf; + } + else + { + PX_ALWAYS_ASSERT(); + } + if ( materialName && nvidia::stricmp(materialName, itemName) == 0) + { + ei->copy(*dataBase); + revised = true; + ret = true; + break; + } + } + if (!revised && mGraphicsMaterialsDatabase) + { + int32_t arraySize = d->GraphicsMaterials.arraySizes[0]; + NvParameterized::Handle handle(mGraphicsMaterialsDatabase); + NvParameterized::ErrorType err = handle.getParameter("GraphicsMaterials"); + PX_ASSERT(err == NvParameterized::ERROR_NONE); + err = handle.resizeArray(arraySize + 1); + PX_ASSERT(err == NvParameterized::ERROR_NONE); + if (err == NvParameterized::ERROR_NONE) + { + NvParameterized::Interface* ei = NULL; + NvParameterized::ErrorType err = dataBase->clone(ei); + if ( err != NvParameterized::ERROR_NONE || ei == NULL ) + { + APEX_DEBUG_WARNING("Failed to clone asset."); + } + else + { + NvParameterized::Handle item(ei); + err = item.getParameter("Name"); + PX_ASSERT(err == NvParameterized::ERROR_NONE); + item.setParamString(itemName); + ei->setName(itemName); + d->GraphicsMaterials.buf[arraySize] = ei; + } + ret = true; + } + } + } + } + } + + if (mGraphicsMaterialsDatabase) + { + EffectPackageGraphicsMaterialsParams* ds = static_cast< EffectPackageGraphicsMaterialsParams*>(mGraphicsMaterialsDatabase); + if (ds->GraphicsMaterials.arraySizes[0] == 0) + { + NvParameterized::Handle handle(mGraphicsMaterialsDatabase); + NvParameterized::ErrorType err = handle.getParameter("GraphicsMaterials"); + PX_ASSERT(err == NvParameterized::ERROR_NONE); + err = handle.resizeArray(2); + PX_ASSERT(err == NvParameterized::ERROR_NONE); + NvParameterized::Interface* ei; + if (err == NvParameterized::ERROR_NONE) + { + ei = traits->createNvParameterized(GraphicsMaterialData::staticClassName()); + ds->GraphicsMaterials.buf[0] = ei; + ei = traits->createNvParameterized(VolumeRenderMaterialData::staticClassName()); + ds->GraphicsMaterials.buf[1] = ei; + } + } + + Array< const char* > nameList; + for (int32_t i = 0; i < ds->GraphicsMaterials.arraySizes[0]; i++) + { + NvParameterized::Interface *ei = ds->GraphicsMaterials.buf[i]; + if ( !ei ) + continue; + const char *materialName=NULL; + if ( nvidia::strcmp(ei->className(),"GraphicsMaterialData") == 0 ) + { + GraphicsMaterialData* e = static_cast< GraphicsMaterialData*>(ei); + if (e) + { + materialName = e->Name; + } + } + else if ( nvidia::strcmp(ei->className(),"VolumeRenderMaterialData") == 0 ) + { + VolumeRenderMaterialData* e = static_cast< VolumeRenderMaterialData*>(ei); + if (e) + { + materialName = e->Name.buf; + } + } + else + { + PX_ALWAYS_ASSERT(); + } + if ( materialName ) + { + for (uint32_t j = 0; j < nameList.size(); j++) + { + if (nvidia::stricmp(nameList[j], materialName) == 0) + { + NvParameterized::Handle handle(ei); + NvParameterized::ErrorType err = handle.getParameter("Name"); + PX_ASSERT(err == NvParameterized::ERROR_NONE); + if (err == NvParameterized::ERROR_NONE) + { + materialName = getUniqueName(nameList, materialName); + handle.setParamString(materialName); + ret = true; + break; + } + } + } + nameList.pushBack(materialName); + } + } + } + } + return ret; +} + + +const NvParameterized::Interface* ModuleParticlesImpl::getEffectPackageGraphicsMaterialsDatabase(void) const +{ + READ_ZONE(); + return mGraphicsMaterialsDatabase; +} + + +NvParameterized::Interface* ModuleParticlesImpl::locateResource(const char* resourceName, const char* nameSpace) +{ + WRITE_ZONE(); + NvParameterized::Interface* ret = NULL; + + if (mEffectPackageDatabaseParams == NULL) + { + return NULL; + } + + if (nvidia::strcmp(nameSpace, PARTICLES_EFFECT_PACKAGE_AUTHORING_TYPE_NAME) == 0) + { + EffectPackageDatabaseParams* d = static_cast< EffectPackageDatabaseParams*>(mEffectPackageDatabaseParams); + if ( d ) + { + for (uint32_t i = 0; i < (uint32_t)d->EffectPackages.arraySizes[0]; i++) + { + NvParameterized::Interface* ei = d->EffectPackages.buf[i]; + if (!ei) + { + continue; + } + EffectPackageData* ed = static_cast< EffectPackageData*>(ei); + if (nvidia::stricmp(ed->Name, resourceName) == 0) + { + ret = ed->EffectPackage; + break; + } + } + } + } + else if (nvidia::strcmp(nameSpace, APEX_MATERIALS_NAME_SPACE) == 0 || nvidia::strcmp(nameSpace,"GraphicsMaterialData") == 0 ) + { + EffectPackageGraphicsMaterialsParams* d = static_cast< EffectPackageGraphicsMaterialsParams*>(mGraphicsMaterialsDatabase); + if ( d ) + { + for (uint32_t i = 0; i < (uint32_t)d->GraphicsMaterials.arraySizes[0]; i++) + { + NvParameterized::Interface* ei = d->GraphicsMaterials.buf[i]; + if (!ei) + { + continue; + } + if ( nvidia::strcmp(ei->className(),"GraphicsMaterialData") == 0 ) + { + GraphicsMaterialData* ed = static_cast< GraphicsMaterialData*>(ei); + if ( nvidia::strcmp(ed->Name,resourceName) == 0 ) + { + ret = ei; + break; + } + } + } + } + } + else if (nvidia::strcmp(nameSpace, APEX_VOLUME_RENDER_MATERIALS_NAME_SPACE) == 0 || nvidia::strcmp(nameSpace,"VolumeRenderMaterialData") == 0 ) + { + EffectPackageGraphicsMaterialsParams* d = static_cast< EffectPackageGraphicsMaterialsParams*>(mGraphicsMaterialsDatabase); + if ( d ) + { + for (uint32_t i = 0; i < (uint32_t)d->GraphicsMaterials.arraySizes[0]; i++) + { + NvParameterized::Interface* ei = d->GraphicsMaterials.buf[i]; + if (!ei) + { + continue; + } + if ( nvidia::strcmp(ei->className(),"VolumeRenderMaterialData") == 0 ) + { + VolumeRenderMaterialData* ed = static_cast< VolumeRenderMaterialData*>(ei); + if ( nvidia::strcmp(ed->Name,resourceName) == 0 ) + { + ret = ei; + break; + } + } + } + } + } + else if (nvidia::strcmp(nameSpace, IOFX_AUTHORING_TYPE_NAME) == 0 || nvidia::strcmp(nameSpace, "GraphicsEffectData") == 0 ) + { + EffectPackageIOFXDatabaseParams* d = static_cast< EffectPackageIOFXDatabaseParams*>(mEffectPackageIOFXDatabaseParams); + if ( d ) + { + for (uint32_t i = 0; i < (uint32_t)d->GraphicsEffects.arraySizes[0]; i++) + { + NvParameterized::Interface* ei = d->GraphicsEffects.buf[i]; + if (!ei) + { + continue; + } + GraphicsEffectData* ed = static_cast< GraphicsEffectData*>(ei); + if (nvidia::stricmp(resourceName, ed->Name) == 0) + { + if (nvidia::strcmp(nameSpace, IOFX_AUTHORING_TYPE_NAME) == 0 ) + { + ret = ed->IOFX; + } + else + { + ret = ed; + } + break; + } + } + } + } + else if (nvidia::strcmp(nameSpace, "ParticleSimulationData") == 0) + { + EffectPackageIOSDatabaseParams* d = static_cast< EffectPackageIOSDatabaseParams*>(mEffectPackageIOSDatabaseParams); + if ( d ) + { + for (uint32_t i = 0; i < (uint32_t)d->ParticleSimulations.arraySizes[0]; i++) + { + NvParameterized::Interface* ei = d->ParticleSimulations.buf[i]; + if (!ei) + { + continue; + } + ParticleSimulationData* ed = static_cast< ParticleSimulationData*>(ei); + if (nvidia::stricmp(ed->Name, resourceName) == 0) + { + ret = ei; + break; + } + } + } + } + else if (nvidia::strcmp(nameSpace, BASIC_IOS_AUTHORING_TYPE_NAME) == 0) + { + EffectPackageIOSDatabaseParams* d = static_cast< EffectPackageIOSDatabaseParams*>(mEffectPackageIOSDatabaseParams); + if ( d ) + { + for (uint32_t i = 0; i < (uint32_t)d->ParticleSimulations.arraySizes[0]; i++) + { + NvParameterized::Interface* ei = d->ParticleSimulations.buf[i]; + if (!ei) + { + continue; + } + ParticleSimulationData* ed = static_cast< ParticleSimulationData*>(ei); + if (nvidia::strcmp(ed->IOS->className(), basicios::BasicIOSAssetParam::staticClassName()) == 0) + { + if (nvidia::stricmp(ed->Name, resourceName) == 0) + { + ret = ed->IOS; + break; + } + } + } + } + } + else if (nvidia::strcmp(nameSpace, PARTICLE_IOS_AUTHORING_TYPE_NAME) == 0) + { + EffectPackageIOSDatabaseParams* d = static_cast< EffectPackageIOSDatabaseParams*>(mEffectPackageIOSDatabaseParams); + if ( d ) + { + for (uint32_t i = 0; i < (uint32_t)d->ParticleSimulations.arraySizes[0]; i++) + { + NvParameterized::Interface* ei = d->ParticleSimulations.buf[i]; + if (!ei) + { + continue; + } + ParticleSimulationData* ed = static_cast< ParticleSimulationData*>(ei); + if (nvidia::strcmp(ed->IOS->className(), pxparticleios::ParticleIosAssetParam::staticClassName()) == 0) + { + if (nvidia::stricmp(ed->Name, resourceName) == 0) + { + ret = ed->IOS; + break; + } + } + } + } + } + else if (nvidia::strcmp(nameSpace, EMITTER_AUTHORING_TYPE_NAME) == 0 || nvidia::strcmp(nameSpace,"EmitterData") == 0 ) + { + EffectPackageEmitterDatabaseParams* d = static_cast< EffectPackageEmitterDatabaseParams*>(mEffectPackageEmitterDatabaseParams); + if ( d ) + { + for (uint32_t i = 0; i < (uint32_t)d->Emitters.arraySizes[0]; i++) + { + NvParameterized::Interface* ei = d->Emitters.buf[i]; + if (!ei) + { + continue; + } + EmitterData* ed = static_cast< EmitterData*>(ei); + if (nvidia::stricmp(resourceName, ed->Name) == 0) + { + if ( nvidia::strcmp(nameSpace, EMITTER_AUTHORING_TYPE_NAME) == 0 ) + { + ret = ed->Emitter; + } + else + { + ret = ed; + } + break; + } + } + } + } + else if (nvidia::strcmp(nameSpace, HEAT_SOURCE_AUTHORING_TYPE_NAME) == 0 || nvidia::strcmp(nameSpace, "HeatSourceData") == 0 ) + { + EffectPackageFieldSamplerDatabaseParams* d = static_cast< EffectPackageFieldSamplerDatabaseParams*>(mEffectPackageFieldSamplerDatabaseParams); + if ( d ) + { + for (uint32_t i = 0; i < (uint32_t)d->FieldSamplers.arraySizes[0]; i++) + { + NvParameterized::Interface* ei = d->FieldSamplers.buf[i]; + if (!ei) + { + continue; + } + if (nvidia::strcmp(ei->className(), HeatSourceData::staticClassName()) != 0) + { + continue; + } + HeatSourceData* ed = static_cast< HeatSourceData*>(ei); + if (nvidia::stricmp(ed->Name, resourceName) == 0) + { + if (nvidia::strcmp(nameSpace, HEAT_SOURCE_AUTHORING_TYPE_NAME) == 0 ) + { + ret = ed->HeatSource; + } + else + { + ret = ed; + } + break; + } + } + } + } + else if (nvidia::strcmp(nameSpace, SUBSTANCE_SOURCE_AUTHORING_TYPE_NAME) == 0 || nvidia::strcmp(nameSpace, "SubstanceSourceData") == 0 ) + { + EffectPackageFieldSamplerDatabaseParams* d = static_cast< EffectPackageFieldSamplerDatabaseParams*>(mEffectPackageFieldSamplerDatabaseParams); + if ( d ) + { + for (uint32_t i = 0; i < (uint32_t)d->FieldSamplers.arraySizes[0]; i++) + { + NvParameterized::Interface* ei = d->FieldSamplers.buf[i]; + if (!ei) + { + continue; + } + if (nvidia::strcmp(ei->className(), SubstanceSourceData::staticClassName()) != 0) + { + continue; + } + SubstanceSourceData* ed = static_cast< SubstanceSourceData*>(ei); + if (nvidia::stricmp(ed->Name, resourceName) == 0) + { + if (nvidia::strcmp(nameSpace, SUBSTANCE_SOURCE_AUTHORING_TYPE_NAME) == 0 ) + { + ret = ed->SubstanceSource; + } + else + { + ret = ed; + } + break; + } + } + } + } + else if (nvidia::strcmp(nameSpace, VELOCITY_SOURCE_AUTHORING_TYPE_NAME) == 0 || nvidia::strcmp(nameSpace, "VelocitySourceData") == 0 ) + { + EffectPackageFieldSamplerDatabaseParams* d = static_cast< EffectPackageFieldSamplerDatabaseParams*>(mEffectPackageFieldSamplerDatabaseParams); + if ( d ) + { + for (uint32_t i = 0; i < (uint32_t)d->FieldSamplers.arraySizes[0]; i++) + { + NvParameterized::Interface* ei = d->FieldSamplers.buf[i]; + if (!ei) + { + continue; + } + if (nvidia::strcmp(ei->className(), VelocitySourceData::staticClassName()) != 0) + { + continue; + } + VelocitySourceData* ed = static_cast< VelocitySourceData*>(ei); + if (nvidia::stricmp(ed->Name, resourceName) == 0) + { + if (nvidia::strcmp(nameSpace, VELOCITY_SOURCE_AUTHORING_TYPE_NAME) == 0 ) + { + ret = ed->VelocitySource; + } + else + { + ret = ed; + } + break; + } + } + } + } + else if (nvidia::strcmp(nameSpace, JET_FS_AUTHORING_TYPE_NAME) == 0 || nvidia::strcmp(nameSpace, "JetFieldSamplerData") == 0 ) + { + EffectPackageFieldSamplerDatabaseParams* d = static_cast< EffectPackageFieldSamplerDatabaseParams*>(mEffectPackageFieldSamplerDatabaseParams); + if ( d ) + { + for (uint32_t i = 0; i < (uint32_t)d->FieldSamplers.arraySizes[0]; i++) + { + NvParameterized::Interface* ei = d->FieldSamplers.buf[i]; + if (!ei) + { + continue; + } + if (nvidia::strcmp(ei->className(), JetFieldSamplerData::staticClassName()) != 0) + { + continue; + } + JetFieldSamplerData* ed = static_cast< JetFieldSamplerData*>(ei); + if (nvidia::stricmp(ed->Name, resourceName) == 0) + { + if (nvidia::strcmp(nameSpace, JET_FS_AUTHORING_TYPE_NAME) == 0 ) + { + ret = ed->JetFieldSampler; + } + else + { + ret = ed; + } + break; + } + } + } + } + else if (nvidia::strcmp(nameSpace, WIND_FS_AUTHORING_TYPE_NAME) == 0 || nvidia::strcmp(nameSpace, "WindFieldSamplerData") == 0 ) + { + EffectPackageFieldSamplerDatabaseParams* d = static_cast< EffectPackageFieldSamplerDatabaseParams*>(mEffectPackageFieldSamplerDatabaseParams); + if ( d ) + { + for (uint32_t i = 0; i < (uint32_t)d->FieldSamplers.arraySizes[0]; i++) + { + NvParameterized::Interface* ei = d->FieldSamplers.buf[i]; + if (!ei) + { + continue; + } + if (nvidia::strcmp(ei->className(), WindFieldSamplerData::staticClassName()) != 0) + { + continue; + } + WindFieldSamplerData* ed = static_cast< WindFieldSamplerData*>(ei); + if (nvidia::stricmp(ed->Name, resourceName) == 0) + { + if (nvidia::strcmp(nameSpace, WIND_FS_AUTHORING_TYPE_NAME) == 0 ) + { + ret = ed->WindFieldSampler; + } + else + { + ret = ed; + } + break; + } + } + } + } + else if (nvidia::strcmp(nameSpace, VORTEX_FS_AUTHORING_TYPE_NAME) == 0 || nvidia::strcmp(nameSpace, "VortexFieldSamplerData") == 0 ) + { + EffectPackageFieldSamplerDatabaseParams* d = static_cast< EffectPackageFieldSamplerDatabaseParams*>(mEffectPackageFieldSamplerDatabaseParams); + if ( d ) + { + for (uint32_t i = 0; i < (uint32_t)d->FieldSamplers.arraySizes[0]; i++) + { + NvParameterized::Interface* ei = d->FieldSamplers.buf[i]; + if (!ei) + { + continue; + } + if (nvidia::strcmp(ei->className(), VortexFieldSamplerData::staticClassName()) != 0) + { + continue; + } + VortexFieldSamplerData* ed = static_cast< VortexFieldSamplerData*>(ei); + if (nvidia::stricmp(ed->Name, resourceName) == 0) + { + if (nvidia::strcmp(nameSpace, VORTEX_FS_AUTHORING_TYPE_NAME) == 0 ) + { + ret = ed->VortexFieldSampler; + } + else + { + ret = ed; + } + break; + } + } + } + } + else if (nvidia::strcmp(nameSpace, NOISE_FS_AUTHORING_TYPE_NAME) == 0 || nvidia::strcmp(nameSpace, "NoiseFieldSamplerData") == 0 ) + { + EffectPackageFieldSamplerDatabaseParams* d = static_cast< EffectPackageFieldSamplerDatabaseParams*>(mEffectPackageFieldSamplerDatabaseParams); + if ( d ) + { + for (uint32_t i = 0; i < (uint32_t)d->FieldSamplers.arraySizes[0]; i++) + { + NvParameterized::Interface* ei = d->FieldSamplers.buf[i]; + if (!ei) + { + continue; + } + if (nvidia::strcmp(ei->className(), NoiseFieldSamplerData::staticClassName()) != 0) + { + continue; + } + NoiseFieldSamplerData* ed = static_cast< NoiseFieldSamplerData*>(ei); + if (nvidia::stricmp(ed->Name, resourceName) == 0) + { + if (nvidia::strcmp(nameSpace, NOISE_FS_AUTHORING_TYPE_NAME) == 0 ) + { + ret = ed->NoiseFieldSampler; + } + else + { + ret = ed; + } + break; + } + } + } + } + else if (nvidia::strcmp(nameSpace, ATTRACTOR_FS_AUTHORING_TYPE_NAME) == 0 || nvidia::strcmp(nameSpace, "AttractorFieldSamplerData") == 0 ) + { + EffectPackageFieldSamplerDatabaseParams* d = static_cast< EffectPackageFieldSamplerDatabaseParams*>(mEffectPackageFieldSamplerDatabaseParams); + if ( d ) + { + for (uint32_t i = 0; i < (uint32_t)d->FieldSamplers.arraySizes[0]; i++) + { + NvParameterized::Interface* ei = d->FieldSamplers.buf[i]; + if (!ei) + { + continue; + } + if (nvidia::strcmp(ei->className(), AttractorFieldSamplerData::staticClassName()) != 0) + { + continue; + } + AttractorFieldSamplerData* ed = static_cast< AttractorFieldSamplerData*>(ei); + if (nvidia::stricmp(ed->Name, resourceName) == 0) + { + if (nvidia::strcmp(nameSpace, ATTRACTOR_FS_AUTHORING_TYPE_NAME) == 0 ) + { + ret = ed->AttractorFieldSampler; + } + else + { + ret = ed; + } + break; + } + } + } + } + else if (nvidia::strcmp(nameSpace, TURBULENCE_FS_AUTHORING_TYPE_NAME) == 0 || nvidia::strcmp(nameSpace, "TurbulenceFieldSamplerData") == 0) + { + EffectPackageFieldSamplerDatabaseParams* d = static_cast< EffectPackageFieldSamplerDatabaseParams*>(mEffectPackageFieldSamplerDatabaseParams); + if ( d ) + { + for (uint32_t i = 0; i < (uint32_t)d->FieldSamplers.arraySizes[0]; i++) + { + NvParameterized::Interface* ei = d->FieldSamplers.buf[i]; + if (!ei) + { + continue; + } + if (nvidia::strcmp(ei->className(), TurbulenceFieldSamplerData::staticClassName()) != 0) + { + continue; + } + TurbulenceFieldSamplerData* ed = static_cast< TurbulenceFieldSamplerData*>(ei); + if (nvidia::stricmp(ed->Name, resourceName) == 0) + { + if (nvidia::strcmp(nameSpace, TURBULENCE_FS_AUTHORING_TYPE_NAME) == 0 ) + { + ret = ed->TurbulenceFieldSampler; + } + else + { + ret = ed; + } + break; + } + } + } + } + else if (nvidia::strcmp(nameSpace, FORCEFIELD_AUTHORING_TYPE_NAME) == 0 || nvidia::strcmp(nameSpace, "ForceFieldData") == 0) + { + EffectPackageFieldSamplerDatabaseParams* d = static_cast< EffectPackageFieldSamplerDatabaseParams*>(mEffectPackageFieldSamplerDatabaseParams); + if ( d ) + { + for (uint32_t i = 0; i < (uint32_t)d->FieldSamplers.arraySizes[0]; i++) + { + NvParameterized::Interface* ei = d->FieldSamplers.buf[i]; + if (!ei) + { + continue; + } + if (nvidia::strcmp(ei->className(), ForceFieldData::staticClassName()) != 0) + { + continue; + } + ForceFieldData* ed = static_cast< ForceFieldData*>(ei); + if (nvidia::stricmp(ed->Name, resourceName) == 0) + { + if (nvidia::strcmp(nameSpace, FORCEFIELD_AUTHORING_TYPE_NAME) == 0 ) + { + ret = ed->ForceField; + } + else + { + ret = ed; + } + break; + } + } + } + } + else if (nvidia::strcmp(nameSpace, FLAME_EMITTER_AUTHORING_TYPE_NAME) == 0 || nvidia::strcmp(nameSpace, "FlameEmitterData") == 0) + { + EffectPackageFieldSamplerDatabaseParams* d = static_cast< EffectPackageFieldSamplerDatabaseParams*>(mEffectPackageFieldSamplerDatabaseParams); + if ( d ) + { + for (uint32_t i = 0; i < (uint32_t)d->FieldSamplers.arraySizes[0]; i++) + { + NvParameterized::Interface* ei = d->FieldSamplers.buf[i]; + if (!ei) + { + continue; + } + if (nvidia::strcmp(ei->className(), FlameEmitterData::staticClassName()) != 0) + { + continue; + } + FlameEmitterData* ed = static_cast< FlameEmitterData*>(ei); + if (nvidia::stricmp(ed->Name, resourceName) == 0) + { + if (nvidia::strcmp(nameSpace, FLAME_EMITTER_AUTHORING_TYPE_NAME) == 0 ) + { + ret = ed->FlameEmitter; + } + else + { + ret = ed; + } + break; + } + } + } + } + + return ret; +} + + + + +const char** ModuleParticlesImpl::getResourceNames(const char* nameSpace, uint32_t& nameCount, const char** &variants) +{ + READ_ZONE(); + const char** ret = NULL; + + variants = NULL; + mTempNames.clear(); + mTempVariantNames.clear(); + + if (nvidia::strcmp(nameSpace, IOFX_AUTHORING_TYPE_NAME) == 0) + { + EffectPackageIOFXDatabaseParams* d = static_cast< EffectPackageIOFXDatabaseParams*>(mEffectPackageIOFXDatabaseParams); + if ( d ) + { + for (uint32_t i = 0; i < (uint32_t)d->GraphicsEffects.arraySizes[0]; i++) + { + NvParameterized::Interface* ei = d->GraphicsEffects.buf[i]; + if (!ei) + { + continue; + } + GraphicsEffectData* ed = static_cast< GraphicsEffectData*>(ei); + mTempNames.pushBack(ed->Name); + mTempVariantNames.pushBack(IOFX_AUTHORING_TYPE_NAME); + } + } + } + else if (nvidia::strcmp(nameSpace, APEX_MATERIALS_NAME_SPACE) == 0) + { + EffectPackageGraphicsMaterialsParams* d = static_cast< EffectPackageGraphicsMaterialsParams*>(mGraphicsMaterialsDatabase); + if ( d ) + { + for (uint32_t i = 0; i < (uint32_t)d->GraphicsMaterials.arraySizes[0]; i++) + { + NvParameterized::Interface* ei = d->GraphicsMaterials.buf[i]; + if (!ei) + { + continue; + } + if ( nvidia::strcmp(ei->className(),"GraphicsMaterialData") == 0 ) + { + GraphicsMaterialData* ed = static_cast< GraphicsMaterialData*>(ei); + mTempNames.pushBack(ed->Name); + mTempVariantNames.pushBack(APEX_MATERIALS_NAME_SPACE); + } + } + } + } + else if (nvidia::strcmp(nameSpace, APEX_VOLUME_RENDER_MATERIALS_NAME_SPACE) == 0) + { + EffectPackageGraphicsMaterialsParams* d = static_cast< EffectPackageGraphicsMaterialsParams*>(mGraphicsMaterialsDatabase); + if ( d ) + { + for (uint32_t i = 0; i < (uint32_t)d->GraphicsMaterials.arraySizes[0]; i++) + { + NvParameterized::Interface* ei = d->GraphicsMaterials.buf[i]; + if (!ei) + { + continue; + } + if ( nvidia::strcmp(ei->className(),"VolumeRenderMaterialData") == 0 ) + { + VolumeRenderMaterialData* ed = static_cast< VolumeRenderMaterialData*>(ei); + mTempNames.pushBack(ed->Name); + mTempVariantNames.pushBack(APEX_VOLUME_RENDER_MATERIALS_NAME_SPACE); + } + } + } + } + else if (nvidia::strcmp(nameSpace, BASIC_IOS_AUTHORING_TYPE_NAME) == 0 || nvidia::strcmp(nameSpace, PARTICLE_IOS_AUTHORING_TYPE_NAME) == 0) + { + EffectPackageIOSDatabaseParams* d = static_cast< EffectPackageIOSDatabaseParams*>(mEffectPackageIOSDatabaseParams); + if ( d ) + { + for (uint32_t i = 0; i < (uint32_t)d->ParticleSimulations.arraySizes[0]; i++) + { + NvParameterized::Interface* ei = d->ParticleSimulations.buf[i]; + if (!ei) + { + continue; + } + ParticleSimulationData* ed = static_cast< ParticleSimulationData*>(ei); + mTempNames.pushBack(ed->Name); + if (nvidia::strcmp(ed->IOS->className(), basicios::BasicIOSAssetParam::staticClassName()) == 0) + { + mTempVariantNames.pushBack(BASIC_IOS_AUTHORING_TYPE_NAME); + } + else + { + mTempVariantNames.pushBack(PARTICLE_IOS_AUTHORING_TYPE_NAME); + } + } + } + } + else if (nvidia::strcmp(nameSpace, EMITTER_AUTHORING_TYPE_NAME) == 0) + { + EffectPackageEmitterDatabaseParams* d = static_cast< EffectPackageEmitterDatabaseParams*>(mEffectPackageEmitterDatabaseParams); + if ( d ) + { + for (uint32_t i = 0; i < (uint32_t)d->Emitters.arraySizes[0]; i++) + { + NvParameterized::Interface* ei = d->Emitters.buf[i]; + if (!ei) + { + continue; + } + EmitterData* ed = static_cast< EmitterData*>(ei); + mTempNames.pushBack(ed->Name); + mTempVariantNames.pushBack(EMITTER_AUTHORING_TYPE_NAME); + } + } + } + else if (nvidia::strcmp(nameSpace, HEAT_SOURCE_AUTHORING_TYPE_NAME) == 0) + { + EffectPackageFieldSamplerDatabaseParams* d = static_cast< EffectPackageFieldSamplerDatabaseParams*>(mEffectPackageFieldSamplerDatabaseParams); + if ( d ) + { + for (uint32_t i = 0; i < (uint32_t)d->FieldSamplers.arraySizes[0]; i++) + { + NvParameterized::Interface* ei = d->FieldSamplers.buf[i]; + if (!ei) + { + continue; + } + if (nvidia::strcmp(ei->className(), HeatSourceData::staticClassName()) != 0) + { + continue; + } + HeatSourceData* ed = static_cast< HeatSourceData*>(ei); + mTempNames.pushBack(ed->Name); + mTempVariantNames.pushBack(HEAT_SOURCE_AUTHORING_TYPE_NAME); + } + } + } + else if (nvidia::strcmp(nameSpace, SUBSTANCE_SOURCE_AUTHORING_TYPE_NAME) == 0) + { + EffectPackageFieldSamplerDatabaseParams* d = static_cast< EffectPackageFieldSamplerDatabaseParams*>(mEffectPackageFieldSamplerDatabaseParams); + if ( d ) + { + for (uint32_t i = 0; i < (uint32_t)d->FieldSamplers.arraySizes[0]; i++) + { + NvParameterized::Interface* ei = d->FieldSamplers.buf[i]; + if (!ei) + { + continue; + } + if (nvidia::strcmp(ei->className(), SubstanceSourceData::staticClassName()) != 0) + { + continue; + } + SubstanceSourceData* ed = static_cast< SubstanceSourceData*>(ei); + mTempNames.pushBack(ed->Name); + mTempVariantNames.pushBack(SUBSTANCE_SOURCE_AUTHORING_TYPE_NAME); + } + } + } + else if (nvidia::strcmp(nameSpace, VELOCITY_SOURCE_AUTHORING_TYPE_NAME) == 0) + { + EffectPackageFieldSamplerDatabaseParams* d = static_cast< EffectPackageFieldSamplerDatabaseParams*>(mEffectPackageFieldSamplerDatabaseParams); + if ( d ) + { + for (uint32_t i = 0; i < (uint32_t)d->FieldSamplers.arraySizes[0]; i++) + { + NvParameterized::Interface* ei = d->FieldSamplers.buf[i]; + if (!ei) + { + continue; + } + if (nvidia::strcmp(ei->className(), VelocitySourceData::staticClassName()) != 0) + { + continue; + } + VelocitySourceData* ed = static_cast< VelocitySourceData*>(ei); + mTempNames.pushBack(ed->Name); + mTempVariantNames.pushBack(SUBSTANCE_SOURCE_AUTHORING_TYPE_NAME); + } + } + } + else if (nvidia::strcmp(nameSpace, JET_FS_AUTHORING_TYPE_NAME) == 0) + { + EffectPackageFieldSamplerDatabaseParams* d = static_cast< EffectPackageFieldSamplerDatabaseParams*>(mEffectPackageFieldSamplerDatabaseParams); + if ( d ) + { + for (uint32_t i = 0; i < (uint32_t)d->FieldSamplers.arraySizes[0]; i++) + { + NvParameterized::Interface* ei = d->FieldSamplers.buf[i]; + if (!ei) + { + continue; + } + if (nvidia::strcmp(ei->className(), JetFieldSamplerData::staticClassName()) != 0) + { + continue; + } + JetFieldSamplerData* ed = static_cast< JetFieldSamplerData*>(ei); + mTempNames.pushBack(ed->Name); + mTempVariantNames.pushBack(JET_FS_AUTHORING_TYPE_NAME); + } + } + } + else if (nvidia::strcmp(nameSpace, WIND_FS_AUTHORING_TYPE_NAME) == 0) + { + EffectPackageFieldSamplerDatabaseParams* d = static_cast< EffectPackageFieldSamplerDatabaseParams*>(mEffectPackageFieldSamplerDatabaseParams); + if ( d ) + { + for (uint32_t i = 0; i < (uint32_t)d->FieldSamplers.arraySizes[0]; i++) + { + NvParameterized::Interface* ei = d->FieldSamplers.buf[i]; + if (!ei) + { + continue; + } + if (nvidia::strcmp(ei->className(), WindFieldSamplerData::staticClassName()) != 0) + { + continue; + } + WindFieldSamplerData* ed = static_cast< WindFieldSamplerData*>(ei); + mTempNames.pushBack(ed->Name); + mTempVariantNames.pushBack(WIND_FS_AUTHORING_TYPE_NAME); + } + } + } + else if (nvidia::strcmp(nameSpace, NOISE_FS_AUTHORING_TYPE_NAME) == 0) + { + EffectPackageFieldSamplerDatabaseParams* d = static_cast< EffectPackageFieldSamplerDatabaseParams*>(mEffectPackageFieldSamplerDatabaseParams); + if ( d ) + { + for (uint32_t i = 0; i < (uint32_t)d->FieldSamplers.arraySizes[0]; i++) + { + NvParameterized::Interface* ei = d->FieldSamplers.buf[i]; + if (!ei) + { + continue; + } + if (nvidia::strcmp(ei->className(), NoiseFieldSamplerData::staticClassName()) != 0) + { + continue; + } + NoiseFieldSamplerData* ed = static_cast< NoiseFieldSamplerData*>(ei); + mTempNames.pushBack(ed->Name); + mTempVariantNames.pushBack(NOISE_FS_AUTHORING_TYPE_NAME); + } + } + } + else if (nvidia::strcmp(nameSpace, VORTEX_FS_AUTHORING_TYPE_NAME) == 0) + { + EffectPackageFieldSamplerDatabaseParams* d = static_cast< EffectPackageFieldSamplerDatabaseParams*>(mEffectPackageFieldSamplerDatabaseParams); + if ( d ) + { + for (uint32_t i = 0; i < (uint32_t)d->FieldSamplers.arraySizes[0]; i++) + { + NvParameterized::Interface* ei = d->FieldSamplers.buf[i]; + if (!ei) + { + continue; + } + if (nvidia::strcmp(ei->className(), VortexFieldSamplerData::staticClassName()) != 0) + { + continue; + } + VortexFieldSamplerData* ed = static_cast< VortexFieldSamplerData*>(ei); + mTempNames.pushBack(ed->Name); + mTempVariantNames.pushBack(VORTEX_FS_AUTHORING_TYPE_NAME); + } + } + } + else if (nvidia::strcmp(nameSpace, ATTRACTOR_FS_AUTHORING_TYPE_NAME) == 0) + { + EffectPackageFieldSamplerDatabaseParams* d = static_cast< EffectPackageFieldSamplerDatabaseParams*>(mEffectPackageFieldSamplerDatabaseParams); + if ( d ) + { + for (uint32_t i = 0; i < (uint32_t)d->FieldSamplers.arraySizes[0]; i++) + { + NvParameterized::Interface* ei = d->FieldSamplers.buf[i]; + if (!ei) + { + continue; + } + if (nvidia::strcmp(ei->className(), AttractorFieldSamplerData::staticClassName()) != 0) + { + continue; + } + AttractorFieldSamplerData* ed = static_cast< AttractorFieldSamplerData*>(ei); + mTempNames.pushBack(ed->Name); + mTempVariantNames.pushBack(ATTRACTOR_FS_AUTHORING_TYPE_NAME); + } + } + } + else if (nvidia::strcmp(nameSpace, TURBULENCE_FS_AUTHORING_TYPE_NAME) == 0) + { + EffectPackageFieldSamplerDatabaseParams* d = static_cast< EffectPackageFieldSamplerDatabaseParams*>(mEffectPackageFieldSamplerDatabaseParams); + if ( d ) + { + for (uint32_t i = 0; i < (uint32_t)d->FieldSamplers.arraySizes[0]; i++) + { + NvParameterized::Interface* ei = d->FieldSamplers.buf[i]; + if (!ei) + { + continue; + } + if (nvidia::strcmp(ei->className(), TurbulenceFieldSamplerData::staticClassName()) != 0) + { + continue; + } + TurbulenceFieldSamplerData* ed = static_cast< TurbulenceFieldSamplerData*>(ei); + mTempNames.pushBack(ed->Name); + mTempVariantNames.pushBack(TURBULENCE_FS_AUTHORING_TYPE_NAME); + } + } + } + else if (nvidia::strcmp(nameSpace, FORCEFIELD_AUTHORING_TYPE_NAME) == 0) + { + EffectPackageFieldSamplerDatabaseParams* d = static_cast< EffectPackageFieldSamplerDatabaseParams*>(mEffectPackageFieldSamplerDatabaseParams); + if ( d ) + { + for (uint32_t i = 0; i < (uint32_t)d->FieldSamplers.arraySizes[0]; i++) + { + NvParameterized::Interface* ei = d->FieldSamplers.buf[i]; + if (!ei) + { + continue; + } + if (nvidia::strcmp(ei->className(), ForceFieldData::staticClassName()) != 0) + { + continue; + } + ForceFieldData* ed = static_cast< ForceFieldData*>(ei); + mTempNames.pushBack(ed->Name); + mTempVariantNames.pushBack(FORCEFIELD_AUTHORING_TYPE_NAME); + } + } + } + else if (nvidia::strcmp(nameSpace, FLAME_EMITTER_AUTHORING_TYPE_NAME) == 0) + { + EffectPackageFieldSamplerDatabaseParams* d = static_cast< EffectPackageFieldSamplerDatabaseParams*>(mEffectPackageFieldSamplerDatabaseParams); + if ( d ) + { + for (uint32_t i = 0; i < (uint32_t)d->FieldSamplers.arraySizes[0]; i++) + { + NvParameterized::Interface* ei = d->FieldSamplers.buf[i]; + if (!ei) + { + continue; + } + if (nvidia::strcmp(ei->className(), FlameEmitterData::staticClassName()) != 0) + { + continue; + } + FlameEmitterData* ed = static_cast< FlameEmitterData*>(ei); + mTempNames.pushBack(ed->Name); + mTempVariantNames.pushBack(FLAME_EMITTER_AUTHORING_TYPE_NAME); + } + } + } + else + { + PX_ALWAYS_ASSERT(); + } + + nameCount = mTempNames.size(); + if (nameCount) + { + ret = &mTempNames[0]; + variants = &mTempVariantNames[0]; + } + + return ret; +} + + +bool ModuleParticlesImpl::setEffectPackageIOSDatabase(const NvParameterized::Interface* dataBase) +{ + WRITE_ZONE(); + bool ret = false; + + if (dataBase) + { + NvParameterized::Traits* traits = mSdk->getParameterizedTraits(); + const char* className = dataBase->className(); + if (nvidia::strcmp(className, basicios::BasicIOSAssetParam::staticClassName()) == 0 || nvidia::strcmp(className, pxparticleios::ParticleIosAssetParam::staticClassName()) == 0) + { + bool revised = false; + const char* itemName = dataBase->name() ? dataBase->name() : "defaultBasicIOS"; + EffectPackageIOSDatabaseParams* d = static_cast< EffectPackageIOSDatabaseParams*>(mEffectPackageIOSDatabaseParams); + if ( d ) + { + for (uint32_t i = 0; i < (uint32_t)d->ParticleSimulations.arraySizes[0]; i++) + { + NvParameterized::Interface* ei = d->ParticleSimulations.buf[i]; + if (!ei) + { + continue; + } + ParticleSimulationData* ed = static_cast< ParticleSimulationData*>(ei); + if (nvidia::stricmp(ed->Name.buf, itemName) == 0) + { + ed->IOS->copy(*dataBase); + initParticleSimulationData(ed); + revised = true; + ret = true; + break; + } + } + } + if (!revised && mEffectPackageIOSDatabaseParams) + { + int32_t arraySize = d->ParticleSimulations.arraySizes[0]; + NvParameterized::Handle handle(mEffectPackageIOSDatabaseParams); + NvParameterized::ErrorType err = handle.getParameter("ParticleSimulations"); + PX_ASSERT(err == NvParameterized::ERROR_NONE); + err = handle.resizeArray(arraySize + 1); + PX_ASSERT(err == NvParameterized::ERROR_NONE); + if (err == NvParameterized::ERROR_NONE) + { + NvParameterized::Interface* ei = traits->createNvParameterized(ParticleSimulationData::staticClassName()); + if (ei) + { + ParticleSimulationData* ed = static_cast< ParticleSimulationData*>(ei); + NvParameterized::Handle item(ei); + err = item.getParameter("Name"); + PX_ASSERT(err == NvParameterized::ERROR_NONE); + item.setParamString(itemName); + ei->setName(itemName); + d->ParticleSimulations.buf[arraySize] = ei; + ed->IOS = NULL; + NvParameterized::ErrorType err = dataBase->clone(ed->IOS); + if ( err != NvParameterized::ERROR_NONE || ed->IOS == NULL ) + { + APEX_DEBUG_WARNING("Failed to clone asset."); + } + else + { + initParticleSimulationData(ed); + } + } + ret = true; + } + } + } + else if (nvidia::strcmp(dataBase->className(), EffectPackageIOSDatabaseParams::staticClassName()) == 0) + { + if (mEffectPackageIOSDatabaseParams && mEffectPackageIOSDatabaseParams != dataBase) + { + mEffectPackageIOSDatabaseParams->destroy(); + mEffectPackageIOSDatabaseParams = NULL; + } + if (mEffectPackageIOSDatabaseParams == NULL) + { + dataBase->clone(mEffectPackageIOSDatabaseParams); + if ( mEffectPackageIOSDatabaseParams == NULL) + { + APEX_DEBUG_WARNING("Failed to clone asset."); + mEffectPackageIOSDatabaseParams = traits->createNvParameterized(EffectPackageIOSDatabaseParams::staticClassName()); + } + } + + EffectPackageIOSDatabaseParams* d = static_cast< EffectPackageIOSDatabaseParams*>(mEffectPackageIOSDatabaseParams); + if ( d ) + { + if (d->ParticleSimulations.arraySizes[0] == 0) + { + NvParameterized::Handle handle(mEffectPackageIOSDatabaseParams); + NvParameterized::ErrorType err = handle.getParameter("ParticleSimulations"); + PX_ASSERT(err == NvParameterized::ERROR_NONE); + err = handle.resizeArray(3); + + PX_ASSERT(err == NvParameterized::ERROR_NONE); + if (err == NvParameterized::ERROR_NONE) + { + // create the default BasicIOS + { + NvParameterized::Interface* ei = traits->createNvParameterized(ParticleSimulationData::staticClassName()); + d->ParticleSimulations.buf[0] = ei; + ParticleSimulationData* psd = static_cast< ParticleSimulationData*>(ei); + if (psd) + { + NvParameterized::setParamString(*ei, "Name", "defaultBasicIOS"); + psd->IOS = traits->createNvParameterized(basicios::BasicIOSAssetParam::staticClassName()); + } + } + // create the default SimpleParticleIOS + { + NvParameterized::Interface* ei = traits->createNvParameterized(ParticleSimulationData::staticClassName()); + d->ParticleSimulations.buf[1] = ei; + ParticleSimulationData* psd = static_cast< ParticleSimulationData*>(ei); + if (psd) + { + NvParameterized::setParamString(*ei, "Name", "defaultSimpleParticleIOS"); + psd->IOS = traits->createNvParameterized(pxparticleios::ParticleIosAssetParam::staticClassName()); + pxparticleios::ParticleIosAssetParam* pia = static_cast< pxparticleios::ParticleIosAssetParam*>(psd->IOS); + if (pia) + { + pia->particleType = traits->createNvParameterized(pxparticleios::SimpleParticleSystemParams::staticClassName()); + } + } + } + // create the default FluidParticleIOS + { + NvParameterized::Interface* ei = traits->createNvParameterized(ParticleSimulationData::staticClassName()); + d->ParticleSimulations.buf[2] = ei; + ParticleSimulationData* psd = static_cast< ParticleSimulationData*>(ei); + + if (psd) + { + NvParameterized::setParamString(*ei, "Name", "defaultFluidParticleIOS"); + psd->IOS = traits->createNvParameterized(pxparticleios::ParticleIosAssetParam::staticClassName()); + pxparticleios::ParticleIosAssetParam* pia = static_cast< pxparticleios::ParticleIosAssetParam*>(psd->IOS); + + if (pia) + { + pia->particleType = traits->createNvParameterized(pxparticleios::FluidParticleSystemParams::staticClassName()); + pxparticleios::FluidParticleSystemParams* fp = static_cast< pxparticleios::FluidParticleSystemParams*>(pia->particleType); + if (fp) + { + fp->restParticleDistance = 0.1f; + fp->stiffness = 8; + fp->viscosity = 5; + } + pia->maxParticleCount = 200000; + pia->particleRadius = 1; + pia->maxInjectedParticleCount = 0.1f; + pia->maxMotionDistance = 0.2; + pia->contactOffset = 0.008f; + pia->restOffset = 0.004f; + pia->gridSize = 1.5f; + pia->damping = 0; + pia->externalAcceleration = PxVec3(0, 0, 0); + pia->projectionPlaneNormal = PxVec3(0, 1, 0); + pia->projectionPlaneDistance = 0; + pia->particleMass = 0.1f; + pia->restitution = 0.15f; + pia->dynamicFriction = 0.008f; + pia->staticFriction = 0.1f; + pia->CollisionTwoway = false; + pia->CollisionWithDynamicActors = true; + pia->Enable = true; + pia->ProjectToPlane = false; + pia->PerParticleRestOffset = false; + pia->PerParticleCollisionCacheHint = false; + } + } + } + ret = true; + } + } + + Array< const char* > nameList; + for (int32_t i = 0; i < d->ParticleSimulations.arraySizes[0]; i++) + { + ParticleSimulationData* e = static_cast< ParticleSimulationData*>(d->ParticleSimulations.buf[i]); + if (e) + { + for (uint32_t j = 0; j < nameList.size(); j++) + { + if (nvidia::stricmp(nameList[j], e->Name) == 0) + { + NvParameterized::Handle handle(e); + NvParameterized::ErrorType err = handle.getParameter("Name"); + PX_ASSERT(err == NvParameterized::ERROR_NONE); + if (err == NvParameterized::ERROR_NONE) + { + handle.setParamString(getUniqueName(nameList, e->Name)); + ret = true; + break; + } + } + } + nameList.pushBack(e->Name); + } + } + + + for (uint32_t i = 0; i < (uint32_t)d->ParticleSimulations.arraySizes[0]; i++) + { + ParticleSimulationData* ed = static_cast< ParticleSimulationData* >(d->ParticleSimulations.buf[i]); + PX_ASSERT(ed); + if (ed && initParticleSimulationData(ed)) + { + ret = true; + } + } + } + } + else + { + PX_ALWAYS_ASSERT(); // not a valid NvParameterized interface + } + if (fixupNamedReferences()) + { + ret = true; + } + } + return ret; +} + +static void initColor(iofx::ColorVsLifeCompositeModifierParamsNS::colorLifeStruct_Type& c, float lifeRemaining, float red, float green, float blue, float alpha) +{ + c.lifeRemaining = lifeRemaining; + c.color.x = red; + c.color.y = green; + c.color.z = blue; + c.color.w = alpha; +} + +static void initScale(iofx::ScaleVsLife2DModifierParamsNS::scaleLifeStruct_Type& s, float lifetime, float scalex, float scaley) +{ + s.lifeRemaining = lifetime; + s.scale.x = scalex; + s.scale.y = scaley; +} + + +bool ModuleParticlesImpl::setEffectPackageIOFXDatabase(const NvParameterized::Interface* dataBase) +{ + WRITE_ZONE(); + bool ret = false; + + if (dataBase) + { + NvParameterized::Traits* traits = mSdk->getParameterizedTraits(); + const char* className = dataBase->className(); + if (nvidia::strcmp(className, iofx::IofxAssetParameters::staticClassName()) == 0) + { + bool revised = false; + const char* itemName = dataBase->name(); + EffectPackageIOFXDatabaseParams* d = static_cast< EffectPackageIOFXDatabaseParams*>(mEffectPackageIOFXDatabaseParams); + if ( d ) + { + for (uint32_t i = 0; i < (uint32_t)d->GraphicsEffects.arraySizes[0]; i++) + { + NvParameterized::Interface* ei = d->GraphicsEffects.buf[i]; + if (!ei) + { + continue; + } + GraphicsEffectData* ed = static_cast< GraphicsEffectData*>(ei); + if (nvidia::stricmp(ed->Name.buf, itemName) == 0) + { + ed->IOFX->copy(*dataBase); + revised = true; + ret = true; + break; + } + } + } + if (!revised && mEffectPackageIOFXDatabaseParams) + { + int32_t arraySize = d->GraphicsEffects.arraySizes[0]; + NvParameterized::Handle handle(mEffectPackageIOFXDatabaseParams); + NvParameterized::ErrorType err = handle.getParameter("GraphicsEffects"); + PX_ASSERT(err == NvParameterized::ERROR_NONE); + err = handle.resizeArray(arraySize + 1); + PX_ASSERT(err == NvParameterized::ERROR_NONE); + if (err == NvParameterized::ERROR_NONE) + { + NvParameterized::Interface* ei = traits->createNvParameterized(GraphicsEffectData::staticClassName()); + if (ei) + { + GraphicsEffectData* ed = static_cast< GraphicsEffectData*>(ei); + NvParameterized::Handle item(ei); + err = item.getParameter("Name"); + PX_ASSERT(err == NvParameterized::ERROR_NONE); + item.setParamString(itemName); + ei->setName(itemName); + d->GraphicsEffects.buf[arraySize] = ei; + ed->IOFX = NULL; + dataBase->clone(ed->IOFX); + if ( ed->IOFX == NULL ) + { + APEX_DEBUG_WARNING("Failed to clone asset."); + } + } + ret = true; + } + } + } + else if (nvidia::strcmp(dataBase->className(), EffectPackageIOFXDatabaseParams::staticClassName()) == 0) + { + if (mEffectPackageIOFXDatabaseParams && mEffectPackageIOFXDatabaseParams != dataBase) + { + mEffectPackageIOFXDatabaseParams->destroy(); + mEffectPackageIOFXDatabaseParams = NULL; + } + if (mEffectPackageIOFXDatabaseParams == NULL) + { + dataBase->clone(mEffectPackageIOFXDatabaseParams); + if ( mEffectPackageIOFXDatabaseParams == NULL ) + { + APEX_DEBUG_WARNING("Failed to clone asset."); + mEffectPackageIOFXDatabaseParams = traits->createNvParameterized(EffectPackageIOFXDatabaseParams::staticClassName()); + } + } + EffectPackageIOFXDatabaseParams* d = static_cast< EffectPackageIOFXDatabaseParams*>(mEffectPackageIOFXDatabaseParams); + if ( d ) + { + if (d->GraphicsEffects.arraySizes[0] == 0) + { + NvParameterized::Handle handle(mEffectPackageIOFXDatabaseParams); + NvParameterized::ErrorType err = handle.getParameter("GraphicsEffects"); + PX_ASSERT(err == NvParameterized::ERROR_NONE); + err = handle.resizeArray(2); + PX_ASSERT(err == NvParameterized::ERROR_NONE); + if (err == NvParameterized::ERROR_NONE) + { + { + NvParameterized::Interface* ei = traits->createNvParameterized(GraphicsEffectData::staticClassName()); + d->GraphicsEffects.buf[0] = ei; + if (ei) + { + GraphicsEffectData* ged = static_cast< GraphicsEffectData*>(ei); + if (ged) + { + NvParameterized::setParamString(*ei, "Name", "defaultSpriteIOFX"); + ged->IOFX = traits->createNvParameterized(iofx::IofxAssetParameters::staticClassName()); + iofx::IofxAssetParameters* iofx = static_cast< iofx::IofxAssetParameters*>(ged->IOFX); + if (iofx) + { + iofx->iofxType = traits->createNvParameterized(iofx::SpriteIofxParameters::staticClassName()); + iofx->renderOutput.useFloat4Color = true; + } + } + } + } + { + NvParameterized::Interface* ei = traits->createNvParameterized(GraphicsEffectData::staticClassName()); + d->GraphicsEffects.buf[1] = ei; + if (ei) + { + GraphicsEffectData* ged = static_cast< GraphicsEffectData*>(ei); + if (ged) + { + NvParameterized::setParamString(*ei, "Name", "defaultMeshIOFX"); + ged->IOFX = traits->createNvParameterized(iofx::IofxAssetParameters::staticClassName()); + iofx::IofxAssetParameters* iofx = static_cast< iofx::IofxAssetParameters*>(ged->IOFX); + if (iofx) + { + iofx->iofxType = traits->createNvParameterized(iofx::MeshIofxParameters::staticClassName()); + iofx->renderOutput.useFloat4Color = true; + } + } + } + } + + ret = true; + } + } + + + Array< const char* > nameList; + for (int32_t i = 0; i < d->GraphicsEffects.arraySizes[0]; i++) + { + GraphicsEffectData* e = static_cast< GraphicsEffectData*>(d->GraphicsEffects.buf[i]); + if (e) + { + for (uint32_t j = 0; j < nameList.size(); j++) + { + if (nvidia::stricmp(nameList[j], e->Name) == 0) + { + NvParameterized::Handle handle(e); + NvParameterized::ErrorType err = handle.getParameter("Name"); + PX_ASSERT(err == NvParameterized::ERROR_NONE); + if (err == NvParameterized::ERROR_NONE) + { + handle.setParamString(getUniqueName(nameList, e->Name)); + ret = true; + break; + } + } + } + nameList.pushBack(e->Name); + } + } + + + for (uint32_t i = 0; i < (uint32_t)d->GraphicsEffects.arraySizes[0]; i++) + { + GraphicsEffectData* ed = static_cast< GraphicsEffectData*>(d->GraphicsEffects.buf[i]); + // first, see if it's assigned to a sprite IOFX without valid default values... + { + iofx::IofxAssetParameters* ae = static_cast< iofx::IofxAssetParameters*>(ed->IOFX); + if (ae) + { + if (nvidia::strcmp(ae->iofxType->className(), iofx::SpriteIofxParameters::staticClassName()) == 0) + { + iofx::SpriteIofxParameters* iofxP = static_cast< iofx::SpriteIofxParameters*>(ae->iofxType); + if (iofxP->spawnModifierList.arraySizes[0] == 0 && iofxP->continuousModifierList.arraySizes[0] == 0) + { + ed->IOFX->destroy(); + ed->IOFX = NULL; + ret = true; + } + } + } + } + + if (ed->IOFX == NULL) + { + ed->IOFX = traits->createNvParameterized(iofx::IofxAssetParameters::staticClassName()); + iofx::IofxAssetParameters* ae = static_cast< iofx::IofxAssetParameters*>(ed->IOFX); + if (ae) + { + ae->renderOutput.useFloat4Color = true; + NvParameterized::Interface* iofx = traits->createNvParameterized(iofx::SpriteIofxParameters::staticClassName()); + ae->iofxType = iofx; + iofx::SpriteIofxParameters* iofxP = static_cast< iofx::SpriteIofxParameters*>(iofx); + if (iofxP) + { + { + NvParameterized::Handle handle(iofx); + NvParameterized::ErrorType err = handle.getParameter("spriteMaterialName"); + PX_ASSERT(err == NvParameterized::ERROR_NONE); + if (err == NvParameterized::ERROR_NONE) + { + err = handle.initParamRef(APEX_MATERIALS_NAME_SPACE, true); + PX_ASSERT(err == NvParameterized::ERROR_NONE); + if (err == NvParameterized::ERROR_NONE) + { + iofxP->spriteMaterialName->setName("defaultGraphicsMaterial"); + } + } + } + + { + NvParameterized::Handle handle(iofx); + NvParameterized::ErrorType err = handle.getParameter("spawnModifierList"); + PX_ASSERT(err == NvParameterized::ERROR_NONE); + err = handle.resizeArray(4); + PX_ASSERT(err == NvParameterized::ERROR_NONE); + if (err == NvParameterized::ERROR_NONE) + { + iofxP->spawnModifierList.buf[0] = traits->createNvParameterized(iofx::InitialColorModifierParams::staticClassName()); + iofxP->spawnModifierList.buf[1] = traits->createNvParameterized(iofx::RandomRotationModifierParams::staticClassName()); + iofxP->spawnModifierList.buf[2] = traits->createNvParameterized(iofx::RandomSubtextureModifierParams::staticClassName()); + iofxP->spawnModifierList.buf[3] = traits->createNvParameterized(iofx::RandomScaleModifierParams::staticClassName()); + } + } + + { + NvParameterized::Handle handle(iofx); + NvParameterized::ErrorType err = handle.getParameter("continuousModifierList"); + PX_ASSERT(err == NvParameterized::ERROR_NONE); + err = handle.resizeArray(1); + PX_ASSERT(err == NvParameterized::ERROR_NONE); + if (err == NvParameterized::ERROR_NONE) + { + iofxP->continuousModifierList.buf[0] = traits->createNvParameterized(iofx::ViewDirectionSortingModifierParams::staticClassName()); + } + } + } + } + ret = true; + } + if (ed->IOFX) + { + iofx::IofxAssetParameters* ae = static_cast< iofx::IofxAssetParameters*>(ed->IOFX); + if (ae->iofxType) + { + ae->renderOutput.useFloat4Color = true; + const char* c = ae->iofxType->className(); + if (c && nvidia::strcmp(c, "MeshIofxParameters") == 0) + { + iofx::MeshIofxParameters* m = static_cast< iofx::MeshIofxParameters*>(ae->iofxType); + if (m->renderMeshList.arraySizes[0] == 0) + { + ret = true; + NvParameterized::Handle handle(m); + NvParameterized::ErrorType err = handle.getParameter("renderMeshList"); + PX_ASSERT(err == NvParameterized::ERROR_NONE); + err = handle.resizeArray(1); + PX_ASSERT(err == NvParameterized::ERROR_NONE); + if (err == NvParameterized::ERROR_NONE) + { + iofx::MeshIofxParametersNS::meshProperties_Type& t = m->renderMeshList.buf[0]; + t.weight = 1; + NvParameterized::Handle elementHandle(m); + err = handle.getChildHandle(0, elementHandle); + PX_ASSERT(err == NvParameterized::ERROR_NONE); + NvParameterized::Handle item(*elementHandle.getInterface()); + NvParameterized::ErrorType err = elementHandle.getChildHandle(elementHandle.getInterface(), "meshAssetName", item); + PX_ASSERT(err == NvParameterized:: ERROR_NONE); + if (err == NvParameterized::ERROR_NONE) + { + err = item.initParamRef(APEX_OPAQUE_MESH_NAME_SPACE,true); + PX_ASSERT(err == NvParameterized::ERROR_NONE); + if (err == NvParameterized::ERROR_NONE) + { + t.meshAssetName->setName("SampleMesh.apx"); + } + } + } + // initialize the spawn modifier list + { + NvParameterized::Handle handle(m); + NvParameterized::ErrorType err = handle.getParameter("spawnModifierList"); + PX_ASSERT(err == NvParameterized::ERROR_NONE); + err = handle.resizeArray(2); + PX_ASSERT(err == NvParameterized::ERROR_NONE); + if (err == NvParameterized::ERROR_NONE) + { + m->spawnModifierList.buf[0] = traits->createNvParameterized(iofx::SimpleScaleModifierParams::staticClassName()); + iofx::SimpleScaleModifierParams* ss = static_cast< iofx::SimpleScaleModifierParams*>(m->spawnModifierList.buf[0]); + if (ss) + { + ss->scaleFactor = PxVec3(1, 1, 1); + m->spawnModifierList.buf[1] = traits->createNvParameterized(iofx::RotationModifierParams::staticClassName()); + NvParameterized::setParamEnum(*m->spawnModifierList.buf[1], "rollType", "SPHERICAL"); + } + } + } + // initialize the continuous modifier list + { + NvParameterized::Handle handle(m); + NvParameterized::ErrorType err = handle.getParameter("continuousModifierList"); + PX_ASSERT(err == NvParameterized::ERROR_NONE); + err = handle.resizeArray(2); + PX_ASSERT(err == NvParameterized::ERROR_NONE); + if (err == NvParameterized::ERROR_NONE) + { + // init RotationModifierParams + { + m->continuousModifierList.buf[0] = traits->createNvParameterized(iofx::RotationModifierParams::staticClassName()); + if (m->continuousModifierList.buf[0]) + { + NvParameterized::setParamEnum(*m->continuousModifierList.buf[0], "rollType", "SPHERICAL"); + iofx::RotationModifierParams* rmp = static_cast< iofx::RotationModifierParams*>(m->continuousModifierList.buf[0]); + rmp->maxRotationRatePerSec = 0; + rmp->maxSettleRatePerSec = 1; + rmp->collisionRotationMultiplier = 1; + rmp->inAirRotationMultiplier = 1; + } + } + { + m->continuousModifierList.buf[1] = traits->createNvParameterized(iofx::ScaleVsLife3DModifierParams::staticClassName()); + if (m->continuousModifierList.buf[1]) + { + NvParameterized::Handle h(m->continuousModifierList.buf[1]); + err = h.getParameter("controlPoints"); + PX_ASSERT(err == NvParameterized::ERROR_NONE); + err = h.resizeArray(3); + iofx::ScaleVsLife3DModifierParams& svl = *(static_cast< iofx::ScaleVsLife3DModifierParams*>(m->continuousModifierList.buf[1])); + svl.controlPoints.buf[0].lifeRemaining = 0; + svl.controlPoints.buf[0].scale = PxVec3(0, 0, 0); + + svl.controlPoints.buf[1].lifeRemaining = 0.5f; + svl.controlPoints.buf[1].scale = PxVec3(1, 1, 1); + + svl.controlPoints.buf[2].lifeRemaining = 1; + svl.controlPoints.buf[2].scale = PxVec3(0, 0, 0); + + } + } + } + + } + } + } + } + } + } + } + } + else + { + PX_ALWAYS_ASSERT(); + } + } + + + return ret; + +} + +bool ModuleParticlesImpl::setEffectPackageEmitterDatabase(const NvParameterized::Interface* dataBase) +{ + WRITE_ZONE(); + bool ret = false; + + if (dataBase) + { + NvParameterized::Traits* traits = mSdk->getParameterizedTraits(); + const char* className = dataBase->className(); + if (nvidia::strcmp(className, emitter::ApexEmitterAssetParameters::staticClassName()) == 0) + { + bool revised = false; + const char* itemName = dataBase->name(); + EffectPackageEmitterDatabaseParams* d = static_cast< EffectPackageEmitterDatabaseParams*>(mEffectPackageEmitterDatabaseParams); + if ( d ) + { + for (uint32_t i = 0; i < (uint32_t)d->Emitters.arraySizes[0]; i++) + { + NvParameterized::Interface* ei = d->Emitters.buf[i]; + if (!ei) + { + continue; + } + EmitterData* ed = static_cast< EmitterData*>(ei); + if (nvidia::stricmp(ed->Name.buf, itemName) == 0) + { + ed->Emitter->copy(*dataBase); + revised = true; + ret = true; + break; + } + } + } + if (!revised && mEffectPackageEmitterDatabaseParams) + { + int32_t arraySize = d->Emitters.arraySizes[0]; + NvParameterized::Handle handle(mEffectPackageEmitterDatabaseParams); + NvParameterized::ErrorType err = handle.getParameter("Emitters"); + PX_ASSERT(err == NvParameterized::ERROR_NONE); + err = handle.resizeArray(arraySize + 1); + PX_ASSERT(err == NvParameterized::ERROR_NONE); + if (err == NvParameterized::ERROR_NONE) + { + NvParameterized::Interface* ei = traits->createNvParameterized(EmitterData::staticClassName()); + if (ei) + { + EmitterData* ed = static_cast< EmitterData*>(ei); + NvParameterized::Handle item(ei); + err = item.getParameter("Name"); + PX_ASSERT(err == NvParameterized::ERROR_NONE); + item.setParamString(itemName); + ei->setName(itemName); + d->Emitters.buf[arraySize] = ei; + ed->Emitter = NULL; + dataBase->clone(ed->Emitter); + if ( ed->Emitter == NULL ) + { + APEX_DEBUG_WARNING("Failed to clone asset."); + } + } + ret = true; + } + } + } + else if (nvidia::strcmp(dataBase->className(), EffectPackageEmitterDatabaseParams::staticClassName()) == 0) + { + if (mEffectPackageEmitterDatabaseParams && mEffectPackageEmitterDatabaseParams != dataBase) + { + mEffectPackageEmitterDatabaseParams->destroy(); + mEffectPackageEmitterDatabaseParams = NULL; + } + if (mEffectPackageEmitterDatabaseParams == NULL) + { + dataBase->clone(mEffectPackageEmitterDatabaseParams); + if ( mEffectPackageEmitterDatabaseParams == NULL ) + { + APEX_DEBUG_WARNING("Failed to clone asset."); + mEffectPackageEmitterDatabaseParams = traits->createNvParameterized(EffectPackageEmitterDatabaseParams::staticClassName()); + } + } + + EffectPackageEmitterDatabaseParams* d = static_cast< EffectPackageEmitterDatabaseParams*>(mEffectPackageEmitterDatabaseParams); + if ( d ) + { + if (d->Emitters.arraySizes[0] == 0) + { + NvParameterized::Handle handle(mEffectPackageEmitterDatabaseParams); + NvParameterized::ErrorType err = handle.getParameter("Emitters"); + PX_ASSERT(err == NvParameterized::ERROR_NONE); + err = handle.resizeArray(1); + PX_ASSERT(err == NvParameterized::ERROR_NONE); + if (err == NvParameterized::ERROR_NONE) + { + NvParameterized::Interface* ei = traits->createNvParameterized(EmitterData::staticClassName()); + d->Emitters.buf[0] = ei; + ret = true; + } + } + + + Array< const char* > nameList; + for (int32_t i = 0; i < d->Emitters.arraySizes[0]; i++) + { + EmitterData* e = static_cast< EmitterData*>(d->Emitters.buf[i]); + if (e) + { + for (uint32_t j = 0; j < nameList.size(); j++) + { + if (nvidia::stricmp(nameList[j], e->Name) == 0) + { + NvParameterized::Handle handle(e); + NvParameterized::ErrorType err = handle.getParameter("Name"); + PX_ASSERT(err == NvParameterized::ERROR_NONE); + if (err == NvParameterized::ERROR_NONE) + { + handle.setParamString(getUniqueName(nameList, e->Name)); + ret = true; + break; + } + } + } + nameList.pushBack(e->Name); + } + } + + for (uint32_t i = 0; i < (uint32_t)d->Emitters.arraySizes[0]; i++) + { + EmitterData* ed = static_cast< EmitterData*>(d->Emitters.buf[i]); + if (ed->Emitter == NULL) + { + ed->Emitter = traits->createNvParameterized(emitter::ApexEmitterAssetParameters::staticClassName()); + // Modify "static_cast<emitter::ApexEmitterAssetParameters*>(ed->Emitter)" if default ApexEmitterAssetParameters initialisation is insufficiently + ret = true; + } + if (ed->Emitter) + { + emitter::ApexEmitterAssetParameters* ae = static_cast< emitter::ApexEmitterAssetParameters*>(ed->Emitter); + NvParameterized::Handle handle(ed->Emitter); + NvParameterized::ErrorType err = ed->Emitter->getParameterHandle("iofxAssetName", handle); + PX_ASSERT(err == NvParameterized::ERROR_NONE); + if (err == NvParameterized::ERROR_NONE) + { + NvParameterized::Interface* val = NULL; + err = handle.getParamRef(val); + if (val == NULL) + { + err = handle.initParamRef(IOFX_AUTHORING_TYPE_NAME,true); + PX_ASSERT(err == NvParameterized::ERROR_NONE); + if (err == NvParameterized::ERROR_NONE) + { + char scratch[512]; + sprintf_s(scratch, 512, "defaultSpriteIOFX"); + ae->iofxAssetName->setName(scratch); + } + } + } + } + if (ed->Emitter) + { + emitter::ApexEmitterAssetParameters* ae = static_cast< emitter::ApexEmitterAssetParameters*>(ed->Emitter); + NvParameterized::Handle handle(ed->Emitter); + NvParameterized::ErrorType err = ed->Emitter->getParameterHandle("iosAssetName", handle); + PX_ASSERT(err == NvParameterized::ERROR_NONE); + if (err == NvParameterized::ERROR_NONE) + { + NvParameterized::Interface* val = NULL; + err = handle.getParamRef(val); + if (val == NULL) + { + err = handle.initParamRef(BASIC_IOS_AUTHORING_TYPE_NAME,true); + PX_ASSERT(err == NvParameterized::ERROR_NONE); + if (err == NvParameterized::ERROR_NONE) + { + char scratch[512]; + sprintf_s(scratch, 512, "defaultBasicIOS"); + ae->iosAssetName->setName(scratch); + } + } + } + } + } + } + } + else + { + PX_ALWAYS_ASSERT(); // invalid NvParameterized::Interface passed in + } + } + + + return ret; +} + +enum FieldSamplerType +{ + FST_NONE, + FST_FORCE_FIELD, + FST_HEAT_SOURCE, + FST_SUBSTANCE_SOURCE, + FST_JET, + FST_ATTRACTOR, + FST_TURBULENCE, + FST_NOISE, + FST_VORTEX, + FST_WIND, + FST_VELOCITY_SOURCE, + FST_FLAME_EMITTER, + FST_LAST +}; + +static FieldSamplerType getFieldSamplerType(const NvParameterized::Interface* iface) +{ + FieldSamplerType ret = FST_NONE; + + if (iface) + { + const char* className = iface->className(); + if (nvidia::strcmp(className, forcefield::ForceFieldAssetParams::staticClassName()) == 0) + { + ret = FST_FORCE_FIELD; + } + else if (nvidia::strcmp(className, turbulencefs::HeatSourceAssetParams::staticClassName()) == 0) + { + ret = FST_HEAT_SOURCE; + } + else if (nvidia::strcmp(className, turbulencefs::SubstanceSourceAssetParams::staticClassName()) == 0) + { + ret = FST_SUBSTANCE_SOURCE; + } + else if (nvidia::strcmp(className, turbulencefs::VelocitySourceAssetParams::staticClassName()) == 0) + { + ret = FST_VELOCITY_SOURCE; + } + else if (nvidia::strcmp(className, basicfs::JetFSAssetParams::staticClassName()) == 0) + { + ret = FST_JET; + } + else if (nvidia::strcmp(className, basicfs::WindFSAssetParams::staticClassName()) == 0) + { + ret = FST_WIND; + } + else if (nvidia::strcmp(className, basicfs::NoiseFSAssetParams::staticClassName()) == 0) + { + ret = FST_NOISE; + } + else if (nvidia::strcmp(className, basicfs::VortexFSAssetParams::staticClassName()) == 0) + { + ret = FST_VORTEX; + } + else if (nvidia::strcmp(className, basicfs::AttractorFSAssetParams::staticClassName()) == 0) + { + ret = FST_ATTRACTOR; + } + else if (nvidia::strcmp(className, turbulencefs::TurbulenceFSAssetParams::staticClassName()) == 0) + { + ret = FST_TURBULENCE; + } + else if (nvidia::strcmp(className, turbulencefs::FlameEmitterAssetParams::staticClassName()) == 0) + { + ret = FST_FLAME_EMITTER; + } + else if (nvidia::strcmp(className, particles::ForceFieldData::staticClassName()) == 0) + { + ret = FST_FORCE_FIELD; + } + else if (nvidia::strcmp(className, particles::HeatSourceData::staticClassName()) == 0) + { + ret = FST_HEAT_SOURCE; + } + else if (nvidia::strcmp(className, particles::SubstanceSourceData::staticClassName()) == 0) + { + ret = FST_SUBSTANCE_SOURCE; + } + else if (nvidia::strcmp(className, particles::VelocitySourceData::staticClassName()) == 0) + { + ret = FST_VELOCITY_SOURCE; + } + else if (nvidia::strcmp(className, particles::AttractorFieldSamplerData::staticClassName()) == 0) + { + ret = FST_ATTRACTOR; + } + else if (nvidia::strcmp(className, particles::JetFieldSamplerData::staticClassName()) == 0) + { + ret = FST_JET; + } + else if (nvidia::strcmp(className, particles::WindFieldSamplerData::staticClassName()) == 0) + { + ret = FST_WIND; + } + else if (nvidia::strcmp(className, particles::NoiseFieldSamplerData::staticClassName()) == 0) + { + ret = FST_NOISE; + } + else if (nvidia::strcmp(className, particles::TurbulenceFieldSamplerData::staticClassName()) == 0) + { + ret = FST_TURBULENCE; + } + else if (nvidia::strcmp(className, particles::VortexFieldSamplerData::staticClassName()) == 0) + { + ret = FST_VORTEX; + } + else if (nvidia::strcmp(className, particles::FlameEmitterData::staticClassName()) == 0) + { + ret = FST_FLAME_EMITTER; + } + } + + return ret; +} + +static NvParameterized::Interface* getFieldSamplerData(FieldSamplerType fst, NvParameterized::Traits* traits, const NvParameterized::Interface* dataBase) +{ + NvParameterized::Interface* ret = NULL; + + const char* itemName = dataBase->name(); + NvParameterized::ErrorType err; + + switch (fst) + { + case FST_FORCE_FIELD: + { + NvParameterized::Interface* ei = traits->createNvParameterized(ForceFieldData::staticClassName()); + ForceFieldData* ed = static_cast< ForceFieldData*>(ei); + if (ed) + { + NvParameterized::Handle item(ei); + err = item.getParameter("Name"); + PX_ASSERT(err == NvParameterized::ERROR_NONE); + item.setParamString(itemName); + ei->setName(itemName); + ret = ei; + ed->ForceField = NULL; + dataBase->clone(ed->ForceField); + if ( ed->ForceField == NULL ) + { + APEX_DEBUG_WARNING("Failed to clone asset."); + } + } + } + break; + case FST_HEAT_SOURCE: + { + NvParameterized::Interface* ei = traits->createNvParameterized(HeatSourceData::staticClassName()); + HeatSourceData* ed = static_cast< HeatSourceData*>(ei); + if (ed) + { + NvParameterized::Handle item(ei); + err = item.getParameter("Name"); + PX_ASSERT(err == NvParameterized::ERROR_NONE); + item.setParamString(itemName); + ei->setName(itemName); + ret = ei; + ed->HeatSource = NULL; + dataBase->clone(ed->HeatSource); + if ( ed->HeatSource == NULL ) + { + APEX_DEBUG_WARNING("Failed to clone asset."); + } + } + } + break; + case FST_SUBSTANCE_SOURCE: + { + NvParameterized::Interface* ei = traits->createNvParameterized(SubstanceSourceData::staticClassName()); + SubstanceSourceData* ed = static_cast< SubstanceSourceData*>(ei); + if (ed) + { + NvParameterized::Handle item(ei); + err = item.getParameter("Name"); + PX_ASSERT(err == NvParameterized::ERROR_NONE); + item.setParamString(itemName); + ei->setName(itemName); + ret = ei; + ed->SubstanceSource = NULL; + dataBase->clone(ed->SubstanceSource); + if ( ed->SubstanceSource == NULL ) + { + APEX_DEBUG_WARNING("Failed to clone asset."); + } + } + } + break; + case FST_VELOCITY_SOURCE: + { + NvParameterized::Interface* ei = traits->createNvParameterized(VelocitySourceData::staticClassName()); + VelocitySourceData* ed = static_cast< VelocitySourceData*>(ei); + if (ed) + { + NvParameterized::Handle item(ei); + err = item.getParameter("Name"); + PX_ASSERT(err == NvParameterized::ERROR_NONE); + item.setParamString(itemName); + ei->setName(itemName); + ret = ei; + ed->VelocitySource = NULL; + dataBase->clone(ed->VelocitySource); + if ( ed->VelocitySource == NULL ) + { + APEX_DEBUG_WARNING("Failed to clone asset."); + } + } + } + break; + case FST_ATTRACTOR: + { + NvParameterized::Interface* ei = traits->createNvParameterized(AttractorFieldSamplerData::staticClassName()); + AttractorFieldSamplerData* ed = static_cast< AttractorFieldSamplerData*>(ei); + if (ed) + { + NvParameterized::Handle item(ei); + err = item.getParameter("Name"); + PX_ASSERT(err == NvParameterized::ERROR_NONE); + item.setParamString(itemName); + ei->setName(itemName); + ret = ei; + ed->AttractorFieldSampler = NULL; + dataBase->clone(ed->AttractorFieldSampler); + if ( ed->AttractorFieldSampler == NULL ) + { + APEX_DEBUG_WARNING("Failed to clone asset."); + } + } + } + break; + case FST_VORTEX: + { + NvParameterized::Interface* ei = traits->createNvParameterized(VortexFieldSamplerData::staticClassName()); + VortexFieldSamplerData* ed = static_cast< VortexFieldSamplerData*>(ei); + if (ed) + { + NvParameterized::Handle item(ei); + err = item.getParameter("Name"); + PX_ASSERT(err == NvParameterized::ERROR_NONE); + item.setParamString(itemName); + ei->setName(itemName); + ret = ei; + ed->VortexFieldSampler = NULL; + dataBase->clone(ed->VortexFieldSampler); + if ( ed->VortexFieldSampler == NULL ) + { + APEX_DEBUG_WARNING("Failed to clone asset."); + } + } + } + break; + case FST_NOISE: + { + NvParameterized::Interface* ei = traits->createNvParameterized(NoiseFieldSamplerData::staticClassName()); + NoiseFieldSamplerData* ed = static_cast< NoiseFieldSamplerData*>(ei); + if (ed) + { + NvParameterized::Handle item(ei); + err = item.getParameter("Name"); + PX_ASSERT(err == NvParameterized::ERROR_NONE); + item.setParamString(itemName); + ei->setName(itemName); + ret = ei; + ed->NoiseFieldSampler = NULL; + dataBase->clone(ed->NoiseFieldSampler); + if ( ed->NoiseFieldSampler == NULL ) + { + APEX_DEBUG_WARNING("Failed to clone asset."); + } + } + } + break; + case FST_JET: + { + NvParameterized::Interface* ei = traits->createNvParameterized(JetFieldSamplerData::staticClassName()); + JetFieldSamplerData* ed = static_cast< JetFieldSamplerData*>(ei); + if (ed) + { + NvParameterized::Handle item(ei); + err = item.getParameter("Name"); + PX_ASSERT(err == NvParameterized::ERROR_NONE); + item.setParamString(itemName); + ei->setName(itemName); + ret = ei; + ed->JetFieldSampler = NULL; + dataBase->clone(ed->JetFieldSampler); + if ( ed->JetFieldSampler == NULL ) + { + APEX_DEBUG_WARNING("Failed to clone asset."); + } + } + } + break; + case FST_WIND: + { + NvParameterized::Interface* ei = traits->createNvParameterized(WindFieldSamplerData::staticClassName()); + WindFieldSamplerData* ed = static_cast< WindFieldSamplerData*>(ei); + if (ed) + { + NvParameterized::Handle item(ei); + err = item.getParameter("Name"); + PX_ASSERT(err == NvParameterized::ERROR_NONE); + item.setParamString(itemName); + ei->setName(itemName); + ret = ei; + ed->WindFieldSampler = NULL; + dataBase->clone(ed->WindFieldSampler); + if ( ed->WindFieldSampler == NULL ) + { + APEX_DEBUG_WARNING("Failed to clone asset."); + } + } + } + break; + case FST_TURBULENCE: + { + NvParameterized::Interface* ei = traits->createNvParameterized(TurbulenceFieldSamplerData::staticClassName()); + TurbulenceFieldSamplerData* ed = static_cast< TurbulenceFieldSamplerData*>(ei); + if (ed) + { + NvParameterized::Handle item(ei); + err = item.getParameter("Name"); + PX_ASSERT(err == NvParameterized::ERROR_NONE); + item.setParamString(itemName); + ei->setName(itemName); + ret = ei; + ed->TurbulenceFieldSampler = NULL; + dataBase->clone(ed->TurbulenceFieldSampler); + if ( ed->TurbulenceFieldSampler == NULL ) + { + APEX_DEBUG_WARNING("Failed to clone asset."); + } + } + } + break; + case FST_FLAME_EMITTER: + { + NvParameterized::Interface* ei = traits->createNvParameterized(FlameEmitterData::staticClassName()); + FlameEmitterData* ed = static_cast< FlameEmitterData*>(ei); + if (ed) + { + NvParameterized::Handle item(ei); + err = item.getParameter("Name"); + PX_ASSERT(err == NvParameterized::ERROR_NONE); + item.setParamString(itemName); + ei->setName(itemName); + ret = ei; + ed->FlameEmitter = NULL; + dataBase->clone(ed->FlameEmitter); + if ( ed->FlameEmitter == NULL ) + { + APEX_DEBUG_WARNING("Failed to clone asset."); + } + } + } + break; + + default: + PX_ALWAYS_ASSERT(); // not yet implemented! + break; + } + + return ret; +} + +bool ModuleParticlesImpl::fixFieldSamplerCollisionFilterNames(NvParameterized::Interface *iface) +{ + bool ret = false; + + FieldSamplerType fst = getFieldSamplerType(iface); + NvParameterized::Interface *asset = NULL; + + const char *filterName=NULL; + + switch (fst) + { + case FST_FORCE_FIELD: + { + ForceFieldData* ed = static_cast< ForceFieldData*>(iface); + asset = ed->ForceField; + filterName = "ForceFieldFS=all"; + } + break; + case FST_HEAT_SOURCE: + { + HeatSourceData *ed = static_cast< HeatSourceData *>(iface); + asset = ed->HeatSource; + filterName = "HeatSource=all"; + } + break; + case FST_SUBSTANCE_SOURCE: + { + SubstanceSourceData *ed = static_cast< SubstanceSourceData *>(iface); + asset = ed->SubstanceSource; + filterName = "SubstanceSource=all"; + } + break; + case FST_VELOCITY_SOURCE: + { + VelocitySourceData *ed = static_cast< VelocitySourceData *>(iface); + asset = ed->VelocitySource; + filterName = "VelocitySource=all"; + } + break; + case FST_ATTRACTOR: + { + AttractorFieldSamplerData* ed = static_cast< AttractorFieldSamplerData*>(iface); + asset = ed->AttractorFieldSampler; + filterName = "AttractorFS=all"; + } + break; + case FST_VORTEX: + { + VortexFieldSamplerData* ed = static_cast< VortexFieldSamplerData*>(iface); + asset = ed->VortexFieldSampler; + filterName = "VortexFS=all"; + } + break; + case FST_NOISE: + { + NoiseFieldSamplerData* ed = static_cast< NoiseFieldSamplerData*>(iface); + asset = ed->NoiseFieldSampler; + filterName = "NoiseFS=all"; + } + break; + case FST_JET: + { + JetFieldSamplerData* ed = static_cast< JetFieldSamplerData*>(iface); + asset = ed->JetFieldSampler; + filterName = "JetFS=all"; + } + break; + case FST_WIND: + { + WindFieldSamplerData* ed = static_cast< WindFieldSamplerData*>(iface); + asset = ed->WindFieldSampler; + filterName = "WindFS=all"; + } + break; + case FST_TURBULENCE: + { + TurbulenceFieldSamplerData* ed = static_cast< TurbulenceFieldSamplerData*>(iface); + asset = ed->TurbulenceFieldSampler; + filterName = "TurbulenceFS=all"; + } + break; + case FST_FLAME_EMITTER: + { + FlameEmitterData *ed = static_cast< FlameEmitterData *>(iface); + asset = ed->FlameEmitter; + filterName = "FlameEmitter=all"; + } + break; + default: + //PX_ASSERT(0); + break; + } + if ( asset && filterName ) + { + const char *fieldBoundaryFilterDataName=NULL; + const char *fieldSamplerFilterDataName=NULL; + bool ok = NvParameterized::getParamString(*asset,"fieldSamplerFilterDataName",fieldSamplerFilterDataName); + PX_ASSERT( ok ); + ok = NvParameterized::getParamString(*asset,"fieldBoundaryFilterDataName",fieldBoundaryFilterDataName); + if ( ok ) + { + if ( fieldBoundaryFilterDataName == NULL || fieldBoundaryFilterDataName[0] == 0 || nvidia::strcmp(fieldBoundaryFilterDataName,"defaultFieldBoundaryFilterDataName") == 0 ) + { + NvParameterized::setParamString(*asset,"fieldBoundaryFilterDataName",filterName); + ret = true; + } + } + if ( fieldSamplerFilterDataName == NULL || fieldSamplerFilterDataName[0] == 0 || nvidia::strcmp(fieldSamplerFilterDataName,"defaultFieldSamplerFilterDataName") == 0 ) + { + NvParameterized::setParamString(*asset,"fieldSamplerFilterDataName",filterName); + ret = true; + } + if ( fst == FST_TURBULENCE ) + { + const char *collisionFilterDataName=NULL; + bool ok = NvParameterized::getParamString(*asset,"collisionFilterDataName",collisionFilterDataName); + PX_UNUSED( ok ); + PX_ASSERT( ok ); + if ( collisionFilterDataName == NULL || collisionFilterDataName[0] == 0 || nvidia::strcmp(collisionFilterDataName,"defaultTurbulenceCollisionFilterDataName") == 0 ) + { + NvParameterized::setParamString(*asset,"collisionFilterDataName",filterName); + ret = true; + } + } + } + return ret; +} + +static void setNamedReference(NvParameterized::Interface* parentInterface, const char* parentName, const char* authoringTypeName) +{ + NvParameterized::Handle handle(parentInterface); + NvParameterized::ErrorType err = parentInterface->getParameterHandle(parentName, handle); + PX_ASSERT(err == NvParameterized::ERROR_NONE); + if (err == NvParameterized::ERROR_NONE) + { + err = handle.initParamRef(authoringTypeName,true); + PX_ASSERT(err == NvParameterized::ERROR_NONE); + } +} + + + +bool ModuleParticlesImpl::setEffectPackageFieldSamplerDatabase(const NvParameterized::Interface* dataBase) +{ + WRITE_ZONE(); + bool ret = false; + + if (dataBase) + { + NvParameterized::Traits* traits = mSdk->getParameterizedTraits(); + FieldSamplerType fst = getFieldSamplerType(dataBase); + if (fst != FST_NONE) + { + bool revised = false; + const char* itemName = dataBase->name(); + EffectPackageFieldSamplerDatabaseParams* d = static_cast< EffectPackageFieldSamplerDatabaseParams*>(mEffectPackageFieldSamplerDatabaseParams); + if ( d ) + { + for (uint32_t i = 0; i < (uint32_t)d->FieldSamplers.arraySizes[0]; i++) + { + NvParameterized::Interface* ei = d->FieldSamplers.buf[i]; + if (!ei) + { + continue; + } + const char* dataName; + NvParameterized::getParamString(*ei, "Name", dataName); + if (nvidia::stricmp(dataName, itemName) == 0) + { + ei->destroy(); + d->FieldSamplers.buf[i] = getFieldSamplerData(fst, traits, dataBase); + fixFieldSamplerCollisionFilterNames( d->FieldSamplers.buf[i] ); + revised = true; + ret = true; + break; + } + } + } + if (!revised && mEffectPackageFieldSamplerDatabaseParams) + { + int32_t arraySize = d->FieldSamplers.arraySizes[0]; + NvParameterized::Handle handle(mEffectPackageFieldSamplerDatabaseParams); + NvParameterized::ErrorType err = handle.getParameter("FieldSamplers"); + PX_ASSERT(err == NvParameterized::ERROR_NONE); + err = handle.resizeArray(arraySize + 1); + PX_ASSERT(err == NvParameterized::ERROR_NONE); + if (err == NvParameterized::ERROR_NONE) + { + d->FieldSamplers.buf[arraySize] = getFieldSamplerData(fst, traits, dataBase); + fixFieldSamplerCollisionFilterNames( d->FieldSamplers.buf[arraySize] ); + } + } + } + else if (nvidia::strcmp(dataBase->className(), EffectPackageFieldSamplerDatabaseParams::staticClassName()) == 0) + { + if (mEffectPackageFieldSamplerDatabaseParams && mEffectPackageFieldSamplerDatabaseParams != dataBase) + { + mEffectPackageFieldSamplerDatabaseParams->destroy(); + mEffectPackageFieldSamplerDatabaseParams = NULL; + } + + if (mEffectPackageFieldSamplerDatabaseParams == NULL) + { + dataBase->clone(mEffectPackageFieldSamplerDatabaseParams); + if ( mEffectPackageFieldSamplerDatabaseParams == NULL ) + { + APEX_DEBUG_WARNING("Failed to clone asset."); + mEffectPackageFieldSamplerDatabaseParams = traits->createNvParameterized(EffectPackageFieldSamplerDatabaseParams::staticClassName()); + } + } + + EffectPackageFieldSamplerDatabaseParams* d = static_cast< EffectPackageFieldSamplerDatabaseParams*>(mEffectPackageFieldSamplerDatabaseParams); + if ( d ) + { + if (d->FieldSamplers.arraySizes[0] == 0) + { + NvParameterized::Handle handle(mEffectPackageFieldSamplerDatabaseParams); + NvParameterized::ErrorType err = handle.getParameter("FieldSamplers"); + PX_ASSERT(err == NvParameterized::ERROR_NONE); + err = handle.resizeArray(11); + PX_ASSERT(err == NvParameterized::ERROR_NONE); + NvParameterized::Interface* ei; + if (err == NvParameterized::ERROR_NONE) + { + ei = traits->createNvParameterized(AttractorFieldSamplerData::staticClassName()); + d->FieldSamplers.buf[0] = ei; + + ei = traits->createNvParameterized(ForceFieldData::staticClassName()); + d->FieldSamplers.buf[1] = ei; + + ei = traits->createNvParameterized(HeatSourceData::staticClassName()); + d->FieldSamplers.buf[2] = ei; + + ei = traits->createNvParameterized(JetFieldSamplerData::staticClassName()); + d->FieldSamplers.buf[3] = ei; + + ei = traits->createNvParameterized(TurbulenceFieldSamplerData::staticClassName()); + d->FieldSamplers.buf[4] = ei; + + ei = traits->createNvParameterized(VortexFieldSamplerData::staticClassName()); + d->FieldSamplers.buf[5] = ei; + + ei = traits->createNvParameterized(NoiseFieldSamplerData::staticClassName()); + d->FieldSamplers.buf[6] = ei; + + ei = traits->createNvParameterized(SubstanceSourceData::staticClassName()); + d->FieldSamplers.buf[7] = ei; + + ei = traits->createNvParameterized(WindFieldSamplerData::staticClassName()); + d->FieldSamplers.buf[8] = ei; + + ei = traits->createNvParameterized(VelocitySourceData::staticClassName()); + d->FieldSamplers.buf[9] = ei; + + ei = traits->createNvParameterized(FlameEmitterData::staticClassName()); + d->FieldSamplers.buf[10] = ei; + + ret = true; + } + } + + + Array< const char* > nameList; + for (int32_t i = 0; i < d->FieldSamplers.arraySizes[0]; i++) + { + ForceFieldData* e = static_cast< ForceFieldData*>(d->FieldSamplers.buf[i]); + if (e) + { + for (uint32_t j = 0; j < nameList.size(); j++) + { + if (nvidia::stricmp(nameList[j], e->Name) == 0) + { + NvParameterized::Handle handle(e); + NvParameterized::ErrorType err = handle.getParameter("Name"); + PX_ASSERT(err == NvParameterized::ERROR_NONE); + if (err == NvParameterized::ERROR_NONE) + { + handle.setParamString(getUniqueName(nameList, e->Name)); + ret = true; + break; + } + } + } + nameList.pushBack(e->Name); + } + } + + + for (uint32_t i = 0; i < (uint32_t)d->FieldSamplers.arraySizes[0]; i++) + { + NvParameterized::Interface* iface = d->FieldSamplers.buf[i]; + FieldSamplerType fst = getFieldSamplerType(iface); + switch (fst) + { + case FST_FORCE_FIELD: + { + ForceFieldData* ed = static_cast< ForceFieldData*>(d->FieldSamplers.buf[i]); + if (ed->ForceField == NULL) + { + ed->ForceField = traits->createNvParameterized(forcefield::ForceFieldAssetParams::staticClassName()); + ret = true; + } + forcefield::ForceFieldAssetParams* fap = static_cast< forcefield::ForceFieldAssetParams*>(ed->ForceField); + if (fap && fap->strength == 0 && fap->lifetime == 0) // initialize the forcefield to reasonable values; if lifetime is zero, then the force field is not considered initalized. + { + ret = true; + fap->defScale = 1; + fap->strength = 20.0f; + fap->lifetime = 1000; + + fap->includeShapeParameters.dimensions = PxVec3(5, 5, 5); + + //TODO: Verify correctness of changes, add case for GenericForceFieldKernelType + if (fap->forceFieldKernelType == NULL) + { + fap->forceFieldKernelType = traits->createNvParameterized(forcefield::RadialForceFieldKernelParams::staticClassName()); + forcefield::RadialForceFieldKernelParams* rfap = static_cast< forcefield::RadialForceFieldKernelParams*>(fap->forceFieldKernelType); + if (rfap) + { + rfap->falloffParameters = traits->createNvParameterized(forcefield::ForceFieldFalloffParams::staticClassName()); + forcefield::ForceFieldFalloffParams* ffp = static_cast< forcefield::ForceFieldFalloffParams*>(rfap->falloffParameters); + rfap->noiseParameters = traits->createNvParameterized(forcefield::ForceFieldNoiseParams::staticClassName()); + forcefield::ForceFieldNoiseParams* fnp = static_cast< forcefield::ForceFieldNoiseParams*>(rfap->noiseParameters); + + ffp->multiplier = 0.5f; + ffp->start = 100; + ffp->end = 0; + + fnp->strength = 0.01f; + fnp->spaceScale = 8; + fnp->timeScale = 1; + fnp->octaves = 3; + } + } + } + } + break; + case FST_HEAT_SOURCE: + { + HeatSourceData* ed = static_cast< HeatSourceData*>(d->FieldSamplers.buf[i]); + if (ed->HeatSource == NULL) + { + ed->HeatSource = traits->createNvParameterized(turbulencefs::HeatSourceAssetParams::staticClassName()); + ret = true; + } + turbulencefs::HeatSourceAssetParams* ap = static_cast< turbulencefs::HeatSourceAssetParams*>(ed->HeatSource); + if (ap && ap->geometryType == NULL) + { + ap->averageTemperature = 4; + ap->stdTemperature = 2; + ap->geometryType = traits->createNvParameterized(turbulencefs::HeatSourceGeomSphereParams::staticClassName()); + ret = true; + } + } + break; + case FST_SUBSTANCE_SOURCE: + { + SubstanceSourceData* ed = static_cast< SubstanceSourceData*>(d->FieldSamplers.buf[i]); + if (ed->SubstanceSource == NULL) + { + ed->SubstanceSource = traits->createNvParameterized(turbulencefs::SubstanceSourceAssetParams::staticClassName()); + ret = true; + } + turbulencefs::SubstanceSourceAssetParams* ap = static_cast< turbulencefs::SubstanceSourceAssetParams*>(ed->SubstanceSource); + if (ap && ap->geometryType == NULL) + { + ap->averageDensity = 32; + ap->stdDensity = 16; + ap->geometryType = traits->createNvParameterized(turbulencefs::HeatSourceGeomSphereParams::staticClassName()); + ret = true; + } + } + break; + case FST_VELOCITY_SOURCE: + { + VelocitySourceData* ed = static_cast< VelocitySourceData*>(d->FieldSamplers.buf[i]); + if (ed->VelocitySource == NULL) + { + ed->VelocitySource = traits->createNvParameterized(turbulencefs::VelocitySourceAssetParams::staticClassName()); + ret = true; + } + turbulencefs::VelocitySourceAssetParams* ap = static_cast< turbulencefs::VelocitySourceAssetParams*>(ed->VelocitySource); + if (ap && ap->geometryType == NULL) + { + ap->geometryType = traits->createNvParameterized(turbulencefs::HeatSourceGeomSphereParams::staticClassName()); + ret = true; + } + } + break; + case FST_ATTRACTOR: + { + AttractorFieldSamplerData* ed = static_cast< AttractorFieldSamplerData*>(d->FieldSamplers.buf[i]); + if (ed->AttractorFieldSampler == NULL) + { + ed->AttractorFieldSampler = traits->createNvParameterized(basicfs::AttractorFSAssetParams::staticClassName()); + basicfs::AttractorFSAssetParams* a = static_cast< basicfs::AttractorFSAssetParams*>(ed->AttractorFieldSampler); + if (a) + { + a->boundaryFadePercentage = 0.3f; + a->radius = 2; + a->constFieldStrength = 20; + a->variableFieldStrength = 1; + } + ret = true; + } + } + break; + case FST_VORTEX: + { + VortexFieldSamplerData* ed = static_cast< VortexFieldSamplerData*>(d->FieldSamplers.buf[i]); + if (ed->VortexFieldSampler == NULL) + { + ed->VortexFieldSampler = traits->createNvParameterized(basicfs::VortexFSAssetParams::staticClassName()); + basicfs::VortexFSAssetParams* j = static_cast< basicfs::VortexFSAssetParams*>(ed->VortexFieldSampler); + if (j) + { + j->boundaryFadePercentage = 0.1f; + j->height = 1; + j->bottomRadius = 1; + j->topRadius = 1; + j->rotationalStrength = 4; + j->radialStrength = 4; + j->liftStrength = 1; + } + ret = true; + } + } + break; + case FST_NOISE: + { + NoiseFieldSamplerData* ed = static_cast< NoiseFieldSamplerData*>(d->FieldSamplers.buf[i]); + if (ed->NoiseFieldSampler == NULL) + { + ed->NoiseFieldSampler = traits->createNvParameterized(basicfs::NoiseFSAssetParams::staticClassName()); + ret = true; + } + } + break; + case FST_JET: + { + JetFieldSamplerData* ed = static_cast< JetFieldSamplerData*>(d->FieldSamplers.buf[i]); + if (ed->JetFieldSampler == NULL) + { + ed->JetFieldSampler = traits->createNvParameterized(basicfs::JetFSAssetParams::staticClassName()); + basicfs::JetFSAssetParams* j = static_cast< basicfs::JetFSAssetParams*>(ed->JetFieldSampler); + if (j) + { + j->defaultScale = 1; + j->boundaryFadePercentage = 0.3f; + j->fieldDirection = PxVec3(1, 0, 0); + j->fieldDirectionDeviationAngle = 0; + j->fieldDirectionOscillationPeriod = 0; + j->fieldStrength = 10; + j->fieldStrengthDeviationPercentage = 0; + j->fieldStrengthOscillationPeriod = 0; + j->gridShapeRadius = 2; + j->gridShapeHeight = 2; + j->gridBoundaryFadePercentage = 0.01f; + j->nearRadius = 0.1f; + j->pivotRadius = 0.2f; + j->farRadius = 4; + j->directionalStretch = 1; + j->averageStartDistance = 1; + j->averageEndDistance = 5; + j->noisePercentage = 0.1f; + j->noiseTimeScale = 1; + j->noiseOctaves = 1; + } + ret = true; + } + } + break; + case FST_WIND: + { + WindFieldSamplerData* ed = static_cast< WindFieldSamplerData*>(d->FieldSamplers.buf[i]); + if (ed->WindFieldSampler == NULL) + { + ed->WindFieldSampler = traits->createNvParameterized(basicfs::WindFSAssetParams::staticClassName()); + basicfs::WindFSAssetParams* j = static_cast< basicfs::WindFSAssetParams*>(ed->WindFieldSampler); + if (j) + { + // TODO initialize to reasonable default values + } + ret = true; + } + } + break; + case FST_TURBULENCE: + { + TurbulenceFieldSamplerData* ed = static_cast< TurbulenceFieldSamplerData*>(d->FieldSamplers.buf[i]); + if (ed->TurbulenceFieldSampler == NULL) + { + ed->TurbulenceFieldSampler = traits->createNvParameterized(turbulencefs::TurbulenceFSAssetParams::staticClassName()); + turbulencefs::TurbulenceFSAssetParams* fs = static_cast< turbulencefs::TurbulenceFSAssetParams*>(ed->TurbulenceFieldSampler); + if (fs) + { + fs->gridSizeWorld = PxVec3(15, 15, 15); + fs->updatesPerFrame = 1; + fs->angularVelocityMultiplier = 1; + fs->angularVelocityClamp = 100000; + fs->linearVelocityMultiplier = 1; + fs->linearVelocityClamp = 100000; + fs->boundaryFadePercentage = 0.3f; + fs->boundarySizePercentage = 1; + fs->maxCollidingObjects = 32; + fs->maxHeatSources = 8; + fs->dragCoeff = 0; + fs->externalVelocity = PxVec3(0, 0, 0); + fs->fieldVelocityMultiplier = 1; + fs->fieldVelocityWeight = 0.75; + fs->useHeat = true; + fs->heatParams.temperatureBasedForceMultiplier = 0.02f; + fs->heatParams.ambientTemperature = 0; + fs->heatParams.heatForceDirection = PxVec3(0, 1, 0); + fs->isEnabledOptimizedLOD = false; + fs->updatesPerFrame = 1.f; + fs->noiseParams.noiseStrength = 0; + fs->noiseParams.noiseSpacePeriod = PxVec3(0.9f, 0.9f, 0.9f); + fs->noiseParams.noiseTimePeriod = 10; + fs->noiseParams.noiseOctaves = 1; + fs->dragCoeffForRigidBody = 0; + fs->fluidViscosity = 0; + } + + ret = true; + } + } + break; + case FST_FLAME_EMITTER: + { + FlameEmitterData* ed = static_cast< FlameEmitterData*>(d->FieldSamplers.buf[i]); + if (ed->FlameEmitter == NULL) + { + ed->FlameEmitter = traits->createNvParameterized(turbulencefs::FlameEmitterAssetParams::staticClassName()); + ret = true; + } + } + break; + default: + PX_ALWAYS_ASSERT(); // not yet implemented + break; + } + if ( fixFieldSamplerCollisionFilterNames( iface ) ) + { + ret = true; + } + } + } + } + else + { + PX_ALWAYS_ASSERT(); // invalid NvParameterized::Interface passed in + } + } + + + return ret; +} + + +static void initPathData(NvParameterized::Interface *ei,RigidBodyEffectNS::EffectProperties_Type &ep,bool &ret) +{ + if ( ep.Path.Scale.arraySizes[0] == 0 ) + { + NvParameterized::Handle handle(ei); + NvParameterized::ErrorType err = handle.getParameter("EffectProperties.Path.Scale"); + PX_ASSERT(err == NvParameterized::ERROR_NONE); + err = handle.resizeArray(2); + PX_ASSERT(err == NvParameterized::ERROR_NONE); + if (err == NvParameterized::ERROR_NONE) + { + RigidBodyEffectNS::ControlPoint_Type &c1 = ep.Path.Scale.buf[0]; + RigidBodyEffectNS::ControlPoint_Type &c2 = ep.Path.Scale.buf[1]; + + c1.x = 0; + c1.y = 1; + + c2.x = 1; + c2.y = 1; + ret = true; + } + } + if ( ep.Path.Speed.arraySizes[0] == 0 ) + { + NvParameterized::Handle handle(ei); + NvParameterized::ErrorType err = handle.getParameter("EffectProperties.Path.Speed"); + PX_ASSERT(err == NvParameterized::ERROR_NONE); + err = handle.resizeArray(2); + PX_ASSERT(err == NvParameterized::ERROR_NONE); + if (err == NvParameterized::ERROR_NONE) + { + RigidBodyEffectNS::ControlPoint_Type &c1 = ep.Path.Speed.buf[0]; + RigidBodyEffectNS::ControlPoint_Type &c2 = ep.Path.Speed.buf[1]; + + c1.x = 0; + c1.y = 1; + + c2.x = 1; + c2.y = 1; + ret = true; + } + } +} + +static void initPathData(NvParameterized::Interface *ei,RigidBodyEffectNS::EffectPath_Type &Path,bool &ret) +{ + if ( Path.Scale.arraySizes[0] == 0 ) + { + NvParameterized::Handle handle(ei); + NvParameterized::ErrorType err = handle.getParameter("Path.Scale"); + PX_ASSERT(err == NvParameterized::ERROR_NONE); + err = handle.resizeArray(2); + PX_ASSERT(err == NvParameterized::ERROR_NONE); + if (err == NvParameterized::ERROR_NONE) + { + RigidBodyEffectNS::ControlPoint_Type &c1 = Path.Scale.buf[0]; + RigidBodyEffectNS::ControlPoint_Type &c2 = Path.Scale.buf[1]; + + c1.x = 0; + c1.y = 1; + + c2.x = 1; + c2.y = 1; + ret = true; + } + } + if ( Path.Speed.arraySizes[0] == 0 ) + { + NvParameterized::Handle handle(ei); + NvParameterized::ErrorType err = handle.getParameter("Path.Speed"); + PX_ASSERT(err == NvParameterized::ERROR_NONE); + err = handle.resizeArray(2); + PX_ASSERT(err == NvParameterized::ERROR_NONE); + if (err == NvParameterized::ERROR_NONE) + { + RigidBodyEffectNS::ControlPoint_Type &c1 = Path.Speed.buf[0]; + RigidBodyEffectNS::ControlPoint_Type &c2 = Path.Speed.buf[1]; + + c1.x = 0; + c1.y = 1; + + c2.x = 1; + c2.y = 1; + ret = true; + } + } +} + + +bool ModuleParticlesImpl::setEffectPackageDatabase(const NvParameterized::Interface* dataBase) +{ + WRITE_ZONE(); + bool ret = false; + + if (dataBase) + { + NvParameterized::Traits* traits = mSdk->getParameterizedTraits(); + const char* className = dataBase->className(); + if (nvidia::strcmp(className, EffectPackageAssetParams::staticClassName()) == 0) + { + bool revised = false; + const char* itemName = dataBase->name(); + EffectPackageDatabaseParams* d = static_cast< EffectPackageDatabaseParams*>(mEffectPackageDatabaseParams); + for (uint32_t i = 0; i < (uint32_t)d->EffectPackages.arraySizes[0]; i++) + { + NvParameterized::Interface* ei = d->EffectPackages.buf[i]; + EffectPackageData* ed = static_cast< EffectPackageData*>(ei); + if (nvidia::stricmp(ed->Name.buf, itemName) == 0) + { + ed->EffectPackage->copy(*dataBase); + revised = true; + ret = true; + break; + } + } + if (!revised && mEffectPackageDatabaseParams) + { + int32_t arraySize = d->EffectPackages.arraySizes[0]; + NvParameterized::Handle handle(mEffectPackageDatabaseParams); + NvParameterized::ErrorType err = handle.getParameter("EffectPackages"); + PX_ASSERT(err == NvParameterized::ERROR_NONE); + err = handle.resizeArray(arraySize + 1); + PX_ASSERT(err == NvParameterized::ERROR_NONE); + if (err == NvParameterized::ERROR_NONE) + { + NvParameterized::Interface* ei = traits->createNvParameterized(EffectPackageData::staticClassName()); + EffectPackageData* ed = static_cast< EffectPackageData*>(ei); + if (ed) + { + NvParameterized::Handle item(ei); + err = item.getParameter("Name"); + PX_ASSERT(err == NvParameterized::ERROR_NONE); + item.setParamString(itemName); + ei->setName(itemName); + d->EffectPackages.buf[arraySize] = ei; + dataBase->clone(ed->EffectPackage); + if ( ed->EffectPackage == NULL ) + { + APEX_DEBUG_WARNING("Failed to clone asset."); + } + } + ret = true; + } + } + } + else if (nvidia::strcmp(className, EffectPackageDatabaseParams::staticClassName()) == 0) + { + if (mEffectPackageDatabaseParams && mEffectPackageDatabaseParams != dataBase) + { + mEffectPackageDatabaseParams->destroy(); + mEffectPackageDatabaseParams = NULL; + } + if (mEffectPackageDatabaseParams == NULL) + { + dataBase->clone(mEffectPackageDatabaseParams); + if ( mEffectPackageDatabaseParams == NULL ) + { + APEX_DEBUG_WARNING("Failed to clone asset."); + mEffectPackageDatabaseParams = traits->createNvParameterized(EffectPackageDatabaseParams::staticClassName()); + } + } + } + // initialize anything which needs default values assigned... + if ( mEffectPackageDatabaseParams ) + { + EffectPackageDatabaseParams* d = static_cast< EffectPackageDatabaseParams*>(mEffectPackageDatabaseParams); + + { + if (d->EffectPackages.arraySizes[0] == 0) + { + NvParameterized::Handle handle(mEffectPackageDatabaseParams); + NvParameterized::ErrorType err = handle.getParameter("EffectPackages"); + PX_ASSERT(err == NvParameterized::ERROR_NONE); + err = handle.resizeArray(1); + PX_ASSERT(err == NvParameterized::ERROR_NONE); + if (err == NvParameterized::ERROR_NONE) + { + NvParameterized::Interface* ei = traits->createNvParameterized(EffectPackageData::staticClassName()); + EffectPackageData* ed = static_cast< EffectPackageData*>(ei); + d->EffectPackages.buf[0] = ei; + if (ed) + { + ed->EffectPackage = traits->createNvParameterized(EffectPackageAssetParams::staticClassName()); + EffectPackageAssetParams* p = static_cast< EffectPackageAssetParams*>(ed->EffectPackage); + if (p->Effects.arraySizes[0] == 0 && p) + { + NvParameterized::Handle handle(p); + NvParameterized::ErrorType err = handle.getParameter("Effects"); + PX_ASSERT(err == NvParameterized::ERROR_NONE); + err = handle.resizeArray(1); + PX_ASSERT(err == NvParameterized::ERROR_NONE); + if (err == NvParameterized::ERROR_NONE) + { + NvParameterized::Interface* ei = traits->createNvParameterized(EmitterEffect::staticClassName()); + p->Effects.buf[0] = ei; + ret = true; + } + } + } + ret = true; + } + } + Array< const char* > nameList; + for (int32_t i = 0; i < d->EffectPackages.arraySizes[0]; i++) + { + EffectPackageData* e = static_cast< EffectPackageData*>(d->EffectPackages.buf[i]); + if (e) + { + for (uint32_t j = 0; j < nameList.size(); j++) + { + if (nvidia::stricmp(nameList[j], e->Name) == 0) + { + NvParameterized::Handle handle(e); + NvParameterized::ErrorType err = handle.getParameter("Name"); + PX_ASSERT(err == NvParameterized::ERROR_NONE); + if (err == NvParameterized::ERROR_NONE) + { + handle.setParamString(getUniqueName(nameList, e->Name)); + ret = true; + break; + } + } + } + nameList.pushBack(e->Name); + } + } + + + + for (uint32_t i = 0; i < (uint32_t)d->EffectPackages.arraySizes[0]; i++) + { + NvParameterized::Interface* ei = d->EffectPackages.buf[i]; + EffectPackageData* d = static_cast< EffectPackageData*>(ei); + + + EffectPackageAssetParams* p = static_cast< EffectPackageAssetParams*>(d->EffectPackage); + if (p == NULL) + { + NvParameterized::Interface* ep = traits->createNvParameterized(EffectPackageAssetParams::staticClassName()); + p = static_cast< EffectPackageAssetParams*>(ep); + d->EffectPackage = ep; + } + + { + RigidBodyEffectNS::EffectPath_Type &path = *(RigidBodyEffectNS::EffectPath_Type *)&p->Path; + initPathData(d->EffectPackage,path,ret); + } + + + + for (uint32_t i = 0; i < (uint32_t)p->Effects.arraySizes[0]; i++) + { + NvParameterized::Interface* ei = p->Effects.buf[i]; + if (!ei) + { + continue; + } + if (nvidia::strcmp(ei->className(), EmitterEffect::staticClassName()) == 0) + { + EmitterEffect* e = static_cast< EmitterEffect*>(ei); + RigidBodyEffectNS::EffectProperties_Type &ep = *(RigidBodyEffectNS::EffectProperties_Type *)&e->EffectProperties; + initPathData(ei,ep,ret); + if (e->Emitter == NULL) + { + setNamedReference(ei, "Emitter", EMITTER_AUTHORING_TYPE_NAME); + PX_ASSERT(e->Emitter); + e->Emitter->setName("defaultEmitter"); + ret = true; + } + } + else if (nvidia::strcmp(ei->className(), RigidBodyEffect::staticClassName()) == 0) + { + RigidBodyEffect* e = static_cast< RigidBodyEffect*>(ei); + RigidBodyEffectNS::EffectProperties_Type &ep = e->EffectProperties; + initPathData(ei,ep,ret); + } + else if (nvidia::strcmp(ei->className(), HeatSourceEffect::staticClassName()) == 0) + { + HeatSourceEffect* e = static_cast< HeatSourceEffect*>(ei); + RigidBodyEffectNS::EffectProperties_Type &ep = *(RigidBodyEffectNS::EffectProperties_Type *)&e->EffectProperties; + initPathData(ei,ep,ret); + if (e->HeatSource == NULL) + { + setNamedReference(ei, "HeatSource", HEAT_SOURCE_AUTHORING_TYPE_NAME); + PX_ASSERT(e->HeatSource); + e->HeatSource->setName("defaultHeatSource"); + ret = true; + } + } + else if (nvidia::strcmp(ei->className(), SubstanceSourceEffect::staticClassName()) == 0) + { + SubstanceSourceEffect* e = static_cast< SubstanceSourceEffect*>(ei); + RigidBodyEffectNS::EffectProperties_Type &ep = *(RigidBodyEffectNS::EffectProperties_Type *)&e->EffectProperties; + initPathData(ei,ep,ret); + if (e->SubstanceSource == NULL) + { + setNamedReference(ei, "SubstanceSource", SUBSTANCE_SOURCE_AUTHORING_TYPE_NAME); + PX_ASSERT(e->SubstanceSource); + e->SubstanceSource->setName("defaultSubstanceSource"); + ret = true; + } + } + else if (nvidia::strcmp(ei->className(), VelocitySourceEffect::staticClassName()) == 0) + { + VelocitySourceEffect* e = static_cast< VelocitySourceEffect*>(ei); + RigidBodyEffectNS::EffectProperties_Type &ep = *(RigidBodyEffectNS::EffectProperties_Type *)&e->EffectProperties; + initPathData(ei,ep,ret); + if (e->VelocitySource == NULL) + { + setNamedReference(ei, "VelocitySource", VELOCITY_SOURCE_AUTHORING_TYPE_NAME); + PX_ASSERT(e->VelocitySource); + e->VelocitySource->setName("defaultVelocitySource"); + ret = true; + } + } + else if (nvidia::strcmp(ei->className(), JetFieldSamplerEffect::staticClassName()) == 0) + { + JetFieldSamplerEffect* e = static_cast< JetFieldSamplerEffect*>(ei); + RigidBodyEffectNS::EffectProperties_Type &ep = *(RigidBodyEffectNS::EffectProperties_Type *)&e->EffectProperties; + initPathData(ei,ep,ret); + if (e->JetFieldSampler == NULL) + { + setNamedReference(ei, "JetFieldSampler", JET_FS_AUTHORING_TYPE_NAME); + PX_ASSERT(e->JetFieldSampler); + e->JetFieldSampler->setName("defaultJetFieldSampler"); + ret = true; + } + } + else if (nvidia::strcmp(ei->className(), WindFieldSamplerEffect::staticClassName()) == 0) + { + WindFieldSamplerEffect* e = static_cast< WindFieldSamplerEffect*>(ei); + RigidBodyEffectNS::EffectProperties_Type &ep = *(RigidBodyEffectNS::EffectProperties_Type *)&e->EffectProperties; + initPathData(ei,ep,ret); + if (e->WindFieldSampler == NULL) + { + setNamedReference(ei, "WindFieldSampler", WIND_FS_AUTHORING_TYPE_NAME); + PX_ASSERT(e->WindFieldSampler); + e->WindFieldSampler->setName("defaultWindFieldSampler"); + ret = true; + } + } + else if (nvidia::strcmp(ei->className(), NoiseFieldSamplerEffect::staticClassName()) == 0) + { + NoiseFieldSamplerEffect* e = static_cast< NoiseFieldSamplerEffect*>(ei); + RigidBodyEffectNS::EffectProperties_Type &ep = *(RigidBodyEffectNS::EffectProperties_Type *)&e->EffectProperties; + initPathData(ei,ep,ret); + if (e->NoiseFieldSampler == NULL) + { + setNamedReference(ei, "NoiseFieldSampler", NOISE_FS_AUTHORING_TYPE_NAME); + PX_ASSERT(e->NoiseFieldSampler); + e->NoiseFieldSampler->setName("defaultNoiseFieldSampler"); + ret = true; + } + } + else if (nvidia::strcmp(ei->className(), VortexFieldSamplerEffect::staticClassName()) == 0) + { + VortexFieldSamplerEffect* e = static_cast< VortexFieldSamplerEffect*>(ei); + RigidBodyEffectNS::EffectProperties_Type &ep = *(RigidBodyEffectNS::EffectProperties_Type *)&e->EffectProperties; + initPathData(ei,ep,ret); + if (e->VortexFieldSampler == NULL) + { + setNamedReference(ei, "VortexFieldSampler", VORTEX_FS_AUTHORING_TYPE_NAME); + PX_ASSERT(e->VortexFieldSampler); + e->VortexFieldSampler->setName("defaultVortexFieldSampler"); + ret = true; + } + } + else if (nvidia::strcmp(ei->className(), AttractorFieldSamplerEffect::staticClassName()) == 0) + { + AttractorFieldSamplerEffect* e = static_cast< AttractorFieldSamplerEffect*>(ei); + RigidBodyEffectNS::EffectProperties_Type &ep = *(RigidBodyEffectNS::EffectProperties_Type *)&e->EffectProperties; + initPathData(ei,ep,ret); + if (e->AttractorFieldSampler == NULL) + { + setNamedReference(ei, "AttractorFieldSampler", ATTRACTOR_FS_AUTHORING_TYPE_NAME); + PX_ASSERT(e->AttractorFieldSampler); + e->AttractorFieldSampler->setName("defaultAttractorFieldSampler"); + ret = true; + } + } + else if (nvidia::strcmp(ei->className(), TurbulenceFieldSamplerEffect::staticClassName()) == 0) + { + TurbulenceFieldSamplerEffect* e = static_cast< TurbulenceFieldSamplerEffect*>(ei); + RigidBodyEffectNS::EffectProperties_Type &ep = *(RigidBodyEffectNS::EffectProperties_Type *)&e->EffectProperties; + initPathData(ei,ep,ret); + if (e->TurbulenceFieldSampler == NULL) + { + setNamedReference(ei, "TurbulenceFieldSampler", TURBULENCE_FS_AUTHORING_TYPE_NAME); + PX_ASSERT(e->TurbulenceFieldSampler); + e->TurbulenceFieldSampler->setName("defaultTurbulenceFieldSampler"); + ret = true; + } + } + else if (nvidia::strcmp(ei->className(), ForceFieldEffect::staticClassName()) == 0) + { + ForceFieldEffect* e = static_cast< ForceFieldEffect*>(ei); + RigidBodyEffectNS::EffectProperties_Type &ep = *(RigidBodyEffectNS::EffectProperties_Type *)&e->EffectProperties; + initPathData(ei,ep,ret); + if (e->ForceField == NULL) + { + setNamedReference(ei, "ForceField", FORCEFIELD_AUTHORING_TYPE_NAME); + PX_ASSERT(e->ForceField); + e->ForceField->setName("defaultForceField"); + ret = true; + } + } + else if (nvidia::strcmp(ei->className(), FlameEmitterEffect::staticClassName()) == 0) + { + FlameEmitterEffect* e = static_cast< FlameEmitterEffect*>(ei); + RigidBodyEffectNS::EffectProperties_Type &ep = *(RigidBodyEffectNS::EffectProperties_Type *)&e->EffectProperties; + initPathData(ei,ep,ret); + if (e->FlameEmitter == NULL) + { + setNamedReference(ei, "FlameEmitter", FLAME_EMITTER_AUTHORING_TYPE_NAME); + PX_ASSERT(e->FlameEmitter); + e->FlameEmitter->setName("defaultFlameEmitter"); + ret = true; + } + } + + } + } + } + } + } + + + return ret; +} + + +bool ModuleParticlesImpl::fixupNamedReferences(void) +{ + bool ret = false; + + if (mEffectPackageEmitterDatabaseParams) + { + EffectPackageEmitterDatabaseParams* d = static_cast< EffectPackageEmitterDatabaseParams*>(mEffectPackageEmitterDatabaseParams); + + for (int32_t i = 0; i < d->Emitters.arraySizes[0]; i++) + { + EmitterData* ed = static_cast< EmitterData*>(d->Emitters.buf[i]); + + if (ed->Emitter) + { + NvParameterized::Handle handle(ed->Emitter); + NvParameterized::ErrorType err = ed->Emitter->getParameterHandle("iosAssetName", handle); + PX_ASSERT(err == NvParameterized::ERROR_NONE); + if (err == NvParameterized::ERROR_NONE) + { + NvParameterized::Interface* val = NULL; + err = handle.getParamRef(val); + // ok..need to see if it has changed! + if (val) + { + const char* refName = val->name(); + EffectPackageIOSDatabaseParams* d = static_cast< EffectPackageIOSDatabaseParams*>(mEffectPackageIOSDatabaseParams); + for (uint32_t i = 0; i < (uint32_t)d->ParticleSimulations.arraySizes[0]; i++) + { + NvParameterized::Interface* ei = d->ParticleSimulations.buf[i]; + emitter::ApexEmitterAssetParameters* ae = static_cast< emitter::ApexEmitterAssetParameters*>(ed->Emitter); + ParticleSimulationData* ed = static_cast< ParticleSimulationData*>(ei); + if (nvidia::stricmp(ed->Name.buf, refName) == 0) + { + NvParameterized::Interface* ios = ed->IOS; + if ( ios ) + { + const char* paramRef = getAuthoringTypeName(ios->className()); + err = handle.initParamRef(paramRef,true); + PX_ASSERT(err == NvParameterized::ERROR_NONE); + if (err == NvParameterized::ERROR_NONE) + { + ae->iosAssetName->setName(ed->Name.buf); + } + } + break; + } + } + } + } + } + } + } + return ret; +} + +bool ModuleParticlesImpl::initParticleSimulationData(ParticleSimulationData* ed) +{ + bool ret = false; + + NvParameterized::Traits* traits = mSdk->getParameterizedTraits(); + + if (ed->IOS == NULL) + { + ed->IOS = traits->createNvParameterized(basicios::BasicIOSAssetParam::staticClassName()); + basicios::BasicIOSAssetParam* ios = static_cast< basicios::BasicIOSAssetParam*>(ed->IOS); + if (ios) + { + ios->restDensity = 1; + ios->particleRadius = 0.1f; + ios->maxParticleCount = 16384; + ios->maxInjectedParticleCount = 0.05; + ios->sceneGravityScale = 1; + ios->externalAcceleration.x = 0; + ios->externalAcceleration.y = 0; + ios->externalAcceleration.z = 0; + ios->particleMass.center = 1; + ios->particleMass.spread = 0; + ios->staticCollision = true; + ios->restitutionForStaticShapes = 0.2f; + ios->dynamicCollision = true; + ios->restitutionForDynamicShapes = 0.2f; + ios->collisionDistanceMultiplier = 1; + ios->collisionThreshold = 0.001f; + ios->collisionWithConvex = true; + ios->collisionWithTriangleMesh = false; + } + ret = true; + } + + if (ed->IOS && nvidia::strcmp(ed->IOS->className(), "ParticleIosAssetParam") == 0) + { + pxparticleios::ParticleIosAssetParam* p = static_cast< pxparticleios::ParticleIosAssetParam*>(ed->IOS); + if (p->particleType == NULL) + { + p->particleType = traits->createNvParameterized(pxparticleios::FluidParticleSystemParams::staticClassName()); + ret = true; + } + } + + if ( ed->IOS ) + { + if ( nvidia::strcmp(ed->IOS->className(), "ParticleIosAssetParam") == 0 ) + { + const char *filterName = "ParticlesSimple=all"; + pxparticleios::ParticleIosAssetParam* p = static_cast< pxparticleios::ParticleIosAssetParam*>(ed->IOS); + if (p->particleType && nvidia::strcmp(p->particleType->className(), pxparticleios::FluidParticleSystemParams::staticClassName()) == 0 ) + { + filterName = "ParticlesFluid=all"; + } + + { + const char *value=NULL; + NvParameterized::getParamString(*ed->IOS,"simulationFilterData",value); + if ( value == NULL || value[0] == 0 ) + { + NvParameterized::setParamString(*ed->IOS,"simulationFilterData",filterName); + ret = true; + } + } + { + const char *value=NULL; + NvParameterized::getParamString(*ed->IOS,"fieldSamplerFilterData",value); + if ( value == NULL || value[0] == 0 ) + { + NvParameterized::setParamString(*ed->IOS,"fieldSamplerFilterData",filterName); + ret = true; + } + } + } + else + { + const char *filterName = "ParticlesBasicIOS=all"; + { + const char *value=NULL; + NvParameterized::getParamString(*ed->IOS,"collisionFilterDataName",value); + if ( value == NULL || value[0] == 0 ) + { + NvParameterized::setParamString(*ed->IOS,"collisionFilterDataName",filterName); + ret = true; + } + } + { + const char *value=NULL; + NvParameterized::getParamString(*ed->IOS,"fieldSamplerFilterDataName",value); + if ( value == NULL || value[0] == 0 ) + { + NvParameterized::setParamString(*ed->IOS,"fieldSamplerFilterDataName",filterName); + ret = true; + } + } + + } + } + return ret; +} + +void ModuleParticlesImpl::resetEmitterPool(void) +{ + WRITE_ZONE(); + for (uint32_t i = 0; i < mScenes.size(); i++) + { + ParticlesScene* ds = static_cast< ParticlesScene*>(mScenes[i]); + ds->resetEmitterPool(); + } +} + +#define MODULE_CHECK(x) if ( x == module ) { x = NULL; } + +/** +Notification from ApexSDK when a module has been released +*/ +void ModuleParticlesImpl::notifyChildGone(ModuleIntl* imodule) +{ + Module* module = mSdk->getModule(imodule); + PX_ASSERT(module); + MODULE_CHECK(mModuleBasicIos); + MODULE_CHECK(mModuleEmitter); + MODULE_CHECK(mModuleIofx); + MODULE_CHECK(mModuleFieldSampler); + MODULE_CHECK(mModuleBasicFS); + MODULE_CHECK(mModuleParticleIos); // PhysX 3.x only : Instantiate the ParticleIOS module + MODULE_CHECK(mModuleForceField); // PhysX 3.x only : Instantiate the ForceField module +}; + +// This is a notification that the ApexSDK is being released. During the shutdown process +// the APEX SDK will automatically release all currently registered modules; therefore we are no longer +// responsible for releasing these modules ourselves. + +#define SAFE_MODULE_NULL(x) if ( x ) { ModuleIntl *m = mSdk->getInternalModule(x); PX_ASSERT(m); m->setParent(NULL); x = NULL; } + +void ModuleParticlesImpl::notifyReleaseSDK(void) +{ + SAFE_MODULE_NULL(mModuleBasicIos); + SAFE_MODULE_NULL(mModuleEmitter); + SAFE_MODULE_NULL(mModuleIofx); + SAFE_MODULE_NULL(mModuleFieldSampler); + SAFE_MODULE_NULL(mModuleBasicFS); + SAFE_MODULE_NULL(mModuleParticleIos); // PhysX 3.x only : Instantiate the ParticleIOS module + SAFE_MODULE_NULL(mModuleForceField); // PhysX 3.x only : Instantiate the ForceField module +} + +void ModuleParticlesImpl::initializeDefaultDatabases(void) +{ + WRITE_ZONE(); + /* Register the NvParameterized factories */ + NvParameterized::Traits* traits = mSdk->getParameterizedTraits(); + + if (mTurbulenceModule == NULL) + { + uint32_t count = mSdk->getNbModules(); + Module** modules = mSdk->getModules(); + for (uint32_t i = 0; i < count; i++) + { + Module* m = modules[i]; + const char* name = m->getName(); + if (nvidia::strcmp(name, "TurbulenceFS") == 0) + { + mTurbulenceModule = static_cast< ModuleTurbulenceFS*>(m); + break; + } + } + } + + // Initialize the effect package databases + if (mEffectPackageIOSDatabaseParams == NULL) + { + NvParameterized::Interface* iface = traits->createNvParameterized(EffectPackageIOSDatabaseParams::staticClassName()); + if (iface) + { + setEffectPackageIOSDatabase(iface); + iface->destroy(); + } + } + if (mEffectPackageIOFXDatabaseParams == NULL) + { + NvParameterized::Interface* iface = traits->createNvParameterized(EffectPackageIOFXDatabaseParams::staticClassName()); + if (iface) + { + setEffectPackageIOFXDatabase(iface); + iface->destroy(); + } + } + if (mEffectPackageEmitterDatabaseParams == NULL) + { + NvParameterized::Interface* iface = traits->createNvParameterized(EffectPackageEmitterDatabaseParams::staticClassName()); + if (iface) + { + setEffectPackageEmitterDatabase(iface); + iface->destroy(); + } + } + if (mEffectPackageFieldSamplerDatabaseParams == NULL) + { + NvParameterized::Interface* iface = traits->createNvParameterized(EffectPackageFieldSamplerDatabaseParams::staticClassName()); + setEffectPackageFieldSamplerDatabase(iface); + iface->destroy(); + } + if (mEffectPackageDatabaseParams == NULL) + { + NvParameterized::Interface* iface = traits->createNvParameterized(EffectPackageDatabaseParams::staticClassName()); + if (iface) + { + setEffectPackageDatabase(iface); + iface->destroy(); + } + } + if (mGraphicsMaterialsDatabase == NULL) + { + NvParameterized::Interface* iface = traits->createNvParameterized(EffectPackageGraphicsMaterialsParams::staticClassName()); + if (iface) + { + setEffectPackageGraphicsMaterialsDatabase(iface); + iface->destroy(); + } + } + +} + +#define MODULE_NAME_CHECK(x) if ( x ) { if ( nvidia::strcmp(x->getName(),moduleName) == 0) ret = x; } + +nvidia::apex::Module* ModuleParticlesImpl::getModule(const char* moduleName) +{ + READ_ZONE(); + nvidia::apex::Module* ret = NULL; + MODULE_NAME_CHECK(mModuleBasicIos); + MODULE_NAME_CHECK(mModuleEmitter); + MODULE_NAME_CHECK(mModuleIofx); + MODULE_NAME_CHECK(mModuleFieldSampler); + MODULE_NAME_CHECK(mModuleBasicFS); + MODULE_NAME_CHECK(mModuleParticleIos); + MODULE_NAME_CHECK(mModuleForceField); + return ret; +} + +} +} // end namespace nvidia + diff --git a/APEX_1.4/module/particles/src/ParticlesScene.cpp b/APEX_1.4/module/particles/src/ParticlesScene.cpp new file mode 100644 index 00000000..4ca17275 --- /dev/null +++ b/APEX_1.4/module/particles/src/ParticlesScene.cpp @@ -0,0 +1,338 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + + +#include "ApexDefs.h" +#include "ApexUsingNamespace.h" + +#include "Apex.h" +#include "ParticlesScene.h" +#include "SceneIntl.h" +#include "ModulePerfScope.h" +#include "ModuleParticlesImpl.h" +#include "PxScene.h" +#include "EffectPackageActorImpl.h" +#include "ApexEmitterAssetParameters.h" +#include "EmitterAsset.h" +#include "EmitterActor.h" +#include "PxProfiler.h" + +#include "ScopedPhysXLock.h" +#include "Lock.h" + +#pragma warning(disable: 4355) // 'this' : used in base member initializer list + +namespace nvidia +{ + +namespace particles +{ + +ParticlesScene::ParticlesScene(ModuleParticlesImpl& module, SceneIntl& scene, RenderDebugInterface* renderDebug, ResourceList& list) + : mRenderDebug(renderDebug) + , mUpdateTask(*this) + , mSimTime(0) + , mCheckTime(0) +{ + mModule = &module; + mApexScene = &scene; + mPhysXScene = NULL; + + list.add(*this); // Add self to module's list of ParticlesScenes + + /* Initialize reference to ParticlesDebugRenderParams */ + { + READ_LOCK(*mApexScene); + mDebugRenderParams = DYNAMIC_CAST(DebugRenderParams*)(mApexScene->getDebugRenderParams()); + } + PX_ASSERT(mDebugRenderParams); + NvParameterized::Handle handle(*mDebugRenderParams), memberHandle(*mDebugRenderParams); + int size; + + if (mDebugRenderParams->getParameterHandle("moduleName", handle) == NvParameterized::ERROR_NONE) + { + handle.getArraySize(size, 0); + handle.resizeArray(size + 1); + if (handle.getChildHandle(size, memberHandle) == NvParameterized::ERROR_NONE) + { + memberHandle.initParamRef(ParticlesDebugRenderParams::staticClassName(), true); + } + } + + /* Load reference to ParticlesDebugRenderParams */ + NvParameterized::Interface* refPtr = NULL; + memberHandle.getParamRef(refPtr); + mParticlesDebugRenderParams = DYNAMIC_CAST(ParticlesDebugRenderParams*)(refPtr); + PX_ASSERT(mParticlesDebugRenderParams); +} + +ParticlesScene::~ParticlesScene() +{ +} + +// Called by scene task graph between LOD and PhysX::simulate() +void ParticlesScene::TaskUpdate::run() +{ +#if 1 + setProfileStat((uint16_t) mOwner.mActorArray.size()); + float dt = mOwner.mApexScene->getElapsedTime(); + mOwner.updateActors(dt); + +#endif +} + +void ParticlesScene::updateFromSimulate(float dt) +{ + PX_UNUSED(dt); +} + +// Called by updateTask between LOD and PhysX simulate. Any writes +// to render data must be protected by acquiring the actor's render data lock +void ParticlesScene::updateActors(float dt) +{ + PX_PROFILE_ZONE("ParticlesScene::updateActors", GetInternalApexSDK()->getContextId()); + + //_ASSERTE (dt <= 1.0f /60.0f); + SCOPED_PHYSX_LOCK_WRITE(mApexScene); + for (uint32_t i = 0 ; i < mActorArray.size() ; i++) + { + ParticlesBase* db = static_cast< ParticlesBase*>(mActorArray[i]); + switch (db->getParticlesType()) + { + case ParticlesBase::DST_EFFECT_PACKAGE_ACTOR: + { + EffectPackageActorImpl* actor = static_cast<EffectPackageActorImpl*>(db); + actor->updateParticles(dt); + } + break; + default: + PX_ASSERT(0); + } + } + +} + +// submit the task that updates the dynamicsystem actors +// called from ApexScene::simulate() +void ParticlesScene::submitTasks(float elapsedTime, float /*substepSize*/, uint32_t /*numSubSteps*/) +{ + PX_UNUSED(elapsedTime); +#if 1 + mSimTime += elapsedTime; + mCheckTime += elapsedTime; + PxTaskManager* tm; + { + READ_LOCK(*mApexScene); + tm = mApexScene->getTaskManager(); + } + tm->submitUnnamedTask(mUpdateTask); + mUpdateTask.finishBefore(tm->getNamedTask(AST_PHYSX_SIMULATE)); +#else + updateActors(elapsedTime); +#endif +} + +void ParticlesScene::fetchResults() +{ + +} + +// Called by ApexScene::fetchResults() with all actors render data locked. +void ParticlesScene::fetchResultsPostRenderUnlock() +{ + PX_PROFILE_ZONE("ParticlesSceneFetchResults", GetInternalApexSDK()->getContextId()); + + bool screenCulling = mModule->getEnableScreenCulling(); + bool znegative = mModule->getZnegative(); + + for (uint32_t i = 0 ; i < mActorArray.size() ; i++) + { + ParticlesBase* db = static_cast< ParticlesBase*>(mActorArray[i]); + + switch (db->getParticlesType()) + { + case ParticlesBase::DST_EFFECT_PACKAGE_ACTOR: + { + EffectPackageActorImpl* actor = static_cast< EffectPackageActorImpl*>(db); + actor->updatePoseAndBounds(screenCulling, znegative); + } + break; + default: + PX_ASSERT(0); + } + } + + // + + if (!mEmitterPool.empty()) + { + if (mCheckTime > 1) // only check once every second + { + mCheckTime = 0; + EmitterPool* source = &mEmitterPool[0]; + EmitterPool* dest = source; + uint32_t incount = mEmitterPool.size(); + uint32_t outcount = 0; + for (uint32_t i = 0; i < incount; i++) + { + bool alive = source->process(mSimTime); + if (!alive) // there must be at least one emitter sharing the same asset! + { + alive = true; // by default we cannot delete it unless there is at least once emitter in the pool sharing the same IOS + EmitterPool* scan = &mEmitterPool[0]; + for (uint32_t i = 0; i < outcount; i++) + { + if (scan != source) + { + if (source->mEmitter->getEmitterAsset() == scan->mEmitter->getEmitterAsset()) + { + alive = false; + break; + } + } + scan++; + } + } + if (alive) + { + *dest = *source; + dest++; + outcount++; + } + else + { + source->releaseEmitter(); + } + source++; + } + if (outcount != incount) + { + mEmitterPool.resize(outcount); + } + } + } + // +} + +void ParticlesScene::visualize() +{ +#ifndef WITHOUT_DEBUG_VISUALIZE + if (!mParticlesDebugRenderParams->VISUALIZE_HEAT_SOURCE_ACTOR && !mParticlesDebugRenderParams->VISUALIZE_EFFECT_PACKAGE_ACTOR) + { + return; + } + const physx::PxMat44& savedPose = *RENDER_DEBUG_IFACE(mRenderDebug)->getPoseTyped(); + RENDER_DEBUG_IFACE(mRenderDebug)->setIdentityPose(); + RENDER_DEBUG_IFACE(mRenderDebug)->pushRenderState(); + for (uint32_t i = 0 ; i < mActorArray.size() ; i++) + { + ParticlesBase* db = static_cast< ParticlesBase*>(mActorArray[i]); + switch (db->getParticlesType()) + { + case ParticlesBase::DST_EFFECT_PACKAGE_ACTOR: + if (mParticlesDebugRenderParams->VISUALIZE_EFFECT_PACKAGE_ACTOR) + { + EffectPackageActorImpl* hsa = static_cast< EffectPackageActorImpl*>(db); + hsa->visualize(mRenderDebug, false); + } + break; + default: + PX_ASSERT(0); + } + } + RENDER_DEBUG_IFACE(mRenderDebug)->setPose(savedPose); + RENDER_DEBUG_IFACE(mRenderDebug)->popRenderState(); +#endif +} + +void ParticlesScene::destroy() +{ + removeAllActors(); + resetEmitterPool(); + mApexScene->moduleReleased(*this); + delete this; +} + +void ParticlesScene::setModulePhysXScene(PxScene* nxScene) +{ + mPhysXScene = nxScene; +} + +void ParticlesScene::resetEmitterPool() +{ + for (uint32_t i = 0; i < mEmitterPool.size(); i++) + { + mEmitterPool[i].releaseEmitter(); + } + mEmitterPool.clear(); +} + +void ParticlesScene::addToEmitterPool(EmitterActor* emitterActor) +{ + EmitterPool ep(emitterActor, mSimTime); + emitterActor->stopEmit(); + mEmitterPool.pushBack(ep); +} + +EmitterActor* ParticlesScene::getEmitterFromPool(EmitterAsset* asset) +{ + EmitterActor* ret = NULL; + + uint32_t ecount = mEmitterPool.size(); + if (ecount) + { + for (uint32_t i = 0; i < ecount; i++) + { + if (mEmitterPool[i].mEmitter->getEmitterAsset() == asset) + { + ret = mEmitterPool[i].mEmitter; + for (uint32_t j = i + 1; j < ecount; j++) + { + mEmitterPool[j - 1] = mEmitterPool[j]; + } + mEmitterPool.resize(ecount - 1); + break; + } + } + } + return ret; +} + +bool EmitterPool::process(float simTime) +{ + bool ret = true; + if (simTime > mEmitterTime) + { + mEmitterTime = simTime + EMITTER_FORGET_TIME; + ret = false; + } + return ret; +} + +void EmitterPool::releaseEmitter() +{ + PX_ASSERT(mEmitter); + if (mEmitter) + { + mEmitter->release(); + mEmitter = NULL; + } +} + +EmitterPool::EmitterPool(EmitterActor* emitterActor, float simTime) +{ + mEmitter = emitterActor; + mEmitterTime = simTime + EMITTER_FORGET_TIME; +} + +} +} // end namespace nvidia + + diff --git a/APEX_1.4/module/particles/src/autogen/AttractorFieldSamplerData.cpp b/APEX_1.4/module/particles/src/autogen/AttractorFieldSamplerData.cpp new file mode 100644 index 00000000..818522a6 --- /dev/null +++ b/APEX_1.4/module/particles/src/autogen/AttractorFieldSamplerData.cpp @@ -0,0 +1,363 @@ +// 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 "AttractorFieldSamplerData.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace particles +{ + +using namespace AttractorFieldSamplerDataNS; + +const char* const AttractorFieldSamplerDataFactory::vptr = + NvParameterized::getVptr<AttractorFieldSamplerData, AttractorFieldSamplerData::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_STRING, false, (size_t)(&((ParametersStruct*)0)->Name), NULL, 0 }, // Name + { TYPE_REF, false, (size_t)(&((ParametersStruct*)0)->AttractorFieldSampler), NULL, 0 }, // AttractorFieldSampler +}; + + +bool AttractorFieldSamplerData::mBuiltFlag = false; +NvParameterized::MutexType AttractorFieldSamplerData::mBuiltFlagMutex; + +AttractorFieldSamplerData::AttractorFieldSamplerData(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &AttractorFieldSamplerDataFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +AttractorFieldSamplerData::~AttractorFieldSamplerData() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void AttractorFieldSamplerData::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->~AttractorFieldSamplerData(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* AttractorFieldSamplerData::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* AttractorFieldSamplerData::getParameterDefinitionTree(void) const +{ + AttractorFieldSamplerData* tmpParam = const_cast<AttractorFieldSamplerData*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType AttractorFieldSamplerData::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 AttractorFieldSamplerData::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 AttractorFieldSamplerData::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<AttractorFieldSamplerData::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ + +void AttractorFieldSamplerData::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 AttractorFieldSamplerData::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", "Containst he asset properties for this attractor field sampler", true); + ParamDefTable[0].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=1, longName="Name" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[1]; + ParamDef->init("Name", TYPE_STRING, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Attractor FS Name", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=2, longName="AttractorFieldSampler" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[2]; + ParamDef->init("AttractorFieldSampler", 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[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("INCLUDED", uint64_t(1), true); + HintTable[1].init("shortDescription", "Attractor FS Name", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + static const char* const RefVariantVals[] = { "AttractorFSAssetParams" }; + ParamDefTable[2].setRefVariantVals((const char**)RefVariantVals, 1); + + + + } + + // 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 AttractorFieldSamplerData::initStrings(void) +{ + Name.isAllocated = false; + Name.buf = (const char*)"defaultAttractorFieldSampler"; +} + +void AttractorFieldSamplerData::initDynamicArrays(void) +{ +} + +void AttractorFieldSamplerData::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void AttractorFieldSamplerData::initReferences(void) +{ + AttractorFieldSampler = NULL; + +} + +void AttractorFieldSamplerData::freeDynamicArrays(void) +{ +} + +void AttractorFieldSamplerData::freeStrings(void) +{ + + if (Name.isAllocated && Name.buf) + { + mParameterizedTraits->strfree((char*)Name.buf); + } +} + +void AttractorFieldSamplerData::freeReferences(void) +{ + if (AttractorFieldSampler) + { + AttractorFieldSampler->destroy(); + } + +} + +} // namespace particles +} // namespace nvidia diff --git a/APEX_1.4/module/particles/src/autogen/AttractorFieldSamplerEffect.cpp b/APEX_1.4/module/particles/src/autogen/AttractorFieldSamplerEffect.cpp new file mode 100644 index 00000000..640c6e85 --- /dev/null +++ b/APEX_1.4/module/particles/src/autogen/AttractorFieldSamplerEffect.cpp @@ -0,0 +1,1362 @@ +// 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 "AttractorFieldSamplerEffect.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace particles +{ + +using namespace AttractorFieldSamplerEffectNS; + +const char* const AttractorFieldSamplerEffectFactory::vptr = + NvParameterized::getVptr<AttractorFieldSamplerEffect, AttractorFieldSamplerEffect::ClassAlignment>(); + +const uint32_t NumParamDefs = 32; +static NvParameterized::DefinitionImpl* ParamDefTable; // now allocated in buildTree [NumParamDefs]; + + +static const size_t ParamLookupChildrenTable[] = +{ + 1, 31, 2, 3, 4, 8, 12, 13, 14, 15, 16, 17, 5, 6, 7, 9, 10, 11, 18, 19, 20, 21, 23, + 27, 22, 24, 25, 26, 28, 29, 30, +}; + +#define TENUM(type) nvidia::##type +#define CHILDREN(index) &ParamLookupChildrenTable[index] +static const NvParameterized::ParamLookupNode ParamLookupTable[NumParamDefs] = +{ + { TYPE_STRUCT, false, 0, CHILDREN(0), 2 }, + { TYPE_STRUCT, false, (size_t)(&((ParametersStruct*)0)->EffectProperties), CHILDREN(2), 10 }, // EffectProperties + { TYPE_STRING, false, (size_t)(&((EffectProperties_Type*)0)->UserString), NULL, 0 }, // EffectProperties.UserString + { TYPE_BOOL, false, (size_t)(&((EffectProperties_Type*)0)->Enable), NULL, 0 }, // EffectProperties.Enable + { TYPE_STRUCT, false, (size_t)(&((EffectProperties_Type*)0)->Position), CHILDREN(12), 3 }, // EffectProperties.Position + { TYPE_F32, false, (size_t)(&((TranslateObject_Type*)0)->TranslateX), NULL, 0 }, // EffectProperties.Position.TranslateX + { TYPE_F32, false, (size_t)(&((TranslateObject_Type*)0)->TranslateY), NULL, 0 }, // EffectProperties.Position.TranslateY + { TYPE_F32, false, (size_t)(&((TranslateObject_Type*)0)->TranslateZ), NULL, 0 }, // EffectProperties.Position.TranslateZ + { TYPE_STRUCT, false, (size_t)(&((EffectProperties_Type*)0)->Orientation), CHILDREN(15), 3 }, // EffectProperties.Orientation + { TYPE_F32, false, (size_t)(&((OrientObject_Type*)0)->RotateX), NULL, 0 }, // EffectProperties.Orientation.RotateX + { TYPE_F32, false, (size_t)(&((OrientObject_Type*)0)->RotateY), NULL, 0 }, // EffectProperties.Orientation.RotateY + { TYPE_F32, false, (size_t)(&((OrientObject_Type*)0)->RotateZ), NULL, 0 }, // EffectProperties.Orientation.RotateZ + { TYPE_F32, false, (size_t)(&((EffectProperties_Type*)0)->InitialDelayTime), NULL, 0 }, // EffectProperties.InitialDelayTime + { TYPE_F32, false, (size_t)(&((EffectProperties_Type*)0)->Duration), NULL, 0 }, // EffectProperties.Duration + { TYPE_U32, false, (size_t)(&((EffectProperties_Type*)0)->RepeatCount), NULL, 0 }, // EffectProperties.RepeatCount + { TYPE_F32, false, (size_t)(&((EffectProperties_Type*)0)->RepeatDelay), NULL, 0 }, // EffectProperties.RepeatDelay + { TYPE_F32, false, (size_t)(&((EffectProperties_Type*)0)->RandomizeRepeatTime), NULL, 0 }, // EffectProperties.RandomizeRepeatTime + { TYPE_STRUCT, false, (size_t)(&((EffectProperties_Type*)0)->Path), CHILDREN(18), 6 }, // EffectProperties.Path + { TYPE_ENUM, false, (size_t)(&((EffectPath_Type*)0)->PlaybackMode), NULL, 0 }, // EffectProperties.Path.PlaybackMode + { TYPE_F32, false, (size_t)(&((EffectPath_Type*)0)->PathDuration), NULL, 0 }, // EffectProperties.Path.PathDuration + { TYPE_U32, false, (size_t)(&((EffectPath_Type*)0)->LoopIndex), NULL, 0 }, // EffectProperties.Path.LoopIndex + { TYPE_ARRAY, true, (size_t)(&((EffectPath_Type*)0)->ControlPoints), CHILDREN(24), 1 }, // EffectProperties.Path.ControlPoints + { TYPE_TRANSFORM, false, 1 * sizeof(physx::PxTransform), NULL, 0 }, // EffectProperties.Path.ControlPoints[] + { TYPE_ARRAY, true, (size_t)(&((EffectPath_Type*)0)->Scale), CHILDREN(25), 1 }, // EffectProperties.Path.Scale + { TYPE_STRUCT, false, 1 * sizeof(ControlPoint_Type), CHILDREN(26), 2 }, // EffectProperties.Path.Scale[] + { TYPE_F32, false, (size_t)(&((ControlPoint_Type*)0)->x), NULL, 0 }, // EffectProperties.Path.Scale[].x + { TYPE_F32, false, (size_t)(&((ControlPoint_Type*)0)->y), NULL, 0 }, // EffectProperties.Path.Scale[].y + { TYPE_ARRAY, true, (size_t)(&((EffectPath_Type*)0)->Speed), CHILDREN(28), 1 }, // EffectProperties.Path.Speed + { TYPE_STRUCT, false, 1 * sizeof(ControlPoint_Type), CHILDREN(29), 2 }, // EffectProperties.Path.Speed[] + { TYPE_F32, false, (size_t)(&((ControlPoint_Type*)0)->x), NULL, 0 }, // EffectProperties.Path.Speed[].x + { TYPE_F32, false, (size_t)(&((ControlPoint_Type*)0)->y), NULL, 0 }, // EffectProperties.Path.Speed[].y + { TYPE_REF, false, (size_t)(&((ParametersStruct*)0)->AttractorFieldSampler), NULL, 0 }, // AttractorFieldSampler +}; + + +bool AttractorFieldSamplerEffect::mBuiltFlag = false; +NvParameterized::MutexType AttractorFieldSamplerEffect::mBuiltFlagMutex; + +AttractorFieldSamplerEffect::AttractorFieldSamplerEffect(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &AttractorFieldSamplerEffectFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +AttractorFieldSamplerEffect::~AttractorFieldSamplerEffect() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void AttractorFieldSamplerEffect::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->~AttractorFieldSamplerEffect(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* AttractorFieldSamplerEffect::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* AttractorFieldSamplerEffect::getParameterDefinitionTree(void) const +{ + AttractorFieldSamplerEffect* tmpParam = const_cast<AttractorFieldSamplerEffect*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType AttractorFieldSamplerEffect::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 AttractorFieldSamplerEffect::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 AttractorFieldSamplerEffect::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<AttractorFieldSamplerEffect::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ + +void AttractorFieldSamplerEffect::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 AttractorFieldSamplerEffect::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", "An attractor effect", true); + ParamDefTable[0].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=1, longName="EffectProperties" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[1]; + ParamDef->init("EffectProperties", TYPE_STRUCT, "EffectProperties", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("READONLY", uint64_t(0), true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("READONLY", uint64_t(0), true); + HintTable[1].init("shortDescription", "Attractor FS Properties", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=2, longName="EffectProperties.UserString" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[2]; + ParamDef->init("UserString", TYPE_STRING, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "An aribtrary user string that can be set by an artist/designer/programmer", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=3, longName="EffectProperties.Enable" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[3]; + ParamDef->init("Enable", TYPE_BOOL, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Whether or not this effect is to be initially enabled on startup", true); + ParamDefTable[3].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=4, longName="EffectProperties.Position" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[4]; + ParamDef->init("Position", TYPE_STRUCT, "TranslateObject", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "The position of this effect relative to the parent", true); + ParamDefTable[4].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=5, longName="EffectProperties.Position.TranslateX" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[5]; + ParamDef->init("TranslateX", 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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(500.000000000), true); + HintTable[2].init("min", double(-500.000000000), true); + ParamDefTable[5].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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(500.000000000), true); + HintTable[2].init("min", double(-500.000000000), true); + HintTable[3].init("shortDescription", "Nudge up to +/- one meter in each direction", true); + ParamDefTable[5].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=6, longName="EffectProperties.Position.TranslateY" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[6]; + ParamDef->init("TranslateY", 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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(500.000000000), true); + HintTable[2].init("min", double(-500.000000000), true); + ParamDefTable[6].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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(500.000000000), true); + HintTable[2].init("min", double(-500.000000000), true); + HintTable[3].init("shortDescription", "Nudge up to +/- one meter in each direction", true); + ParamDefTable[6].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=7, longName="EffectProperties.Position.TranslateZ" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[7]; + ParamDef->init("TranslateZ", 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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(500.000000000), true); + HintTable[2].init("min", double(-500.000000000), true); + ParamDefTable[7].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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(500.000000000), true); + HintTable[2].init("min", double(-500.000000000), true); + HintTable[3].init("shortDescription", "Nudge up to +/- one meter in each direction", true); + ParamDefTable[7].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=8, longName="EffectProperties.Orientation" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[8]; + ParamDef->init("Orientation", TYPE_STRUCT, "OrientObject", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "The orientation of this effect, relative to the parent orientation", true); + ParamDefTable[8].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=9, longName="EffectProperties.Orientation.RotateX" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[9]; + ParamDef->init("RotateX", 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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(360.000000000), true); + HintTable[2].init("min", double(0.000000000), true); + ParamDefTable[9].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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(360.000000000), true); + HintTable[2].init("min", double(0.000000000), true); + HintTable[3].init("shortDescription", "Rotate on the X axis (0-360 degrees)", true); + ParamDefTable[9].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=10, longName="EffectProperties.Orientation.RotateY" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[10]; + ParamDef->init("RotateY", 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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(360.000000000), true); + HintTable[2].init("min", double(0.000000000), true); + ParamDefTable[10].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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(360.000000000), true); + HintTable[2].init("min", double(0.000000000), true); + HintTable[3].init("shortDescription", "Rotate on the Y axis (0-360 degrees)", true); + ParamDefTable[10].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=11, longName="EffectProperties.Orientation.RotateZ" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[11]; + ParamDef->init("RotateZ", 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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(360.000000000), true); + HintTable[2].init("min", double(0.000000000), 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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(360.000000000), true); + HintTable[2].init("min", double(0.000000000), true); + HintTable[3].init("shortDescription", "Rotate on the Z axis (0-360 degrees)", true); + ParamDefTable[11].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=12, longName="EffectProperties.InitialDelayTime" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[12]; + ParamDef->init("InitialDelayTime", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("min", double(0.000000000), 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("min", double(0.000000000), true); + HintTable[1].init("shortDescription", "Initial time to delay before spawning this effect", true); + ParamDefTable[12].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=13, longName="EffectProperties.Duration" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[13]; + ParamDef->init("Duration", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("min", double(0.000000000), true); + ParamDefTable[13].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("min", double(0.000000000), true); + HintTable[1].init("shortDescription", "The duration of the effect in secontds", true); + ParamDefTable[13].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=14, longName="EffectProperties.RepeatCount" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[14]; + ParamDef->init("RepeatCount", TYPE_U32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("min", uint64_t(1), 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("min", uint64_t(1), true); + HintTable[1].init("shortDescription", "The number of times to repeat the effect; 9999 means repeate forever", true); + ParamDefTable[14].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=15, longName="EffectProperties.RepeatDelay" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[15]; + ParamDef->init("RepeatDelay", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("min", double(0.000000000), 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("min", double(0.000000000), true); + HintTable[1].init("shortDescription", "The time to delay activation each time the effect repeats in seconds; this can be different than the initial delay time", true); + ParamDefTable[15].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=16, longName="EffectProperties.RandomizeRepeatTime" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[16]; + ParamDef->init("RandomizeRepeatTime", 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", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), 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("max", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + HintTable[2].init("shortDescription", "Amount of randomization to the repeat cycle; a value of zero (default) means no random and a value of one means completely random.", true); + ParamDefTable[16].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=17, longName="EffectProperties.Path" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[17]; + ParamDef->init("Path", TYPE_STRUCT, "EffectPath", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "An optional pre-defined path for this effect to travel on", true); + ParamDefTable[17].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=18, longName="EffectProperties.Path.PlaybackMode" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[18]; + ParamDef->init("PlaybackMode", TYPE_ENUM, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "The mode to play back the path", true); + ParamDefTable[18].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + static const char* const EnumVals[] = { "LOOP", "PLAY_ONCE", "PING_PONG" }; + ParamDefTable[18].setEnumVals((const char**)EnumVals, 3); + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=19, longName="EffectProperties.Path.PathDuration" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[19]; + ParamDef->init("PathDuration", 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", double(1000.000000000), true); + HintTable[1].init("min", double(0.000010000), true); + ParamDefTable[19].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", double(1000.000000000), true); + HintTable[1].init("min", double(0.000010000), true); + HintTable[2].init("shortDescription", "The duration of the path if one is not otherwise provided", true); + ParamDefTable[19].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=20, longName="EffectProperties.Path.LoopIndex" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[20]; + ParamDef->init("LoopIndex", TYPE_U32, 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[20].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("min", uint64_t(0), true); + HintTable[1].init("shortDescription", "The array index to loop back to", true); + ParamDefTable[20].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=21, longName="EffectProperties.Path.ControlPoints" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[21]; + ParamDef->init("ControlPoints", TYPE_ARRAY, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("editorCurve", uint64_t(1), true); + HintTable[2].init("pathEditor", uint64_t(1), 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("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("editorCurve", uint64_t(1), true); + HintTable[2].init("pathEditor", uint64_t(1), true); + HintTable[3].init("shortDescription", "The array of control points to fit the curve to", true); + ParamDefTable[21].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + ParamDef->setArraySize(-1); + } + + // Initialize DefinitionImpl node: nodeIndex=22, longName="EffectProperties.Path.ControlPoints[]" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[22]; + ParamDef->init("ControlPoints", TYPE_TRANSFORM, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("editorCurve", uint64_t(1), true); + HintTable[2].init("pathEditor", uint64_t(1), 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("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("editorCurve", uint64_t(1), true); + HintTable[2].init("pathEditor", uint64_t(1), true); + HintTable[3].init("shortDescription", "The array of control points to fit the curve to", true); + ParamDefTable[22].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=23, longName="EffectProperties.Path.Scale" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[23]; + ParamDef->init("Scale", TYPE_ARRAY, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("xAxisLabel", "Over Time", true); + HintTable[4].init("yAxisLabel", "Scale", true); + ParamDefTable[23].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#else + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("shortDescription", "The array of scale values over time", true); + HintTable[4].init("xAxisLabel", "Over Time", true); + HintTable[5].init("yAxisLabel", "Scale", true); + ParamDefTable[23].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + ParamDef->setArraySize(-1); + } + + // Initialize DefinitionImpl node: nodeIndex=24, longName="EffectProperties.Path.Scale[]" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[24]; + ParamDef->init("Scale", TYPE_STRUCT, "ControlPoint", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("xAxisLabel", "Over Time", true); + HintTable[4].init("yAxisLabel", "Scale", true); + ParamDefTable[24].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#else + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("shortDescription", "The array of scale values over time", true); + HintTable[4].init("xAxisLabel", "Over Time", true); + HintTable[5].init("yAxisLabel", "Scale", true); + ParamDefTable[24].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=25, longName="EffectProperties.Path.Scale[].x" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[25]; + 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", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), 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("max", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + HintTable[2].init("shortDescription", "The x-axis value for this vector", true); + ParamDefTable[25].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=26, longName="EffectProperties.Path.Scale[].y" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[26]; + 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", "The y-axis value for this vector", true); + ParamDefTable[26].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=27, longName="EffectProperties.Path.Speed" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[27]; + ParamDef->init("Speed", TYPE_ARRAY, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("xAxisLabel", "Over Time", true); + HintTable[4].init("yAxisLabel", "Speed", true); + ParamDefTable[27].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#else + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("shortDescription", "The array of speed values over time", true); + HintTable[4].init("xAxisLabel", "Over Time", true); + HintTable[5].init("yAxisLabel", "Speed", true); + ParamDefTable[27].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + ParamDef->setArraySize(-1); + } + + // Initialize DefinitionImpl node: nodeIndex=28, longName="EffectProperties.Path.Speed[]" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[28]; + ParamDef->init("Speed", TYPE_STRUCT, "ControlPoint", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("xAxisLabel", "Over Time", true); + HintTable[4].init("yAxisLabel", "Speed", true); + ParamDefTable[28].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#else + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("shortDescription", "The array of speed values over time", true); + HintTable[4].init("xAxisLabel", "Over Time", true); + HintTable[5].init("yAxisLabel", "Speed", true); + ParamDefTable[28].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=29, longName="EffectProperties.Path.Speed[].x" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[29]; + 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", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + ParamDefTable[29].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", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + HintTable[2].init("shortDescription", "The x-axis value for this vector", true); + ParamDefTable[29].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=30, longName="EffectProperties.Path.Speed[].y" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[30]; + 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", "The y-axis value for this vector", true); + ParamDefTable[30].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=31, longName="AttractorFieldSampler" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[31]; + ParamDef->init("AttractorFieldSampler", TYPE_REF, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Attractor FS Asset", true); + ParamDefTable[31].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + static const char* const RefVariantVals[] = { "AttractorFSAsset" }; + ParamDefTable[31].setRefVariantVals((const char**)RefVariantVals, 1); + + + + } + + // SetChildren for: nodeIndex=0, longName="" + { + static Definition* Children[2]; + Children[0] = PDEF_PTR(1); + Children[1] = PDEF_PTR(31); + + ParamDefTable[0].setChildren(Children, 2); + } + + // SetChildren for: nodeIndex=1, longName="EffectProperties" + { + static Definition* Children[10]; + Children[0] = PDEF_PTR(2); + Children[1] = PDEF_PTR(3); + Children[2] = PDEF_PTR(4); + Children[3] = PDEF_PTR(8); + Children[4] = PDEF_PTR(12); + Children[5] = PDEF_PTR(13); + Children[6] = PDEF_PTR(14); + Children[7] = PDEF_PTR(15); + Children[8] = PDEF_PTR(16); + Children[9] = PDEF_PTR(17); + + ParamDefTable[1].setChildren(Children, 10); + } + + // SetChildren for: nodeIndex=4, longName="EffectProperties.Position" + { + static Definition* Children[3]; + Children[0] = PDEF_PTR(5); + Children[1] = PDEF_PTR(6); + Children[2] = PDEF_PTR(7); + + ParamDefTable[4].setChildren(Children, 3); + } + + // SetChildren for: nodeIndex=8, longName="EffectProperties.Orientation" + { + static Definition* Children[3]; + Children[0] = PDEF_PTR(9); + Children[1] = PDEF_PTR(10); + Children[2] = PDEF_PTR(11); + + ParamDefTable[8].setChildren(Children, 3); + } + + // SetChildren for: nodeIndex=17, longName="EffectProperties.Path" + { + static Definition* Children[6]; + Children[0] = PDEF_PTR(18); + Children[1] = PDEF_PTR(19); + Children[2] = PDEF_PTR(20); + Children[3] = PDEF_PTR(21); + Children[4] = PDEF_PTR(23); + Children[5] = PDEF_PTR(27); + + ParamDefTable[17].setChildren(Children, 6); + } + + // SetChildren for: nodeIndex=21, longName="EffectProperties.Path.ControlPoints" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(22); + + ParamDefTable[21].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=23, longName="EffectProperties.Path.Scale" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(24); + + ParamDefTable[23].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=24, longName="EffectProperties.Path.Scale[]" + { + static Definition* Children[2]; + Children[0] = PDEF_PTR(25); + Children[1] = PDEF_PTR(26); + + ParamDefTable[24].setChildren(Children, 2); + } + + // SetChildren for: nodeIndex=27, longName="EffectProperties.Path.Speed" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(28); + + ParamDefTable[27].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=28, longName="EffectProperties.Path.Speed[]" + { + static Definition* Children[2]; + Children[0] = PDEF_PTR(29); + Children[1] = PDEF_PTR(30); + + ParamDefTable[28].setChildren(Children, 2); + } + + mBuiltFlag = true; + +} +void AttractorFieldSamplerEffect::initStrings(void) +{ + EffectProperties.UserString.isAllocated = true; + EffectProperties.UserString.buf = NULL; +} + +void AttractorFieldSamplerEffect::initDynamicArrays(void) +{ + EffectProperties.Path.ControlPoints.buf = NULL; + EffectProperties.Path.ControlPoints.isAllocated = true; + EffectProperties.Path.ControlPoints.elementSize = sizeof(physx::PxTransform); + EffectProperties.Path.ControlPoints.arraySizes[0] = 0; + EffectProperties.Path.Scale.buf = NULL; + EffectProperties.Path.Scale.isAllocated = true; + EffectProperties.Path.Scale.elementSize = sizeof(ControlPoint_Type); + EffectProperties.Path.Scale.arraySizes[0] = 0; + EffectProperties.Path.Speed.buf = NULL; + EffectProperties.Path.Speed.isAllocated = true; + EffectProperties.Path.Speed.elementSize = sizeof(ControlPoint_Type); + EffectProperties.Path.Speed.arraySizes[0] = 0; +} + +void AttractorFieldSamplerEffect::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + EffectProperties.Enable = bool(1); + EffectProperties.Position.TranslateX = float(0.000000000); + EffectProperties.Position.TranslateY = float(0.000000000); + EffectProperties.Position.TranslateZ = float(0.000000000); + EffectProperties.Orientation.RotateX = float(0.000000000); + EffectProperties.Orientation.RotateY = float(0.000000000); + EffectProperties.Orientation.RotateZ = float(0.000000000); + EffectProperties.InitialDelayTime = float(0.000000000); + EffectProperties.Duration = float(0.000000000); + EffectProperties.RepeatCount = uint32_t(1); + EffectProperties.RepeatDelay = float(0.000000000); + EffectProperties.RandomizeRepeatTime = float(0.000000000); + EffectProperties.Path.PlaybackMode = (const char*)"LOOP"; + EffectProperties.Path.PathDuration = float(4.000000000); + EffectProperties.Path.LoopIndex = uint32_t(0); + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void AttractorFieldSamplerEffect::initReferences(void) +{ + AttractorFieldSampler = NULL; + +} + +void AttractorFieldSamplerEffect::freeDynamicArrays(void) +{ + if (EffectProperties.Path.ControlPoints.isAllocated && EffectProperties.Path.ControlPoints.buf) + { + mParameterizedTraits->free(EffectProperties.Path.ControlPoints.buf); + } + if (EffectProperties.Path.Scale.isAllocated && EffectProperties.Path.Scale.buf) + { + mParameterizedTraits->free(EffectProperties.Path.Scale.buf); + } + if (EffectProperties.Path.Speed.isAllocated && EffectProperties.Path.Speed.buf) + { + mParameterizedTraits->free(EffectProperties.Path.Speed.buf); + } +} + +void AttractorFieldSamplerEffect::freeStrings(void) +{ + + if (EffectProperties.UserString.isAllocated && EffectProperties.UserString.buf) + { + mParameterizedTraits->strfree((char*)EffectProperties.UserString.buf); + } +} + +void AttractorFieldSamplerEffect::freeReferences(void) +{ + if (AttractorFieldSampler) + { + AttractorFieldSampler->destroy(); + } + +} + +} // namespace particles +} // namespace nvidia diff --git a/APEX_1.4/module/particles/src/autogen/EffectPackageActorParams.cpp b/APEX_1.4/module/particles/src/autogen/EffectPackageActorParams.cpp new file mode 100644 index 00000000..ca305693 --- /dev/null +++ b/APEX_1.4/module/particles/src/autogen/EffectPackageActorParams.cpp @@ -0,0 +1,368 @@ +// 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 "EffectPackageActorParams.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace particles +{ + +using namespace EffectPackageActorParamsNS; + +const char* const EffectPackageActorParamsFactory::vptr = + NvParameterized::getVptr<EffectPackageActorParams, EffectPackageActorParams::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_TRANSFORM, false, (size_t)(&((ParametersStruct*)0)->InitialPose), NULL, 0 }, // InitialPose + { TYPE_F32, false, (size_t)(&((ParametersStruct*)0)->objectScale), NULL, 0 }, // objectScale + { TYPE_BOOL, false, (size_t)(&((ParametersStruct*)0)->Enabled), NULL, 0 }, // Enabled +}; + + +bool EffectPackageActorParams::mBuiltFlag = false; +NvParameterized::MutexType EffectPackageActorParams::mBuiltFlagMutex; + +EffectPackageActorParams::EffectPackageActorParams(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &EffectPackageActorParamsFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +EffectPackageActorParams::~EffectPackageActorParams() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void EffectPackageActorParams::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->~EffectPackageActorParams(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* EffectPackageActorParams::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* EffectPackageActorParams::getParameterDefinitionTree(void) const +{ + EffectPackageActorParams* tmpParam = const_cast<EffectPackageActorParams*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType EffectPackageActorParams::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 EffectPackageActorParams::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 EffectPackageActorParams::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<EffectPackageActorParams::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ + +void EffectPackageActorParams::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 EffectPackageActorParams::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", "The individual effect package actor properties", 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", "Helpful tooltip information goes here", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=2, longName="objectScale" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[2]; + ParamDef->init("objectScale", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "A uniform overall scale factor for this effect actor", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=3, longName="Enabled" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[3]; + ParamDef->init("Enabled", TYPE_BOOL, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Helpful tooltip information goes here", true); + ParamDefTable[3].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(2); + Children[2] = PDEF_PTR(3); + + ParamDefTable[0].setChildren(Children, 3); + } + + mBuiltFlag = true; + +} +void EffectPackageActorParams::initStrings(void) +{ +} + +void EffectPackageActorParams::initDynamicArrays(void) +{ +} + +void EffectPackageActorParams::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + InitialPose = physx::PxTransform(init(0,0,0,0,0,0,1)); + objectScale = float(1.000000000); + Enabled = bool(1); + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void EffectPackageActorParams::initReferences(void) +{ +} + +void EffectPackageActorParams::freeDynamicArrays(void) +{ +} + +void EffectPackageActorParams::freeStrings(void) +{ +} + +void EffectPackageActorParams::freeReferences(void) +{ +} + +} // namespace particles +} // namespace nvidia diff --git a/APEX_1.4/module/particles/src/autogen/EffectPackageAssetParams.cpp b/APEX_1.4/module/particles/src/autogen/EffectPackageAssetParams.cpp new file mode 100644 index 00000000..1c36c949 --- /dev/null +++ b/APEX_1.4/module/particles/src/autogen/EffectPackageAssetParams.cpp @@ -0,0 +1,1613 @@ +// 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 "EffectPackageAssetParams.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace particles +{ + +using namespace EffectPackageAssetParamsNS; + +const char* const EffectPackageAssetParamsFactory::vptr = + NvParameterized::getVptr<EffectPackageAssetParams, EffectPackageAssetParams::ClassAlignment>(); + +const uint32_t NumParamDefs = 40; +static NvParameterized::DefinitionImpl* ParamDefTable; // now allocated in buildTree [NumParamDefs]; + + +static const size_t ParamLookupChildrenTable[] = +{ + 1, 23, 37, 39, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, + 21, 22, 24, 25, 26, 27, 29, 33, 28, 30, 31, 32, 34, 35, 36, 38, +}; + +#define TENUM(type) nvidia::##type +#define CHILDREN(index) &ParamLookupChildrenTable[index] +static const NvParameterized::ParamLookupNode ParamLookupTable[NumParamDefs] = +{ + { TYPE_STRUCT, false, 0, CHILDREN(0), 4 }, + { TYPE_STRUCT, false, (size_t)(&((ParametersStruct*)0)->LODSettings), CHILDREN(4), 21 }, // LODSettings + { TYPE_BOOL, false, (size_t)(&((LevelOfDetailSettings_Type*)0)->UniqueRenderVolume), NULL, 0 }, // LODSettings.UniqueRenderVolume + { TYPE_F32, false, (size_t)(&((LevelOfDetailSettings_Type*)0)->FadeDistanceBegin), NULL, 0 }, // LODSettings.FadeDistanceBegin + { TYPE_F32, false, (size_t)(&((LevelOfDetailSettings_Type*)0)->FadeDistanceEnd), NULL, 0 }, // LODSettings.FadeDistanceEnd + { TYPE_BOOL, false, (size_t)(&((LevelOfDetailSettings_Type*)0)->RandomizeEmitterRate), NULL, 0 }, // LODSettings.RandomizeEmitterRate + { TYPE_F32, false, (size_t)(&((LevelOfDetailSettings_Type*)0)->FadeOutRate), NULL, 0 }, // LODSettings.FadeOutRate + { TYPE_BOOL, false, (size_t)(&((LevelOfDetailSettings_Type*)0)->CullByDistance), NULL, 0 }, // LODSettings.CullByDistance + { TYPE_BOOL, false, (size_t)(&((LevelOfDetailSettings_Type*)0)->CullOffScreen), NULL, 0 }, // LODSettings.CullOffScreen + { TYPE_F32, false, (size_t)(&((LevelOfDetailSettings_Type*)0)->OffScreenCullTime), NULL, 0 }, // LODSettings.OffScreenCullTime + { TYPE_F32, false, (size_t)(&((LevelOfDetailSettings_Type*)0)->NonVisibleDeleteTime), NULL, 0 }, // LODSettings.NonVisibleDeleteTime + { TYPE_F32, false, (size_t)(&((LevelOfDetailSettings_Type*)0)->ScreenCullSize), NULL, 0 }, // LODSettings.ScreenCullSize + { TYPE_F32, false, (size_t)(&((LevelOfDetailSettings_Type*)0)->ScreenCullDistance), NULL, 0 }, // LODSettings.ScreenCullDistance + { TYPE_BOOL, false, (size_t)(&((LevelOfDetailSettings_Type*)0)->FadeEmitterRate), NULL, 0 }, // LODSettings.FadeEmitterRate + { TYPE_BOOL, false, (size_t)(&((LevelOfDetailSettings_Type*)0)->FadeAttractorFieldStrength), NULL, 0 }, // LODSettings.FadeAttractorFieldStrength + { TYPE_BOOL, false, (size_t)(&((LevelOfDetailSettings_Type*)0)->FadeJetFieldStrength), NULL, 0 }, // LODSettings.FadeJetFieldStrength + { TYPE_BOOL, false, (size_t)(&((LevelOfDetailSettings_Type*)0)->FadeTurbulenceVelocity), NULL, 0 }, // LODSettings.FadeTurbulenceVelocity + { TYPE_BOOL, false, (size_t)(&((LevelOfDetailSettings_Type*)0)->FadeTurbulenceNoise), NULL, 0 }, // LODSettings.FadeTurbulenceNoise + { TYPE_BOOL, false, (size_t)(&((LevelOfDetailSettings_Type*)0)->FadeTurbulenceExternalVelocity), NULL, 0 }, // LODSettings.FadeTurbulenceExternalVelocity + { TYPE_BOOL, false, (size_t)(&((LevelOfDetailSettings_Type*)0)->FadeTurbulenceVelocityWeight), NULL, 0 }, // LODSettings.FadeTurbulenceVelocityWeight + { TYPE_BOOL, false, (size_t)(&((LevelOfDetailSettings_Type*)0)->FadeHeatSourceTemperature), NULL, 0 }, // LODSettings.FadeHeatSourceTemperature + { TYPE_BOOL, false, (size_t)(&((LevelOfDetailSettings_Type*)0)->FadeForceFieldStrength), NULL, 0 }, // LODSettings.FadeForceFieldStrength + { TYPE_BOOL, false, (size_t)(&((LevelOfDetailSettings_Type*)0)->FadeForceFieldScale), NULL, 0 }, // LODSettings.FadeForceFieldScale + { TYPE_STRUCT, false, (size_t)(&((ParametersStruct*)0)->Path), CHILDREN(25), 6 }, // Path + { TYPE_ENUM, false, (size_t)(&((EffectPath_Type*)0)->PlaybackMode), NULL, 0 }, // Path.PlaybackMode + { TYPE_F32, false, (size_t)(&((EffectPath_Type*)0)->PathDuration), NULL, 0 }, // Path.PathDuration + { TYPE_U32, false, (size_t)(&((EffectPath_Type*)0)->LoopIndex), NULL, 0 }, // Path.LoopIndex + { TYPE_ARRAY, true, (size_t)(&((EffectPath_Type*)0)->ControlPoints), CHILDREN(31), 1 }, // Path.ControlPoints + { TYPE_TRANSFORM, false, 1 * sizeof(physx::PxTransform), NULL, 0 }, // Path.ControlPoints[] + { TYPE_ARRAY, true, (size_t)(&((EffectPath_Type*)0)->Scale), CHILDREN(32), 1 }, // Path.Scale + { TYPE_STRUCT, false, 1 * sizeof(ControlPoint_Type), CHILDREN(33), 2 }, // Path.Scale[] + { TYPE_F32, false, (size_t)(&((ControlPoint_Type*)0)->x), NULL, 0 }, // Path.Scale[].x + { TYPE_F32, false, (size_t)(&((ControlPoint_Type*)0)->y), NULL, 0 }, // Path.Scale[].y + { TYPE_ARRAY, true, (size_t)(&((EffectPath_Type*)0)->Speed), CHILDREN(35), 1 }, // Path.Speed + { TYPE_STRUCT, false, 1 * sizeof(ControlPoint_Type), CHILDREN(36), 2 }, // Path.Speed[] + { TYPE_F32, false, (size_t)(&((ControlPoint_Type*)0)->x), NULL, 0 }, // Path.Speed[].x + { TYPE_F32, false, (size_t)(&((ControlPoint_Type*)0)->y), NULL, 0 }, // Path.Speed[].y + { TYPE_ARRAY, true, (size_t)(&((ParametersStruct*)0)->Effects), CHILDREN(38), 1 }, // Effects + { TYPE_REF, false, 1 * sizeof(NvParameterized::Interface*), NULL, 0 }, // Effects[] + { TYPE_STRING, false, (size_t)(&((ParametersStruct*)0)->toolString), NULL, 0 }, // toolString +}; + + +bool EffectPackageAssetParams::mBuiltFlag = false; +NvParameterized::MutexType EffectPackageAssetParams::mBuiltFlagMutex; + +EffectPackageAssetParams::EffectPackageAssetParams(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &EffectPackageAssetParamsFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +EffectPackageAssetParams::~EffectPackageAssetParams() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void EffectPackageAssetParams::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->~EffectPackageAssetParams(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* EffectPackageAssetParams::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* EffectPackageAssetParams::getParameterDefinitionTree(void) const +{ + EffectPackageAssetParams* tmpParam = const_cast<EffectPackageAssetParams*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType EffectPackageAssetParams::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 EffectPackageAssetParams::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 EffectPackageAssetParams::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<EffectPackageAssetParams::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ +/* [0] - Effects (not an array of structs) */ + +void EffectPackageAssetParams::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 EffectPackageAssetParams::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", "The effect package asset", true); + ParamDefTable[0].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=1, longName="LODSettings" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[1]; + ParamDef->init("LODSettings", TYPE_STRUCT, "LevelOfDetailSettings", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "LOD Settings for this effect package", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=2, longName="LODSettings.UniqueRenderVolume" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[2]; + ParamDef->init("UniqueRenderVolume", TYPE_BOOL, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Set to true if this effect should have a unique render volume; to get a separate draw call from all other instances of this effect", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=3, longName="LODSettings.FadeDistanceBegin" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[3]; + ParamDef->init("FadeDistanceBegin", 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", double(5000.000000000), true); + HintTable[1].init("min", double(0.100000001), 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("max", double(5000.000000000), true); + HintTable[1].init("min", double(0.100000001), true); + HintTable[2].init("shortDescription", "Distance to begin fading out the effect", true); + ParamDefTable[3].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=4, longName="LODSettings.FadeDistanceEnd" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[4]; + ParamDef->init("FadeDistanceEnd", 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", double(5000.000000000), true); + HintTable[1].init("min", double(0.100000001), 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("max", double(5000.000000000), true); + HintTable[1].init("min", double(0.100000001), true); + HintTable[2].init("shortDescription", "Distance to finish fading out the effect", true); + ParamDefTable[4].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=5, longName="LODSettings.RandomizeEmitterRate" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[5]; + ParamDef->init("RandomizeEmitterRate", TYPE_BOOL, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "If true the emitter rate is randomized from the min to max values", true); + ParamDefTable[5].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=6, longName="LODSettings.FadeOutRate" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[6]; + ParamDef->init("FadeOutRate", 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", double(10.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + ParamDefTable[6].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", double(10.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + HintTable[2].init("shortDescription", "Time over which to fade out effect completely", true); + ParamDefTable[6].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=7, longName="LODSettings.CullByDistance" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[7]; + ParamDef->init("CullByDistance", TYPE_BOOL, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Whether or not to cull effects based on their distance from the camera; requires a valid view matrix", true); + ParamDefTable[7].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=8, longName="LODSettings.CullOffScreen" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[8]; + ParamDef->init("CullOffScreen", TYPE_BOOL, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Whether or not to cull this effect if it is off screen", true); + ParamDefTable[8].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=9, longName="LODSettings.OffScreenCullTime" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[9]; + ParamDef->init("OffScreenCullTime", 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", double(99.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + ParamDefTable[9].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", double(99.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + HintTable[2].init("shortDescription", "Time the effect should be offscreen before it is disabled", true); + ParamDefTable[9].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=10, longName="LODSettings.NonVisibleDeleteTime" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[10]; + ParamDef->init("NonVisibleDeleteTime", 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", double(99.000000000), true); + HintTable[1].init("min", double(0.000000000), 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("max", double(99.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + HintTable[2].init("shortDescription", "The time an effect is non-visible before we delete it, rathern than just disabling it's state", true); + ParamDefTable[10].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=11, longName="LODSettings.ScreenCullSize" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[11]; + ParamDef->init("ScreenCullSize", 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("DISPLAY_NAME", "ScreenCullingSize", true); + HintTable[1].init("max", double(1.000000000), true); + HintTable[2].init("min", double(0.010000000), 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("DISPLAY_NAME", "ScreenCullingSize", true); + HintTable[1].init("max", double(1.000000000), true); + HintTable[2].init("min", double(0.010000000), true); + HintTable[3].init("shortDescription", "Bounding volme to cull the effect when near the edge of the screen", true); + ParamDefTable[11].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=12, longName="LODSettings.ScreenCullDistance" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[12]; + ParamDef->init("ScreenCullDistance", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("min", double(0.000000000), 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("min", double(0.000000000), true); + HintTable[1].init("shortDescription", "Radius to camera that we bypass screen culling entirely because the effect is too close to the screen; default is 3 meters", true); + ParamDefTable[12].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=13, longName="LODSettings.FadeEmitterRate" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[13]; + ParamDef->init("FadeEmitterRate", TYPE_BOOL, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Control the emitter rate with Fade Distance LOD setting", true); + ParamDefTable[13].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=14, longName="LODSettings.FadeAttractorFieldStrength" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[14]; + ParamDef->init("FadeAttractorFieldStrength", TYPE_BOOL, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("HIDDEN", uint64_t(1), 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("HIDDEN", uint64_t(1), true); + HintTable[1].init("shortDescription", "Helpful tooltip information goes here", true); + ParamDefTable[14].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=15, longName="LODSettings.FadeJetFieldStrength" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[15]; + ParamDef->init("FadeJetFieldStrength", TYPE_BOOL, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("HIDDEN", uint64_t(1), 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("HIDDEN", uint64_t(1), true); + HintTable[1].init("shortDescription", "Helpful tooltip information goes here", true); + ParamDefTable[15].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=16, longName="LODSettings.FadeTurbulenceVelocity" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[16]; + ParamDef->init("FadeTurbulenceVelocity", TYPE_BOOL, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("HIDDEN", uint64_t(1), 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("HIDDEN", uint64_t(1), true); + HintTable[1].init("shortDescription", "Helpful tooltip information goes here", true); + ParamDefTable[16].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=17, longName="LODSettings.FadeTurbulenceNoise" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[17]; + ParamDef->init("FadeTurbulenceNoise", TYPE_BOOL, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("HIDDEN", uint64_t(1), 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("HIDDEN", uint64_t(1), true); + HintTable[1].init("shortDescription", "Helpful tooltip information goes here", true); + ParamDefTable[17].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=18, longName="LODSettings.FadeTurbulenceExternalVelocity" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[18]; + ParamDef->init("FadeTurbulenceExternalVelocity", TYPE_BOOL, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("HIDDEN", uint64_t(1), 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("HIDDEN", uint64_t(1), true); + HintTable[1].init("shortDescription", "Helpful tooltip information goes here", true); + ParamDefTable[18].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=19, longName="LODSettings.FadeTurbulenceVelocityWeight" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[19]; + ParamDef->init("FadeTurbulenceVelocityWeight", TYPE_BOOL, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("HIDDEN", uint64_t(1), 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("HIDDEN", uint64_t(1), true); + HintTable[1].init("shortDescription", "Helpful tooltip information goes here", true); + ParamDefTable[19].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=20, longName="LODSettings.FadeHeatSourceTemperature" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[20]; + ParamDef->init("FadeHeatSourceTemperature", TYPE_BOOL, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("HIDDEN", uint64_t(1), 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("HIDDEN", uint64_t(1), true); + HintTable[1].init("shortDescription", "Helpful tooltip information goes here", true); + ParamDefTable[20].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=21, longName="LODSettings.FadeForceFieldStrength" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[21]; + ParamDef->init("FadeForceFieldStrength", TYPE_BOOL, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("HIDDEN", uint64_t(1), true); + ParamDefTable[21].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("HIDDEN", uint64_t(1), true); + HintTable[1].init("shortDescription", "Helpful tooltip information goes here", true); + ParamDefTable[21].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=22, longName="LODSettings.FadeForceFieldScale" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[22]; + ParamDef->init("FadeForceFieldScale", TYPE_BOOL, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("HIDDEN", uint64_t(1), true); + ParamDefTable[22].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("HIDDEN", uint64_t(1), true); + HintTable[1].init("shortDescription", "Helpful tooltip information goes here", true); + ParamDefTable[22].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=23, longName="Path" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[23]; + ParamDef->init("Path", TYPE_STRUCT, "EffectPath", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "An optional path for this effect to travel on", true); + ParamDefTable[23].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=24, longName="Path.PlaybackMode" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[24]; + ParamDef->init("PlaybackMode", TYPE_ENUM, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "The mode to play back the path", true); + ParamDefTable[24].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + static const char* const EnumVals[] = { "LOOP", "PLAY_ONCE", "PING_PONG" }; + ParamDefTable[24].setEnumVals((const char**)EnumVals, 3); + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=25, longName="Path.PathDuration" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[25]; + ParamDef->init("PathDuration", 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", double(1000.000000000), true); + HintTable[1].init("min", double(0.000010000), 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("max", double(1000.000000000), true); + HintTable[1].init("min", double(0.000010000), true); + HintTable[2].init("shortDescription", "The duration of the path if one is not otherwise provided", true); + ParamDefTable[25].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=26, longName="Path.LoopIndex" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[26]; + ParamDef->init("LoopIndex", TYPE_U32, 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[26].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("min", uint64_t(0), true); + HintTable[1].init("shortDescription", "The array index to loop back to", true); + ParamDefTable[26].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=27, longName="Path.ControlPoints" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[27]; + ParamDef->init("ControlPoints", TYPE_ARRAY, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("editorCurve", uint64_t(1), true); + HintTable[2].init("pathEditor", uint64_t(1), true); + ParamDefTable[27].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("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("editorCurve", uint64_t(1), true); + HintTable[2].init("pathEditor", uint64_t(1), true); + HintTable[3].init("shortDescription", "The array of control points to fit the curve to", true); + ParamDefTable[27].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + ParamDef->setArraySize(-1); + } + + // Initialize DefinitionImpl node: nodeIndex=28, longName="Path.ControlPoints[]" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[28]; + ParamDef->init("ControlPoints", TYPE_TRANSFORM, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("editorCurve", uint64_t(1), true); + HintTable[2].init("pathEditor", uint64_t(1), true); + ParamDefTable[28].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("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("editorCurve", uint64_t(1), true); + HintTable[2].init("pathEditor", uint64_t(1), true); + HintTable[3].init("shortDescription", "The array of control points to fit the curve to", true); + ParamDefTable[28].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=29, longName="Path.Scale" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[29]; + ParamDef->init("Scale", TYPE_ARRAY, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("xAxisLabel", "Over Time", true); + HintTable[4].init("yAxisLabel", "Scale", true); + ParamDefTable[29].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#else + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("shortDescription", "The array of scale values over time", true); + HintTable[4].init("xAxisLabel", "Over Time", true); + HintTable[5].init("yAxisLabel", "Scale", true); + ParamDefTable[29].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + ParamDef->setArraySize(-1); + } + + // Initialize DefinitionImpl node: nodeIndex=30, longName="Path.Scale[]" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[30]; + ParamDef->init("Scale", TYPE_STRUCT, "ControlPoint", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("xAxisLabel", "Over Time", true); + HintTable[4].init("yAxisLabel", "Scale", true); + ParamDefTable[30].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#else + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("shortDescription", "The array of scale values over time", true); + HintTable[4].init("xAxisLabel", "Over Time", true); + HintTable[5].init("yAxisLabel", "Scale", true); + ParamDefTable[30].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=31, longName="Path.Scale[].x" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[31]; + 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", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + ParamDefTable[31].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", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + HintTable[2].init("shortDescription", "The x-axis value for this vector", true); + ParamDefTable[31].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=32, longName="Path.Scale[].y" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[32]; + 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", "The y-axis value for this vector", true); + ParamDefTable[32].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=33, longName="Path.Speed" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[33]; + ParamDef->init("Speed", TYPE_ARRAY, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("xAxisLabel", "Over Time", true); + HintTable[4].init("yAxisLabel", "Speed", true); + ParamDefTable[33].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#else + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("shortDescription", "The array of speed values over time", true); + HintTable[4].init("xAxisLabel", "Over Time", true); + HintTable[5].init("yAxisLabel", "Speed", true); + ParamDefTable[33].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + ParamDef->setArraySize(-1); + } + + // Initialize DefinitionImpl node: nodeIndex=34, longName="Path.Speed[]" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[34]; + ParamDef->init("Speed", TYPE_STRUCT, "ControlPoint", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("xAxisLabel", "Over Time", true); + HintTable[4].init("yAxisLabel", "Speed", true); + ParamDefTable[34].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#else + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("shortDescription", "The array of speed values over time", true); + HintTable[4].init("xAxisLabel", "Over Time", true); + HintTable[5].init("yAxisLabel", "Speed", true); + ParamDefTable[34].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=35, longName="Path.Speed[].x" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[35]; + 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", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + ParamDefTable[35].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", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + HintTable[2].init("shortDescription", "The x-axis value for this vector", true); + ParamDefTable[35].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=36, longName="Path.Speed[].y" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[36]; + 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", "The y-axis value for this vector", true); + ParamDefTable[36].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=37, longName="Effects" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[37]; + ParamDef->init("Effects", 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("DISABLE_SINGLE_CLICK_COLLAPSE", uint64_t(1), true); + HintTable[1].init("DISABLE_SINGLE_CLICK_EXPAND", uint64_t(1), true); + HintTable[2].init("INCLUDED", uint64_t(1), true); + HintTable[3].init("RIGHT_CLICK", "ENABLE_EFFECT DISABLE_EFFECT COPY_EFFECT_PROPERTIES PASTE_EFFECT_PROPERTIES", true); + ParamDefTable[37].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("DISABLE_SINGLE_CLICK_COLLAPSE", uint64_t(1), true); + HintTable[1].init("DISABLE_SINGLE_CLICK_EXPAND", uint64_t(1), true); + HintTable[2].init("INCLUDED", uint64_t(1), true); + HintTable[3].init("RIGHT_CLICK", "ENABLE_EFFECT DISABLE_EFFECT COPY_EFFECT_PROPERTIES PASTE_EFFECT_PROPERTIES", true); + HintTable[4].init("shortDescription", "Effect Setting", true); + ParamDefTable[37].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + static const char* const RefVariantVals[] = { "EmitterEffect", "HeatSourceEffect", "JetFieldSamplerEffect", "AttractorFieldSamplerEffect", "TurbulenceFieldSamplerEffect", "ForceFieldEffect", "NoiseFieldSamplerEffect", "VortexFieldSamplerEffect", "SubstanceSourceEffect", "WindFieldSamplerEffect", "RigidBodyEffect", "VelocitySourceEffect", "FlameEmitterEffect" }; + ParamDefTable[37].setRefVariantVals((const char**)RefVariantVals, 13); + + + ParamDef->setArraySize(-1); + static const uint8_t dynHandleIndices[1] = { 0, }; + ParamDef->setDynamicHandleIndicesMap(dynHandleIndices, 1); + + } + + // Initialize DefinitionImpl node: nodeIndex=38, longName="Effects[]" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[38]; + ParamDef->init("Effects", TYPE_REF, 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("DISABLE_SINGLE_CLICK_COLLAPSE", uint64_t(1), true); + HintTable[1].init("DISABLE_SINGLE_CLICK_EXPAND", uint64_t(1), true); + HintTable[2].init("INCLUDED", uint64_t(1), true); + HintTable[3].init("RIGHT_CLICK", "ENABLE_EFFECT DISABLE_EFFECT COPY_EFFECT_PROPERTIES PASTE_EFFECT_PROPERTIES", true); + ParamDefTable[38].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("DISABLE_SINGLE_CLICK_COLLAPSE", uint64_t(1), true); + HintTable[1].init("DISABLE_SINGLE_CLICK_EXPAND", uint64_t(1), true); + HintTable[2].init("INCLUDED", uint64_t(1), true); + HintTable[3].init("RIGHT_CLICK", "ENABLE_EFFECT DISABLE_EFFECT COPY_EFFECT_PROPERTIES PASTE_EFFECT_PROPERTIES", true); + HintTable[4].init("shortDescription", "Effect Setting", true); + ParamDefTable[38].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + static const char* const RefVariantVals[] = { "EmitterEffect", "HeatSourceEffect", "JetFieldSamplerEffect", "AttractorFieldSamplerEffect", "TurbulenceFieldSamplerEffect", "ForceFieldEffect", "NoiseFieldSamplerEffect", "VortexFieldSamplerEffect", "SubstanceSourceEffect", "WindFieldSamplerEffect", "RigidBodyEffect", "VelocitySourceEffect", "FlameEmitterEffect" }; + ParamDefTable[38].setRefVariantVals((const char**)RefVariantVals, 13); + + + + } + + // Initialize DefinitionImpl node: nodeIndex=39, longName="toolString" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[39]; + ParamDef->init("toolString", TYPE_STRING, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("READONLY", uint64_t(1), true); + ParamDefTable[39].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("READONLY", uint64_t(1), true); + HintTable[1].init("shortDescription", "Describes the authoring tool. Info about used tool and runtime during effect creation", true); + ParamDefTable[39].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(23); + Children[2] = PDEF_PTR(37); + Children[3] = PDEF_PTR(39); + + ParamDefTable[0].setChildren(Children, 4); + } + + // SetChildren for: nodeIndex=1, longName="LODSettings" + { + static Definition* Children[21]; + 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); + Children[6] = PDEF_PTR(8); + Children[7] = PDEF_PTR(9); + Children[8] = PDEF_PTR(10); + Children[9] = PDEF_PTR(11); + Children[10] = PDEF_PTR(12); + Children[11] = PDEF_PTR(13); + Children[12] = PDEF_PTR(14); + Children[13] = PDEF_PTR(15); + Children[14] = PDEF_PTR(16); + Children[15] = PDEF_PTR(17); + Children[16] = PDEF_PTR(18); + Children[17] = PDEF_PTR(19); + Children[18] = PDEF_PTR(20); + Children[19] = PDEF_PTR(21); + Children[20] = PDEF_PTR(22); + + ParamDefTable[1].setChildren(Children, 21); + } + + // SetChildren for: nodeIndex=23, longName="Path" + { + static Definition* Children[6]; + Children[0] = PDEF_PTR(24); + Children[1] = PDEF_PTR(25); + Children[2] = PDEF_PTR(26); + Children[3] = PDEF_PTR(27); + Children[4] = PDEF_PTR(29); + Children[5] = PDEF_PTR(33); + + ParamDefTable[23].setChildren(Children, 6); + } + + // SetChildren for: nodeIndex=27, longName="Path.ControlPoints" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(28); + + ParamDefTable[27].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=29, longName="Path.Scale" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(30); + + ParamDefTable[29].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=30, longName="Path.Scale[]" + { + static Definition* Children[2]; + Children[0] = PDEF_PTR(31); + Children[1] = PDEF_PTR(32); + + ParamDefTable[30].setChildren(Children, 2); + } + + // SetChildren for: nodeIndex=33, longName="Path.Speed" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(34); + + ParamDefTable[33].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=34, longName="Path.Speed[]" + { + static Definition* Children[2]; + Children[0] = PDEF_PTR(35); + Children[1] = PDEF_PTR(36); + + ParamDefTable[34].setChildren(Children, 2); + } + + // SetChildren for: nodeIndex=37, longName="Effects" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(38); + + ParamDefTable[37].setChildren(Children, 1); + } + + mBuiltFlag = true; + +} +void EffectPackageAssetParams::initStrings(void) +{ + toolString.isAllocated = true; + toolString.buf = NULL; +} + +void EffectPackageAssetParams::initDynamicArrays(void) +{ + Path.ControlPoints.buf = NULL; + Path.ControlPoints.isAllocated = true; + Path.ControlPoints.elementSize = sizeof(physx::PxTransform); + Path.ControlPoints.arraySizes[0] = 0; + Path.Scale.buf = NULL; + Path.Scale.isAllocated = true; + Path.Scale.elementSize = sizeof(ControlPoint_Type); + Path.Scale.arraySizes[0] = 0; + Path.Speed.buf = NULL; + Path.Speed.isAllocated = true; + Path.Speed.elementSize = sizeof(ControlPoint_Type); + Path.Speed.arraySizes[0] = 0; + Effects.buf = NULL; + Effects.isAllocated = true; + Effects.elementSize = sizeof(NvParameterized::Interface*); + Effects.arraySizes[0] = 0; +} + +void EffectPackageAssetParams::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + LODSettings.UniqueRenderVolume = bool(0); + LODSettings.FadeDistanceBegin = float(50000.000000000); + LODSettings.FadeDistanceEnd = float(5000.000000000); + LODSettings.RandomizeEmitterRate = bool(0); + LODSettings.FadeOutRate = float(0.200000003); + LODSettings.CullByDistance = bool(0); + LODSettings.CullOffScreen = bool(0); + LODSettings.OffScreenCullTime = float(1.000000000); + LODSettings.NonVisibleDeleteTime = float(4.000000000); + LODSettings.ScreenCullSize = float(0.100000001); + LODSettings.ScreenCullDistance = float(3.000000000); + LODSettings.FadeEmitterRate = bool(1); + LODSettings.FadeAttractorFieldStrength = bool(1); + LODSettings.FadeJetFieldStrength = bool(1); + LODSettings.FadeTurbulenceVelocity = bool(0); + LODSettings.FadeTurbulenceNoise = bool(0); + LODSettings.FadeTurbulenceExternalVelocity = bool(0); + LODSettings.FadeTurbulenceVelocityWeight = bool(0); + LODSettings.FadeHeatSourceTemperature = bool(0); + LODSettings.FadeForceFieldStrength = bool(0); + LODSettings.FadeForceFieldScale = bool(0); + Path.PlaybackMode = (const char*)"LOOP"; + Path.PathDuration = float(4.000000000); + Path.LoopIndex = uint32_t(0); + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void EffectPackageAssetParams::initReferences(void) +{ +} + +void EffectPackageAssetParams::freeDynamicArrays(void) +{ + if (Path.ControlPoints.isAllocated && Path.ControlPoints.buf) + { + mParameterizedTraits->free(Path.ControlPoints.buf); + } + if (Path.Scale.isAllocated && Path.Scale.buf) + { + mParameterizedTraits->free(Path.Scale.buf); + } + if (Path.Speed.isAllocated && Path.Speed.buf) + { + mParameterizedTraits->free(Path.Speed.buf); + } + if (Effects.isAllocated && Effects.buf) + { + mParameterizedTraits->free(Effects.buf); + } +} + +void EffectPackageAssetParams::freeStrings(void) +{ + + if (toolString.isAllocated && toolString.buf) + { + mParameterizedTraits->strfree((char*)toolString.buf); + } +} + +void EffectPackageAssetParams::freeReferences(void) +{ + + for (int i = 0; i < Effects.arraySizes[0]; ++i) + { + if (Effects.buf[i]) + { + Effects.buf[i]->destroy(); + } + } +} + +} // namespace particles +} // namespace nvidia diff --git a/APEX_1.4/module/particles/src/autogen/EffectPackageData.cpp b/APEX_1.4/module/particles/src/autogen/EffectPackageData.cpp new file mode 100644 index 00000000..c92b2177 --- /dev/null +++ b/APEX_1.4/module/particles/src/autogen/EffectPackageData.cpp @@ -0,0 +1,363 @@ +// 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 "EffectPackageData.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace particles +{ + +using namespace EffectPackageDataNS; + +const char* const EffectPackageDataFactory::vptr = + NvParameterized::getVptr<EffectPackageData, EffectPackageData::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_STRING, false, (size_t)(&((ParametersStruct*)0)->Name), NULL, 0 }, // Name + { TYPE_REF, false, (size_t)(&((ParametersStruct*)0)->EffectPackage), NULL, 0 }, // EffectPackage +}; + + +bool EffectPackageData::mBuiltFlag = false; +NvParameterized::MutexType EffectPackageData::mBuiltFlagMutex; + +EffectPackageData::EffectPackageData(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &EffectPackageDataFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +EffectPackageData::~EffectPackageData() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void EffectPackageData::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->~EffectPackageData(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* EffectPackageData::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* EffectPackageData::getParameterDefinitionTree(void) const +{ + EffectPackageData* tmpParam = const_cast<EffectPackageData*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType EffectPackageData::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 EffectPackageData::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 EffectPackageData::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<EffectPackageData::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ + +void EffectPackageData::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 EffectPackageData::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", "Contains the Effect Package Properties", true); + ParamDefTable[0].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=1, longName="Name" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[1]; + ParamDef->init("Name", TYPE_STRING, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Effect package name", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=2, longName="EffectPackage" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[2]; + ParamDef->init("EffectPackage", 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[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("INCLUDED", uint64_t(1), true); + HintTable[1].init("shortDescription", "Effect package parameters", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + static const char* const RefVariantVals[] = { "EffectPackageAssetParams" }; + ParamDefTable[2].setRefVariantVals((const char**)RefVariantVals, 1); + + + + } + + // 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 EffectPackageData::initStrings(void) +{ + Name.isAllocated = false; + Name.buf = (const char*)"defaultEffectPackage"; +} + +void EffectPackageData::initDynamicArrays(void) +{ +} + +void EffectPackageData::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void EffectPackageData::initReferences(void) +{ + EffectPackage = NULL; + +} + +void EffectPackageData::freeDynamicArrays(void) +{ +} + +void EffectPackageData::freeStrings(void) +{ + + if (Name.isAllocated && Name.buf) + { + mParameterizedTraits->strfree((char*)Name.buf); + } +} + +void EffectPackageData::freeReferences(void) +{ + if (EffectPackage) + { + EffectPackage->destroy(); + } + +} + +} // namespace particles +} // namespace nvidia diff --git a/APEX_1.4/module/particles/src/autogen/EffectPackageDatabaseParams.cpp b/APEX_1.4/module/particles/src/autogen/EffectPackageDatabaseParams.cpp new file mode 100644 index 00000000..059ddc3e --- /dev/null +++ b/APEX_1.4/module/particles/src/autogen/EffectPackageDatabaseParams.cpp @@ -0,0 +1,400 @@ +// 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 "EffectPackageDatabaseParams.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace particles +{ + +using namespace EffectPackageDatabaseParamsNS; + +const char* const EffectPackageDatabaseParamsFactory::vptr = + NvParameterized::getVptr<EffectPackageDatabaseParams, EffectPackageDatabaseParams::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)->EffectPackages), CHILDREN(1), 1 }, // EffectPackages + { TYPE_REF, false, 1 * sizeof(NvParameterized::Interface*), NULL, 0 }, // EffectPackages[] +}; + + +bool EffectPackageDatabaseParams::mBuiltFlag = false; +NvParameterized::MutexType EffectPackageDatabaseParams::mBuiltFlagMutex; + +EffectPackageDatabaseParams::EffectPackageDatabaseParams(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &EffectPackageDatabaseParamsFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +EffectPackageDatabaseParams::~EffectPackageDatabaseParams() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void EffectPackageDatabaseParams::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->~EffectPackageDatabaseParams(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* EffectPackageDatabaseParams::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* EffectPackageDatabaseParams::getParameterDefinitionTree(void) const +{ + EffectPackageDatabaseParams* tmpParam = const_cast<EffectPackageDatabaseParams*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType EffectPackageDatabaseParams::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 EffectPackageDatabaseParams::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 EffectPackageDatabaseParams::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<EffectPackageDatabaseParams::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ +/* [0] - EffectPackages (not an array of structs) */ + +void EffectPackageDatabaseParams::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 EffectPackageDatabaseParams::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", "The collection of all effect packages", true); + ParamDefTable[0].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=1, longName="EffectPackages" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[1]; + ParamDef->init("EffectPackages", TYPE_ARRAY, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("DISABLE_SINGLE_CLICK_COLLAPSE", uint64_t(1), true); + HintTable[1].init("DISABLE_SINGLE_CLICK_EXPAND", uint64_t(1), true); + HintTable[2].init("INCLUDED", uint64_t(1), true); + HintTable[3].init("READONLY", uint64_t(0), true); + HintTable[4].init("RIGHT_CLICK", "ENABLE_EFFECT_PACKAGE DISABLE_EFFECT_PACKAGE COPY_EFFECT_PACKAGE_PROPERTIES PASTE_EFFECT_PACKAGE_PROPERTIES DISABLE_ALL_EFFECT_PACKAGES", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#else + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("DISABLE_SINGLE_CLICK_COLLAPSE", uint64_t(1), true); + HintTable[1].init("DISABLE_SINGLE_CLICK_EXPAND", uint64_t(1), true); + HintTable[2].init("INCLUDED", uint64_t(1), true); + HintTable[3].init("READONLY", uint64_t(0), true); + HintTable[4].init("RIGHT_CLICK", "ENABLE_EFFECT_PACKAGE DISABLE_EFFECT_PACKAGE COPY_EFFECT_PACKAGE_PROPERTIES PASTE_EFFECT_PACKAGE_PROPERTIES DISABLE_ALL_EFFECT_PACKAGES", true); + HintTable[5].init("shortDescription", "The arary of EffectPackages", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + static const char* const RefVariantVals[] = { "EffectPackageData" }; + ParamDefTable[1].setRefVariantVals((const char**)RefVariantVals, 1); + + + ParamDef->setArraySize(-1); + static const uint8_t dynHandleIndices[1] = { 0, }; + ParamDef->setDynamicHandleIndicesMap(dynHandleIndices, 1); + + } + + // Initialize DefinitionImpl node: nodeIndex=2, longName="EffectPackages[]" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[2]; + ParamDef->init("EffectPackages", TYPE_REF, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("DISABLE_SINGLE_CLICK_COLLAPSE", uint64_t(1), true); + HintTable[1].init("DISABLE_SINGLE_CLICK_EXPAND", uint64_t(1), true); + HintTable[2].init("INCLUDED", uint64_t(1), true); + HintTable[3].init("READONLY", uint64_t(0), true); + HintTable[4].init("RIGHT_CLICK", "ENABLE_EFFECT_PACKAGE DISABLE_EFFECT_PACKAGE COPY_EFFECT_PACKAGE_PROPERTIES PASTE_EFFECT_PACKAGE_PROPERTIES DISABLE_ALL_EFFECT_PACKAGES", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#else + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("DISABLE_SINGLE_CLICK_COLLAPSE", uint64_t(1), true); + HintTable[1].init("DISABLE_SINGLE_CLICK_EXPAND", uint64_t(1), true); + HintTable[2].init("INCLUDED", uint64_t(1), true); + HintTable[3].init("READONLY", uint64_t(0), true); + HintTable[4].init("RIGHT_CLICK", "ENABLE_EFFECT_PACKAGE DISABLE_EFFECT_PACKAGE COPY_EFFECT_PACKAGE_PROPERTIES PASTE_EFFECT_PACKAGE_PROPERTIES DISABLE_ALL_EFFECT_PACKAGES", true); + HintTable[5].init("shortDescription", "The arary of EffectPackages", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + static const char* const RefVariantVals[] = { "EffectPackageData" }; + ParamDefTable[2].setRefVariantVals((const char**)RefVariantVals, 1); + + + + } + + // SetChildren for: nodeIndex=0, longName="" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(1); + + ParamDefTable[0].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=1, longName="EffectPackages" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(2); + + ParamDefTable[1].setChildren(Children, 1); + } + + mBuiltFlag = true; + +} +void EffectPackageDatabaseParams::initStrings(void) +{ +} + +void EffectPackageDatabaseParams::initDynamicArrays(void) +{ + EffectPackages.buf = NULL; + EffectPackages.isAllocated = true; + EffectPackages.elementSize = sizeof(NvParameterized::Interface*); + EffectPackages.arraySizes[0] = 0; +} + +void EffectPackageDatabaseParams::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void EffectPackageDatabaseParams::initReferences(void) +{ +} + +void EffectPackageDatabaseParams::freeDynamicArrays(void) +{ + if (EffectPackages.isAllocated && EffectPackages.buf) + { + mParameterizedTraits->free(EffectPackages.buf); + } +} + +void EffectPackageDatabaseParams::freeStrings(void) +{ +} + +void EffectPackageDatabaseParams::freeReferences(void) +{ + + for (int i = 0; i < EffectPackages.arraySizes[0]; ++i) + { + if (EffectPackages.buf[i]) + { + EffectPackages.buf[i]->destroy(); + } + } +} + +} // namespace particles +} // namespace nvidia diff --git a/APEX_1.4/module/particles/src/autogen/EffectPackageEmitterDatabaseParams.cpp b/APEX_1.4/module/particles/src/autogen/EffectPackageEmitterDatabaseParams.cpp new file mode 100644 index 00000000..c10a0b56 --- /dev/null +++ b/APEX_1.4/module/particles/src/autogen/EffectPackageEmitterDatabaseParams.cpp @@ -0,0 +1,400 @@ +// 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 "EffectPackageEmitterDatabaseParams.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace particles +{ + +using namespace EffectPackageEmitterDatabaseParamsNS; + +const char* const EffectPackageEmitterDatabaseParamsFactory::vptr = + NvParameterized::getVptr<EffectPackageEmitterDatabaseParams, EffectPackageEmitterDatabaseParams::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)->Emitters), CHILDREN(1), 1 }, // Emitters + { TYPE_REF, false, 1 * sizeof(NvParameterized::Interface*), NULL, 0 }, // Emitters[] +}; + + +bool EffectPackageEmitterDatabaseParams::mBuiltFlag = false; +NvParameterized::MutexType EffectPackageEmitterDatabaseParams::mBuiltFlagMutex; + +EffectPackageEmitterDatabaseParams::EffectPackageEmitterDatabaseParams(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &EffectPackageEmitterDatabaseParamsFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +EffectPackageEmitterDatabaseParams::~EffectPackageEmitterDatabaseParams() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void EffectPackageEmitterDatabaseParams::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->~EffectPackageEmitterDatabaseParams(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* EffectPackageEmitterDatabaseParams::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* EffectPackageEmitterDatabaseParams::getParameterDefinitionTree(void) const +{ + EffectPackageEmitterDatabaseParams* tmpParam = const_cast<EffectPackageEmitterDatabaseParams*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType EffectPackageEmitterDatabaseParams::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 EffectPackageEmitterDatabaseParams::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 EffectPackageEmitterDatabaseParams::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<EffectPackageEmitterDatabaseParams::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ +/* [0] - Emitters (not an array of structs) */ + +void EffectPackageEmitterDatabaseParams::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 EffectPackageEmitterDatabaseParams::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", "The collection of all emitter assets", true); + ParamDefTable[0].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=1, longName="Emitters" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[1]; + ParamDef->init("Emitters", TYPE_ARRAY, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("DISABLE_SINGLE_CLICK_COLLAPSE", uint64_t(1), true); + HintTable[1].init("DISABLE_SINGLE_CLICK_EXPAND", uint64_t(1), true); + HintTable[2].init("INCLUDED", uint64_t(1), true); + HintTable[3].init("READONLY", uint64_t(0), true); + HintTable[4].init("RIGHT_CLICK", "COPY_EMITTER_PROPERTIES PASTE_EMITTER_PROPERTIES", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#else + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("DISABLE_SINGLE_CLICK_COLLAPSE", uint64_t(1), true); + HintTable[1].init("DISABLE_SINGLE_CLICK_EXPAND", uint64_t(1), true); + HintTable[2].init("INCLUDED", uint64_t(1), true); + HintTable[3].init("READONLY", uint64_t(0), true); + HintTable[4].init("RIGHT_CLICK", "COPY_EMITTER_PROPERTIES PASTE_EMITTER_PROPERTIES", true); + HintTable[5].init("shortDescription", "The array of emitters", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + static const char* const RefVariantVals[] = { "EmitterData" }; + ParamDefTable[1].setRefVariantVals((const char**)RefVariantVals, 1); + + + ParamDef->setArraySize(-1); + static const uint8_t dynHandleIndices[1] = { 0, }; + ParamDef->setDynamicHandleIndicesMap(dynHandleIndices, 1); + + } + + // Initialize DefinitionImpl node: nodeIndex=2, longName="Emitters[]" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[2]; + ParamDef->init("Emitters", TYPE_REF, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("DISABLE_SINGLE_CLICK_COLLAPSE", uint64_t(1), true); + HintTable[1].init("DISABLE_SINGLE_CLICK_EXPAND", uint64_t(1), true); + HintTable[2].init("INCLUDED", uint64_t(1), true); + HintTable[3].init("READONLY", uint64_t(0), true); + HintTable[4].init("RIGHT_CLICK", "COPY_EMITTER_PROPERTIES PASTE_EMITTER_PROPERTIES", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#else + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("DISABLE_SINGLE_CLICK_COLLAPSE", uint64_t(1), true); + HintTable[1].init("DISABLE_SINGLE_CLICK_EXPAND", uint64_t(1), true); + HintTable[2].init("INCLUDED", uint64_t(1), true); + HintTable[3].init("READONLY", uint64_t(0), true); + HintTable[4].init("RIGHT_CLICK", "COPY_EMITTER_PROPERTIES PASTE_EMITTER_PROPERTIES", true); + HintTable[5].init("shortDescription", "The array of emitters", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + static const char* const RefVariantVals[] = { "EmitterData" }; + ParamDefTable[2].setRefVariantVals((const char**)RefVariantVals, 1); + + + + } + + // SetChildren for: nodeIndex=0, longName="" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(1); + + ParamDefTable[0].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=1, longName="Emitters" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(2); + + ParamDefTable[1].setChildren(Children, 1); + } + + mBuiltFlag = true; + +} +void EffectPackageEmitterDatabaseParams::initStrings(void) +{ +} + +void EffectPackageEmitterDatabaseParams::initDynamicArrays(void) +{ + Emitters.buf = NULL; + Emitters.isAllocated = true; + Emitters.elementSize = sizeof(NvParameterized::Interface*); + Emitters.arraySizes[0] = 0; +} + +void EffectPackageEmitterDatabaseParams::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void EffectPackageEmitterDatabaseParams::initReferences(void) +{ +} + +void EffectPackageEmitterDatabaseParams::freeDynamicArrays(void) +{ + if (Emitters.isAllocated && Emitters.buf) + { + mParameterizedTraits->free(Emitters.buf); + } +} + +void EffectPackageEmitterDatabaseParams::freeStrings(void) +{ +} + +void EffectPackageEmitterDatabaseParams::freeReferences(void) +{ + + for (int i = 0; i < Emitters.arraySizes[0]; ++i) + { + if (Emitters.buf[i]) + { + Emitters.buf[i]->destroy(); + } + } +} + +} // namespace particles +} // namespace nvidia diff --git a/APEX_1.4/module/particles/src/autogen/EffectPackageFieldSamplerDatabaseParams.cpp b/APEX_1.4/module/particles/src/autogen/EffectPackageFieldSamplerDatabaseParams.cpp new file mode 100644 index 00000000..6295edc3 --- /dev/null +++ b/APEX_1.4/module/particles/src/autogen/EffectPackageFieldSamplerDatabaseParams.cpp @@ -0,0 +1,400 @@ +// 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 "EffectPackageFieldSamplerDatabaseParams.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace particles +{ + +using namespace EffectPackageFieldSamplerDatabaseParamsNS; + +const char* const EffectPackageFieldSamplerDatabaseParamsFactory::vptr = + NvParameterized::getVptr<EffectPackageFieldSamplerDatabaseParams, EffectPackageFieldSamplerDatabaseParams::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)->FieldSamplers), CHILDREN(1), 1 }, // FieldSamplers + { TYPE_REF, false, 1 * sizeof(NvParameterized::Interface*), NULL, 0 }, // FieldSamplers[] +}; + + +bool EffectPackageFieldSamplerDatabaseParams::mBuiltFlag = false; +NvParameterized::MutexType EffectPackageFieldSamplerDatabaseParams::mBuiltFlagMutex; + +EffectPackageFieldSamplerDatabaseParams::EffectPackageFieldSamplerDatabaseParams(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &EffectPackageFieldSamplerDatabaseParamsFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +EffectPackageFieldSamplerDatabaseParams::~EffectPackageFieldSamplerDatabaseParams() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void EffectPackageFieldSamplerDatabaseParams::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->~EffectPackageFieldSamplerDatabaseParams(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* EffectPackageFieldSamplerDatabaseParams::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* EffectPackageFieldSamplerDatabaseParams::getParameterDefinitionTree(void) const +{ + EffectPackageFieldSamplerDatabaseParams* tmpParam = const_cast<EffectPackageFieldSamplerDatabaseParams*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType EffectPackageFieldSamplerDatabaseParams::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 EffectPackageFieldSamplerDatabaseParams::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 EffectPackageFieldSamplerDatabaseParams::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<EffectPackageFieldSamplerDatabaseParams::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ +/* [0] - FieldSamplers (not an array of structs) */ + +void EffectPackageFieldSamplerDatabaseParams::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 EffectPackageFieldSamplerDatabaseParams::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", "The collection of all field sampler assets", true); + ParamDefTable[0].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=1, longName="FieldSamplers" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[1]; + ParamDef->init("FieldSamplers", TYPE_ARRAY, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("DISABLE_SINGLE_CLICK_COLLAPSE", uint64_t(1), true); + HintTable[1].init("DISABLE_SINGLE_CLICK_EXPAND", uint64_t(1), true); + HintTable[2].init("INCLUDED", uint64_t(1), true); + HintTable[3].init("READONLY", uint64_t(0), true); + HintTable[4].init("RIGHT_CLICK", "COPY_FIELD_SAMPLER_PROPERTIES PASTE_FIELD_SAMPLER_PROPERTIES", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#else + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("DISABLE_SINGLE_CLICK_COLLAPSE", uint64_t(1), true); + HintTable[1].init("DISABLE_SINGLE_CLICK_EXPAND", uint64_t(1), true); + HintTable[2].init("INCLUDED", uint64_t(1), true); + HintTable[3].init("READONLY", uint64_t(0), true); + HintTable[4].init("RIGHT_CLICK", "COPY_FIELD_SAMPLER_PROPERTIES PASTE_FIELD_SAMPLER_PROPERTIES", true); + HintTable[5].init("shortDescription", "The arary of FieldSamplers", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + static const char* const RefVariantVals[] = { "AttractorFieldSamplerData", "ForceFieldData", "HeatSourceData", "JetFieldSamplerData", "TurbulenceFieldSamplerData", "VortexFieldSamplerData", "NoiseFieldSamplerData", "SubstanceSourceData", "WindFieldSamplerData", "VelocitySourceData", "FlameEmitterData" }; + ParamDefTable[1].setRefVariantVals((const char**)RefVariantVals, 11); + + + ParamDef->setArraySize(-1); + static const uint8_t dynHandleIndices[1] = { 0, }; + ParamDef->setDynamicHandleIndicesMap(dynHandleIndices, 1); + + } + + // Initialize DefinitionImpl node: nodeIndex=2, longName="FieldSamplers[]" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[2]; + ParamDef->init("FieldSamplers", TYPE_REF, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("DISABLE_SINGLE_CLICK_COLLAPSE", uint64_t(1), true); + HintTable[1].init("DISABLE_SINGLE_CLICK_EXPAND", uint64_t(1), true); + HintTable[2].init("INCLUDED", uint64_t(1), true); + HintTable[3].init("READONLY", uint64_t(0), true); + HintTable[4].init("RIGHT_CLICK", "COPY_FIELD_SAMPLER_PROPERTIES PASTE_FIELD_SAMPLER_PROPERTIES", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#else + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("DISABLE_SINGLE_CLICK_COLLAPSE", uint64_t(1), true); + HintTable[1].init("DISABLE_SINGLE_CLICK_EXPAND", uint64_t(1), true); + HintTable[2].init("INCLUDED", uint64_t(1), true); + HintTable[3].init("READONLY", uint64_t(0), true); + HintTable[4].init("RIGHT_CLICK", "COPY_FIELD_SAMPLER_PROPERTIES PASTE_FIELD_SAMPLER_PROPERTIES", true); + HintTable[5].init("shortDescription", "The arary of FieldSamplers", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + static const char* const RefVariantVals[] = { "AttractorFieldSamplerData", "ForceFieldData", "HeatSourceData", "JetFieldSamplerData", "TurbulenceFieldSamplerData", "VortexFieldSamplerData", "NoiseFieldSamplerData", "SubstanceSourceData", "WindFieldSamplerData", "VelocitySourceData", "FlameEmitterData" }; + ParamDefTable[2].setRefVariantVals((const char**)RefVariantVals, 11); + + + + } + + // SetChildren for: nodeIndex=0, longName="" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(1); + + ParamDefTable[0].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=1, longName="FieldSamplers" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(2); + + ParamDefTable[1].setChildren(Children, 1); + } + + mBuiltFlag = true; + +} +void EffectPackageFieldSamplerDatabaseParams::initStrings(void) +{ +} + +void EffectPackageFieldSamplerDatabaseParams::initDynamicArrays(void) +{ + FieldSamplers.buf = NULL; + FieldSamplers.isAllocated = true; + FieldSamplers.elementSize = sizeof(NvParameterized::Interface*); + FieldSamplers.arraySizes[0] = 0; +} + +void EffectPackageFieldSamplerDatabaseParams::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void EffectPackageFieldSamplerDatabaseParams::initReferences(void) +{ +} + +void EffectPackageFieldSamplerDatabaseParams::freeDynamicArrays(void) +{ + if (FieldSamplers.isAllocated && FieldSamplers.buf) + { + mParameterizedTraits->free(FieldSamplers.buf); + } +} + +void EffectPackageFieldSamplerDatabaseParams::freeStrings(void) +{ +} + +void EffectPackageFieldSamplerDatabaseParams::freeReferences(void) +{ + + for (int i = 0; i < FieldSamplers.arraySizes[0]; ++i) + { + if (FieldSamplers.buf[i]) + { + FieldSamplers.buf[i]->destroy(); + } + } +} + +} // namespace particles +} // namespace nvidia diff --git a/APEX_1.4/module/particles/src/autogen/EffectPackageGraphicsMaterialsParams.cpp b/APEX_1.4/module/particles/src/autogen/EffectPackageGraphicsMaterialsParams.cpp new file mode 100644 index 00000000..651c80a0 --- /dev/null +++ b/APEX_1.4/module/particles/src/autogen/EffectPackageGraphicsMaterialsParams.cpp @@ -0,0 +1,392 @@ +// 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 "EffectPackageGraphicsMaterialsParams.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace particles +{ + +using namespace EffectPackageGraphicsMaterialsParamsNS; + +const char* const EffectPackageGraphicsMaterialsParamsFactory::vptr = + NvParameterized::getVptr<EffectPackageGraphicsMaterialsParams, EffectPackageGraphicsMaterialsParams::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)->GraphicsMaterials), CHILDREN(1), 1 }, // GraphicsMaterials + { TYPE_REF, false, 1 * sizeof(NvParameterized::Interface*), NULL, 0 }, // GraphicsMaterials[] +}; + + +bool EffectPackageGraphicsMaterialsParams::mBuiltFlag = false; +NvParameterized::MutexType EffectPackageGraphicsMaterialsParams::mBuiltFlagMutex; + +EffectPackageGraphicsMaterialsParams::EffectPackageGraphicsMaterialsParams(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &EffectPackageGraphicsMaterialsParamsFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +EffectPackageGraphicsMaterialsParams::~EffectPackageGraphicsMaterialsParams() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void EffectPackageGraphicsMaterialsParams::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->~EffectPackageGraphicsMaterialsParams(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* EffectPackageGraphicsMaterialsParams::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* EffectPackageGraphicsMaterialsParams::getParameterDefinitionTree(void) const +{ + EffectPackageGraphicsMaterialsParams* tmpParam = const_cast<EffectPackageGraphicsMaterialsParams*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType EffectPackageGraphicsMaterialsParams::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 EffectPackageGraphicsMaterialsParams::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 EffectPackageGraphicsMaterialsParams::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<EffectPackageGraphicsMaterialsParams::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ +/* [0] - GraphicsMaterials (not an array of structs) */ + +void EffectPackageGraphicsMaterialsParams::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 EffectPackageGraphicsMaterialsParams::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", "The collection of graphics and volumetric material assets", true); + ParamDefTable[0].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=1, longName="GraphicsMaterials" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[1]; + ParamDef->init("GraphicsMaterials", TYPE_ARRAY, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + 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("READONLY", uint64_t(0), true); + HintTable[2].init("RIGHT_CLICK", "COPY_GRAPHICS_MATERIAL_PROPERTIES PASTE_GRAPHICS_MATERIAL_PROPERTIES", true); + ParamDefTable[1].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("INCLUDED", uint64_t(1), true); + HintTable[1].init("READONLY", uint64_t(0), true); + HintTable[2].init("RIGHT_CLICK", "COPY_GRAPHICS_MATERIAL_PROPERTIES PASTE_GRAPHICS_MATERIAL_PROPERTIES", true); + HintTable[3].init("shortDescription", "The array of graphics materials", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + static const char* const RefVariantVals[] = { "GraphicsMaterialData", "VolumeRenderMaterialData" }; + 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="GraphicsMaterials[]" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[2]; + ParamDef->init("GraphicsMaterials", TYPE_REF, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + 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("READONLY", uint64_t(0), true); + HintTable[2].init("RIGHT_CLICK", "COPY_GRAPHICS_MATERIAL_PROPERTIES PASTE_GRAPHICS_MATERIAL_PROPERTIES", 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("INCLUDED", uint64_t(1), true); + HintTable[1].init("READONLY", uint64_t(0), true); + HintTable[2].init("RIGHT_CLICK", "COPY_GRAPHICS_MATERIAL_PROPERTIES PASTE_GRAPHICS_MATERIAL_PROPERTIES", true); + HintTable[3].init("shortDescription", "The array of graphics materials", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + static const char* const RefVariantVals[] = { "GraphicsMaterialData", "VolumeRenderMaterialData" }; + 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="GraphicsMaterials" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(2); + + ParamDefTable[1].setChildren(Children, 1); + } + + mBuiltFlag = true; + +} +void EffectPackageGraphicsMaterialsParams::initStrings(void) +{ +} + +void EffectPackageGraphicsMaterialsParams::initDynamicArrays(void) +{ + GraphicsMaterials.buf = NULL; + GraphicsMaterials.isAllocated = true; + GraphicsMaterials.elementSize = sizeof(NvParameterized::Interface*); + GraphicsMaterials.arraySizes[0] = 0; +} + +void EffectPackageGraphicsMaterialsParams::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void EffectPackageGraphicsMaterialsParams::initReferences(void) +{ +} + +void EffectPackageGraphicsMaterialsParams::freeDynamicArrays(void) +{ + if (GraphicsMaterials.isAllocated && GraphicsMaterials.buf) + { + mParameterizedTraits->free(GraphicsMaterials.buf); + } +} + +void EffectPackageGraphicsMaterialsParams::freeStrings(void) +{ +} + +void EffectPackageGraphicsMaterialsParams::freeReferences(void) +{ + + for (int i = 0; i < GraphicsMaterials.arraySizes[0]; ++i) + { + if (GraphicsMaterials.buf[i]) + { + GraphicsMaterials.buf[i]->destroy(); + } + } +} + +} // namespace particles +} // namespace nvidia diff --git a/APEX_1.4/module/particles/src/autogen/EffectPackageIOFXDatabaseParams.cpp b/APEX_1.4/module/particles/src/autogen/EffectPackageIOFXDatabaseParams.cpp new file mode 100644 index 00000000..49b45674 --- /dev/null +++ b/APEX_1.4/module/particles/src/autogen/EffectPackageIOFXDatabaseParams.cpp @@ -0,0 +1,400 @@ +// 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 "EffectPackageIOFXDatabaseParams.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace particles +{ + +using namespace EffectPackageIOFXDatabaseParamsNS; + +const char* const EffectPackageIOFXDatabaseParamsFactory::vptr = + NvParameterized::getVptr<EffectPackageIOFXDatabaseParams, EffectPackageIOFXDatabaseParams::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)->GraphicsEffects), CHILDREN(1), 1 }, // GraphicsEffects + { TYPE_REF, false, 1 * sizeof(NvParameterized::Interface*), NULL, 0 }, // GraphicsEffects[] +}; + + +bool EffectPackageIOFXDatabaseParams::mBuiltFlag = false; +NvParameterized::MutexType EffectPackageIOFXDatabaseParams::mBuiltFlagMutex; + +EffectPackageIOFXDatabaseParams::EffectPackageIOFXDatabaseParams(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &EffectPackageIOFXDatabaseParamsFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +EffectPackageIOFXDatabaseParams::~EffectPackageIOFXDatabaseParams() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void EffectPackageIOFXDatabaseParams::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->~EffectPackageIOFXDatabaseParams(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* EffectPackageIOFXDatabaseParams::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* EffectPackageIOFXDatabaseParams::getParameterDefinitionTree(void) const +{ + EffectPackageIOFXDatabaseParams* tmpParam = const_cast<EffectPackageIOFXDatabaseParams*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType EffectPackageIOFXDatabaseParams::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 EffectPackageIOFXDatabaseParams::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 EffectPackageIOFXDatabaseParams::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<EffectPackageIOFXDatabaseParams::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ +/* [0] - GraphicsEffects (not an array of structs) */ + +void EffectPackageIOFXDatabaseParams::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 EffectPackageIOFXDatabaseParams::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", "The collection of graphics effect assets (IOFX)", true); + ParamDefTable[0].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=1, longName="GraphicsEffects" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[1]; + ParamDef->init("GraphicsEffects", TYPE_ARRAY, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("DISABLE_SINGLE_CLICK_COLLAPSE", uint64_t(1), true); + HintTable[1].init("DISABLE_SINGLE_CLICK_EXPAND", uint64_t(1), true); + HintTable[2].init("INCLUDED", uint64_t(1), true); + HintTable[3].init("READONLY", uint64_t(0), true); + HintTable[4].init("RIGHT_CLICK", "COPY_IOFX_PROPERTIES PASTE_IOFX_PROPERTIES", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#else + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("DISABLE_SINGLE_CLICK_COLLAPSE", uint64_t(1), true); + HintTable[1].init("DISABLE_SINGLE_CLICK_EXPAND", uint64_t(1), true); + HintTable[2].init("INCLUDED", uint64_t(1), true); + HintTable[3].init("READONLY", uint64_t(0), true); + HintTable[4].init("RIGHT_CLICK", "COPY_IOFX_PROPERTIES PASTE_IOFX_PROPERTIES", true); + HintTable[5].init("shortDescription", "The array of graphics effect definition data", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + static const char* const RefVariantVals[] = { "GraphicsEffectData" }; + ParamDefTable[1].setRefVariantVals((const char**)RefVariantVals, 1); + + + ParamDef->setArraySize(-1); + static const uint8_t dynHandleIndices[1] = { 0, }; + ParamDef->setDynamicHandleIndicesMap(dynHandleIndices, 1); + + } + + // Initialize DefinitionImpl node: nodeIndex=2, longName="GraphicsEffects[]" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[2]; + ParamDef->init("GraphicsEffects", TYPE_REF, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("DISABLE_SINGLE_CLICK_COLLAPSE", uint64_t(1), true); + HintTable[1].init("DISABLE_SINGLE_CLICK_EXPAND", uint64_t(1), true); + HintTable[2].init("INCLUDED", uint64_t(1), true); + HintTable[3].init("READONLY", uint64_t(0), true); + HintTable[4].init("RIGHT_CLICK", "COPY_IOFX_PROPERTIES PASTE_IOFX_PROPERTIES", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#else + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("DISABLE_SINGLE_CLICK_COLLAPSE", uint64_t(1), true); + HintTable[1].init("DISABLE_SINGLE_CLICK_EXPAND", uint64_t(1), true); + HintTable[2].init("INCLUDED", uint64_t(1), true); + HintTable[3].init("READONLY", uint64_t(0), true); + HintTable[4].init("RIGHT_CLICK", "COPY_IOFX_PROPERTIES PASTE_IOFX_PROPERTIES", true); + HintTable[5].init("shortDescription", "The array of graphics effect definition data", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + static const char* const RefVariantVals[] = { "GraphicsEffectData" }; + ParamDefTable[2].setRefVariantVals((const char**)RefVariantVals, 1); + + + + } + + // SetChildren for: nodeIndex=0, longName="" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(1); + + ParamDefTable[0].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=1, longName="GraphicsEffects" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(2); + + ParamDefTable[1].setChildren(Children, 1); + } + + mBuiltFlag = true; + +} +void EffectPackageIOFXDatabaseParams::initStrings(void) +{ +} + +void EffectPackageIOFXDatabaseParams::initDynamicArrays(void) +{ + GraphicsEffects.buf = NULL; + GraphicsEffects.isAllocated = true; + GraphicsEffects.elementSize = sizeof(NvParameterized::Interface*); + GraphicsEffects.arraySizes[0] = 0; +} + +void EffectPackageIOFXDatabaseParams::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void EffectPackageIOFXDatabaseParams::initReferences(void) +{ +} + +void EffectPackageIOFXDatabaseParams::freeDynamicArrays(void) +{ + if (GraphicsEffects.isAllocated && GraphicsEffects.buf) + { + mParameterizedTraits->free(GraphicsEffects.buf); + } +} + +void EffectPackageIOFXDatabaseParams::freeStrings(void) +{ +} + +void EffectPackageIOFXDatabaseParams::freeReferences(void) +{ + + for (int i = 0; i < GraphicsEffects.arraySizes[0]; ++i) + { + if (GraphicsEffects.buf[i]) + { + GraphicsEffects.buf[i]->destroy(); + } + } +} + +} // namespace particles +} // namespace nvidia diff --git a/APEX_1.4/module/particles/src/autogen/EffectPackageIOSDatabaseParams.cpp b/APEX_1.4/module/particles/src/autogen/EffectPackageIOSDatabaseParams.cpp new file mode 100644 index 00000000..f71aa4fb --- /dev/null +++ b/APEX_1.4/module/particles/src/autogen/EffectPackageIOSDatabaseParams.cpp @@ -0,0 +1,400 @@ +// 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 "EffectPackageIOSDatabaseParams.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace particles +{ + +using namespace EffectPackageIOSDatabaseParamsNS; + +const char* const EffectPackageIOSDatabaseParamsFactory::vptr = + NvParameterized::getVptr<EffectPackageIOSDatabaseParams, EffectPackageIOSDatabaseParams::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)->ParticleSimulations), CHILDREN(1), 1 }, // ParticleSimulations + { TYPE_REF, false, 1 * sizeof(NvParameterized::Interface*), NULL, 0 }, // ParticleSimulations[] +}; + + +bool EffectPackageIOSDatabaseParams::mBuiltFlag = false; +NvParameterized::MutexType EffectPackageIOSDatabaseParams::mBuiltFlagMutex; + +EffectPackageIOSDatabaseParams::EffectPackageIOSDatabaseParams(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &EffectPackageIOSDatabaseParamsFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +EffectPackageIOSDatabaseParams::~EffectPackageIOSDatabaseParams() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void EffectPackageIOSDatabaseParams::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->~EffectPackageIOSDatabaseParams(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* EffectPackageIOSDatabaseParams::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* EffectPackageIOSDatabaseParams::getParameterDefinitionTree(void) const +{ + EffectPackageIOSDatabaseParams* tmpParam = const_cast<EffectPackageIOSDatabaseParams*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType EffectPackageIOSDatabaseParams::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 EffectPackageIOSDatabaseParams::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 EffectPackageIOSDatabaseParams::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<EffectPackageIOSDatabaseParams::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ +/* [0] - ParticleSimulations (not an array of structs) */ + +void EffectPackageIOSDatabaseParams::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 EffectPackageIOSDatabaseParams::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", "The collection of particle simulation assets (IOS)", true); + ParamDefTable[0].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=1, longName="ParticleSimulations" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[1]; + ParamDef->init("ParticleSimulations", TYPE_ARRAY, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("DISABLE_SINGLE_CLICK_COLLAPSE", uint64_t(1), true); + HintTable[1].init("DISABLE_SINGLE_CLICK_EXPAND", uint64_t(1), true); + HintTable[2].init("INCLUDED", uint64_t(1), true); + HintTable[3].init("READONLY", uint64_t(0), true); + HintTable[4].init("RIGHT_CLICK", "COPY_IOS_PROPERTIES PASTE_IOS_PROPERTIES", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#else + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("DISABLE_SINGLE_CLICK_COLLAPSE", uint64_t(1), true); + HintTable[1].init("DISABLE_SINGLE_CLICK_EXPAND", uint64_t(1), true); + HintTable[2].init("INCLUDED", uint64_t(1), true); + HintTable[3].init("READONLY", uint64_t(0), true); + HintTable[4].init("RIGHT_CLICK", "COPY_IOS_PROPERTIES PASTE_IOS_PROPERTIES", true); + HintTable[5].init("shortDescription", "The arary of particle simulation data", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + static const char* const RefVariantVals[] = { "ParticleSimulationData" }; + ParamDefTable[1].setRefVariantVals((const char**)RefVariantVals, 1); + + + ParamDef->setArraySize(-1); + static const uint8_t dynHandleIndices[1] = { 0, }; + ParamDef->setDynamicHandleIndicesMap(dynHandleIndices, 1); + + } + + // Initialize DefinitionImpl node: nodeIndex=2, longName="ParticleSimulations[]" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[2]; + ParamDef->init("ParticleSimulations", TYPE_REF, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("DISABLE_SINGLE_CLICK_COLLAPSE", uint64_t(1), true); + HintTable[1].init("DISABLE_SINGLE_CLICK_EXPAND", uint64_t(1), true); + HintTable[2].init("INCLUDED", uint64_t(1), true); + HintTable[3].init("READONLY", uint64_t(0), true); + HintTable[4].init("RIGHT_CLICK", "COPY_IOS_PROPERTIES PASTE_IOS_PROPERTIES", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#else + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("DISABLE_SINGLE_CLICK_COLLAPSE", uint64_t(1), true); + HintTable[1].init("DISABLE_SINGLE_CLICK_EXPAND", uint64_t(1), true); + HintTable[2].init("INCLUDED", uint64_t(1), true); + HintTable[3].init("READONLY", uint64_t(0), true); + HintTable[4].init("RIGHT_CLICK", "COPY_IOS_PROPERTIES PASTE_IOS_PROPERTIES", true); + HintTable[5].init("shortDescription", "The arary of particle simulation data", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + static const char* const RefVariantVals[] = { "ParticleSimulationData" }; + ParamDefTable[2].setRefVariantVals((const char**)RefVariantVals, 1); + + + + } + + // SetChildren for: nodeIndex=0, longName="" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(1); + + ParamDefTable[0].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=1, longName="ParticleSimulations" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(2); + + ParamDefTable[1].setChildren(Children, 1); + } + + mBuiltFlag = true; + +} +void EffectPackageIOSDatabaseParams::initStrings(void) +{ +} + +void EffectPackageIOSDatabaseParams::initDynamicArrays(void) +{ + ParticleSimulations.buf = NULL; + ParticleSimulations.isAllocated = true; + ParticleSimulations.elementSize = sizeof(NvParameterized::Interface*); + ParticleSimulations.arraySizes[0] = 0; +} + +void EffectPackageIOSDatabaseParams::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void EffectPackageIOSDatabaseParams::initReferences(void) +{ +} + +void EffectPackageIOSDatabaseParams::freeDynamicArrays(void) +{ + if (ParticleSimulations.isAllocated && ParticleSimulations.buf) + { + mParameterizedTraits->free(ParticleSimulations.buf); + } +} + +void EffectPackageIOSDatabaseParams::freeStrings(void) +{ +} + +void EffectPackageIOSDatabaseParams::freeReferences(void) +{ + + for (int i = 0; i < ParticleSimulations.arraySizes[0]; ++i) + { + if (ParticleSimulations.buf[i]) + { + ParticleSimulations.buf[i]->destroy(); + } + } +} + +} // namespace particles +} // namespace nvidia diff --git a/APEX_1.4/module/particles/src/autogen/EmitterData.cpp b/APEX_1.4/module/particles/src/autogen/EmitterData.cpp new file mode 100644 index 00000000..428c2900 --- /dev/null +++ b/APEX_1.4/module/particles/src/autogen/EmitterData.cpp @@ -0,0 +1,363 @@ +// 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 "EmitterData.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace particles +{ + +using namespace EmitterDataNS; + +const char* const EmitterDataFactory::vptr = + NvParameterized::getVptr<EmitterData, EmitterData::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_STRING, false, (size_t)(&((ParametersStruct*)0)->Name), NULL, 0 }, // Name + { TYPE_REF, false, (size_t)(&((ParametersStruct*)0)->Emitter), NULL, 0 }, // Emitter +}; + + +bool EmitterData::mBuiltFlag = false; +NvParameterized::MutexType EmitterData::mBuiltFlagMutex; + +EmitterData::EmitterData(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &EmitterDataFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +EmitterData::~EmitterData() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void EmitterData::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->~EmitterData(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* EmitterData::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* EmitterData::getParameterDefinitionTree(void) const +{ + EmitterData* tmpParam = const_cast<EmitterData*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType EmitterData::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 EmitterData::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 EmitterData::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<EmitterData::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ + +void EmitterData::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 EmitterData::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", "Contains the asset properties for this emitter", true); + ParamDefTable[0].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=1, longName="Name" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[1]; + ParamDef->init("Name", TYPE_STRING, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Emitter name", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=2, longName="Emitter" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[2]; + ParamDef->init("Emitter", 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[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("INCLUDED", uint64_t(1), true); + HintTable[1].init("shortDescription", "Emitter properties", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + static const char* const RefVariantVals[] = { "ApexEmitterAssetParameters" }; + ParamDefTable[2].setRefVariantVals((const char**)RefVariantVals, 1); + + + + } + + // 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 EmitterData::initStrings(void) +{ + Name.isAllocated = false; + Name.buf = (const char*)"defaultEmitter"; +} + +void EmitterData::initDynamicArrays(void) +{ +} + +void EmitterData::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void EmitterData::initReferences(void) +{ + Emitter = NULL; + +} + +void EmitterData::freeDynamicArrays(void) +{ +} + +void EmitterData::freeStrings(void) +{ + + if (Name.isAllocated && Name.buf) + { + mParameterizedTraits->strfree((char*)Name.buf); + } +} + +void EmitterData::freeReferences(void) +{ + if (Emitter) + { + Emitter->destroy(); + } + +} + +} // namespace particles +} // namespace nvidia diff --git a/APEX_1.4/module/particles/src/autogen/EmitterEffect.cpp b/APEX_1.4/module/particles/src/autogen/EmitterEffect.cpp new file mode 100644 index 00000000..41bd6d6f --- /dev/null +++ b/APEX_1.4/module/particles/src/autogen/EmitterEffect.cpp @@ -0,0 +1,1769 @@ +// 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 "EmitterEffect.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace particles +{ + +using namespace EmitterEffectNS; + +const char* const EmitterEffectFactory::vptr = + NvParameterized::getVptr<EmitterEffect, EmitterEffect::ClassAlignment>(); + +const uint32_t NumParamDefs = 45; +static NvParameterized::DefinitionImpl* ParamDefTable; // now allocated in buildTree [NumParamDefs]; + + +static const size_t ParamLookupChildrenTable[] = +{ + 1, 31, 44, 2, 3, 4, 8, 12, 13, 14, 15, 16, 17, 5, 6, 7, 9, 10, 11, 18, 19, 20, 21, + 23, 27, 22, 24, 25, 26, 28, 29, 30, 32, 38, 33, 34, 35, 36, 37, 39, 40, 41, 42, 43, +}; + +#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)->EffectProperties), CHILDREN(3), 10 }, // EffectProperties + { TYPE_STRING, false, (size_t)(&((EffectProperties_Type*)0)->UserString), NULL, 0 }, // EffectProperties.UserString + { TYPE_BOOL, false, (size_t)(&((EffectProperties_Type*)0)->Enable), NULL, 0 }, // EffectProperties.Enable + { TYPE_STRUCT, false, (size_t)(&((EffectProperties_Type*)0)->Position), CHILDREN(13), 3 }, // EffectProperties.Position + { TYPE_F32, false, (size_t)(&((TranslateObject_Type*)0)->TranslateX), NULL, 0 }, // EffectProperties.Position.TranslateX + { TYPE_F32, false, (size_t)(&((TranslateObject_Type*)0)->TranslateY), NULL, 0 }, // EffectProperties.Position.TranslateY + { TYPE_F32, false, (size_t)(&((TranslateObject_Type*)0)->TranslateZ), NULL, 0 }, // EffectProperties.Position.TranslateZ + { TYPE_STRUCT, false, (size_t)(&((EffectProperties_Type*)0)->Orientation), CHILDREN(16), 3 }, // EffectProperties.Orientation + { TYPE_F32, false, (size_t)(&((OrientObject_Type*)0)->RotateX), NULL, 0 }, // EffectProperties.Orientation.RotateX + { TYPE_F32, false, (size_t)(&((OrientObject_Type*)0)->RotateY), NULL, 0 }, // EffectProperties.Orientation.RotateY + { TYPE_F32, false, (size_t)(&((OrientObject_Type*)0)->RotateZ), NULL, 0 }, // EffectProperties.Orientation.RotateZ + { TYPE_F32, false, (size_t)(&((EffectProperties_Type*)0)->InitialDelayTime), NULL, 0 }, // EffectProperties.InitialDelayTime + { TYPE_F32, false, (size_t)(&((EffectProperties_Type*)0)->Duration), NULL, 0 }, // EffectProperties.Duration + { TYPE_U32, false, (size_t)(&((EffectProperties_Type*)0)->RepeatCount), NULL, 0 }, // EffectProperties.RepeatCount + { TYPE_F32, false, (size_t)(&((EffectProperties_Type*)0)->RepeatDelay), NULL, 0 }, // EffectProperties.RepeatDelay + { TYPE_F32, false, (size_t)(&((EffectProperties_Type*)0)->RandomizeRepeatTime), NULL, 0 }, // EffectProperties.RandomizeRepeatTime + { TYPE_STRUCT, false, (size_t)(&((EffectProperties_Type*)0)->Path), CHILDREN(19), 6 }, // EffectProperties.Path + { TYPE_ENUM, false, (size_t)(&((EffectPath_Type*)0)->PlaybackMode), NULL, 0 }, // EffectProperties.Path.PlaybackMode + { TYPE_F32, false, (size_t)(&((EffectPath_Type*)0)->PathDuration), NULL, 0 }, // EffectProperties.Path.PathDuration + { TYPE_U32, false, (size_t)(&((EffectPath_Type*)0)->LoopIndex), NULL, 0 }, // EffectProperties.Path.LoopIndex + { TYPE_ARRAY, true, (size_t)(&((EffectPath_Type*)0)->ControlPoints), CHILDREN(25), 1 }, // EffectProperties.Path.ControlPoints + { TYPE_TRANSFORM, false, 1 * sizeof(physx::PxTransform), NULL, 0 }, // EffectProperties.Path.ControlPoints[] + { TYPE_ARRAY, true, (size_t)(&((EffectPath_Type*)0)->Scale), CHILDREN(26), 1 }, // EffectProperties.Path.Scale + { TYPE_STRUCT, false, 1 * sizeof(ControlPoint_Type), CHILDREN(27), 2 }, // EffectProperties.Path.Scale[] + { TYPE_F32, false, (size_t)(&((ControlPoint_Type*)0)->x), NULL, 0 }, // EffectProperties.Path.Scale[].x + { TYPE_F32, false, (size_t)(&((ControlPoint_Type*)0)->y), NULL, 0 }, // EffectProperties.Path.Scale[].y + { TYPE_ARRAY, true, (size_t)(&((EffectPath_Type*)0)->Speed), CHILDREN(29), 1 }, // EffectProperties.Path.Speed + { TYPE_STRUCT, false, 1 * sizeof(ControlPoint_Type), CHILDREN(30), 2 }, // EffectProperties.Path.Speed[] + { TYPE_F32, false, (size_t)(&((ControlPoint_Type*)0)->x), NULL, 0 }, // EffectProperties.Path.Speed[].x + { TYPE_F32, false, (size_t)(&((ControlPoint_Type*)0)->y), NULL, 0 }, // EffectProperties.Path.Speed[].y + { TYPE_STRUCT, false, (size_t)(&((ParametersStruct*)0)->EmitterVelocityChanges), CHILDREN(32), 2 }, // EmitterVelocityChanges + { TYPE_STRUCT, false, (size_t)(&((EmitterVelocityProperties_Type*)0)->AdjustLifetime), CHILDREN(34), 5 }, // EmitterVelocityChanges.AdjustLifetime + { TYPE_BOOL, false, (size_t)(&((EmitterVelocityAdjust_Type*)0)->AdjustEnabled), NULL, 0 }, // EmitterVelocityChanges.AdjustLifetime.AdjustEnabled + { TYPE_F32, false, (size_t)(&((EmitterVelocityAdjust_Type*)0)->VelocityLow), NULL, 0 }, // EmitterVelocityChanges.AdjustLifetime.VelocityLow + { TYPE_F32, false, (size_t)(&((EmitterVelocityAdjust_Type*)0)->VelocityHigh), NULL, 0 }, // EmitterVelocityChanges.AdjustLifetime.VelocityHigh + { TYPE_F32, false, (size_t)(&((EmitterVelocityAdjust_Type*)0)->LowValue), NULL, 0 }, // EmitterVelocityChanges.AdjustLifetime.LowValue + { TYPE_F32, false, (size_t)(&((EmitterVelocityAdjust_Type*)0)->HighValue), NULL, 0 }, // EmitterVelocityChanges.AdjustLifetime.HighValue + { TYPE_STRUCT, false, (size_t)(&((EmitterVelocityProperties_Type*)0)->AdjustEmitterRate), CHILDREN(39), 5 }, // EmitterVelocityChanges.AdjustEmitterRate + { TYPE_BOOL, false, (size_t)(&((EmitterVelocityAdjust_Type*)0)->AdjustEnabled), NULL, 0 }, // EmitterVelocityChanges.AdjustEmitterRate.AdjustEnabled + { TYPE_F32, false, (size_t)(&((EmitterVelocityAdjust_Type*)0)->VelocityLow), NULL, 0 }, // EmitterVelocityChanges.AdjustEmitterRate.VelocityLow + { TYPE_F32, false, (size_t)(&((EmitterVelocityAdjust_Type*)0)->VelocityHigh), NULL, 0 }, // EmitterVelocityChanges.AdjustEmitterRate.VelocityHigh + { TYPE_F32, false, (size_t)(&((EmitterVelocityAdjust_Type*)0)->LowValue), NULL, 0 }, // EmitterVelocityChanges.AdjustEmitterRate.LowValue + { TYPE_F32, false, (size_t)(&((EmitterVelocityAdjust_Type*)0)->HighValue), NULL, 0 }, // EmitterVelocityChanges.AdjustEmitterRate.HighValue + { TYPE_REF, false, (size_t)(&((ParametersStruct*)0)->Emitter), NULL, 0 }, // Emitter +}; + + +bool EmitterEffect::mBuiltFlag = false; +NvParameterized::MutexType EmitterEffect::mBuiltFlagMutex; + +EmitterEffect::EmitterEffect(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &EmitterEffectFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +EmitterEffect::~EmitterEffect() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void EmitterEffect::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->~EmitterEffect(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* EmitterEffect::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* EmitterEffect::getParameterDefinitionTree(void) const +{ + EmitterEffect* tmpParam = const_cast<EmitterEffect*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType EmitterEffect::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 EmitterEffect::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 EmitterEffect::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<EmitterEffect::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ + +void EmitterEffect::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 EmitterEffect::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", "An emitter effect", true); + ParamDefTable[0].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=1, longName="EffectProperties" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[1]; + ParamDef->init("EffectProperties", TYPE_STRUCT, "EffectProperties", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("READONLY", uint64_t(0), true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("READONLY", uint64_t(0), true); + HintTable[1].init("shortDescription", "Emitter Effect Properties", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=2, longName="EffectProperties.UserString" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[2]; + ParamDef->init("UserString", TYPE_STRING, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "An aribtrary user string that can be set by an artist/designer/programmer", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=3, longName="EffectProperties.Enable" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[3]; + ParamDef->init("Enable", TYPE_BOOL, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Whether or not this effect is to be initially enabled on startup", true); + ParamDefTable[3].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=4, longName="EffectProperties.Position" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[4]; + ParamDef->init("Position", TYPE_STRUCT, "TranslateObject", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "The position of this effect relative to the parent", true); + ParamDefTable[4].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=5, longName="EffectProperties.Position.TranslateX" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[5]; + ParamDef->init("TranslateX", 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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(500.000000000), true); + HintTable[2].init("min", double(-500.000000000), true); + ParamDefTable[5].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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(500.000000000), true); + HintTable[2].init("min", double(-500.000000000), true); + HintTable[3].init("shortDescription", "Nudge up to +/- one meter in each direction", true); + ParamDefTable[5].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=6, longName="EffectProperties.Position.TranslateY" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[6]; + ParamDef->init("TranslateY", 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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(500.000000000), true); + HintTable[2].init("min", double(-500.000000000), true); + ParamDefTable[6].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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(500.000000000), true); + HintTable[2].init("min", double(-500.000000000), true); + HintTable[3].init("shortDescription", "Nudge up to +/- one meter in each direction", true); + ParamDefTable[6].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=7, longName="EffectProperties.Position.TranslateZ" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[7]; + ParamDef->init("TranslateZ", 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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(500.000000000), true); + HintTable[2].init("min", double(-500.000000000), true); + ParamDefTable[7].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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(500.000000000), true); + HintTable[2].init("min", double(-500.000000000), true); + HintTable[3].init("shortDescription", "Nudge up to +/- one meter in each direction", true); + ParamDefTable[7].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=8, longName="EffectProperties.Orientation" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[8]; + ParamDef->init("Orientation", TYPE_STRUCT, "OrientObject", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "The orientation of this effect, relative to the parent orientation", true); + ParamDefTable[8].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=9, longName="EffectProperties.Orientation.RotateX" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[9]; + ParamDef->init("RotateX", 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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(360.000000000), true); + HintTable[2].init("min", double(0.000000000), true); + ParamDefTable[9].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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(360.000000000), true); + HintTable[2].init("min", double(0.000000000), true); + HintTable[3].init("shortDescription", "Rotate on the X axis (0-360 degrees)", true); + ParamDefTable[9].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=10, longName="EffectProperties.Orientation.RotateY" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[10]; + ParamDef->init("RotateY", 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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(360.000000000), true); + HintTable[2].init("min", double(0.000000000), true); + ParamDefTable[10].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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(360.000000000), true); + HintTable[2].init("min", double(0.000000000), true); + HintTable[3].init("shortDescription", "Rotate on the Y axis (0-360 degrees)", true); + ParamDefTable[10].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=11, longName="EffectProperties.Orientation.RotateZ" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[11]; + ParamDef->init("RotateZ", 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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(360.000000000), true); + HintTable[2].init("min", double(0.000000000), 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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(360.000000000), true); + HintTable[2].init("min", double(0.000000000), true); + HintTable[3].init("shortDescription", "Rotate on the Z axis (0-360 degrees)", true); + ParamDefTable[11].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=12, longName="EffectProperties.InitialDelayTime" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[12]; + ParamDef->init("InitialDelayTime", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("min", double(0.000000000), 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("min", double(0.000000000), true); + HintTable[1].init("shortDescription", "Initial time to delay before spawning this effect", true); + ParamDefTable[12].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=13, longName="EffectProperties.Duration" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[13]; + ParamDef->init("Duration", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("min", double(0.000000000), true); + ParamDefTable[13].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("min", double(0.000000000), true); + HintTable[1].init("shortDescription", "The duration of the effect in secontds", true); + ParamDefTable[13].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=14, longName="EffectProperties.RepeatCount" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[14]; + ParamDef->init("RepeatCount", TYPE_U32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("min", uint64_t(1), 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("min", uint64_t(1), true); + HintTable[1].init("shortDescription", "The number of times to repeat the effect; 9999 means repeate forever", true); + ParamDefTable[14].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=15, longName="EffectProperties.RepeatDelay" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[15]; + ParamDef->init("RepeatDelay", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("min", double(0.000000000), 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("min", double(0.000000000), true); + HintTable[1].init("shortDescription", "The time to delay activation each time the effect repeats in seconds; this can be different than the initial delay time", true); + ParamDefTable[15].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=16, longName="EffectProperties.RandomizeRepeatTime" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[16]; + ParamDef->init("RandomizeRepeatTime", 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", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), 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("max", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + HintTable[2].init("shortDescription", "Amount of randomization to the repeat cycle; a value of zero (default) means no random and a value of one means completely random.", true); + ParamDefTable[16].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=17, longName="EffectProperties.Path" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[17]; + ParamDef->init("Path", TYPE_STRUCT, "EffectPath", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "An optional pre-defined path for this effect to travel on", true); + ParamDefTable[17].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=18, longName="EffectProperties.Path.PlaybackMode" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[18]; + ParamDef->init("PlaybackMode", TYPE_ENUM, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "The mode to play back the path", true); + ParamDefTable[18].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + static const char* const EnumVals[] = { "LOOP", "PLAY_ONCE", "PING_PONG" }; + ParamDefTable[18].setEnumVals((const char**)EnumVals, 3); + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=19, longName="EffectProperties.Path.PathDuration" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[19]; + ParamDef->init("PathDuration", 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", double(1000.000000000), true); + HintTable[1].init("min", double(0.000010000), true); + ParamDefTable[19].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", double(1000.000000000), true); + HintTable[1].init("min", double(0.000010000), true); + HintTable[2].init("shortDescription", "The duration of the path if one is not otherwise provided", true); + ParamDefTable[19].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=20, longName="EffectProperties.Path.LoopIndex" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[20]; + ParamDef->init("LoopIndex", TYPE_U32, 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[20].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("min", uint64_t(0), true); + HintTable[1].init("shortDescription", "The array index to loop back to", true); + ParamDefTable[20].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=21, longName="EffectProperties.Path.ControlPoints" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[21]; + ParamDef->init("ControlPoints", TYPE_ARRAY, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("editorCurve", uint64_t(1), true); + HintTable[2].init("pathEditor", uint64_t(1), 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("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("editorCurve", uint64_t(1), true); + HintTable[2].init("pathEditor", uint64_t(1), true); + HintTable[3].init("shortDescription", "The array of control points to fit the curve to", true); + ParamDefTable[21].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + ParamDef->setArraySize(-1); + } + + // Initialize DefinitionImpl node: nodeIndex=22, longName="EffectProperties.Path.ControlPoints[]" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[22]; + ParamDef->init("ControlPoints", TYPE_TRANSFORM, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("editorCurve", uint64_t(1), true); + HintTable[2].init("pathEditor", uint64_t(1), 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("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("editorCurve", uint64_t(1), true); + HintTable[2].init("pathEditor", uint64_t(1), true); + HintTable[3].init("shortDescription", "The array of control points to fit the curve to", true); + ParamDefTable[22].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=23, longName="EffectProperties.Path.Scale" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[23]; + ParamDef->init("Scale", TYPE_ARRAY, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("xAxisLabel", "Over Time", true); + HintTable[4].init("yAxisLabel", "Scale", true); + ParamDefTable[23].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#else + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("shortDescription", "The array of scale values over time", true); + HintTable[4].init("xAxisLabel", "Over Time", true); + HintTable[5].init("yAxisLabel", "Scale", true); + ParamDefTable[23].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + ParamDef->setArraySize(-1); + } + + // Initialize DefinitionImpl node: nodeIndex=24, longName="EffectProperties.Path.Scale[]" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[24]; + ParamDef->init("Scale", TYPE_STRUCT, "ControlPoint", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("xAxisLabel", "Over Time", true); + HintTable[4].init("yAxisLabel", "Scale", true); + ParamDefTable[24].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#else + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("shortDescription", "The array of scale values over time", true); + HintTable[4].init("xAxisLabel", "Over Time", true); + HintTable[5].init("yAxisLabel", "Scale", true); + ParamDefTable[24].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=25, longName="EffectProperties.Path.Scale[].x" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[25]; + 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", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), 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("max", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + HintTable[2].init("shortDescription", "The x-axis value for this vector", true); + ParamDefTable[25].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=26, longName="EffectProperties.Path.Scale[].y" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[26]; + 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", "The y-axis value for this vector", true); + ParamDefTable[26].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=27, longName="EffectProperties.Path.Speed" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[27]; + ParamDef->init("Speed", TYPE_ARRAY, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("xAxisLabel", "Over Time", true); + HintTable[4].init("yAxisLabel", "Speed", true); + ParamDefTable[27].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#else + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("shortDescription", "The array of speed values over time", true); + HintTable[4].init("xAxisLabel", "Over Time", true); + HintTable[5].init("yAxisLabel", "Speed", true); + ParamDefTable[27].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + ParamDef->setArraySize(-1); + } + + // Initialize DefinitionImpl node: nodeIndex=28, longName="EffectProperties.Path.Speed[]" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[28]; + ParamDef->init("Speed", TYPE_STRUCT, "ControlPoint", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("xAxisLabel", "Over Time", true); + HintTable[4].init("yAxisLabel", "Speed", true); + ParamDefTable[28].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#else + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("shortDescription", "The array of speed values over time", true); + HintTable[4].init("xAxisLabel", "Over Time", true); + HintTable[5].init("yAxisLabel", "Speed", true); + ParamDefTable[28].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=29, longName="EffectProperties.Path.Speed[].x" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[29]; + 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", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + ParamDefTable[29].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", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + HintTable[2].init("shortDescription", "The x-axis value for this vector", true); + ParamDefTable[29].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=30, longName="EffectProperties.Path.Speed[].y" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[30]; + 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", "The y-axis value for this vector", true); + ParamDefTable[30].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=31, longName="EmitterVelocityChanges" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[31]; + ParamDef->init("EmitterVelocityChanges", TYPE_STRUCT, "EmitterVelocityProperties", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Adjust the Velocity of the Emitter", true); + ParamDefTable[31].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=32, longName="EmitterVelocityChanges.AdjustLifetime" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[32]; + ParamDef->init("AdjustLifetime", TYPE_STRUCT, "EmitterVelocityAdjust", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Optionally adjust the lifetime of emitted particles based on the velocity of the emitter", true); + ParamDefTable[32].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=33, longName="EmitterVelocityChanges.AdjustLifetime.AdjustEnabled" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[33]; + ParamDef->init("AdjustEnabled", TYPE_BOOL, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "True if adjusting emitter properties based on velocity", true); + ParamDefTable[33].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=34, longName="EmitterVelocityChanges.AdjustLifetime.VelocityLow" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[34]; + ParamDef->init("VelocityLow", 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", double(100.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + ParamDefTable[34].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", double(100.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + HintTable[2].init("shortDescription", "Low velocity range to match the low", true); + ParamDefTable[34].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=35, longName="EmitterVelocityChanges.AdjustLifetime.VelocityHigh" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[35]; + ParamDef->init("VelocityHigh", 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", double(100.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + ParamDefTable[35].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", double(100.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + HintTable[2].init("shortDescription", "High velocity range to match the high value", true); + ParamDefTable[35].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=36, longName="EmitterVelocityChanges.AdjustLifetime.LowValue" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[36]; + ParamDef->init("LowValue", 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", double(100.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + ParamDefTable[36].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", double(100.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + HintTable[2].init("shortDescription", "The multiplier when the velocity equals VelocityLow", true); + ParamDefTable[36].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=37, longName="EmitterVelocityChanges.AdjustLifetime.HighValue" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[37]; + ParamDef->init("HighValue", 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", double(100.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + ParamDefTable[37].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", double(100.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + HintTable[2].init("shortDescription", "The multiplier when the velocity equals VelocityHigh", true); + ParamDefTable[37].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=38, longName="EmitterVelocityChanges.AdjustEmitterRate" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[38]; + ParamDef->init("AdjustEmitterRate", TYPE_STRUCT, "EmitterVelocityAdjust", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Optionally adjust the rate of the emitted particles based on the velocity of the emitter", true); + ParamDefTable[38].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=39, longName="EmitterVelocityChanges.AdjustEmitterRate.AdjustEnabled" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[39]; + ParamDef->init("AdjustEnabled", TYPE_BOOL, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "True if adjusting emitter properties based on velocity", true); + ParamDefTable[39].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=40, longName="EmitterVelocityChanges.AdjustEmitterRate.VelocityLow" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[40]; + ParamDef->init("VelocityLow", 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", double(100.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + ParamDefTable[40].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", double(100.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + HintTable[2].init("shortDescription", "Low velocity range to match the low", true); + ParamDefTable[40].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=41, longName="EmitterVelocityChanges.AdjustEmitterRate.VelocityHigh" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[41]; + ParamDef->init("VelocityHigh", 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", double(100.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + ParamDefTable[41].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", double(100.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + HintTable[2].init("shortDescription", "High velocity range to match the high value", true); + ParamDefTable[41].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=42, longName="EmitterVelocityChanges.AdjustEmitterRate.LowValue" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[42]; + ParamDef->init("LowValue", 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", double(100.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + ParamDefTable[42].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", double(100.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + HintTable[2].init("shortDescription", "The multiplier when the velocity equals VelocityLow", true); + ParamDefTable[42].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=43, longName="EmitterVelocityChanges.AdjustEmitterRate.HighValue" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[43]; + ParamDef->init("HighValue", 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", double(100.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + ParamDefTable[43].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", double(100.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + HintTable[2].init("shortDescription", "The multiplier when the velocity equals VelocityHigh", true); + ParamDefTable[43].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=44, longName="Emitter" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[44]; + ParamDef->init("Emitter", TYPE_REF, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Emitter Asset", true); + ParamDefTable[44].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + static const char* const RefVariantVals[] = { "ApexEmitterAsset" }; + ParamDefTable[44].setRefVariantVals((const char**)RefVariantVals, 1); + + + + } + + // SetChildren for: nodeIndex=0, longName="" + { + static Definition* Children[3]; + Children[0] = PDEF_PTR(1); + Children[1] = PDEF_PTR(31); + Children[2] = PDEF_PTR(44); + + ParamDefTable[0].setChildren(Children, 3); + } + + // SetChildren for: nodeIndex=1, longName="EffectProperties" + { + static Definition* Children[10]; + Children[0] = PDEF_PTR(2); + Children[1] = PDEF_PTR(3); + Children[2] = PDEF_PTR(4); + Children[3] = PDEF_PTR(8); + Children[4] = PDEF_PTR(12); + Children[5] = PDEF_PTR(13); + Children[6] = PDEF_PTR(14); + Children[7] = PDEF_PTR(15); + Children[8] = PDEF_PTR(16); + Children[9] = PDEF_PTR(17); + + ParamDefTable[1].setChildren(Children, 10); + } + + // SetChildren for: nodeIndex=4, longName="EffectProperties.Position" + { + static Definition* Children[3]; + Children[0] = PDEF_PTR(5); + Children[1] = PDEF_PTR(6); + Children[2] = PDEF_PTR(7); + + ParamDefTable[4].setChildren(Children, 3); + } + + // SetChildren for: nodeIndex=8, longName="EffectProperties.Orientation" + { + static Definition* Children[3]; + Children[0] = PDEF_PTR(9); + Children[1] = PDEF_PTR(10); + Children[2] = PDEF_PTR(11); + + ParamDefTable[8].setChildren(Children, 3); + } + + // SetChildren for: nodeIndex=17, longName="EffectProperties.Path" + { + static Definition* Children[6]; + Children[0] = PDEF_PTR(18); + Children[1] = PDEF_PTR(19); + Children[2] = PDEF_PTR(20); + Children[3] = PDEF_PTR(21); + Children[4] = PDEF_PTR(23); + Children[5] = PDEF_PTR(27); + + ParamDefTable[17].setChildren(Children, 6); + } + + // SetChildren for: nodeIndex=21, longName="EffectProperties.Path.ControlPoints" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(22); + + ParamDefTable[21].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=23, longName="EffectProperties.Path.Scale" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(24); + + ParamDefTable[23].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=24, longName="EffectProperties.Path.Scale[]" + { + static Definition* Children[2]; + Children[0] = PDEF_PTR(25); + Children[1] = PDEF_PTR(26); + + ParamDefTable[24].setChildren(Children, 2); + } + + // SetChildren for: nodeIndex=27, longName="EffectProperties.Path.Speed" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(28); + + ParamDefTable[27].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=28, longName="EffectProperties.Path.Speed[]" + { + static Definition* Children[2]; + Children[0] = PDEF_PTR(29); + Children[1] = PDEF_PTR(30); + + ParamDefTable[28].setChildren(Children, 2); + } + + // SetChildren for: nodeIndex=31, longName="EmitterVelocityChanges" + { + static Definition* Children[2]; + Children[0] = PDEF_PTR(32); + Children[1] = PDEF_PTR(38); + + ParamDefTable[31].setChildren(Children, 2); + } + + // SetChildren for: nodeIndex=32, longName="EmitterVelocityChanges.AdjustLifetime" + { + static Definition* Children[5]; + Children[0] = PDEF_PTR(33); + Children[1] = PDEF_PTR(34); + Children[2] = PDEF_PTR(35); + Children[3] = PDEF_PTR(36); + Children[4] = PDEF_PTR(37); + + ParamDefTable[32].setChildren(Children, 5); + } + + // SetChildren for: nodeIndex=38, longName="EmitterVelocityChanges.AdjustEmitterRate" + { + static Definition* Children[5]; + Children[0] = PDEF_PTR(39); + Children[1] = PDEF_PTR(40); + Children[2] = PDEF_PTR(41); + Children[3] = PDEF_PTR(42); + Children[4] = PDEF_PTR(43); + + ParamDefTable[38].setChildren(Children, 5); + } + + mBuiltFlag = true; + +} +void EmitterEffect::initStrings(void) +{ + EffectProperties.UserString.isAllocated = true; + EffectProperties.UserString.buf = NULL; +} + +void EmitterEffect::initDynamicArrays(void) +{ + EffectProperties.Path.ControlPoints.buf = NULL; + EffectProperties.Path.ControlPoints.isAllocated = true; + EffectProperties.Path.ControlPoints.elementSize = sizeof(physx::PxTransform); + EffectProperties.Path.ControlPoints.arraySizes[0] = 0; + EffectProperties.Path.Scale.buf = NULL; + EffectProperties.Path.Scale.isAllocated = true; + EffectProperties.Path.Scale.elementSize = sizeof(ControlPoint_Type); + EffectProperties.Path.Scale.arraySizes[0] = 0; + EffectProperties.Path.Speed.buf = NULL; + EffectProperties.Path.Speed.isAllocated = true; + EffectProperties.Path.Speed.elementSize = sizeof(ControlPoint_Type); + EffectProperties.Path.Speed.arraySizes[0] = 0; +} + +void EmitterEffect::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + EffectProperties.Enable = bool(1); + EffectProperties.Position.TranslateX = float(0.000000000); + EffectProperties.Position.TranslateY = float(0.000000000); + EffectProperties.Position.TranslateZ = float(0.000000000); + EffectProperties.Orientation.RotateX = float(0.000000000); + EffectProperties.Orientation.RotateY = float(0.000000000); + EffectProperties.Orientation.RotateZ = float(0.000000000); + EffectProperties.InitialDelayTime = float(0.000000000); + EffectProperties.Duration = float(0.000000000); + EffectProperties.RepeatCount = uint32_t(1); + EffectProperties.RepeatDelay = float(0.000000000); + EffectProperties.RandomizeRepeatTime = float(0.000000000); + EffectProperties.Path.PlaybackMode = (const char*)"LOOP"; + EffectProperties.Path.PathDuration = float(4.000000000); + EffectProperties.Path.LoopIndex = uint32_t(0); + EmitterVelocityChanges.AdjustLifetime.AdjustEnabled = bool(0); + EmitterVelocityChanges.AdjustLifetime.VelocityLow = float(2.000000000); + EmitterVelocityChanges.AdjustLifetime.VelocityHigh = float(10.000000000); + EmitterVelocityChanges.AdjustLifetime.LowValue = float(1.000000000); + EmitterVelocityChanges.AdjustLifetime.HighValue = float(0.000000000); + EmitterVelocityChanges.AdjustEmitterRate.AdjustEnabled = bool(0); + EmitterVelocityChanges.AdjustEmitterRate.VelocityLow = float(2.000000000); + EmitterVelocityChanges.AdjustEmitterRate.VelocityHigh = float(10.000000000); + EmitterVelocityChanges.AdjustEmitterRate.LowValue = float(1.000000000); + EmitterVelocityChanges.AdjustEmitterRate.HighValue = float(0.000000000); + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void EmitterEffect::initReferences(void) +{ + Emitter = NULL; + +} + +void EmitterEffect::freeDynamicArrays(void) +{ + if (EffectProperties.Path.ControlPoints.isAllocated && EffectProperties.Path.ControlPoints.buf) + { + mParameterizedTraits->free(EffectProperties.Path.ControlPoints.buf); + } + if (EffectProperties.Path.Scale.isAllocated && EffectProperties.Path.Scale.buf) + { + mParameterizedTraits->free(EffectProperties.Path.Scale.buf); + } + if (EffectProperties.Path.Speed.isAllocated && EffectProperties.Path.Speed.buf) + { + mParameterizedTraits->free(EffectProperties.Path.Speed.buf); + } +} + +void EmitterEffect::freeStrings(void) +{ + + if (EffectProperties.UserString.isAllocated && EffectProperties.UserString.buf) + { + mParameterizedTraits->strfree((char*)EffectProperties.UserString.buf); + } +} + +void EmitterEffect::freeReferences(void) +{ + if (Emitter) + { + Emitter->destroy(); + } + +} + +} // namespace particles +} // namespace nvidia diff --git a/APEX_1.4/module/particles/src/autogen/FlameEmitterData.cpp b/APEX_1.4/module/particles/src/autogen/FlameEmitterData.cpp new file mode 100644 index 00000000..26107f7b --- /dev/null +++ b/APEX_1.4/module/particles/src/autogen/FlameEmitterData.cpp @@ -0,0 +1,363 @@ +// 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 "FlameEmitterData.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace particles +{ + +using namespace FlameEmitterDataNS; + +const char* const FlameEmitterDataFactory::vptr = + NvParameterized::getVptr<FlameEmitterData, FlameEmitterData::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_STRING, false, (size_t)(&((ParametersStruct*)0)->Name), NULL, 0 }, // Name + { TYPE_REF, false, (size_t)(&((ParametersStruct*)0)->FlameEmitter), NULL, 0 }, // FlameEmitter +}; + + +bool FlameEmitterData::mBuiltFlag = false; +NvParameterized::MutexType FlameEmitterData::mBuiltFlagMutex; + +FlameEmitterData::FlameEmitterData(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &FlameEmitterDataFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +FlameEmitterData::~FlameEmitterData() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void FlameEmitterData::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->~FlameEmitterData(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* FlameEmitterData::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* FlameEmitterData::getParameterDefinitionTree(void) const +{ + FlameEmitterData* tmpParam = const_cast<FlameEmitterData*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType FlameEmitterData::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 FlameEmitterData::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 FlameEmitterData::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<FlameEmitterData::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ + +void FlameEmitterData::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 FlameEmitterData::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", "Contains the asset properties for this flame emitter", true); + ParamDefTable[0].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=1, longName="Name" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[1]; + ParamDef->init("Name", TYPE_STRING, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Flame Emitter Name", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=2, longName="FlameEmitter" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[2]; + ParamDef->init("FlameEmitter", 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[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("INCLUDED", uint64_t(1), true); + HintTable[1].init("shortDescription", "Flame Emitter properties", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + static const char* const RefVariantVals[] = { "FlameEmitterAssetParams" }; + ParamDefTable[2].setRefVariantVals((const char**)RefVariantVals, 1); + + + + } + + // 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 FlameEmitterData::initStrings(void) +{ + Name.isAllocated = false; + Name.buf = (const char*)"defaultFlameEmitter"; +} + +void FlameEmitterData::initDynamicArrays(void) +{ +} + +void FlameEmitterData::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void FlameEmitterData::initReferences(void) +{ + FlameEmitter = NULL; + +} + +void FlameEmitterData::freeDynamicArrays(void) +{ +} + +void FlameEmitterData::freeStrings(void) +{ + + if (Name.isAllocated && Name.buf) + { + mParameterizedTraits->strfree((char*)Name.buf); + } +} + +void FlameEmitterData::freeReferences(void) +{ + if (FlameEmitter) + { + FlameEmitter->destroy(); + } + +} + +} // namespace particles +} // namespace nvidia diff --git a/APEX_1.4/module/particles/src/autogen/FlameEmitterEffect.cpp b/APEX_1.4/module/particles/src/autogen/FlameEmitterEffect.cpp new file mode 100644 index 00000000..7b5e81aa --- /dev/null +++ b/APEX_1.4/module/particles/src/autogen/FlameEmitterEffect.cpp @@ -0,0 +1,1356 @@ +// 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 "FlameEmitterEffect.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace particles +{ + +using namespace FlameEmitterEffectNS; + +const char* const FlameEmitterEffectFactory::vptr = + NvParameterized::getVptr<FlameEmitterEffect, FlameEmitterEffect::ClassAlignment>(); + +const uint32_t NumParamDefs = 32; +static NvParameterized::DefinitionImpl* ParamDefTable; // now allocated in buildTree [NumParamDefs]; + + +static const size_t ParamLookupChildrenTable[] = +{ + 1, 31, 2, 3, 4, 8, 12, 13, 14, 15, 16, 17, 5, 6, 7, 9, 10, 11, 18, 19, 20, 21, 23, + 27, 22, 24, 25, 26, 28, 29, 30, +}; + +#define TENUM(type) nvidia::##type +#define CHILDREN(index) &ParamLookupChildrenTable[index] +static const NvParameterized::ParamLookupNode ParamLookupTable[NumParamDefs] = +{ + { TYPE_STRUCT, false, 0, CHILDREN(0), 2 }, + { TYPE_STRUCT, false, (size_t)(&((ParametersStruct*)0)->EffectProperties), CHILDREN(2), 10 }, // EffectProperties + { TYPE_STRING, false, (size_t)(&((EffectProperties_Type*)0)->UserString), NULL, 0 }, // EffectProperties.UserString + { TYPE_BOOL, false, (size_t)(&((EffectProperties_Type*)0)->Enable), NULL, 0 }, // EffectProperties.Enable + { TYPE_STRUCT, false, (size_t)(&((EffectProperties_Type*)0)->Position), CHILDREN(12), 3 }, // EffectProperties.Position + { TYPE_F32, false, (size_t)(&((TranslateObject_Type*)0)->TranslateX), NULL, 0 }, // EffectProperties.Position.TranslateX + { TYPE_F32, false, (size_t)(&((TranslateObject_Type*)0)->TranslateY), NULL, 0 }, // EffectProperties.Position.TranslateY + { TYPE_F32, false, (size_t)(&((TranslateObject_Type*)0)->TranslateZ), NULL, 0 }, // EffectProperties.Position.TranslateZ + { TYPE_STRUCT, false, (size_t)(&((EffectProperties_Type*)0)->Orientation), CHILDREN(15), 3 }, // EffectProperties.Orientation + { TYPE_F32, false, (size_t)(&((OrientObject_Type*)0)->RotateX), NULL, 0 }, // EffectProperties.Orientation.RotateX + { TYPE_F32, false, (size_t)(&((OrientObject_Type*)0)->RotateY), NULL, 0 }, // EffectProperties.Orientation.RotateY + { TYPE_F32, false, (size_t)(&((OrientObject_Type*)0)->RotateZ), NULL, 0 }, // EffectProperties.Orientation.RotateZ + { TYPE_F32, false, (size_t)(&((EffectProperties_Type*)0)->InitialDelayTime), NULL, 0 }, // EffectProperties.InitialDelayTime + { TYPE_F32, false, (size_t)(&((EffectProperties_Type*)0)->Duration), NULL, 0 }, // EffectProperties.Duration + { TYPE_U32, false, (size_t)(&((EffectProperties_Type*)0)->RepeatCount), NULL, 0 }, // EffectProperties.RepeatCount + { TYPE_F32, false, (size_t)(&((EffectProperties_Type*)0)->RepeatDelay), NULL, 0 }, // EffectProperties.RepeatDelay + { TYPE_F32, false, (size_t)(&((EffectProperties_Type*)0)->RandomizeRepeatTime), NULL, 0 }, // EffectProperties.RandomizeRepeatTime + { TYPE_STRUCT, false, (size_t)(&((EffectProperties_Type*)0)->Path), CHILDREN(18), 6 }, // EffectProperties.Path + { TYPE_ENUM, false, (size_t)(&((EffectPath_Type*)0)->PlaybackMode), NULL, 0 }, // EffectProperties.Path.PlaybackMode + { TYPE_F32, false, (size_t)(&((EffectPath_Type*)0)->PathDuration), NULL, 0 }, // EffectProperties.Path.PathDuration + { TYPE_U32, false, (size_t)(&((EffectPath_Type*)0)->LoopIndex), NULL, 0 }, // EffectProperties.Path.LoopIndex + { TYPE_ARRAY, true, (size_t)(&((EffectPath_Type*)0)->ControlPoints), CHILDREN(24), 1 }, // EffectProperties.Path.ControlPoints + { TYPE_TRANSFORM, false, 1 * sizeof(physx::PxTransform), NULL, 0 }, // EffectProperties.Path.ControlPoints[] + { TYPE_ARRAY, true, (size_t)(&((EffectPath_Type*)0)->Scale), CHILDREN(25), 1 }, // EffectProperties.Path.Scale + { TYPE_STRUCT, false, 1 * sizeof(ControlPoint_Type), CHILDREN(26), 2 }, // EffectProperties.Path.Scale[] + { TYPE_F32, false, (size_t)(&((ControlPoint_Type*)0)->x), NULL, 0 }, // EffectProperties.Path.Scale[].x + { TYPE_F32, false, (size_t)(&((ControlPoint_Type*)0)->y), NULL, 0 }, // EffectProperties.Path.Scale[].y + { TYPE_ARRAY, true, (size_t)(&((EffectPath_Type*)0)->Speed), CHILDREN(28), 1 }, // EffectProperties.Path.Speed + { TYPE_STRUCT, false, 1 * sizeof(ControlPoint_Type), CHILDREN(29), 2 }, // EffectProperties.Path.Speed[] + { TYPE_F32, false, (size_t)(&((ControlPoint_Type*)0)->x), NULL, 0 }, // EffectProperties.Path.Speed[].x + { TYPE_F32, false, (size_t)(&((ControlPoint_Type*)0)->y), NULL, 0 }, // EffectProperties.Path.Speed[].y + { TYPE_REF, false, (size_t)(&((ParametersStruct*)0)->FlameEmitter), NULL, 0 }, // FlameEmitter +}; + + +bool FlameEmitterEffect::mBuiltFlag = false; +NvParameterized::MutexType FlameEmitterEffect::mBuiltFlagMutex; + +FlameEmitterEffect::FlameEmitterEffect(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &FlameEmitterEffectFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +FlameEmitterEffect::~FlameEmitterEffect() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void FlameEmitterEffect::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->~FlameEmitterEffect(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* FlameEmitterEffect::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* FlameEmitterEffect::getParameterDefinitionTree(void) const +{ + FlameEmitterEffect* tmpParam = const_cast<FlameEmitterEffect*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType FlameEmitterEffect::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 FlameEmitterEffect::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 FlameEmitterEffect::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<FlameEmitterEffect::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ + +void FlameEmitterEffect::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 FlameEmitterEffect::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", "A flame emitter effect", true); + ParamDefTable[0].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=1, longName="EffectProperties" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[1]; + ParamDef->init("EffectProperties", TYPE_STRUCT, "EffectProperties", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Flame Emitter Properties", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=2, longName="EffectProperties.UserString" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[2]; + ParamDef->init("UserString", TYPE_STRING, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "An aribtrary user string that can be set by an artist/designer/programmer", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=3, longName="EffectProperties.Enable" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[3]; + ParamDef->init("Enable", TYPE_BOOL, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Whether or not this effect is to be initially enabled on startup", true); + ParamDefTable[3].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=4, longName="EffectProperties.Position" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[4]; + ParamDef->init("Position", TYPE_STRUCT, "TranslateObject", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "The position of this effect relative to the parent", true); + ParamDefTable[4].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=5, longName="EffectProperties.Position.TranslateX" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[5]; + ParamDef->init("TranslateX", 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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(500.000000000), true); + HintTable[2].init("min", double(-500.000000000), true); + ParamDefTable[5].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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(500.000000000), true); + HintTable[2].init("min", double(-500.000000000), true); + HintTable[3].init("shortDescription", "Nudge up to +/- one meter in each direction", true); + ParamDefTable[5].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=6, longName="EffectProperties.Position.TranslateY" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[6]; + ParamDef->init("TranslateY", 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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(500.000000000), true); + HintTable[2].init("min", double(-500.000000000), true); + ParamDefTable[6].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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(500.000000000), true); + HintTable[2].init("min", double(-500.000000000), true); + HintTable[3].init("shortDescription", "Nudge up to +/- one meter in each direction", true); + ParamDefTable[6].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=7, longName="EffectProperties.Position.TranslateZ" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[7]; + ParamDef->init("TranslateZ", 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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(500.000000000), true); + HintTable[2].init("min", double(-500.000000000), true); + ParamDefTable[7].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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(500.000000000), true); + HintTable[2].init("min", double(-500.000000000), true); + HintTable[3].init("shortDescription", "Nudge up to +/- one meter in each direction", true); + ParamDefTable[7].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=8, longName="EffectProperties.Orientation" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[8]; + ParamDef->init("Orientation", TYPE_STRUCT, "OrientObject", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "The orientation of this effect, relative to the parent orientation", true); + ParamDefTable[8].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=9, longName="EffectProperties.Orientation.RotateX" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[9]; + ParamDef->init("RotateX", 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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(360.000000000), true); + HintTable[2].init("min", double(0.000000000), true); + ParamDefTable[9].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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(360.000000000), true); + HintTable[2].init("min", double(0.000000000), true); + HintTable[3].init("shortDescription", "Rotate on the X axis (0-360 degrees)", true); + ParamDefTable[9].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=10, longName="EffectProperties.Orientation.RotateY" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[10]; + ParamDef->init("RotateY", 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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(360.000000000), true); + HintTable[2].init("min", double(0.000000000), true); + ParamDefTable[10].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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(360.000000000), true); + HintTable[2].init("min", double(0.000000000), true); + HintTable[3].init("shortDescription", "Rotate on the Y axis (0-360 degrees)", true); + ParamDefTable[10].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=11, longName="EffectProperties.Orientation.RotateZ" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[11]; + ParamDef->init("RotateZ", 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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(360.000000000), true); + HintTable[2].init("min", double(0.000000000), 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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(360.000000000), true); + HintTable[2].init("min", double(0.000000000), true); + HintTable[3].init("shortDescription", "Rotate on the Z axis (0-360 degrees)", true); + ParamDefTable[11].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=12, longName="EffectProperties.InitialDelayTime" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[12]; + ParamDef->init("InitialDelayTime", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("min", double(0.000000000), 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("min", double(0.000000000), true); + HintTable[1].init("shortDescription", "Initial time to delay before spawning this effect", true); + ParamDefTable[12].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=13, longName="EffectProperties.Duration" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[13]; + ParamDef->init("Duration", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("min", double(0.000000000), true); + ParamDefTable[13].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("min", double(0.000000000), true); + HintTable[1].init("shortDescription", "The duration of the effect in secontds", true); + ParamDefTable[13].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=14, longName="EffectProperties.RepeatCount" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[14]; + ParamDef->init("RepeatCount", TYPE_U32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("min", uint64_t(1), 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("min", uint64_t(1), true); + HintTable[1].init("shortDescription", "The number of times to repeat the effect; 9999 means repeate forever", true); + ParamDefTable[14].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=15, longName="EffectProperties.RepeatDelay" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[15]; + ParamDef->init("RepeatDelay", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("min", double(0.000000000), 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("min", double(0.000000000), true); + HintTable[1].init("shortDescription", "The time to delay activation each time the effect repeats in seconds; this can be different than the initial delay time", true); + ParamDefTable[15].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=16, longName="EffectProperties.RandomizeRepeatTime" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[16]; + ParamDef->init("RandomizeRepeatTime", 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", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), 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("max", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + HintTable[2].init("shortDescription", "Amount of randomization to the repeat cycle; a value of zero (default) means no random and a value of one means completely random.", true); + ParamDefTable[16].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=17, longName="EffectProperties.Path" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[17]; + ParamDef->init("Path", TYPE_STRUCT, "EffectPath", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "An optional pre-defined path for this effect to travel on", true); + ParamDefTable[17].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=18, longName="EffectProperties.Path.PlaybackMode" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[18]; + ParamDef->init("PlaybackMode", TYPE_ENUM, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "The mode to play back the path", true); + ParamDefTable[18].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + static const char* const EnumVals[] = { "LOOP", "PLAY_ONCE", "PING_PONG" }; + ParamDefTable[18].setEnumVals((const char**)EnumVals, 3); + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=19, longName="EffectProperties.Path.PathDuration" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[19]; + ParamDef->init("PathDuration", 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", double(1000.000000000), true); + HintTable[1].init("min", double(0.000010000), true); + ParamDefTable[19].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", double(1000.000000000), true); + HintTable[1].init("min", double(0.000010000), true); + HintTable[2].init("shortDescription", "The duration of the path if one is not otherwise provided", true); + ParamDefTable[19].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=20, longName="EffectProperties.Path.LoopIndex" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[20]; + ParamDef->init("LoopIndex", TYPE_U32, 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[20].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("min", uint64_t(0), true); + HintTable[1].init("shortDescription", "The array index to loop back to", true); + ParamDefTable[20].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=21, longName="EffectProperties.Path.ControlPoints" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[21]; + ParamDef->init("ControlPoints", TYPE_ARRAY, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("editorCurve", uint64_t(1), true); + HintTable[2].init("pathEditor", uint64_t(1), 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("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("editorCurve", uint64_t(1), true); + HintTable[2].init("pathEditor", uint64_t(1), true); + HintTable[3].init("shortDescription", "The array of control points to fit the curve to", true); + ParamDefTable[21].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + ParamDef->setArraySize(-1); + } + + // Initialize DefinitionImpl node: nodeIndex=22, longName="EffectProperties.Path.ControlPoints[]" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[22]; + ParamDef->init("ControlPoints", TYPE_TRANSFORM, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("editorCurve", uint64_t(1), true); + HintTable[2].init("pathEditor", uint64_t(1), 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("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("editorCurve", uint64_t(1), true); + HintTable[2].init("pathEditor", uint64_t(1), true); + HintTable[3].init("shortDescription", "The array of control points to fit the curve to", true); + ParamDefTable[22].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=23, longName="EffectProperties.Path.Scale" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[23]; + ParamDef->init("Scale", TYPE_ARRAY, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("xAxisLabel", "Over Time", true); + HintTable[4].init("yAxisLabel", "Scale", true); + ParamDefTable[23].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#else + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("shortDescription", "The array of scale values over time", true); + HintTable[4].init("xAxisLabel", "Over Time", true); + HintTable[5].init("yAxisLabel", "Scale", true); + ParamDefTable[23].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + ParamDef->setArraySize(-1); + } + + // Initialize DefinitionImpl node: nodeIndex=24, longName="EffectProperties.Path.Scale[]" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[24]; + ParamDef->init("Scale", TYPE_STRUCT, "ControlPoint", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("xAxisLabel", "Over Time", true); + HintTable[4].init("yAxisLabel", "Scale", true); + ParamDefTable[24].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#else + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("shortDescription", "The array of scale values over time", true); + HintTable[4].init("xAxisLabel", "Over Time", true); + HintTable[5].init("yAxisLabel", "Scale", true); + ParamDefTable[24].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=25, longName="EffectProperties.Path.Scale[].x" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[25]; + 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", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), 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("max", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + HintTable[2].init("shortDescription", "The x-axis value for this vector", true); + ParamDefTable[25].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=26, longName="EffectProperties.Path.Scale[].y" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[26]; + 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", "The y-axis value for this vector", true); + ParamDefTable[26].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=27, longName="EffectProperties.Path.Speed" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[27]; + ParamDef->init("Speed", TYPE_ARRAY, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("xAxisLabel", "Over Time", true); + HintTable[4].init("yAxisLabel", "Speed", true); + ParamDefTable[27].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#else + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("shortDescription", "The array of speed values over time", true); + HintTable[4].init("xAxisLabel", "Over Time", true); + HintTable[5].init("yAxisLabel", "Speed", true); + ParamDefTable[27].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + ParamDef->setArraySize(-1); + } + + // Initialize DefinitionImpl node: nodeIndex=28, longName="EffectProperties.Path.Speed[]" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[28]; + ParamDef->init("Speed", TYPE_STRUCT, "ControlPoint", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("xAxisLabel", "Over Time", true); + HintTable[4].init("yAxisLabel", "Speed", true); + ParamDefTable[28].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#else + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("shortDescription", "The array of speed values over time", true); + HintTable[4].init("xAxisLabel", "Over Time", true); + HintTable[5].init("yAxisLabel", "Speed", true); + ParamDefTable[28].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=29, longName="EffectProperties.Path.Speed[].x" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[29]; + 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", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + ParamDefTable[29].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", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + HintTable[2].init("shortDescription", "The x-axis value for this vector", true); + ParamDefTable[29].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=30, longName="EffectProperties.Path.Speed[].y" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[30]; + 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", "The y-axis value for this vector", true); + ParamDefTable[30].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=31, longName="FlameEmitter" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[31]; + ParamDef->init("FlameEmitter", TYPE_REF, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Flame Emitter Asset", true); + ParamDefTable[31].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + static const char* const RefVariantVals[] = { "FlameEmitterAsset" }; + ParamDefTable[31].setRefVariantVals((const char**)RefVariantVals, 1); + + + + } + + // SetChildren for: nodeIndex=0, longName="" + { + static Definition* Children[2]; + Children[0] = PDEF_PTR(1); + Children[1] = PDEF_PTR(31); + + ParamDefTable[0].setChildren(Children, 2); + } + + // SetChildren for: nodeIndex=1, longName="EffectProperties" + { + static Definition* Children[10]; + Children[0] = PDEF_PTR(2); + Children[1] = PDEF_PTR(3); + Children[2] = PDEF_PTR(4); + Children[3] = PDEF_PTR(8); + Children[4] = PDEF_PTR(12); + Children[5] = PDEF_PTR(13); + Children[6] = PDEF_PTR(14); + Children[7] = PDEF_PTR(15); + Children[8] = PDEF_PTR(16); + Children[9] = PDEF_PTR(17); + + ParamDefTable[1].setChildren(Children, 10); + } + + // SetChildren for: nodeIndex=4, longName="EffectProperties.Position" + { + static Definition* Children[3]; + Children[0] = PDEF_PTR(5); + Children[1] = PDEF_PTR(6); + Children[2] = PDEF_PTR(7); + + ParamDefTable[4].setChildren(Children, 3); + } + + // SetChildren for: nodeIndex=8, longName="EffectProperties.Orientation" + { + static Definition* Children[3]; + Children[0] = PDEF_PTR(9); + Children[1] = PDEF_PTR(10); + Children[2] = PDEF_PTR(11); + + ParamDefTable[8].setChildren(Children, 3); + } + + // SetChildren for: nodeIndex=17, longName="EffectProperties.Path" + { + static Definition* Children[6]; + Children[0] = PDEF_PTR(18); + Children[1] = PDEF_PTR(19); + Children[2] = PDEF_PTR(20); + Children[3] = PDEF_PTR(21); + Children[4] = PDEF_PTR(23); + Children[5] = PDEF_PTR(27); + + ParamDefTable[17].setChildren(Children, 6); + } + + // SetChildren for: nodeIndex=21, longName="EffectProperties.Path.ControlPoints" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(22); + + ParamDefTable[21].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=23, longName="EffectProperties.Path.Scale" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(24); + + ParamDefTable[23].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=24, longName="EffectProperties.Path.Scale[]" + { + static Definition* Children[2]; + Children[0] = PDEF_PTR(25); + Children[1] = PDEF_PTR(26); + + ParamDefTable[24].setChildren(Children, 2); + } + + // SetChildren for: nodeIndex=27, longName="EffectProperties.Path.Speed" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(28); + + ParamDefTable[27].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=28, longName="EffectProperties.Path.Speed[]" + { + static Definition* Children[2]; + Children[0] = PDEF_PTR(29); + Children[1] = PDEF_PTR(30); + + ParamDefTable[28].setChildren(Children, 2); + } + + mBuiltFlag = true; + +} +void FlameEmitterEffect::initStrings(void) +{ + EffectProperties.UserString.isAllocated = true; + EffectProperties.UserString.buf = NULL; +} + +void FlameEmitterEffect::initDynamicArrays(void) +{ + EffectProperties.Path.ControlPoints.buf = NULL; + EffectProperties.Path.ControlPoints.isAllocated = true; + EffectProperties.Path.ControlPoints.elementSize = sizeof(physx::PxTransform); + EffectProperties.Path.ControlPoints.arraySizes[0] = 0; + EffectProperties.Path.Scale.buf = NULL; + EffectProperties.Path.Scale.isAllocated = true; + EffectProperties.Path.Scale.elementSize = sizeof(ControlPoint_Type); + EffectProperties.Path.Scale.arraySizes[0] = 0; + EffectProperties.Path.Speed.buf = NULL; + EffectProperties.Path.Speed.isAllocated = true; + EffectProperties.Path.Speed.elementSize = sizeof(ControlPoint_Type); + EffectProperties.Path.Speed.arraySizes[0] = 0; +} + +void FlameEmitterEffect::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + EffectProperties.Enable = bool(1); + EffectProperties.Position.TranslateX = float(0.000000000); + EffectProperties.Position.TranslateY = float(0.000000000); + EffectProperties.Position.TranslateZ = float(0.000000000); + EffectProperties.Orientation.RotateX = float(0.000000000); + EffectProperties.Orientation.RotateY = float(0.000000000); + EffectProperties.Orientation.RotateZ = float(0.000000000); + EffectProperties.InitialDelayTime = float(0.000000000); + EffectProperties.Duration = float(0.000000000); + EffectProperties.RepeatCount = uint32_t(1); + EffectProperties.RepeatDelay = float(0.000000000); + EffectProperties.RandomizeRepeatTime = float(0.000000000); + EffectProperties.Path.PlaybackMode = (const char*)"LOOP"; + EffectProperties.Path.PathDuration = float(4.000000000); + EffectProperties.Path.LoopIndex = uint32_t(0); + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void FlameEmitterEffect::initReferences(void) +{ + FlameEmitter = NULL; + +} + +void FlameEmitterEffect::freeDynamicArrays(void) +{ + if (EffectProperties.Path.ControlPoints.isAllocated && EffectProperties.Path.ControlPoints.buf) + { + mParameterizedTraits->free(EffectProperties.Path.ControlPoints.buf); + } + if (EffectProperties.Path.Scale.isAllocated && EffectProperties.Path.Scale.buf) + { + mParameterizedTraits->free(EffectProperties.Path.Scale.buf); + } + if (EffectProperties.Path.Speed.isAllocated && EffectProperties.Path.Speed.buf) + { + mParameterizedTraits->free(EffectProperties.Path.Speed.buf); + } +} + +void FlameEmitterEffect::freeStrings(void) +{ + + if (EffectProperties.UserString.isAllocated && EffectProperties.UserString.buf) + { + mParameterizedTraits->strfree((char*)EffectProperties.UserString.buf); + } +} + +void FlameEmitterEffect::freeReferences(void) +{ + if (FlameEmitter) + { + FlameEmitter->destroy(); + } + +} + +} // namespace particles +} // namespace nvidia diff --git a/APEX_1.4/module/particles/src/autogen/ForceFieldData.cpp b/APEX_1.4/module/particles/src/autogen/ForceFieldData.cpp new file mode 100644 index 00000000..51a4f604 --- /dev/null +++ b/APEX_1.4/module/particles/src/autogen/ForceFieldData.cpp @@ -0,0 +1,363 @@ +// 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 "ForceFieldData.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace particles +{ + +using namespace ForceFieldDataNS; + +const char* const ForceFieldDataFactory::vptr = + NvParameterized::getVptr<ForceFieldData, ForceFieldData::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_STRING, false, (size_t)(&((ParametersStruct*)0)->Name), NULL, 0 }, // Name + { TYPE_REF, false, (size_t)(&((ParametersStruct*)0)->ForceField), NULL, 0 }, // ForceField +}; + + +bool ForceFieldData::mBuiltFlag = false; +NvParameterized::MutexType ForceFieldData::mBuiltFlagMutex; + +ForceFieldData::ForceFieldData(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &ForceFieldDataFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +ForceFieldData::~ForceFieldData() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void ForceFieldData::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->~ForceFieldData(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* ForceFieldData::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* ForceFieldData::getParameterDefinitionTree(void) const +{ + ForceFieldData* tmpParam = const_cast<ForceFieldData*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType ForceFieldData::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 ForceFieldData::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 ForceFieldData::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<ForceFieldData::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ + +void ForceFieldData::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 ForceFieldData::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", "Contains the asset properties for this force field sampler", true); + ParamDefTable[0].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=1, longName="Name" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[1]; + ParamDef->init("Name", TYPE_STRING, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Forcefield Name", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=2, longName="ForceField" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[2]; + ParamDef->init("ForceField", 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[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("INCLUDED", uint64_t(1), true); + HintTable[1].init("shortDescription", "Forcefield properties", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + static const char* const RefVariantVals[] = { "ForceFieldAssetParams" }; + ParamDefTable[2].setRefVariantVals((const char**)RefVariantVals, 1); + + + + } + + // 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 ForceFieldData::initStrings(void) +{ + Name.isAllocated = false; + Name.buf = (const char*)"defaultForceField"; +} + +void ForceFieldData::initDynamicArrays(void) +{ +} + +void ForceFieldData::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void ForceFieldData::initReferences(void) +{ + ForceField = NULL; + +} + +void ForceFieldData::freeDynamicArrays(void) +{ +} + +void ForceFieldData::freeStrings(void) +{ + + if (Name.isAllocated && Name.buf) + { + mParameterizedTraits->strfree((char*)Name.buf); + } +} + +void ForceFieldData::freeReferences(void) +{ + if (ForceField) + { + ForceField->destroy(); + } + +} + +} // namespace particles +} // namespace nvidia diff --git a/APEX_1.4/module/particles/src/autogen/ForceFieldEffect.cpp b/APEX_1.4/module/particles/src/autogen/ForceFieldEffect.cpp new file mode 100644 index 00000000..dc3bed74 --- /dev/null +++ b/APEX_1.4/module/particles/src/autogen/ForceFieldEffect.cpp @@ -0,0 +1,1362 @@ +// 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 "ForceFieldEffect.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace particles +{ + +using namespace ForceFieldEffectNS; + +const char* const ForceFieldEffectFactory::vptr = + NvParameterized::getVptr<ForceFieldEffect, ForceFieldEffect::ClassAlignment>(); + +const uint32_t NumParamDefs = 32; +static NvParameterized::DefinitionImpl* ParamDefTable; // now allocated in buildTree [NumParamDefs]; + + +static const size_t ParamLookupChildrenTable[] = +{ + 1, 31, 2, 3, 4, 8, 12, 13, 14, 15, 16, 17, 5, 6, 7, 9, 10, 11, 18, 19, 20, 21, 23, + 27, 22, 24, 25, 26, 28, 29, 30, +}; + +#define TENUM(type) nvidia::##type +#define CHILDREN(index) &ParamLookupChildrenTable[index] +static const NvParameterized::ParamLookupNode ParamLookupTable[NumParamDefs] = +{ + { TYPE_STRUCT, false, 0, CHILDREN(0), 2 }, + { TYPE_STRUCT, false, (size_t)(&((ParametersStruct*)0)->EffectProperties), CHILDREN(2), 10 }, // EffectProperties + { TYPE_STRING, false, (size_t)(&((EffectProperties_Type*)0)->UserString), NULL, 0 }, // EffectProperties.UserString + { TYPE_BOOL, false, (size_t)(&((EffectProperties_Type*)0)->Enable), NULL, 0 }, // EffectProperties.Enable + { TYPE_STRUCT, false, (size_t)(&((EffectProperties_Type*)0)->Position), CHILDREN(12), 3 }, // EffectProperties.Position + { TYPE_F32, false, (size_t)(&((TranslateObject_Type*)0)->TranslateX), NULL, 0 }, // EffectProperties.Position.TranslateX + { TYPE_F32, false, (size_t)(&((TranslateObject_Type*)0)->TranslateY), NULL, 0 }, // EffectProperties.Position.TranslateY + { TYPE_F32, false, (size_t)(&((TranslateObject_Type*)0)->TranslateZ), NULL, 0 }, // EffectProperties.Position.TranslateZ + { TYPE_STRUCT, false, (size_t)(&((EffectProperties_Type*)0)->Orientation), CHILDREN(15), 3 }, // EffectProperties.Orientation + { TYPE_F32, false, (size_t)(&((OrientObject_Type*)0)->RotateX), NULL, 0 }, // EffectProperties.Orientation.RotateX + { TYPE_F32, false, (size_t)(&((OrientObject_Type*)0)->RotateY), NULL, 0 }, // EffectProperties.Orientation.RotateY + { TYPE_F32, false, (size_t)(&((OrientObject_Type*)0)->RotateZ), NULL, 0 }, // EffectProperties.Orientation.RotateZ + { TYPE_F32, false, (size_t)(&((EffectProperties_Type*)0)->InitialDelayTime), NULL, 0 }, // EffectProperties.InitialDelayTime + { TYPE_F32, false, (size_t)(&((EffectProperties_Type*)0)->Duration), NULL, 0 }, // EffectProperties.Duration + { TYPE_U32, false, (size_t)(&((EffectProperties_Type*)0)->RepeatCount), NULL, 0 }, // EffectProperties.RepeatCount + { TYPE_F32, false, (size_t)(&((EffectProperties_Type*)0)->RepeatDelay), NULL, 0 }, // EffectProperties.RepeatDelay + { TYPE_F32, false, (size_t)(&((EffectProperties_Type*)0)->RandomizeRepeatTime), NULL, 0 }, // EffectProperties.RandomizeRepeatTime + { TYPE_STRUCT, false, (size_t)(&((EffectProperties_Type*)0)->Path), CHILDREN(18), 6 }, // EffectProperties.Path + { TYPE_ENUM, false, (size_t)(&((EffectPath_Type*)0)->PlaybackMode), NULL, 0 }, // EffectProperties.Path.PlaybackMode + { TYPE_F32, false, (size_t)(&((EffectPath_Type*)0)->PathDuration), NULL, 0 }, // EffectProperties.Path.PathDuration + { TYPE_U32, false, (size_t)(&((EffectPath_Type*)0)->LoopIndex), NULL, 0 }, // EffectProperties.Path.LoopIndex + { TYPE_ARRAY, true, (size_t)(&((EffectPath_Type*)0)->ControlPoints), CHILDREN(24), 1 }, // EffectProperties.Path.ControlPoints + { TYPE_TRANSFORM, false, 1 * sizeof(physx::PxTransform), NULL, 0 }, // EffectProperties.Path.ControlPoints[] + { TYPE_ARRAY, true, (size_t)(&((EffectPath_Type*)0)->Scale), CHILDREN(25), 1 }, // EffectProperties.Path.Scale + { TYPE_STRUCT, false, 1 * sizeof(ControlPoint_Type), CHILDREN(26), 2 }, // EffectProperties.Path.Scale[] + { TYPE_F32, false, (size_t)(&((ControlPoint_Type*)0)->x), NULL, 0 }, // EffectProperties.Path.Scale[].x + { TYPE_F32, false, (size_t)(&((ControlPoint_Type*)0)->y), NULL, 0 }, // EffectProperties.Path.Scale[].y + { TYPE_ARRAY, true, (size_t)(&((EffectPath_Type*)0)->Speed), CHILDREN(28), 1 }, // EffectProperties.Path.Speed + { TYPE_STRUCT, false, 1 * sizeof(ControlPoint_Type), CHILDREN(29), 2 }, // EffectProperties.Path.Speed[] + { TYPE_F32, false, (size_t)(&((ControlPoint_Type*)0)->x), NULL, 0 }, // EffectProperties.Path.Speed[].x + { TYPE_F32, false, (size_t)(&((ControlPoint_Type*)0)->y), NULL, 0 }, // EffectProperties.Path.Speed[].y + { TYPE_REF, false, (size_t)(&((ParametersStruct*)0)->ForceField), NULL, 0 }, // ForceField +}; + + +bool ForceFieldEffect::mBuiltFlag = false; +NvParameterized::MutexType ForceFieldEffect::mBuiltFlagMutex; + +ForceFieldEffect::ForceFieldEffect(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &ForceFieldEffectFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +ForceFieldEffect::~ForceFieldEffect() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void ForceFieldEffect::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->~ForceFieldEffect(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* ForceFieldEffect::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* ForceFieldEffect::getParameterDefinitionTree(void) const +{ + ForceFieldEffect* tmpParam = const_cast<ForceFieldEffect*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType ForceFieldEffect::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 ForceFieldEffect::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 ForceFieldEffect::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<ForceFieldEffect::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ + +void ForceFieldEffect::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 ForceFieldEffect::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", "A forcefield effect", true); + ParamDefTable[0].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=1, longName="EffectProperties" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[1]; + ParamDef->init("EffectProperties", TYPE_STRUCT, "EffectProperties", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("READONLY", uint64_t(0), true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("READONLY", uint64_t(0), true); + HintTable[1].init("shortDescription", "Forcefield Properties", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=2, longName="EffectProperties.UserString" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[2]; + ParamDef->init("UserString", TYPE_STRING, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "An aribtrary user string that can be set by an artist/designer/programmer", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=3, longName="EffectProperties.Enable" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[3]; + ParamDef->init("Enable", TYPE_BOOL, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Whether or not this effect is to be initially enabled on startup", true); + ParamDefTable[3].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=4, longName="EffectProperties.Position" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[4]; + ParamDef->init("Position", TYPE_STRUCT, "TranslateObject", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "The position of this effect relative to the parent", true); + ParamDefTable[4].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=5, longName="EffectProperties.Position.TranslateX" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[5]; + ParamDef->init("TranslateX", 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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(500.000000000), true); + HintTable[2].init("min", double(-500.000000000), true); + ParamDefTable[5].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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(500.000000000), true); + HintTable[2].init("min", double(-500.000000000), true); + HintTable[3].init("shortDescription", "Nudge up to +/- one meter in each direction", true); + ParamDefTable[5].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=6, longName="EffectProperties.Position.TranslateY" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[6]; + ParamDef->init("TranslateY", 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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(500.000000000), true); + HintTable[2].init("min", double(-500.000000000), true); + ParamDefTable[6].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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(500.000000000), true); + HintTable[2].init("min", double(-500.000000000), true); + HintTable[3].init("shortDescription", "Nudge up to +/- one meter in each direction", true); + ParamDefTable[6].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=7, longName="EffectProperties.Position.TranslateZ" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[7]; + ParamDef->init("TranslateZ", 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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(500.000000000), true); + HintTable[2].init("min", double(-500.000000000), true); + ParamDefTable[7].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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(500.000000000), true); + HintTable[2].init("min", double(-500.000000000), true); + HintTable[3].init("shortDescription", "Nudge up to +/- one meter in each direction", true); + ParamDefTable[7].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=8, longName="EffectProperties.Orientation" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[8]; + ParamDef->init("Orientation", TYPE_STRUCT, "OrientObject", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "The orientation of this effect, relative to the parent orientation", true); + ParamDefTable[8].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=9, longName="EffectProperties.Orientation.RotateX" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[9]; + ParamDef->init("RotateX", 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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(360.000000000), true); + HintTable[2].init("min", double(0.000000000), true); + ParamDefTable[9].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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(360.000000000), true); + HintTable[2].init("min", double(0.000000000), true); + HintTable[3].init("shortDescription", "Rotate on the X axis (0-360 degrees)", true); + ParamDefTable[9].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=10, longName="EffectProperties.Orientation.RotateY" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[10]; + ParamDef->init("RotateY", 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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(360.000000000), true); + HintTable[2].init("min", double(0.000000000), true); + ParamDefTable[10].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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(360.000000000), true); + HintTable[2].init("min", double(0.000000000), true); + HintTable[3].init("shortDescription", "Rotate on the Y axis (0-360 degrees)", true); + ParamDefTable[10].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=11, longName="EffectProperties.Orientation.RotateZ" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[11]; + ParamDef->init("RotateZ", 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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(360.000000000), true); + HintTable[2].init("min", double(0.000000000), 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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(360.000000000), true); + HintTable[2].init("min", double(0.000000000), true); + HintTable[3].init("shortDescription", "Rotate on the Z axis (0-360 degrees)", true); + ParamDefTable[11].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=12, longName="EffectProperties.InitialDelayTime" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[12]; + ParamDef->init("InitialDelayTime", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("min", double(0.000000000), 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("min", double(0.000000000), true); + HintTable[1].init("shortDescription", "Initial time to delay before spawning this effect", true); + ParamDefTable[12].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=13, longName="EffectProperties.Duration" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[13]; + ParamDef->init("Duration", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("min", double(0.000000000), true); + ParamDefTable[13].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("min", double(0.000000000), true); + HintTable[1].init("shortDescription", "The duration of the effect in secontds", true); + ParamDefTable[13].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=14, longName="EffectProperties.RepeatCount" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[14]; + ParamDef->init("RepeatCount", TYPE_U32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("min", uint64_t(1), 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("min", uint64_t(1), true); + HintTable[1].init("shortDescription", "The number of times to repeat the effect; 9999 means repeate forever", true); + ParamDefTable[14].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=15, longName="EffectProperties.RepeatDelay" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[15]; + ParamDef->init("RepeatDelay", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("min", double(0.000000000), 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("min", double(0.000000000), true); + HintTable[1].init("shortDescription", "The time to delay activation each time the effect repeats in seconds; this can be different than the initial delay time", true); + ParamDefTable[15].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=16, longName="EffectProperties.RandomizeRepeatTime" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[16]; + ParamDef->init("RandomizeRepeatTime", 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", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), 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("max", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + HintTable[2].init("shortDescription", "Amount of randomization to the repeat cycle; a value of zero (default) means no random and a value of one means completely random.", true); + ParamDefTable[16].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=17, longName="EffectProperties.Path" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[17]; + ParamDef->init("Path", TYPE_STRUCT, "EffectPath", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "An optional pre-defined path for this effect to travel on", true); + ParamDefTable[17].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=18, longName="EffectProperties.Path.PlaybackMode" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[18]; + ParamDef->init("PlaybackMode", TYPE_ENUM, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "The mode to play back the path", true); + ParamDefTable[18].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + static const char* const EnumVals[] = { "LOOP", "PLAY_ONCE", "PING_PONG" }; + ParamDefTable[18].setEnumVals((const char**)EnumVals, 3); + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=19, longName="EffectProperties.Path.PathDuration" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[19]; + ParamDef->init("PathDuration", 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", double(1000.000000000), true); + HintTable[1].init("min", double(0.000010000), true); + ParamDefTable[19].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", double(1000.000000000), true); + HintTable[1].init("min", double(0.000010000), true); + HintTable[2].init("shortDescription", "The duration of the path if one is not otherwise provided", true); + ParamDefTable[19].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=20, longName="EffectProperties.Path.LoopIndex" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[20]; + ParamDef->init("LoopIndex", TYPE_U32, 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[20].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("min", uint64_t(0), true); + HintTable[1].init("shortDescription", "The array index to loop back to", true); + ParamDefTable[20].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=21, longName="EffectProperties.Path.ControlPoints" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[21]; + ParamDef->init("ControlPoints", TYPE_ARRAY, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("editorCurve", uint64_t(1), true); + HintTable[2].init("pathEditor", uint64_t(1), 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("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("editorCurve", uint64_t(1), true); + HintTable[2].init("pathEditor", uint64_t(1), true); + HintTable[3].init("shortDescription", "The array of control points to fit the curve to", true); + ParamDefTable[21].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + ParamDef->setArraySize(-1); + } + + // Initialize DefinitionImpl node: nodeIndex=22, longName="EffectProperties.Path.ControlPoints[]" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[22]; + ParamDef->init("ControlPoints", TYPE_TRANSFORM, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("editorCurve", uint64_t(1), true); + HintTable[2].init("pathEditor", uint64_t(1), 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("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("editorCurve", uint64_t(1), true); + HintTable[2].init("pathEditor", uint64_t(1), true); + HintTable[3].init("shortDescription", "The array of control points to fit the curve to", true); + ParamDefTable[22].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=23, longName="EffectProperties.Path.Scale" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[23]; + ParamDef->init("Scale", TYPE_ARRAY, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("xAxisLabel", "Over Time", true); + HintTable[4].init("yAxisLabel", "Scale", true); + ParamDefTable[23].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#else + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("shortDescription", "The array of scale values over time", true); + HintTable[4].init("xAxisLabel", "Over Time", true); + HintTable[5].init("yAxisLabel", "Scale", true); + ParamDefTable[23].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + ParamDef->setArraySize(-1); + } + + // Initialize DefinitionImpl node: nodeIndex=24, longName="EffectProperties.Path.Scale[]" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[24]; + ParamDef->init("Scale", TYPE_STRUCT, "ControlPoint", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("xAxisLabel", "Over Time", true); + HintTable[4].init("yAxisLabel", "Scale", true); + ParamDefTable[24].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#else + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("shortDescription", "The array of scale values over time", true); + HintTable[4].init("xAxisLabel", "Over Time", true); + HintTable[5].init("yAxisLabel", "Scale", true); + ParamDefTable[24].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=25, longName="EffectProperties.Path.Scale[].x" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[25]; + 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", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), 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("max", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + HintTable[2].init("shortDescription", "The x-axis value for this vector", true); + ParamDefTable[25].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=26, longName="EffectProperties.Path.Scale[].y" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[26]; + 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", "The y-axis value for this vector", true); + ParamDefTable[26].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=27, longName="EffectProperties.Path.Speed" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[27]; + ParamDef->init("Speed", TYPE_ARRAY, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("xAxisLabel", "Over Time", true); + HintTable[4].init("yAxisLabel", "Speed", true); + ParamDefTable[27].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#else + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("shortDescription", "The array of speed values over time", true); + HintTable[4].init("xAxisLabel", "Over Time", true); + HintTable[5].init("yAxisLabel", "Speed", true); + ParamDefTable[27].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + ParamDef->setArraySize(-1); + } + + // Initialize DefinitionImpl node: nodeIndex=28, longName="EffectProperties.Path.Speed[]" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[28]; + ParamDef->init("Speed", TYPE_STRUCT, "ControlPoint", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("xAxisLabel", "Over Time", true); + HintTable[4].init("yAxisLabel", "Speed", true); + ParamDefTable[28].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#else + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("shortDescription", "The array of speed values over time", true); + HintTable[4].init("xAxisLabel", "Over Time", true); + HintTable[5].init("yAxisLabel", "Speed", true); + ParamDefTable[28].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=29, longName="EffectProperties.Path.Speed[].x" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[29]; + 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", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + ParamDefTable[29].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", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + HintTable[2].init("shortDescription", "The x-axis value for this vector", true); + ParamDefTable[29].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=30, longName="EffectProperties.Path.Speed[].y" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[30]; + 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", "The y-axis value for this vector", true); + ParamDefTable[30].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=31, longName="ForceField" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[31]; + ParamDef->init("ForceField", TYPE_REF, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Forcefield Asset", true); + ParamDefTable[31].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + static const char* const RefVariantVals[] = { "ForceFieldAsset" }; + ParamDefTable[31].setRefVariantVals((const char**)RefVariantVals, 1); + + + + } + + // SetChildren for: nodeIndex=0, longName="" + { + static Definition* Children[2]; + Children[0] = PDEF_PTR(1); + Children[1] = PDEF_PTR(31); + + ParamDefTable[0].setChildren(Children, 2); + } + + // SetChildren for: nodeIndex=1, longName="EffectProperties" + { + static Definition* Children[10]; + Children[0] = PDEF_PTR(2); + Children[1] = PDEF_PTR(3); + Children[2] = PDEF_PTR(4); + Children[3] = PDEF_PTR(8); + Children[4] = PDEF_PTR(12); + Children[5] = PDEF_PTR(13); + Children[6] = PDEF_PTR(14); + Children[7] = PDEF_PTR(15); + Children[8] = PDEF_PTR(16); + Children[9] = PDEF_PTR(17); + + ParamDefTable[1].setChildren(Children, 10); + } + + // SetChildren for: nodeIndex=4, longName="EffectProperties.Position" + { + static Definition* Children[3]; + Children[0] = PDEF_PTR(5); + Children[1] = PDEF_PTR(6); + Children[2] = PDEF_PTR(7); + + ParamDefTable[4].setChildren(Children, 3); + } + + // SetChildren for: nodeIndex=8, longName="EffectProperties.Orientation" + { + static Definition* Children[3]; + Children[0] = PDEF_PTR(9); + Children[1] = PDEF_PTR(10); + Children[2] = PDEF_PTR(11); + + ParamDefTable[8].setChildren(Children, 3); + } + + // SetChildren for: nodeIndex=17, longName="EffectProperties.Path" + { + static Definition* Children[6]; + Children[0] = PDEF_PTR(18); + Children[1] = PDEF_PTR(19); + Children[2] = PDEF_PTR(20); + Children[3] = PDEF_PTR(21); + Children[4] = PDEF_PTR(23); + Children[5] = PDEF_PTR(27); + + ParamDefTable[17].setChildren(Children, 6); + } + + // SetChildren for: nodeIndex=21, longName="EffectProperties.Path.ControlPoints" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(22); + + ParamDefTable[21].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=23, longName="EffectProperties.Path.Scale" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(24); + + ParamDefTable[23].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=24, longName="EffectProperties.Path.Scale[]" + { + static Definition* Children[2]; + Children[0] = PDEF_PTR(25); + Children[1] = PDEF_PTR(26); + + ParamDefTable[24].setChildren(Children, 2); + } + + // SetChildren for: nodeIndex=27, longName="EffectProperties.Path.Speed" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(28); + + ParamDefTable[27].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=28, longName="EffectProperties.Path.Speed[]" + { + static Definition* Children[2]; + Children[0] = PDEF_PTR(29); + Children[1] = PDEF_PTR(30); + + ParamDefTable[28].setChildren(Children, 2); + } + + mBuiltFlag = true; + +} +void ForceFieldEffect::initStrings(void) +{ + EffectProperties.UserString.isAllocated = true; + EffectProperties.UserString.buf = NULL; +} + +void ForceFieldEffect::initDynamicArrays(void) +{ + EffectProperties.Path.ControlPoints.buf = NULL; + EffectProperties.Path.ControlPoints.isAllocated = true; + EffectProperties.Path.ControlPoints.elementSize = sizeof(physx::PxTransform); + EffectProperties.Path.ControlPoints.arraySizes[0] = 0; + EffectProperties.Path.Scale.buf = NULL; + EffectProperties.Path.Scale.isAllocated = true; + EffectProperties.Path.Scale.elementSize = sizeof(ControlPoint_Type); + EffectProperties.Path.Scale.arraySizes[0] = 0; + EffectProperties.Path.Speed.buf = NULL; + EffectProperties.Path.Speed.isAllocated = true; + EffectProperties.Path.Speed.elementSize = sizeof(ControlPoint_Type); + EffectProperties.Path.Speed.arraySizes[0] = 0; +} + +void ForceFieldEffect::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + EffectProperties.Enable = bool(1); + EffectProperties.Position.TranslateX = float(0.000000000); + EffectProperties.Position.TranslateY = float(0.000000000); + EffectProperties.Position.TranslateZ = float(0.000000000); + EffectProperties.Orientation.RotateX = float(0.000000000); + EffectProperties.Orientation.RotateY = float(0.000000000); + EffectProperties.Orientation.RotateZ = float(0.000000000); + EffectProperties.InitialDelayTime = float(0.000000000); + EffectProperties.Duration = float(0.000000000); + EffectProperties.RepeatCount = uint32_t(1); + EffectProperties.RepeatDelay = float(0.000000000); + EffectProperties.RandomizeRepeatTime = float(0.000000000); + EffectProperties.Path.PlaybackMode = (const char*)"LOOP"; + EffectProperties.Path.PathDuration = float(4.000000000); + EffectProperties.Path.LoopIndex = uint32_t(0); + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void ForceFieldEffect::initReferences(void) +{ + ForceField = NULL; + +} + +void ForceFieldEffect::freeDynamicArrays(void) +{ + if (EffectProperties.Path.ControlPoints.isAllocated && EffectProperties.Path.ControlPoints.buf) + { + mParameterizedTraits->free(EffectProperties.Path.ControlPoints.buf); + } + if (EffectProperties.Path.Scale.isAllocated && EffectProperties.Path.Scale.buf) + { + mParameterizedTraits->free(EffectProperties.Path.Scale.buf); + } + if (EffectProperties.Path.Speed.isAllocated && EffectProperties.Path.Speed.buf) + { + mParameterizedTraits->free(EffectProperties.Path.Speed.buf); + } +} + +void ForceFieldEffect::freeStrings(void) +{ + + if (EffectProperties.UserString.isAllocated && EffectProperties.UserString.buf) + { + mParameterizedTraits->strfree((char*)EffectProperties.UserString.buf); + } +} + +void ForceFieldEffect::freeReferences(void) +{ + if (ForceField) + { + ForceField->destroy(); + } + +} + +} // namespace particles +} // namespace nvidia diff --git a/APEX_1.4/module/particles/src/autogen/GraphicsEffectData.cpp b/APEX_1.4/module/particles/src/autogen/GraphicsEffectData.cpp new file mode 100644 index 00000000..dece3c93 --- /dev/null +++ b/APEX_1.4/module/particles/src/autogen/GraphicsEffectData.cpp @@ -0,0 +1,363 @@ +// 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 "GraphicsEffectData.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace particles +{ + +using namespace GraphicsEffectDataNS; + +const char* const GraphicsEffectDataFactory::vptr = + NvParameterized::getVptr<GraphicsEffectData, GraphicsEffectData::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_STRING, false, (size_t)(&((ParametersStruct*)0)->Name), NULL, 0 }, // Name + { TYPE_REF, false, (size_t)(&((ParametersStruct*)0)->IOFX), NULL, 0 }, // IOFX +}; + + +bool GraphicsEffectData::mBuiltFlag = false; +NvParameterized::MutexType GraphicsEffectData::mBuiltFlagMutex; + +GraphicsEffectData::GraphicsEffectData(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &GraphicsEffectDataFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +GraphicsEffectData::~GraphicsEffectData() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void GraphicsEffectData::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->~GraphicsEffectData(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* GraphicsEffectData::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* GraphicsEffectData::getParameterDefinitionTree(void) const +{ + GraphicsEffectData* tmpParam = const_cast<GraphicsEffectData*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType GraphicsEffectData::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 GraphicsEffectData::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 GraphicsEffectData::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<GraphicsEffectData::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ + +void GraphicsEffectData::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 GraphicsEffectData::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", "Contains the asset properties for this graphics effect (IOFX)", true); + ParamDefTable[0].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=1, longName="Name" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[1]; + ParamDef->init("Name", TYPE_STRING, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Sprite IOFX Name", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=2, longName="IOFX" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[2]; + ParamDef->init("IOFX", 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[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("INCLUDED", uint64_t(1), true); + HintTable[1].init("shortDescription", "Sprite IOFX properties", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + static const char* const RefVariantVals[] = { "IofxAssetParameters" }; + ParamDefTable[2].setRefVariantVals((const char**)RefVariantVals, 1); + + + + } + + // 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 GraphicsEffectData::initStrings(void) +{ + Name.isAllocated = false; + Name.buf = (const char*)"defaultSpriteIOFX"; +} + +void GraphicsEffectData::initDynamicArrays(void) +{ +} + +void GraphicsEffectData::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void GraphicsEffectData::initReferences(void) +{ + IOFX = NULL; + +} + +void GraphicsEffectData::freeDynamicArrays(void) +{ +} + +void GraphicsEffectData::freeStrings(void) +{ + + if (Name.isAllocated && Name.buf) + { + mParameterizedTraits->strfree((char*)Name.buf); + } +} + +void GraphicsEffectData::freeReferences(void) +{ + if (IOFX) + { + IOFX->destroy(); + } + +} + +} // namespace particles +} // namespace nvidia diff --git a/APEX_1.4/module/particles/src/autogen/GraphicsMaterialData.cpp b/APEX_1.4/module/particles/src/autogen/GraphicsMaterialData.cpp new file mode 100644 index 00000000..dc30bb65 --- /dev/null +++ b/APEX_1.4/module/particles/src/autogen/GraphicsMaterialData.cpp @@ -0,0 +1,886 @@ +// 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 "GraphicsMaterialData.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace particles +{ + +using namespace GraphicsMaterialDataNS; + +const char* const GraphicsMaterialDataFactory::vptr = + NvParameterized::getVptr<GraphicsMaterialData, GraphicsMaterialData::ClassAlignment>(); + +const uint32_t NumParamDefs = 20; +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, +}; + +#define TENUM(type) nvidia::##type +#define CHILDREN(index) &ParamLookupChildrenTable[index] +static const NvParameterized::ParamLookupNode ParamLookupTable[NumParamDefs] = +{ + { TYPE_STRUCT, false, 0, CHILDREN(0), 16 }, + { TYPE_STRING, false, (size_t)(&((ParametersStruct*)0)->Name), NULL, 0 }, // Name + { TYPE_STRING, false, (size_t)(&((ParametersStruct*)0)->ApplicationMaterialName), NULL, 0 }, // ApplicationMaterialName + { TYPE_STRING, false, (size_t)(&((ParametersStruct*)0)->UserProperties), NULL, 0 }, // UserProperties + { TYPE_ENUM, false, (size_t)(&((ParametersStruct*)0)->RenderTechnique), NULL, 0 }, // RenderTechnique + { TYPE_STRING, false, (size_t)(&((ParametersStruct*)0)->DiffuseTexture), NULL, 0 }, // DiffuseTexture + { TYPE_U32, false, (size_t)(&((ParametersStruct*)0)->CellColumn), NULL, 0 }, // CellColumn + { TYPE_U32, false, (size_t)(&((ParametersStruct*)0)->CellRow), NULL, 0 }, // CellRow + { TYPE_U32, false, (size_t)(&((ParametersStruct*)0)->CellCount), NULL, 0 }, // CellCount + { TYPE_BOOL, false, (size_t)(&((ParametersStruct*)0)->CrossBlend), NULL, 0 }, // CrossBlend + { TYPE_F32, false, (size_t)(&((ParametersStruct*)0)->ColorMultiplier), NULL, 0 }, // ColorMultiplier + { TYPE_BOOL, false, (size_t)(&((ParametersStruct*)0)->UsePSM), NULL, 0 }, // UsePSM + { TYPE_ENUM, false, (size_t)(&((ParametersStruct*)0)->Resolution), NULL, 0 }, // Resolution + { TYPE_U32, false, (size_t)(&((ParametersStruct*)0)->FullResPercent), NULL, 0 }, // FullResPercent + { TYPE_U32, false, (size_t)(&((ParametersStruct*)0)->HalfResPercent), NULL, 0 }, // HalfResPercent + { TYPE_F32, false, (size_t)(&((ParametersStruct*)0)->PSM_ShadowBias), NULL, 0 }, // PSM_ShadowBias + { TYPE_STRUCT, false, (size_t)(&((ParametersStruct*)0)->PSM_Frustum), CHILDREN(16), 3 }, // PSM_Frustum + { TYPE_BOOL, false, (size_t)(&((FrustumPSM_Type*)0)->ShowFrustum), NULL, 0 }, // PSM_Frustum.ShowFrustum + { TYPE_F32, false, (size_t)(&((FrustumPSM_Type*)0)->FrustumDepth), NULL, 0 }, // PSM_Frustum.FrustumDepth + { TYPE_F32, false, (size_t)(&((FrustumPSM_Type*)0)->FrustumSize), NULL, 0 }, // PSM_Frustum.FrustumSize +}; + + +bool GraphicsMaterialData::mBuiltFlag = false; +NvParameterized::MutexType GraphicsMaterialData::mBuiltFlagMutex; + +GraphicsMaterialData::GraphicsMaterialData(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &GraphicsMaterialDataFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +GraphicsMaterialData::~GraphicsMaterialData() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void GraphicsMaterialData::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->~GraphicsMaterialData(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* GraphicsMaterialData::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* GraphicsMaterialData::getParameterDefinitionTree(void) const +{ + GraphicsMaterialData* tmpParam = const_cast<GraphicsMaterialData*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType GraphicsMaterialData::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 GraphicsMaterialData::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 GraphicsMaterialData::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<GraphicsMaterialData::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ + +void GraphicsMaterialData::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 GraphicsMaterialData::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", "Contains the asset properties for this graphics material", true); + ParamDefTable[0].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=1, longName="Name" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[1]; + ParamDef->init("Name", TYPE_STRING, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("READONLY", uint64_t(0), true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("READONLY", uint64_t(0), true); + HintTable[1].init("shortDescription", "The name of this graphics material", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=2, longName="ApplicationMaterialName" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[2]; + ParamDef->init("ApplicationMaterialName", 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 material to match up with the application's material system", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=3, longName="UserProperties" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[3]; + ParamDef->init("UserProperties", TYPE_STRING, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Optional user properties string", true); + ParamDefTable[3].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=4, longName="RenderTechnique" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[4]; + ParamDef->init("RenderTechnique", TYPE_ENUM, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Which sprite rendering technique to apply", true); + ParamDefTable[4].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + static const char* const EnumVals[] = { "SPRITE_ONE", "SPRITE_ONE", "SPRITE_ALPHA", "SPRITE_SOLID", "SPRITE_TEXTURE", "SPRITE_WIREFRAME" }; + ParamDefTable[4].setEnumVals((const char**)EnumVals, 6); + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=5, longName="DiffuseTexture" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[5]; + ParamDef->init("DiffuseTexture", TYPE_STRING, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("NAME_CALLBACK", uint64_t(1), 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("NAME_CALLBACK", uint64_t(1), true); + HintTable[1].init("shortDescription", "The diffuse source texture to render the sprite with.", true); + ParamDefTable[5].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=6, longName="CellColumn" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[6]; + ParamDef->init("CellColumn", TYPE_U32, 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(32), true); + HintTable[1].init("min", uint64_t(1), true); + ParamDefTable[6].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(32), true); + HintTable[1].init("min", uint64_t(1), true); + HintTable[2].init("shortDescription", "The number of columns in the celled texture", true); + ParamDefTable[6].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=7, longName="CellRow" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[7]; + ParamDef->init("CellRow", TYPE_U32, 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(32), true); + HintTable[1].init("min", uint64_t(1), true); + ParamDefTable[7].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(32), true); + HintTable[1].init("min", uint64_t(1), true); + HintTable[2].init("shortDescription", "The number of rows in the celled texture", true); + ParamDefTable[7].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=8, longName="CellCount" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[8]; + ParamDef->init("CellCount", TYPE_U32, 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(1024), true); + HintTable[1].init("min", uint64_t(1), true); + ParamDefTable[8].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(1024), true); + HintTable[1].init("min", uint64_t(1), true); + HintTable[2].init("shortDescription", "The total number of frames in the celled animation", true); + ParamDefTable[8].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=9, longName="CrossBlend" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[9]; + ParamDef->init("CrossBlend", TYPE_BOOL, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "True if cross blending celled animated sprites", true); + ParamDefTable[9].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=10, longName="ColorMultiplier" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[10]; + ParamDef->init("ColorMultiplier", 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", double(10.000000000), true); + HintTable[1].init("min", double(0.000000000), 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("max", double(10.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + HintTable[2].init("shortDescription", "Multiply this constant times the output color", true); + ParamDefTable[10].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=11, longName="UsePSM" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[11]; + ParamDef->init("UsePSM", TYPE_BOOL, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Whether or not to use the PSM pipeline or not", true); + ParamDefTable[11].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=12, longName="Resolution" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[12]; + ParamDef->init("Resolution", TYPE_ENUM, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Whether or not to use full-res, half-res, quarter res, or multi-resoluation particle rendering", true); + ParamDefTable[12].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + static const char* const EnumVals[] = { "FULL", "HALF", "QUARTER", "MULTI" }; + ParamDefTable[12].setEnumVals((const char**)EnumVals, 4); + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=13, longName="FullResPercent" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[13]; + ParamDef->init("FullResPercent", TYPE_U32, 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(100), true); + HintTable[1].init("min", uint64_t(0), 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("max", uint64_t(100), true); + HintTable[1].init("min", uint64_t(0), true); + HintTable[2].init("shortDescription", "Percentage of particles to render at full resolution, is using the multi-res feature", true); + ParamDefTable[13].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=14, longName="HalfResPercent" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[14]; + ParamDef->init("HalfResPercent", TYPE_U32, 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(100), true); + HintTable[1].init("min", uint64_t(0), true); + ParamDefTable[14].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(100), true); + HintTable[1].init("min", uint64_t(0), true); + HintTable[2].init("shortDescription", "Percentage of particles to reunder at half-resolution; remaining percentage maps to quarter resolution if rendering using the multi-res feature", true); + ParamDefTable[14].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=15, longName="PSM_ShadowBias" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[15]; + ParamDef->init("PSM_ShadowBias", 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", double(2.000000000), true); + HintTable[1].init("min", double(0.000000000), 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("max", double(2.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + HintTable[2].init("shortDescription", "Helpful ToolTip goes here", true); + ParamDefTable[15].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=16, longName="PSM_Frustum" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[16]; + ParamDef->init("PSM_Frustum", TYPE_STRUCT, "FrustumPSM", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "The frustum properties for PSM", true); + ParamDefTable[16].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=17, longName="PSM_Frustum.ShowFrustum" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[17]; + ParamDef->init("ShowFrustum", TYPE_BOOL, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Debug visualize the frustum", true); + ParamDefTable[17].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=18, longName="PSM_Frustum.FrustumDepth" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[18]; + ParamDef->init("FrustumDepth", 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", double(100.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + ParamDefTable[18].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", double(100.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + HintTable[2].init("shortDescription", "The depth to use to build the non-orthographic projection", true); + ParamDefTable[18].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=19, longName="PSM_Frustum.FrustumSize" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[19]; + ParamDef->init("FrustumSize", 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", double(100.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + ParamDefTable[19].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", double(100.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + HintTable[2].init("shortDescription", "The overall bounding volume width/height to use to compute the PSM view frustum", true); + ParamDefTable[19].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // SetChildren for: nodeIndex=0, longName="" + { + static Definition* Children[16]; + 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); + Children[13] = PDEF_PTR(14); + Children[14] = PDEF_PTR(15); + Children[15] = PDEF_PTR(16); + + ParamDefTable[0].setChildren(Children, 16); + } + + // SetChildren for: nodeIndex=16, longName="PSM_Frustum" + { + static Definition* Children[3]; + Children[0] = PDEF_PTR(17); + Children[1] = PDEF_PTR(18); + Children[2] = PDEF_PTR(19); + + ParamDefTable[16].setChildren(Children, 3); + } + + mBuiltFlag = true; + +} +void GraphicsMaterialData::initStrings(void) +{ + Name.isAllocated = false; + Name.buf = (const char*)"defaultGraphicsMaterial"; + ApplicationMaterialName.isAllocated = true; + ApplicationMaterialName.buf = NULL; + UserProperties.isAllocated = true; + UserProperties.buf = NULL; + DiffuseTexture.isAllocated = false; + DiffuseTexture.buf = (const char*)"DefaultSprite.dds"; +} + +void GraphicsMaterialData::initDynamicArrays(void) +{ +} + +void GraphicsMaterialData::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + RenderTechnique = (const char*)"SPRITE_ONE"; + CellColumn = uint32_t(1); + CellRow = uint32_t(1); + CellCount = uint32_t(1); + CrossBlend = bool(0); + ColorMultiplier = float(1.000000000); + UsePSM = bool(0); + Resolution = (const char*)"FULL"; + FullResPercent = uint32_t(0); + HalfResPercent = uint32_t(80); + PSM_ShadowBias = float(1.000000000); + PSM_Frustum.ShowFrustum = bool(0); + PSM_Frustum.FrustumDepth = float(10.000000000); + PSM_Frustum.FrustumSize = float(10.000000000); + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void GraphicsMaterialData::initReferences(void) +{ +} + +void GraphicsMaterialData::freeDynamicArrays(void) +{ +} + +void GraphicsMaterialData::freeStrings(void) +{ + + if (Name.isAllocated && Name.buf) + { + mParameterizedTraits->strfree((char*)Name.buf); + } + + if (ApplicationMaterialName.isAllocated && ApplicationMaterialName.buf) + { + mParameterizedTraits->strfree((char*)ApplicationMaterialName.buf); + } + + if (UserProperties.isAllocated && UserProperties.buf) + { + mParameterizedTraits->strfree((char*)UserProperties.buf); + } + + if (DiffuseTexture.isAllocated && DiffuseTexture.buf) + { + mParameterizedTraits->strfree((char*)DiffuseTexture.buf); + } +} + +void GraphicsMaterialData::freeReferences(void) +{ +} + +} // namespace particles +} // namespace nvidia diff --git a/APEX_1.4/module/particles/src/autogen/HeatSourceData.cpp b/APEX_1.4/module/particles/src/autogen/HeatSourceData.cpp new file mode 100644 index 00000000..648c54e7 --- /dev/null +++ b/APEX_1.4/module/particles/src/autogen/HeatSourceData.cpp @@ -0,0 +1,363 @@ +// 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 "HeatSourceData.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace particles +{ + +using namespace HeatSourceDataNS; + +const char* const HeatSourceDataFactory::vptr = + NvParameterized::getVptr<HeatSourceData, HeatSourceData::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_STRING, false, (size_t)(&((ParametersStruct*)0)->Name), NULL, 0 }, // Name + { TYPE_REF, false, (size_t)(&((ParametersStruct*)0)->HeatSource), NULL, 0 }, // HeatSource +}; + + +bool HeatSourceData::mBuiltFlag = false; +NvParameterized::MutexType HeatSourceData::mBuiltFlagMutex; + +HeatSourceData::HeatSourceData(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &HeatSourceDataFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +HeatSourceData::~HeatSourceData() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void HeatSourceData::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->~HeatSourceData(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* HeatSourceData::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* HeatSourceData::getParameterDefinitionTree(void) const +{ + HeatSourceData* tmpParam = const_cast<HeatSourceData*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType HeatSourceData::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 HeatSourceData::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 HeatSourceData::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<HeatSourceData::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ + +void HeatSourceData::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 HeatSourceData::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", "Contains the asset properties for this heat source asset", true); + ParamDefTable[0].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=1, longName="Name" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[1]; + ParamDef->init("Name", TYPE_STRING, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Heat Source name", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=2, longName="HeatSource" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[2]; + ParamDef->init("HeatSource", 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[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("INCLUDED", uint64_t(1), true); + HintTable[1].init("shortDescription", "Heat Source properties", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + static const char* const RefVariantVals[] = { "HeatSourceAssetParams" }; + ParamDefTable[2].setRefVariantVals((const char**)RefVariantVals, 1); + + + + } + + // 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 HeatSourceData::initStrings(void) +{ + Name.isAllocated = false; + Name.buf = (const char*)"defaultHeatSource"; +} + +void HeatSourceData::initDynamicArrays(void) +{ +} + +void HeatSourceData::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void HeatSourceData::initReferences(void) +{ + HeatSource = NULL; + +} + +void HeatSourceData::freeDynamicArrays(void) +{ +} + +void HeatSourceData::freeStrings(void) +{ + + if (Name.isAllocated && Name.buf) + { + mParameterizedTraits->strfree((char*)Name.buf); + } +} + +void HeatSourceData::freeReferences(void) +{ + if (HeatSource) + { + HeatSource->destroy(); + } + +} + +} // namespace particles +} // namespace nvidia diff --git a/APEX_1.4/module/particles/src/autogen/HeatSourceEffect.cpp b/APEX_1.4/module/particles/src/autogen/HeatSourceEffect.cpp new file mode 100644 index 00000000..f7ed8122 --- /dev/null +++ b/APEX_1.4/module/particles/src/autogen/HeatSourceEffect.cpp @@ -0,0 +1,1356 @@ +// 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 "HeatSourceEffect.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace particles +{ + +using namespace HeatSourceEffectNS; + +const char* const HeatSourceEffectFactory::vptr = + NvParameterized::getVptr<HeatSourceEffect, HeatSourceEffect::ClassAlignment>(); + +const uint32_t NumParamDefs = 32; +static NvParameterized::DefinitionImpl* ParamDefTable; // now allocated in buildTree [NumParamDefs]; + + +static const size_t ParamLookupChildrenTable[] = +{ + 1, 31, 2, 3, 4, 8, 12, 13, 14, 15, 16, 17, 5, 6, 7, 9, 10, 11, 18, 19, 20, 21, 23, + 27, 22, 24, 25, 26, 28, 29, 30, +}; + +#define TENUM(type) nvidia::##type +#define CHILDREN(index) &ParamLookupChildrenTable[index] +static const NvParameterized::ParamLookupNode ParamLookupTable[NumParamDefs] = +{ + { TYPE_STRUCT, false, 0, CHILDREN(0), 2 }, + { TYPE_STRUCT, false, (size_t)(&((ParametersStruct*)0)->EffectProperties), CHILDREN(2), 10 }, // EffectProperties + { TYPE_STRING, false, (size_t)(&((EffectProperties_Type*)0)->UserString), NULL, 0 }, // EffectProperties.UserString + { TYPE_BOOL, false, (size_t)(&((EffectProperties_Type*)0)->Enable), NULL, 0 }, // EffectProperties.Enable + { TYPE_STRUCT, false, (size_t)(&((EffectProperties_Type*)0)->Position), CHILDREN(12), 3 }, // EffectProperties.Position + { TYPE_F32, false, (size_t)(&((TranslateObject_Type*)0)->TranslateX), NULL, 0 }, // EffectProperties.Position.TranslateX + { TYPE_F32, false, (size_t)(&((TranslateObject_Type*)0)->TranslateY), NULL, 0 }, // EffectProperties.Position.TranslateY + { TYPE_F32, false, (size_t)(&((TranslateObject_Type*)0)->TranslateZ), NULL, 0 }, // EffectProperties.Position.TranslateZ + { TYPE_STRUCT, false, (size_t)(&((EffectProperties_Type*)0)->Orientation), CHILDREN(15), 3 }, // EffectProperties.Orientation + { TYPE_F32, false, (size_t)(&((OrientObject_Type*)0)->RotateX), NULL, 0 }, // EffectProperties.Orientation.RotateX + { TYPE_F32, false, (size_t)(&((OrientObject_Type*)0)->RotateY), NULL, 0 }, // EffectProperties.Orientation.RotateY + { TYPE_F32, false, (size_t)(&((OrientObject_Type*)0)->RotateZ), NULL, 0 }, // EffectProperties.Orientation.RotateZ + { TYPE_F32, false, (size_t)(&((EffectProperties_Type*)0)->InitialDelayTime), NULL, 0 }, // EffectProperties.InitialDelayTime + { TYPE_F32, false, (size_t)(&((EffectProperties_Type*)0)->Duration), NULL, 0 }, // EffectProperties.Duration + { TYPE_U32, false, (size_t)(&((EffectProperties_Type*)0)->RepeatCount), NULL, 0 }, // EffectProperties.RepeatCount + { TYPE_F32, false, (size_t)(&((EffectProperties_Type*)0)->RepeatDelay), NULL, 0 }, // EffectProperties.RepeatDelay + { TYPE_F32, false, (size_t)(&((EffectProperties_Type*)0)->RandomizeRepeatTime), NULL, 0 }, // EffectProperties.RandomizeRepeatTime + { TYPE_STRUCT, false, (size_t)(&((EffectProperties_Type*)0)->Path), CHILDREN(18), 6 }, // EffectProperties.Path + { TYPE_ENUM, false, (size_t)(&((EffectPath_Type*)0)->PlaybackMode), NULL, 0 }, // EffectProperties.Path.PlaybackMode + { TYPE_F32, false, (size_t)(&((EffectPath_Type*)0)->PathDuration), NULL, 0 }, // EffectProperties.Path.PathDuration + { TYPE_U32, false, (size_t)(&((EffectPath_Type*)0)->LoopIndex), NULL, 0 }, // EffectProperties.Path.LoopIndex + { TYPE_ARRAY, true, (size_t)(&((EffectPath_Type*)0)->ControlPoints), CHILDREN(24), 1 }, // EffectProperties.Path.ControlPoints + { TYPE_TRANSFORM, false, 1 * sizeof(physx::PxTransform), NULL, 0 }, // EffectProperties.Path.ControlPoints[] + { TYPE_ARRAY, true, (size_t)(&((EffectPath_Type*)0)->Scale), CHILDREN(25), 1 }, // EffectProperties.Path.Scale + { TYPE_STRUCT, false, 1 * sizeof(ControlPoint_Type), CHILDREN(26), 2 }, // EffectProperties.Path.Scale[] + { TYPE_F32, false, (size_t)(&((ControlPoint_Type*)0)->x), NULL, 0 }, // EffectProperties.Path.Scale[].x + { TYPE_F32, false, (size_t)(&((ControlPoint_Type*)0)->y), NULL, 0 }, // EffectProperties.Path.Scale[].y + { TYPE_ARRAY, true, (size_t)(&((EffectPath_Type*)0)->Speed), CHILDREN(28), 1 }, // EffectProperties.Path.Speed + { TYPE_STRUCT, false, 1 * sizeof(ControlPoint_Type), CHILDREN(29), 2 }, // EffectProperties.Path.Speed[] + { TYPE_F32, false, (size_t)(&((ControlPoint_Type*)0)->x), NULL, 0 }, // EffectProperties.Path.Speed[].x + { TYPE_F32, false, (size_t)(&((ControlPoint_Type*)0)->y), NULL, 0 }, // EffectProperties.Path.Speed[].y + { TYPE_REF, false, (size_t)(&((ParametersStruct*)0)->HeatSource), NULL, 0 }, // HeatSource +}; + + +bool HeatSourceEffect::mBuiltFlag = false; +NvParameterized::MutexType HeatSourceEffect::mBuiltFlagMutex; + +HeatSourceEffect::HeatSourceEffect(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &HeatSourceEffectFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +HeatSourceEffect::~HeatSourceEffect() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void HeatSourceEffect::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->~HeatSourceEffect(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* HeatSourceEffect::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* HeatSourceEffect::getParameterDefinitionTree(void) const +{ + HeatSourceEffect* tmpParam = const_cast<HeatSourceEffect*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType HeatSourceEffect::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 HeatSourceEffect::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 HeatSourceEffect::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<HeatSourceEffect::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ + +void HeatSourceEffect::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 HeatSourceEffect::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", "A heat source effect", true); + ParamDefTable[0].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=1, longName="EffectProperties" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[1]; + ParamDef->init("EffectProperties", TYPE_STRUCT, "EffectProperties", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Properties of Heat Source Asset", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=2, longName="EffectProperties.UserString" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[2]; + ParamDef->init("UserString", TYPE_STRING, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "An aribtrary user string that can be set by an artist/designer/programmer", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=3, longName="EffectProperties.Enable" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[3]; + ParamDef->init("Enable", TYPE_BOOL, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Whether or not this effect is to be initially enabled on startup", true); + ParamDefTable[3].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=4, longName="EffectProperties.Position" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[4]; + ParamDef->init("Position", TYPE_STRUCT, "TranslateObject", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "The position of this effect relative to the parent", true); + ParamDefTable[4].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=5, longName="EffectProperties.Position.TranslateX" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[5]; + ParamDef->init("TranslateX", 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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(500.000000000), true); + HintTable[2].init("min", double(-500.000000000), true); + ParamDefTable[5].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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(500.000000000), true); + HintTable[2].init("min", double(-500.000000000), true); + HintTable[3].init("shortDescription", "Nudge up to +/- one meter in each direction", true); + ParamDefTable[5].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=6, longName="EffectProperties.Position.TranslateY" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[6]; + ParamDef->init("TranslateY", 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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(500.000000000), true); + HintTable[2].init("min", double(-500.000000000), true); + ParamDefTable[6].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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(500.000000000), true); + HintTable[2].init("min", double(-500.000000000), true); + HintTable[3].init("shortDescription", "Nudge up to +/- one meter in each direction", true); + ParamDefTable[6].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=7, longName="EffectProperties.Position.TranslateZ" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[7]; + ParamDef->init("TranslateZ", 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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(500.000000000), true); + HintTable[2].init("min", double(-500.000000000), true); + ParamDefTable[7].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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(500.000000000), true); + HintTable[2].init("min", double(-500.000000000), true); + HintTable[3].init("shortDescription", "Nudge up to +/- one meter in each direction", true); + ParamDefTable[7].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=8, longName="EffectProperties.Orientation" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[8]; + ParamDef->init("Orientation", TYPE_STRUCT, "OrientObject", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "The orientation of this effect, relative to the parent orientation", true); + ParamDefTable[8].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=9, longName="EffectProperties.Orientation.RotateX" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[9]; + ParamDef->init("RotateX", 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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(360.000000000), true); + HintTable[2].init("min", double(0.000000000), true); + ParamDefTable[9].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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(360.000000000), true); + HintTable[2].init("min", double(0.000000000), true); + HintTable[3].init("shortDescription", "Rotate on the X axis (0-360 degrees)", true); + ParamDefTable[9].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=10, longName="EffectProperties.Orientation.RotateY" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[10]; + ParamDef->init("RotateY", 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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(360.000000000), true); + HintTable[2].init("min", double(0.000000000), true); + ParamDefTable[10].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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(360.000000000), true); + HintTable[2].init("min", double(0.000000000), true); + HintTable[3].init("shortDescription", "Rotate on the Y axis (0-360 degrees)", true); + ParamDefTable[10].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=11, longName="EffectProperties.Orientation.RotateZ" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[11]; + ParamDef->init("RotateZ", 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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(360.000000000), true); + HintTable[2].init("min", double(0.000000000), 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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(360.000000000), true); + HintTable[2].init("min", double(0.000000000), true); + HintTable[3].init("shortDescription", "Rotate on the Z axis (0-360 degrees)", true); + ParamDefTable[11].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=12, longName="EffectProperties.InitialDelayTime" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[12]; + ParamDef->init("InitialDelayTime", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("min", double(0.000000000), 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("min", double(0.000000000), true); + HintTable[1].init("shortDescription", "Initial time to delay before spawning this effect", true); + ParamDefTable[12].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=13, longName="EffectProperties.Duration" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[13]; + ParamDef->init("Duration", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("min", double(0.000000000), true); + ParamDefTable[13].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("min", double(0.000000000), true); + HintTable[1].init("shortDescription", "The duration of the effect in secontds", true); + ParamDefTable[13].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=14, longName="EffectProperties.RepeatCount" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[14]; + ParamDef->init("RepeatCount", TYPE_U32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("min", uint64_t(1), 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("min", uint64_t(1), true); + HintTable[1].init("shortDescription", "The number of times to repeat the effect; 9999 means repeate forever", true); + ParamDefTable[14].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=15, longName="EffectProperties.RepeatDelay" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[15]; + ParamDef->init("RepeatDelay", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("min", double(0.000000000), 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("min", double(0.000000000), true); + HintTable[1].init("shortDescription", "The time to delay activation each time the effect repeats in seconds; this can be different than the initial delay time", true); + ParamDefTable[15].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=16, longName="EffectProperties.RandomizeRepeatTime" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[16]; + ParamDef->init("RandomizeRepeatTime", 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", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), 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("max", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + HintTable[2].init("shortDescription", "Amount of randomization to the repeat cycle; a value of zero (default) means no random and a value of one means completely random.", true); + ParamDefTable[16].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=17, longName="EffectProperties.Path" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[17]; + ParamDef->init("Path", TYPE_STRUCT, "EffectPath", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "An optional pre-defined path for this effect to travel on", true); + ParamDefTable[17].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=18, longName="EffectProperties.Path.PlaybackMode" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[18]; + ParamDef->init("PlaybackMode", TYPE_ENUM, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "The mode to play back the path", true); + ParamDefTable[18].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + static const char* const EnumVals[] = { "LOOP", "PLAY_ONCE", "PING_PONG" }; + ParamDefTable[18].setEnumVals((const char**)EnumVals, 3); + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=19, longName="EffectProperties.Path.PathDuration" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[19]; + ParamDef->init("PathDuration", 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", double(1000.000000000), true); + HintTable[1].init("min", double(0.000010000), true); + ParamDefTable[19].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", double(1000.000000000), true); + HintTable[1].init("min", double(0.000010000), true); + HintTable[2].init("shortDescription", "The duration of the path if one is not otherwise provided", true); + ParamDefTable[19].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=20, longName="EffectProperties.Path.LoopIndex" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[20]; + ParamDef->init("LoopIndex", TYPE_U32, 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[20].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("min", uint64_t(0), true); + HintTable[1].init("shortDescription", "The array index to loop back to", true); + ParamDefTable[20].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=21, longName="EffectProperties.Path.ControlPoints" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[21]; + ParamDef->init("ControlPoints", TYPE_ARRAY, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("editorCurve", uint64_t(1), true); + HintTable[2].init("pathEditor", uint64_t(1), 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("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("editorCurve", uint64_t(1), true); + HintTable[2].init("pathEditor", uint64_t(1), true); + HintTable[3].init("shortDescription", "The array of control points to fit the curve to", true); + ParamDefTable[21].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + ParamDef->setArraySize(-1); + } + + // Initialize DefinitionImpl node: nodeIndex=22, longName="EffectProperties.Path.ControlPoints[]" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[22]; + ParamDef->init("ControlPoints", TYPE_TRANSFORM, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("editorCurve", uint64_t(1), true); + HintTable[2].init("pathEditor", uint64_t(1), 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("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("editorCurve", uint64_t(1), true); + HintTable[2].init("pathEditor", uint64_t(1), true); + HintTable[3].init("shortDescription", "The array of control points to fit the curve to", true); + ParamDefTable[22].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=23, longName="EffectProperties.Path.Scale" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[23]; + ParamDef->init("Scale", TYPE_ARRAY, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("xAxisLabel", "Over Time", true); + HintTable[4].init("yAxisLabel", "Scale", true); + ParamDefTable[23].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#else + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("shortDescription", "The array of scale values over time", true); + HintTable[4].init("xAxisLabel", "Over Time", true); + HintTable[5].init("yAxisLabel", "Scale", true); + ParamDefTable[23].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + ParamDef->setArraySize(-1); + } + + // Initialize DefinitionImpl node: nodeIndex=24, longName="EffectProperties.Path.Scale[]" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[24]; + ParamDef->init("Scale", TYPE_STRUCT, "ControlPoint", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("xAxisLabel", "Over Time", true); + HintTable[4].init("yAxisLabel", "Scale", true); + ParamDefTable[24].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#else + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("shortDescription", "The array of scale values over time", true); + HintTable[4].init("xAxisLabel", "Over Time", true); + HintTable[5].init("yAxisLabel", "Scale", true); + ParamDefTable[24].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=25, longName="EffectProperties.Path.Scale[].x" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[25]; + 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", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), 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("max", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + HintTable[2].init("shortDescription", "The x-axis value for this vector", true); + ParamDefTable[25].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=26, longName="EffectProperties.Path.Scale[].y" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[26]; + 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", "The y-axis value for this vector", true); + ParamDefTable[26].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=27, longName="EffectProperties.Path.Speed" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[27]; + ParamDef->init("Speed", TYPE_ARRAY, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("xAxisLabel", "Over Time", true); + HintTable[4].init("yAxisLabel", "Speed", true); + ParamDefTable[27].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#else + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("shortDescription", "The array of speed values over time", true); + HintTable[4].init("xAxisLabel", "Over Time", true); + HintTable[5].init("yAxisLabel", "Speed", true); + ParamDefTable[27].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + ParamDef->setArraySize(-1); + } + + // Initialize DefinitionImpl node: nodeIndex=28, longName="EffectProperties.Path.Speed[]" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[28]; + ParamDef->init("Speed", TYPE_STRUCT, "ControlPoint", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("xAxisLabel", "Over Time", true); + HintTable[4].init("yAxisLabel", "Speed", true); + ParamDefTable[28].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#else + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("shortDescription", "The array of speed values over time", true); + HintTable[4].init("xAxisLabel", "Over Time", true); + HintTable[5].init("yAxisLabel", "Speed", true); + ParamDefTable[28].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=29, longName="EffectProperties.Path.Speed[].x" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[29]; + 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", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + ParamDefTable[29].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", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + HintTable[2].init("shortDescription", "The x-axis value for this vector", true); + ParamDefTable[29].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=30, longName="EffectProperties.Path.Speed[].y" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[30]; + 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", "The y-axis value for this vector", true); + ParamDefTable[30].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=31, longName="HeatSource" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[31]; + ParamDef->init("HeatSource", TYPE_REF, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Heat Source Asset", true); + ParamDefTable[31].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + static const char* const RefVariantVals[] = { "HeatSourceAsset" }; + ParamDefTable[31].setRefVariantVals((const char**)RefVariantVals, 1); + + + + } + + // SetChildren for: nodeIndex=0, longName="" + { + static Definition* Children[2]; + Children[0] = PDEF_PTR(1); + Children[1] = PDEF_PTR(31); + + ParamDefTable[0].setChildren(Children, 2); + } + + // SetChildren for: nodeIndex=1, longName="EffectProperties" + { + static Definition* Children[10]; + Children[0] = PDEF_PTR(2); + Children[1] = PDEF_PTR(3); + Children[2] = PDEF_PTR(4); + Children[3] = PDEF_PTR(8); + Children[4] = PDEF_PTR(12); + Children[5] = PDEF_PTR(13); + Children[6] = PDEF_PTR(14); + Children[7] = PDEF_PTR(15); + Children[8] = PDEF_PTR(16); + Children[9] = PDEF_PTR(17); + + ParamDefTable[1].setChildren(Children, 10); + } + + // SetChildren for: nodeIndex=4, longName="EffectProperties.Position" + { + static Definition* Children[3]; + Children[0] = PDEF_PTR(5); + Children[1] = PDEF_PTR(6); + Children[2] = PDEF_PTR(7); + + ParamDefTable[4].setChildren(Children, 3); + } + + // SetChildren for: nodeIndex=8, longName="EffectProperties.Orientation" + { + static Definition* Children[3]; + Children[0] = PDEF_PTR(9); + Children[1] = PDEF_PTR(10); + Children[2] = PDEF_PTR(11); + + ParamDefTable[8].setChildren(Children, 3); + } + + // SetChildren for: nodeIndex=17, longName="EffectProperties.Path" + { + static Definition* Children[6]; + Children[0] = PDEF_PTR(18); + Children[1] = PDEF_PTR(19); + Children[2] = PDEF_PTR(20); + Children[3] = PDEF_PTR(21); + Children[4] = PDEF_PTR(23); + Children[5] = PDEF_PTR(27); + + ParamDefTable[17].setChildren(Children, 6); + } + + // SetChildren for: nodeIndex=21, longName="EffectProperties.Path.ControlPoints" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(22); + + ParamDefTable[21].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=23, longName="EffectProperties.Path.Scale" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(24); + + ParamDefTable[23].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=24, longName="EffectProperties.Path.Scale[]" + { + static Definition* Children[2]; + Children[0] = PDEF_PTR(25); + Children[1] = PDEF_PTR(26); + + ParamDefTable[24].setChildren(Children, 2); + } + + // SetChildren for: nodeIndex=27, longName="EffectProperties.Path.Speed" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(28); + + ParamDefTable[27].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=28, longName="EffectProperties.Path.Speed[]" + { + static Definition* Children[2]; + Children[0] = PDEF_PTR(29); + Children[1] = PDEF_PTR(30); + + ParamDefTable[28].setChildren(Children, 2); + } + + mBuiltFlag = true; + +} +void HeatSourceEffect::initStrings(void) +{ + EffectProperties.UserString.isAllocated = true; + EffectProperties.UserString.buf = NULL; +} + +void HeatSourceEffect::initDynamicArrays(void) +{ + EffectProperties.Path.ControlPoints.buf = NULL; + EffectProperties.Path.ControlPoints.isAllocated = true; + EffectProperties.Path.ControlPoints.elementSize = sizeof(physx::PxTransform); + EffectProperties.Path.ControlPoints.arraySizes[0] = 0; + EffectProperties.Path.Scale.buf = NULL; + EffectProperties.Path.Scale.isAllocated = true; + EffectProperties.Path.Scale.elementSize = sizeof(ControlPoint_Type); + EffectProperties.Path.Scale.arraySizes[0] = 0; + EffectProperties.Path.Speed.buf = NULL; + EffectProperties.Path.Speed.isAllocated = true; + EffectProperties.Path.Speed.elementSize = sizeof(ControlPoint_Type); + EffectProperties.Path.Speed.arraySizes[0] = 0; +} + +void HeatSourceEffect::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + EffectProperties.Enable = bool(1); + EffectProperties.Position.TranslateX = float(0.000000000); + EffectProperties.Position.TranslateY = float(0.000000000); + EffectProperties.Position.TranslateZ = float(0.000000000); + EffectProperties.Orientation.RotateX = float(0.000000000); + EffectProperties.Orientation.RotateY = float(0.000000000); + EffectProperties.Orientation.RotateZ = float(0.000000000); + EffectProperties.InitialDelayTime = float(0.000000000); + EffectProperties.Duration = float(0.000000000); + EffectProperties.RepeatCount = uint32_t(1); + EffectProperties.RepeatDelay = float(0.000000000); + EffectProperties.RandomizeRepeatTime = float(0.000000000); + EffectProperties.Path.PlaybackMode = (const char*)"LOOP"; + EffectProperties.Path.PathDuration = float(4.000000000); + EffectProperties.Path.LoopIndex = uint32_t(0); + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void HeatSourceEffect::initReferences(void) +{ + HeatSource = NULL; + +} + +void HeatSourceEffect::freeDynamicArrays(void) +{ + if (EffectProperties.Path.ControlPoints.isAllocated && EffectProperties.Path.ControlPoints.buf) + { + mParameterizedTraits->free(EffectProperties.Path.ControlPoints.buf); + } + if (EffectProperties.Path.Scale.isAllocated && EffectProperties.Path.Scale.buf) + { + mParameterizedTraits->free(EffectProperties.Path.Scale.buf); + } + if (EffectProperties.Path.Speed.isAllocated && EffectProperties.Path.Speed.buf) + { + mParameterizedTraits->free(EffectProperties.Path.Speed.buf); + } +} + +void HeatSourceEffect::freeStrings(void) +{ + + if (EffectProperties.UserString.isAllocated && EffectProperties.UserString.buf) + { + mParameterizedTraits->strfree((char*)EffectProperties.UserString.buf); + } +} + +void HeatSourceEffect::freeReferences(void) +{ + if (HeatSource) + { + HeatSource->destroy(); + } + +} + +} // namespace particles +} // namespace nvidia diff --git a/APEX_1.4/module/particles/src/autogen/JetFieldSamplerData.cpp b/APEX_1.4/module/particles/src/autogen/JetFieldSamplerData.cpp new file mode 100644 index 00000000..5981bac8 --- /dev/null +++ b/APEX_1.4/module/particles/src/autogen/JetFieldSamplerData.cpp @@ -0,0 +1,363 @@ +// 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 "JetFieldSamplerData.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace particles +{ + +using namespace JetFieldSamplerDataNS; + +const char* const JetFieldSamplerDataFactory::vptr = + NvParameterized::getVptr<JetFieldSamplerData, JetFieldSamplerData::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_STRING, false, (size_t)(&((ParametersStruct*)0)->Name), NULL, 0 }, // Name + { TYPE_REF, false, (size_t)(&((ParametersStruct*)0)->JetFieldSampler), NULL, 0 }, // JetFieldSampler +}; + + +bool JetFieldSamplerData::mBuiltFlag = false; +NvParameterized::MutexType JetFieldSamplerData::mBuiltFlagMutex; + +JetFieldSamplerData::JetFieldSamplerData(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &JetFieldSamplerDataFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +JetFieldSamplerData::~JetFieldSamplerData() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void JetFieldSamplerData::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->~JetFieldSamplerData(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* JetFieldSamplerData::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* JetFieldSamplerData::getParameterDefinitionTree(void) const +{ + JetFieldSamplerData* tmpParam = const_cast<JetFieldSamplerData*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType JetFieldSamplerData::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 JetFieldSamplerData::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 JetFieldSamplerData::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<JetFieldSamplerData::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ + +void JetFieldSamplerData::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 JetFieldSamplerData::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", "Contains the asset properties for this jet field sampler", true); + ParamDefTable[0].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=1, longName="Name" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[1]; + ParamDef->init("Name", TYPE_STRING, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Jet FS Name", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=2, longName="JetFieldSampler" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[2]; + ParamDef->init("JetFieldSampler", 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[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("INCLUDED", uint64_t(1), true); + HintTable[1].init("shortDescription", "Jet FS properties", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + static const char* const RefVariantVals[] = { "JetFSAssetParams" }; + ParamDefTable[2].setRefVariantVals((const char**)RefVariantVals, 1); + + + + } + + // 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 JetFieldSamplerData::initStrings(void) +{ + Name.isAllocated = false; + Name.buf = (const char*)"defaultJetFieldSampler"; +} + +void JetFieldSamplerData::initDynamicArrays(void) +{ +} + +void JetFieldSamplerData::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void JetFieldSamplerData::initReferences(void) +{ + JetFieldSampler = NULL; + +} + +void JetFieldSamplerData::freeDynamicArrays(void) +{ +} + +void JetFieldSamplerData::freeStrings(void) +{ + + if (Name.isAllocated && Name.buf) + { + mParameterizedTraits->strfree((char*)Name.buf); + } +} + +void JetFieldSamplerData::freeReferences(void) +{ + if (JetFieldSampler) + { + JetFieldSampler->destroy(); + } + +} + +} // namespace particles +} // namespace nvidia diff --git a/APEX_1.4/module/particles/src/autogen/JetFieldSamplerEffect.cpp b/APEX_1.4/module/particles/src/autogen/JetFieldSamplerEffect.cpp new file mode 100644 index 00000000..4353b16b --- /dev/null +++ b/APEX_1.4/module/particles/src/autogen/JetFieldSamplerEffect.cpp @@ -0,0 +1,1362 @@ +// 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 "JetFieldSamplerEffect.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace particles +{ + +using namespace JetFieldSamplerEffectNS; + +const char* const JetFieldSamplerEffectFactory::vptr = + NvParameterized::getVptr<JetFieldSamplerEffect, JetFieldSamplerEffect::ClassAlignment>(); + +const uint32_t NumParamDefs = 32; +static NvParameterized::DefinitionImpl* ParamDefTable; // now allocated in buildTree [NumParamDefs]; + + +static const size_t ParamLookupChildrenTable[] = +{ + 1, 31, 2, 3, 4, 8, 12, 13, 14, 15, 16, 17, 5, 6, 7, 9, 10, 11, 18, 19, 20, 21, 23, + 27, 22, 24, 25, 26, 28, 29, 30, +}; + +#define TENUM(type) nvidia::##type +#define CHILDREN(index) &ParamLookupChildrenTable[index] +static const NvParameterized::ParamLookupNode ParamLookupTable[NumParamDefs] = +{ + { TYPE_STRUCT, false, 0, CHILDREN(0), 2 }, + { TYPE_STRUCT, false, (size_t)(&((ParametersStruct*)0)->EffectProperties), CHILDREN(2), 10 }, // EffectProperties + { TYPE_STRING, false, (size_t)(&((EffectProperties_Type*)0)->UserString), NULL, 0 }, // EffectProperties.UserString + { TYPE_BOOL, false, (size_t)(&((EffectProperties_Type*)0)->Enable), NULL, 0 }, // EffectProperties.Enable + { TYPE_STRUCT, false, (size_t)(&((EffectProperties_Type*)0)->Position), CHILDREN(12), 3 }, // EffectProperties.Position + { TYPE_F32, false, (size_t)(&((TranslateObject_Type*)0)->TranslateX), NULL, 0 }, // EffectProperties.Position.TranslateX + { TYPE_F32, false, (size_t)(&((TranslateObject_Type*)0)->TranslateY), NULL, 0 }, // EffectProperties.Position.TranslateY + { TYPE_F32, false, (size_t)(&((TranslateObject_Type*)0)->TranslateZ), NULL, 0 }, // EffectProperties.Position.TranslateZ + { TYPE_STRUCT, false, (size_t)(&((EffectProperties_Type*)0)->Orientation), CHILDREN(15), 3 }, // EffectProperties.Orientation + { TYPE_F32, false, (size_t)(&((OrientObject_Type*)0)->RotateX), NULL, 0 }, // EffectProperties.Orientation.RotateX + { TYPE_F32, false, (size_t)(&((OrientObject_Type*)0)->RotateY), NULL, 0 }, // EffectProperties.Orientation.RotateY + { TYPE_F32, false, (size_t)(&((OrientObject_Type*)0)->RotateZ), NULL, 0 }, // EffectProperties.Orientation.RotateZ + { TYPE_F32, false, (size_t)(&((EffectProperties_Type*)0)->InitialDelayTime), NULL, 0 }, // EffectProperties.InitialDelayTime + { TYPE_F32, false, (size_t)(&((EffectProperties_Type*)0)->Duration), NULL, 0 }, // EffectProperties.Duration + { TYPE_U32, false, (size_t)(&((EffectProperties_Type*)0)->RepeatCount), NULL, 0 }, // EffectProperties.RepeatCount + { TYPE_F32, false, (size_t)(&((EffectProperties_Type*)0)->RepeatDelay), NULL, 0 }, // EffectProperties.RepeatDelay + { TYPE_F32, false, (size_t)(&((EffectProperties_Type*)0)->RandomizeRepeatTime), NULL, 0 }, // EffectProperties.RandomizeRepeatTime + { TYPE_STRUCT, false, (size_t)(&((EffectProperties_Type*)0)->Path), CHILDREN(18), 6 }, // EffectProperties.Path + { TYPE_ENUM, false, (size_t)(&((EffectPath_Type*)0)->PlaybackMode), NULL, 0 }, // EffectProperties.Path.PlaybackMode + { TYPE_F32, false, (size_t)(&((EffectPath_Type*)0)->PathDuration), NULL, 0 }, // EffectProperties.Path.PathDuration + { TYPE_U32, false, (size_t)(&((EffectPath_Type*)0)->LoopIndex), NULL, 0 }, // EffectProperties.Path.LoopIndex + { TYPE_ARRAY, true, (size_t)(&((EffectPath_Type*)0)->ControlPoints), CHILDREN(24), 1 }, // EffectProperties.Path.ControlPoints + { TYPE_TRANSFORM, false, 1 * sizeof(physx::PxTransform), NULL, 0 }, // EffectProperties.Path.ControlPoints[] + { TYPE_ARRAY, true, (size_t)(&((EffectPath_Type*)0)->Scale), CHILDREN(25), 1 }, // EffectProperties.Path.Scale + { TYPE_STRUCT, false, 1 * sizeof(ControlPoint_Type), CHILDREN(26), 2 }, // EffectProperties.Path.Scale[] + { TYPE_F32, false, (size_t)(&((ControlPoint_Type*)0)->x), NULL, 0 }, // EffectProperties.Path.Scale[].x + { TYPE_F32, false, (size_t)(&((ControlPoint_Type*)0)->y), NULL, 0 }, // EffectProperties.Path.Scale[].y + { TYPE_ARRAY, true, (size_t)(&((EffectPath_Type*)0)->Speed), CHILDREN(28), 1 }, // EffectProperties.Path.Speed + { TYPE_STRUCT, false, 1 * sizeof(ControlPoint_Type), CHILDREN(29), 2 }, // EffectProperties.Path.Speed[] + { TYPE_F32, false, (size_t)(&((ControlPoint_Type*)0)->x), NULL, 0 }, // EffectProperties.Path.Speed[].x + { TYPE_F32, false, (size_t)(&((ControlPoint_Type*)0)->y), NULL, 0 }, // EffectProperties.Path.Speed[].y + { TYPE_REF, false, (size_t)(&((ParametersStruct*)0)->JetFieldSampler), NULL, 0 }, // JetFieldSampler +}; + + +bool JetFieldSamplerEffect::mBuiltFlag = false; +NvParameterized::MutexType JetFieldSamplerEffect::mBuiltFlagMutex; + +JetFieldSamplerEffect::JetFieldSamplerEffect(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &JetFieldSamplerEffectFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +JetFieldSamplerEffect::~JetFieldSamplerEffect() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void JetFieldSamplerEffect::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->~JetFieldSamplerEffect(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* JetFieldSamplerEffect::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* JetFieldSamplerEffect::getParameterDefinitionTree(void) const +{ + JetFieldSamplerEffect* tmpParam = const_cast<JetFieldSamplerEffect*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType JetFieldSamplerEffect::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 JetFieldSamplerEffect::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 JetFieldSamplerEffect::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<JetFieldSamplerEffect::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ + +void JetFieldSamplerEffect::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 JetFieldSamplerEffect::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", "A jet field sampler effect", true); + ParamDefTable[0].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=1, longName="EffectProperties" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[1]; + ParamDef->init("EffectProperties", TYPE_STRUCT, "EffectProperties", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("READONLY", uint64_t(0), true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("READONLY", uint64_t(0), true); + HintTable[1].init("shortDescription", "Jet FS Properties", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=2, longName="EffectProperties.UserString" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[2]; + ParamDef->init("UserString", TYPE_STRING, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "An aribtrary user string that can be set by an artist/designer/programmer", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=3, longName="EffectProperties.Enable" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[3]; + ParamDef->init("Enable", TYPE_BOOL, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Whether or not this effect is to be initially enabled on startup", true); + ParamDefTable[3].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=4, longName="EffectProperties.Position" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[4]; + ParamDef->init("Position", TYPE_STRUCT, "TranslateObject", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "The position of this effect relative to the parent", true); + ParamDefTable[4].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=5, longName="EffectProperties.Position.TranslateX" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[5]; + ParamDef->init("TranslateX", 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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(500.000000000), true); + HintTable[2].init("min", double(-500.000000000), true); + ParamDefTable[5].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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(500.000000000), true); + HintTable[2].init("min", double(-500.000000000), true); + HintTable[3].init("shortDescription", "Nudge up to +/- one meter in each direction", true); + ParamDefTable[5].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=6, longName="EffectProperties.Position.TranslateY" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[6]; + ParamDef->init("TranslateY", 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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(500.000000000), true); + HintTable[2].init("min", double(-500.000000000), true); + ParamDefTable[6].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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(500.000000000), true); + HintTable[2].init("min", double(-500.000000000), true); + HintTable[3].init("shortDescription", "Nudge up to +/- one meter in each direction", true); + ParamDefTable[6].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=7, longName="EffectProperties.Position.TranslateZ" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[7]; + ParamDef->init("TranslateZ", 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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(500.000000000), true); + HintTable[2].init("min", double(-500.000000000), true); + ParamDefTable[7].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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(500.000000000), true); + HintTable[2].init("min", double(-500.000000000), true); + HintTable[3].init("shortDescription", "Nudge up to +/- one meter in each direction", true); + ParamDefTable[7].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=8, longName="EffectProperties.Orientation" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[8]; + ParamDef->init("Orientation", TYPE_STRUCT, "OrientObject", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "The orientation of this effect, relative to the parent orientation", true); + ParamDefTable[8].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=9, longName="EffectProperties.Orientation.RotateX" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[9]; + ParamDef->init("RotateX", 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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(360.000000000), true); + HintTable[2].init("min", double(0.000000000), true); + ParamDefTable[9].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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(360.000000000), true); + HintTable[2].init("min", double(0.000000000), true); + HintTable[3].init("shortDescription", "Rotate on the X axis (0-360 degrees)", true); + ParamDefTable[9].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=10, longName="EffectProperties.Orientation.RotateY" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[10]; + ParamDef->init("RotateY", 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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(360.000000000), true); + HintTable[2].init("min", double(0.000000000), true); + ParamDefTable[10].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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(360.000000000), true); + HintTable[2].init("min", double(0.000000000), true); + HintTable[3].init("shortDescription", "Rotate on the Y axis (0-360 degrees)", true); + ParamDefTable[10].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=11, longName="EffectProperties.Orientation.RotateZ" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[11]; + ParamDef->init("RotateZ", 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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(360.000000000), true); + HintTable[2].init("min", double(0.000000000), 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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(360.000000000), true); + HintTable[2].init("min", double(0.000000000), true); + HintTable[3].init("shortDescription", "Rotate on the Z axis (0-360 degrees)", true); + ParamDefTable[11].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=12, longName="EffectProperties.InitialDelayTime" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[12]; + ParamDef->init("InitialDelayTime", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("min", double(0.000000000), 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("min", double(0.000000000), true); + HintTable[1].init("shortDescription", "Initial time to delay before spawning this effect", true); + ParamDefTable[12].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=13, longName="EffectProperties.Duration" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[13]; + ParamDef->init("Duration", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("min", double(0.000000000), true); + ParamDefTable[13].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("min", double(0.000000000), true); + HintTable[1].init("shortDescription", "The duration of the effect in secontds", true); + ParamDefTable[13].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=14, longName="EffectProperties.RepeatCount" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[14]; + ParamDef->init("RepeatCount", TYPE_U32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("min", uint64_t(1), 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("min", uint64_t(1), true); + HintTable[1].init("shortDescription", "The number of times to repeat the effect; 9999 means repeate forever", true); + ParamDefTable[14].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=15, longName="EffectProperties.RepeatDelay" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[15]; + ParamDef->init("RepeatDelay", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("min", double(0.000000000), 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("min", double(0.000000000), true); + HintTable[1].init("shortDescription", "The time to delay activation each time the effect repeats in seconds; this can be different than the initial delay time", true); + ParamDefTable[15].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=16, longName="EffectProperties.RandomizeRepeatTime" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[16]; + ParamDef->init("RandomizeRepeatTime", 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", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), 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("max", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + HintTable[2].init("shortDescription", "Amount of randomization to the repeat cycle; a value of zero (default) means no random and a value of one means completely random.", true); + ParamDefTable[16].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=17, longName="EffectProperties.Path" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[17]; + ParamDef->init("Path", TYPE_STRUCT, "EffectPath", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "An optional pre-defined path for this effect to travel on", true); + ParamDefTable[17].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=18, longName="EffectProperties.Path.PlaybackMode" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[18]; + ParamDef->init("PlaybackMode", TYPE_ENUM, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "The mode to play back the path", true); + ParamDefTable[18].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + static const char* const EnumVals[] = { "LOOP", "PLAY_ONCE", "PING_PONG" }; + ParamDefTable[18].setEnumVals((const char**)EnumVals, 3); + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=19, longName="EffectProperties.Path.PathDuration" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[19]; + ParamDef->init("PathDuration", 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", double(1000.000000000), true); + HintTable[1].init("min", double(0.000010000), true); + ParamDefTable[19].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", double(1000.000000000), true); + HintTable[1].init("min", double(0.000010000), true); + HintTable[2].init("shortDescription", "The duration of the path if one is not otherwise provided", true); + ParamDefTable[19].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=20, longName="EffectProperties.Path.LoopIndex" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[20]; + ParamDef->init("LoopIndex", TYPE_U32, 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[20].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("min", uint64_t(0), true); + HintTable[1].init("shortDescription", "The array index to loop back to", true); + ParamDefTable[20].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=21, longName="EffectProperties.Path.ControlPoints" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[21]; + ParamDef->init("ControlPoints", TYPE_ARRAY, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("editorCurve", uint64_t(1), true); + HintTable[2].init("pathEditor", uint64_t(1), 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("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("editorCurve", uint64_t(1), true); + HintTable[2].init("pathEditor", uint64_t(1), true); + HintTable[3].init("shortDescription", "The array of control points to fit the curve to", true); + ParamDefTable[21].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + ParamDef->setArraySize(-1); + } + + // Initialize DefinitionImpl node: nodeIndex=22, longName="EffectProperties.Path.ControlPoints[]" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[22]; + ParamDef->init("ControlPoints", TYPE_TRANSFORM, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("editorCurve", uint64_t(1), true); + HintTable[2].init("pathEditor", uint64_t(1), 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("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("editorCurve", uint64_t(1), true); + HintTable[2].init("pathEditor", uint64_t(1), true); + HintTable[3].init("shortDescription", "The array of control points to fit the curve to", true); + ParamDefTable[22].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=23, longName="EffectProperties.Path.Scale" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[23]; + ParamDef->init("Scale", TYPE_ARRAY, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("xAxisLabel", "Over Time", true); + HintTable[4].init("yAxisLabel", "Scale", true); + ParamDefTable[23].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#else + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("shortDescription", "The array of scale values over time", true); + HintTable[4].init("xAxisLabel", "Over Time", true); + HintTable[5].init("yAxisLabel", "Scale", true); + ParamDefTable[23].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + ParamDef->setArraySize(-1); + } + + // Initialize DefinitionImpl node: nodeIndex=24, longName="EffectProperties.Path.Scale[]" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[24]; + ParamDef->init("Scale", TYPE_STRUCT, "ControlPoint", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("xAxisLabel", "Over Time", true); + HintTable[4].init("yAxisLabel", "Scale", true); + ParamDefTable[24].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#else + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("shortDescription", "The array of scale values over time", true); + HintTable[4].init("xAxisLabel", "Over Time", true); + HintTable[5].init("yAxisLabel", "Scale", true); + ParamDefTable[24].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=25, longName="EffectProperties.Path.Scale[].x" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[25]; + 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", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), 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("max", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + HintTable[2].init("shortDescription", "The x-axis value for this vector", true); + ParamDefTable[25].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=26, longName="EffectProperties.Path.Scale[].y" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[26]; + 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", "The y-axis value for this vector", true); + ParamDefTable[26].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=27, longName="EffectProperties.Path.Speed" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[27]; + ParamDef->init("Speed", TYPE_ARRAY, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("xAxisLabel", "Over Time", true); + HintTable[4].init("yAxisLabel", "Speed", true); + ParamDefTable[27].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#else + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("shortDescription", "The array of speed values over time", true); + HintTable[4].init("xAxisLabel", "Over Time", true); + HintTable[5].init("yAxisLabel", "Speed", true); + ParamDefTable[27].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + ParamDef->setArraySize(-1); + } + + // Initialize DefinitionImpl node: nodeIndex=28, longName="EffectProperties.Path.Speed[]" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[28]; + ParamDef->init("Speed", TYPE_STRUCT, "ControlPoint", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("xAxisLabel", "Over Time", true); + HintTable[4].init("yAxisLabel", "Speed", true); + ParamDefTable[28].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#else + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("shortDescription", "The array of speed values over time", true); + HintTable[4].init("xAxisLabel", "Over Time", true); + HintTable[5].init("yAxisLabel", "Speed", true); + ParamDefTable[28].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=29, longName="EffectProperties.Path.Speed[].x" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[29]; + 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", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + ParamDefTable[29].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", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + HintTable[2].init("shortDescription", "The x-axis value for this vector", true); + ParamDefTable[29].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=30, longName="EffectProperties.Path.Speed[].y" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[30]; + 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", "The y-axis value for this vector", true); + ParamDefTable[30].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=31, longName="JetFieldSampler" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[31]; + ParamDef->init("JetFieldSampler", TYPE_REF, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Jet FS Asset", true); + ParamDefTable[31].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + static const char* const RefVariantVals[] = { "JetFSAsset" }; + ParamDefTable[31].setRefVariantVals((const char**)RefVariantVals, 1); + + + + } + + // SetChildren for: nodeIndex=0, longName="" + { + static Definition* Children[2]; + Children[0] = PDEF_PTR(1); + Children[1] = PDEF_PTR(31); + + ParamDefTable[0].setChildren(Children, 2); + } + + // SetChildren for: nodeIndex=1, longName="EffectProperties" + { + static Definition* Children[10]; + Children[0] = PDEF_PTR(2); + Children[1] = PDEF_PTR(3); + Children[2] = PDEF_PTR(4); + Children[3] = PDEF_PTR(8); + Children[4] = PDEF_PTR(12); + Children[5] = PDEF_PTR(13); + Children[6] = PDEF_PTR(14); + Children[7] = PDEF_PTR(15); + Children[8] = PDEF_PTR(16); + Children[9] = PDEF_PTR(17); + + ParamDefTable[1].setChildren(Children, 10); + } + + // SetChildren for: nodeIndex=4, longName="EffectProperties.Position" + { + static Definition* Children[3]; + Children[0] = PDEF_PTR(5); + Children[1] = PDEF_PTR(6); + Children[2] = PDEF_PTR(7); + + ParamDefTable[4].setChildren(Children, 3); + } + + // SetChildren for: nodeIndex=8, longName="EffectProperties.Orientation" + { + static Definition* Children[3]; + Children[0] = PDEF_PTR(9); + Children[1] = PDEF_PTR(10); + Children[2] = PDEF_PTR(11); + + ParamDefTable[8].setChildren(Children, 3); + } + + // SetChildren for: nodeIndex=17, longName="EffectProperties.Path" + { + static Definition* Children[6]; + Children[0] = PDEF_PTR(18); + Children[1] = PDEF_PTR(19); + Children[2] = PDEF_PTR(20); + Children[3] = PDEF_PTR(21); + Children[4] = PDEF_PTR(23); + Children[5] = PDEF_PTR(27); + + ParamDefTable[17].setChildren(Children, 6); + } + + // SetChildren for: nodeIndex=21, longName="EffectProperties.Path.ControlPoints" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(22); + + ParamDefTable[21].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=23, longName="EffectProperties.Path.Scale" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(24); + + ParamDefTable[23].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=24, longName="EffectProperties.Path.Scale[]" + { + static Definition* Children[2]; + Children[0] = PDEF_PTR(25); + Children[1] = PDEF_PTR(26); + + ParamDefTable[24].setChildren(Children, 2); + } + + // SetChildren for: nodeIndex=27, longName="EffectProperties.Path.Speed" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(28); + + ParamDefTable[27].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=28, longName="EffectProperties.Path.Speed[]" + { + static Definition* Children[2]; + Children[0] = PDEF_PTR(29); + Children[1] = PDEF_PTR(30); + + ParamDefTable[28].setChildren(Children, 2); + } + + mBuiltFlag = true; + +} +void JetFieldSamplerEffect::initStrings(void) +{ + EffectProperties.UserString.isAllocated = true; + EffectProperties.UserString.buf = NULL; +} + +void JetFieldSamplerEffect::initDynamicArrays(void) +{ + EffectProperties.Path.ControlPoints.buf = NULL; + EffectProperties.Path.ControlPoints.isAllocated = true; + EffectProperties.Path.ControlPoints.elementSize = sizeof(physx::PxTransform); + EffectProperties.Path.ControlPoints.arraySizes[0] = 0; + EffectProperties.Path.Scale.buf = NULL; + EffectProperties.Path.Scale.isAllocated = true; + EffectProperties.Path.Scale.elementSize = sizeof(ControlPoint_Type); + EffectProperties.Path.Scale.arraySizes[0] = 0; + EffectProperties.Path.Speed.buf = NULL; + EffectProperties.Path.Speed.isAllocated = true; + EffectProperties.Path.Speed.elementSize = sizeof(ControlPoint_Type); + EffectProperties.Path.Speed.arraySizes[0] = 0; +} + +void JetFieldSamplerEffect::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + EffectProperties.Enable = bool(1); + EffectProperties.Position.TranslateX = float(0.000000000); + EffectProperties.Position.TranslateY = float(0.000000000); + EffectProperties.Position.TranslateZ = float(0.000000000); + EffectProperties.Orientation.RotateX = float(0.000000000); + EffectProperties.Orientation.RotateY = float(0.000000000); + EffectProperties.Orientation.RotateZ = float(0.000000000); + EffectProperties.InitialDelayTime = float(0.000000000); + EffectProperties.Duration = float(0.000000000); + EffectProperties.RepeatCount = uint32_t(1); + EffectProperties.RepeatDelay = float(0.000000000); + EffectProperties.RandomizeRepeatTime = float(0.000000000); + EffectProperties.Path.PlaybackMode = (const char*)"LOOP"; + EffectProperties.Path.PathDuration = float(4.000000000); + EffectProperties.Path.LoopIndex = uint32_t(0); + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void JetFieldSamplerEffect::initReferences(void) +{ + JetFieldSampler = NULL; + +} + +void JetFieldSamplerEffect::freeDynamicArrays(void) +{ + if (EffectProperties.Path.ControlPoints.isAllocated && EffectProperties.Path.ControlPoints.buf) + { + mParameterizedTraits->free(EffectProperties.Path.ControlPoints.buf); + } + if (EffectProperties.Path.Scale.isAllocated && EffectProperties.Path.Scale.buf) + { + mParameterizedTraits->free(EffectProperties.Path.Scale.buf); + } + if (EffectProperties.Path.Speed.isAllocated && EffectProperties.Path.Speed.buf) + { + mParameterizedTraits->free(EffectProperties.Path.Speed.buf); + } +} + +void JetFieldSamplerEffect::freeStrings(void) +{ + + if (EffectProperties.UserString.isAllocated && EffectProperties.UserString.buf) + { + mParameterizedTraits->strfree((char*)EffectProperties.UserString.buf); + } +} + +void JetFieldSamplerEffect::freeReferences(void) +{ + if (JetFieldSampler) + { + JetFieldSampler->destroy(); + } + +} + +} // namespace particles +} // namespace nvidia diff --git a/APEX_1.4/module/particles/src/autogen/NoiseFieldSamplerData.cpp b/APEX_1.4/module/particles/src/autogen/NoiseFieldSamplerData.cpp new file mode 100644 index 00000000..ca78ce4a --- /dev/null +++ b/APEX_1.4/module/particles/src/autogen/NoiseFieldSamplerData.cpp @@ -0,0 +1,363 @@ +// 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 "NoiseFieldSamplerData.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace particles +{ + +using namespace NoiseFieldSamplerDataNS; + +const char* const NoiseFieldSamplerDataFactory::vptr = + NvParameterized::getVptr<NoiseFieldSamplerData, NoiseFieldSamplerData::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_STRING, false, (size_t)(&((ParametersStruct*)0)->Name), NULL, 0 }, // Name + { TYPE_REF, false, (size_t)(&((ParametersStruct*)0)->NoiseFieldSampler), NULL, 0 }, // NoiseFieldSampler +}; + + +bool NoiseFieldSamplerData::mBuiltFlag = false; +NvParameterized::MutexType NoiseFieldSamplerData::mBuiltFlagMutex; + +NoiseFieldSamplerData::NoiseFieldSamplerData(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &NoiseFieldSamplerDataFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +NoiseFieldSamplerData::~NoiseFieldSamplerData() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void NoiseFieldSamplerData::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->~NoiseFieldSamplerData(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* NoiseFieldSamplerData::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* NoiseFieldSamplerData::getParameterDefinitionTree(void) const +{ + NoiseFieldSamplerData* tmpParam = const_cast<NoiseFieldSamplerData*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType NoiseFieldSamplerData::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 NoiseFieldSamplerData::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 NoiseFieldSamplerData::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<NoiseFieldSamplerData::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ + +void NoiseFieldSamplerData::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 NoiseFieldSamplerData::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", "Contains the asset properties for this noise field sampler", true); + ParamDefTable[0].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=1, longName="Name" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[1]; + ParamDef->init("Name", TYPE_STRING, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Noise FS Name", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=2, longName="NoiseFieldSampler" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[2]; + ParamDef->init("NoiseFieldSampler", 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[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("INCLUDED", uint64_t(1), true); + HintTable[1].init("shortDescription", "Noise FS properties", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + static const char* const RefVariantVals[] = { "NoiseFSAssetParams" }; + ParamDefTable[2].setRefVariantVals((const char**)RefVariantVals, 1); + + + + } + + // 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 NoiseFieldSamplerData::initStrings(void) +{ + Name.isAllocated = false; + Name.buf = (const char*)"defaultNoiseFieldSampler"; +} + +void NoiseFieldSamplerData::initDynamicArrays(void) +{ +} + +void NoiseFieldSamplerData::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void NoiseFieldSamplerData::initReferences(void) +{ + NoiseFieldSampler = NULL; + +} + +void NoiseFieldSamplerData::freeDynamicArrays(void) +{ +} + +void NoiseFieldSamplerData::freeStrings(void) +{ + + if (Name.isAllocated && Name.buf) + { + mParameterizedTraits->strfree((char*)Name.buf); + } +} + +void NoiseFieldSamplerData::freeReferences(void) +{ + if (NoiseFieldSampler) + { + NoiseFieldSampler->destroy(); + } + +} + +} // namespace particles +} // namespace nvidia diff --git a/APEX_1.4/module/particles/src/autogen/NoiseFieldSamplerEffect.cpp b/APEX_1.4/module/particles/src/autogen/NoiseFieldSamplerEffect.cpp new file mode 100644 index 00000000..99a0cf62 --- /dev/null +++ b/APEX_1.4/module/particles/src/autogen/NoiseFieldSamplerEffect.cpp @@ -0,0 +1,1362 @@ +// 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 "NoiseFieldSamplerEffect.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace particles +{ + +using namespace NoiseFieldSamplerEffectNS; + +const char* const NoiseFieldSamplerEffectFactory::vptr = + NvParameterized::getVptr<NoiseFieldSamplerEffect, NoiseFieldSamplerEffect::ClassAlignment>(); + +const uint32_t NumParamDefs = 32; +static NvParameterized::DefinitionImpl* ParamDefTable; // now allocated in buildTree [NumParamDefs]; + + +static const size_t ParamLookupChildrenTable[] = +{ + 1, 31, 2, 3, 4, 8, 12, 13, 14, 15, 16, 17, 5, 6, 7, 9, 10, 11, 18, 19, 20, 21, 23, + 27, 22, 24, 25, 26, 28, 29, 30, +}; + +#define TENUM(type) nvidia::##type +#define CHILDREN(index) &ParamLookupChildrenTable[index] +static const NvParameterized::ParamLookupNode ParamLookupTable[NumParamDefs] = +{ + { TYPE_STRUCT, false, 0, CHILDREN(0), 2 }, + { TYPE_STRUCT, false, (size_t)(&((ParametersStruct*)0)->EffectProperties), CHILDREN(2), 10 }, // EffectProperties + { TYPE_STRING, false, (size_t)(&((EffectProperties_Type*)0)->UserString), NULL, 0 }, // EffectProperties.UserString + { TYPE_BOOL, false, (size_t)(&((EffectProperties_Type*)0)->Enable), NULL, 0 }, // EffectProperties.Enable + { TYPE_STRUCT, false, (size_t)(&((EffectProperties_Type*)0)->Position), CHILDREN(12), 3 }, // EffectProperties.Position + { TYPE_F32, false, (size_t)(&((TranslateObject_Type*)0)->TranslateX), NULL, 0 }, // EffectProperties.Position.TranslateX + { TYPE_F32, false, (size_t)(&((TranslateObject_Type*)0)->TranslateY), NULL, 0 }, // EffectProperties.Position.TranslateY + { TYPE_F32, false, (size_t)(&((TranslateObject_Type*)0)->TranslateZ), NULL, 0 }, // EffectProperties.Position.TranslateZ + { TYPE_STRUCT, false, (size_t)(&((EffectProperties_Type*)0)->Orientation), CHILDREN(15), 3 }, // EffectProperties.Orientation + { TYPE_F32, false, (size_t)(&((OrientObject_Type*)0)->RotateX), NULL, 0 }, // EffectProperties.Orientation.RotateX + { TYPE_F32, false, (size_t)(&((OrientObject_Type*)0)->RotateY), NULL, 0 }, // EffectProperties.Orientation.RotateY + { TYPE_F32, false, (size_t)(&((OrientObject_Type*)0)->RotateZ), NULL, 0 }, // EffectProperties.Orientation.RotateZ + { TYPE_F32, false, (size_t)(&((EffectProperties_Type*)0)->InitialDelayTime), NULL, 0 }, // EffectProperties.InitialDelayTime + { TYPE_F32, false, (size_t)(&((EffectProperties_Type*)0)->Duration), NULL, 0 }, // EffectProperties.Duration + { TYPE_U32, false, (size_t)(&((EffectProperties_Type*)0)->RepeatCount), NULL, 0 }, // EffectProperties.RepeatCount + { TYPE_F32, false, (size_t)(&((EffectProperties_Type*)0)->RepeatDelay), NULL, 0 }, // EffectProperties.RepeatDelay + { TYPE_F32, false, (size_t)(&((EffectProperties_Type*)0)->RandomizeRepeatTime), NULL, 0 }, // EffectProperties.RandomizeRepeatTime + { TYPE_STRUCT, false, (size_t)(&((EffectProperties_Type*)0)->Path), CHILDREN(18), 6 }, // EffectProperties.Path + { TYPE_ENUM, false, (size_t)(&((EffectPath_Type*)0)->PlaybackMode), NULL, 0 }, // EffectProperties.Path.PlaybackMode + { TYPE_F32, false, (size_t)(&((EffectPath_Type*)0)->PathDuration), NULL, 0 }, // EffectProperties.Path.PathDuration + { TYPE_U32, false, (size_t)(&((EffectPath_Type*)0)->LoopIndex), NULL, 0 }, // EffectProperties.Path.LoopIndex + { TYPE_ARRAY, true, (size_t)(&((EffectPath_Type*)0)->ControlPoints), CHILDREN(24), 1 }, // EffectProperties.Path.ControlPoints + { TYPE_TRANSFORM, false, 1 * sizeof(physx::PxTransform), NULL, 0 }, // EffectProperties.Path.ControlPoints[] + { TYPE_ARRAY, true, (size_t)(&((EffectPath_Type*)0)->Scale), CHILDREN(25), 1 }, // EffectProperties.Path.Scale + { TYPE_STRUCT, false, 1 * sizeof(ControlPoint_Type), CHILDREN(26), 2 }, // EffectProperties.Path.Scale[] + { TYPE_F32, false, (size_t)(&((ControlPoint_Type*)0)->x), NULL, 0 }, // EffectProperties.Path.Scale[].x + { TYPE_F32, false, (size_t)(&((ControlPoint_Type*)0)->y), NULL, 0 }, // EffectProperties.Path.Scale[].y + { TYPE_ARRAY, true, (size_t)(&((EffectPath_Type*)0)->Speed), CHILDREN(28), 1 }, // EffectProperties.Path.Speed + { TYPE_STRUCT, false, 1 * sizeof(ControlPoint_Type), CHILDREN(29), 2 }, // EffectProperties.Path.Speed[] + { TYPE_F32, false, (size_t)(&((ControlPoint_Type*)0)->x), NULL, 0 }, // EffectProperties.Path.Speed[].x + { TYPE_F32, false, (size_t)(&((ControlPoint_Type*)0)->y), NULL, 0 }, // EffectProperties.Path.Speed[].y + { TYPE_REF, false, (size_t)(&((ParametersStruct*)0)->NoiseFieldSampler), NULL, 0 }, // NoiseFieldSampler +}; + + +bool NoiseFieldSamplerEffect::mBuiltFlag = false; +NvParameterized::MutexType NoiseFieldSamplerEffect::mBuiltFlagMutex; + +NoiseFieldSamplerEffect::NoiseFieldSamplerEffect(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &NoiseFieldSamplerEffectFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +NoiseFieldSamplerEffect::~NoiseFieldSamplerEffect() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void NoiseFieldSamplerEffect::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->~NoiseFieldSamplerEffect(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* NoiseFieldSamplerEffect::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* NoiseFieldSamplerEffect::getParameterDefinitionTree(void) const +{ + NoiseFieldSamplerEffect* tmpParam = const_cast<NoiseFieldSamplerEffect*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType NoiseFieldSamplerEffect::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 NoiseFieldSamplerEffect::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 NoiseFieldSamplerEffect::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<NoiseFieldSamplerEffect::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ + +void NoiseFieldSamplerEffect::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 NoiseFieldSamplerEffect::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", "A noise field sampler effect", true); + ParamDefTable[0].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=1, longName="EffectProperties" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[1]; + ParamDef->init("EffectProperties", TYPE_STRUCT, "EffectProperties", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("READONLY", uint64_t(0), true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("READONLY", uint64_t(0), true); + HintTable[1].init("shortDescription", "Noise FS Properties", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=2, longName="EffectProperties.UserString" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[2]; + ParamDef->init("UserString", TYPE_STRING, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "An aribtrary user string that can be set by an artist/designer/programmer", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=3, longName="EffectProperties.Enable" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[3]; + ParamDef->init("Enable", TYPE_BOOL, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Whether or not this effect is to be initially enabled on startup", true); + ParamDefTable[3].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=4, longName="EffectProperties.Position" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[4]; + ParamDef->init("Position", TYPE_STRUCT, "TranslateObject", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "The position of this effect relative to the parent", true); + ParamDefTable[4].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=5, longName="EffectProperties.Position.TranslateX" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[5]; + ParamDef->init("TranslateX", 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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(500.000000000), true); + HintTable[2].init("min", double(-500.000000000), true); + ParamDefTable[5].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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(500.000000000), true); + HintTable[2].init("min", double(-500.000000000), true); + HintTable[3].init("shortDescription", "Nudge up to +/- one meter in each direction", true); + ParamDefTable[5].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=6, longName="EffectProperties.Position.TranslateY" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[6]; + ParamDef->init("TranslateY", 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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(500.000000000), true); + HintTable[2].init("min", double(-500.000000000), true); + ParamDefTable[6].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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(500.000000000), true); + HintTable[2].init("min", double(-500.000000000), true); + HintTable[3].init("shortDescription", "Nudge up to +/- one meter in each direction", true); + ParamDefTable[6].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=7, longName="EffectProperties.Position.TranslateZ" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[7]; + ParamDef->init("TranslateZ", 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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(500.000000000), true); + HintTable[2].init("min", double(-500.000000000), true); + ParamDefTable[7].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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(500.000000000), true); + HintTable[2].init("min", double(-500.000000000), true); + HintTable[3].init("shortDescription", "Nudge up to +/- one meter in each direction", true); + ParamDefTable[7].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=8, longName="EffectProperties.Orientation" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[8]; + ParamDef->init("Orientation", TYPE_STRUCT, "OrientObject", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "The orientation of this effect, relative to the parent orientation", true); + ParamDefTable[8].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=9, longName="EffectProperties.Orientation.RotateX" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[9]; + ParamDef->init("RotateX", 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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(360.000000000), true); + HintTable[2].init("min", double(0.000000000), true); + ParamDefTable[9].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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(360.000000000), true); + HintTable[2].init("min", double(0.000000000), true); + HintTable[3].init("shortDescription", "Rotate on the X axis (0-360 degrees)", true); + ParamDefTable[9].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=10, longName="EffectProperties.Orientation.RotateY" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[10]; + ParamDef->init("RotateY", 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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(360.000000000), true); + HintTable[2].init("min", double(0.000000000), true); + ParamDefTable[10].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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(360.000000000), true); + HintTable[2].init("min", double(0.000000000), true); + HintTable[3].init("shortDescription", "Rotate on the Y axis (0-360 degrees)", true); + ParamDefTable[10].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=11, longName="EffectProperties.Orientation.RotateZ" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[11]; + ParamDef->init("RotateZ", 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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(360.000000000), true); + HintTable[2].init("min", double(0.000000000), 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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(360.000000000), true); + HintTable[2].init("min", double(0.000000000), true); + HintTable[3].init("shortDescription", "Rotate on the Z axis (0-360 degrees)", true); + ParamDefTable[11].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=12, longName="EffectProperties.InitialDelayTime" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[12]; + ParamDef->init("InitialDelayTime", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("min", double(0.000000000), 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("min", double(0.000000000), true); + HintTable[1].init("shortDescription", "Initial time to delay before spawning this effect", true); + ParamDefTable[12].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=13, longName="EffectProperties.Duration" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[13]; + ParamDef->init("Duration", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("min", double(0.000000000), true); + ParamDefTable[13].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("min", double(0.000000000), true); + HintTable[1].init("shortDescription", "The duration of the effect in secontds", true); + ParamDefTable[13].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=14, longName="EffectProperties.RepeatCount" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[14]; + ParamDef->init("RepeatCount", TYPE_U32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("min", uint64_t(1), 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("min", uint64_t(1), true); + HintTable[1].init("shortDescription", "The number of times to repeat the effect; 9999 means repeate forever", true); + ParamDefTable[14].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=15, longName="EffectProperties.RepeatDelay" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[15]; + ParamDef->init("RepeatDelay", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("min", double(0.000000000), 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("min", double(0.000000000), true); + HintTable[1].init("shortDescription", "The time to delay activation each time the effect repeats in seconds; this can be different than the initial delay time", true); + ParamDefTable[15].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=16, longName="EffectProperties.RandomizeRepeatTime" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[16]; + ParamDef->init("RandomizeRepeatTime", 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", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), 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("max", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + HintTable[2].init("shortDescription", "Amount of randomization to the repeat cycle; a value of zero (default) means no random and a value of one means completely random.", true); + ParamDefTable[16].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=17, longName="EffectProperties.Path" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[17]; + ParamDef->init("Path", TYPE_STRUCT, "EffectPath", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "An optional pre-defined path for this effect to travel on", true); + ParamDefTable[17].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=18, longName="EffectProperties.Path.PlaybackMode" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[18]; + ParamDef->init("PlaybackMode", TYPE_ENUM, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "The mode to play back the path", true); + ParamDefTable[18].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + static const char* const EnumVals[] = { "LOOP", "PLAY_ONCE", "PING_PONG" }; + ParamDefTable[18].setEnumVals((const char**)EnumVals, 3); + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=19, longName="EffectProperties.Path.PathDuration" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[19]; + ParamDef->init("PathDuration", 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", double(1000.000000000), true); + HintTable[1].init("min", double(0.000010000), true); + ParamDefTable[19].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", double(1000.000000000), true); + HintTable[1].init("min", double(0.000010000), true); + HintTable[2].init("shortDescription", "The duration of the path if one is not otherwise provided", true); + ParamDefTable[19].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=20, longName="EffectProperties.Path.LoopIndex" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[20]; + ParamDef->init("LoopIndex", TYPE_U32, 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[20].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("min", uint64_t(0), true); + HintTable[1].init("shortDescription", "The array index to loop back to", true); + ParamDefTable[20].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=21, longName="EffectProperties.Path.ControlPoints" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[21]; + ParamDef->init("ControlPoints", TYPE_ARRAY, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("editorCurve", uint64_t(1), true); + HintTable[2].init("pathEditor", uint64_t(1), 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("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("editorCurve", uint64_t(1), true); + HintTable[2].init("pathEditor", uint64_t(1), true); + HintTable[3].init("shortDescription", "The array of control points to fit the curve to", true); + ParamDefTable[21].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + ParamDef->setArraySize(-1); + } + + // Initialize DefinitionImpl node: nodeIndex=22, longName="EffectProperties.Path.ControlPoints[]" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[22]; + ParamDef->init("ControlPoints", TYPE_TRANSFORM, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("editorCurve", uint64_t(1), true); + HintTable[2].init("pathEditor", uint64_t(1), 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("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("editorCurve", uint64_t(1), true); + HintTable[2].init("pathEditor", uint64_t(1), true); + HintTable[3].init("shortDescription", "The array of control points to fit the curve to", true); + ParamDefTable[22].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=23, longName="EffectProperties.Path.Scale" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[23]; + ParamDef->init("Scale", TYPE_ARRAY, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("xAxisLabel", "Over Time", true); + HintTable[4].init("yAxisLabel", "Scale", true); + ParamDefTable[23].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#else + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("shortDescription", "The array of scale values over time", true); + HintTable[4].init("xAxisLabel", "Over Time", true); + HintTable[5].init("yAxisLabel", "Scale", true); + ParamDefTable[23].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + ParamDef->setArraySize(-1); + } + + // Initialize DefinitionImpl node: nodeIndex=24, longName="EffectProperties.Path.Scale[]" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[24]; + ParamDef->init("Scale", TYPE_STRUCT, "ControlPoint", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("xAxisLabel", "Over Time", true); + HintTable[4].init("yAxisLabel", "Scale", true); + ParamDefTable[24].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#else + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("shortDescription", "The array of scale values over time", true); + HintTable[4].init("xAxisLabel", "Over Time", true); + HintTable[5].init("yAxisLabel", "Scale", true); + ParamDefTable[24].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=25, longName="EffectProperties.Path.Scale[].x" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[25]; + 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", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), 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("max", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + HintTable[2].init("shortDescription", "The x-axis value for this vector", true); + ParamDefTable[25].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=26, longName="EffectProperties.Path.Scale[].y" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[26]; + 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", "The y-axis value for this vector", true); + ParamDefTable[26].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=27, longName="EffectProperties.Path.Speed" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[27]; + ParamDef->init("Speed", TYPE_ARRAY, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("xAxisLabel", "Over Time", true); + HintTable[4].init("yAxisLabel", "Speed", true); + ParamDefTable[27].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#else + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("shortDescription", "The array of speed values over time", true); + HintTable[4].init("xAxisLabel", "Over Time", true); + HintTable[5].init("yAxisLabel", "Speed", true); + ParamDefTable[27].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + ParamDef->setArraySize(-1); + } + + // Initialize DefinitionImpl node: nodeIndex=28, longName="EffectProperties.Path.Speed[]" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[28]; + ParamDef->init("Speed", TYPE_STRUCT, "ControlPoint", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("xAxisLabel", "Over Time", true); + HintTable[4].init("yAxisLabel", "Speed", true); + ParamDefTable[28].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#else + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("shortDescription", "The array of speed values over time", true); + HintTable[4].init("xAxisLabel", "Over Time", true); + HintTable[5].init("yAxisLabel", "Speed", true); + ParamDefTable[28].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=29, longName="EffectProperties.Path.Speed[].x" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[29]; + 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", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + ParamDefTable[29].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", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + HintTable[2].init("shortDescription", "The x-axis value for this vector", true); + ParamDefTable[29].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=30, longName="EffectProperties.Path.Speed[].y" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[30]; + 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", "The y-axis value for this vector", true); + ParamDefTable[30].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=31, longName="NoiseFieldSampler" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[31]; + ParamDef->init("NoiseFieldSampler", TYPE_REF, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Noise FS Asset", true); + ParamDefTable[31].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + static const char* const RefVariantVals[] = { "NoiseFSAsset" }; + ParamDefTable[31].setRefVariantVals((const char**)RefVariantVals, 1); + + + + } + + // SetChildren for: nodeIndex=0, longName="" + { + static Definition* Children[2]; + Children[0] = PDEF_PTR(1); + Children[1] = PDEF_PTR(31); + + ParamDefTable[0].setChildren(Children, 2); + } + + // SetChildren for: nodeIndex=1, longName="EffectProperties" + { + static Definition* Children[10]; + Children[0] = PDEF_PTR(2); + Children[1] = PDEF_PTR(3); + Children[2] = PDEF_PTR(4); + Children[3] = PDEF_PTR(8); + Children[4] = PDEF_PTR(12); + Children[5] = PDEF_PTR(13); + Children[6] = PDEF_PTR(14); + Children[7] = PDEF_PTR(15); + Children[8] = PDEF_PTR(16); + Children[9] = PDEF_PTR(17); + + ParamDefTable[1].setChildren(Children, 10); + } + + // SetChildren for: nodeIndex=4, longName="EffectProperties.Position" + { + static Definition* Children[3]; + Children[0] = PDEF_PTR(5); + Children[1] = PDEF_PTR(6); + Children[2] = PDEF_PTR(7); + + ParamDefTable[4].setChildren(Children, 3); + } + + // SetChildren for: nodeIndex=8, longName="EffectProperties.Orientation" + { + static Definition* Children[3]; + Children[0] = PDEF_PTR(9); + Children[1] = PDEF_PTR(10); + Children[2] = PDEF_PTR(11); + + ParamDefTable[8].setChildren(Children, 3); + } + + // SetChildren for: nodeIndex=17, longName="EffectProperties.Path" + { + static Definition* Children[6]; + Children[0] = PDEF_PTR(18); + Children[1] = PDEF_PTR(19); + Children[2] = PDEF_PTR(20); + Children[3] = PDEF_PTR(21); + Children[4] = PDEF_PTR(23); + Children[5] = PDEF_PTR(27); + + ParamDefTable[17].setChildren(Children, 6); + } + + // SetChildren for: nodeIndex=21, longName="EffectProperties.Path.ControlPoints" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(22); + + ParamDefTable[21].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=23, longName="EffectProperties.Path.Scale" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(24); + + ParamDefTable[23].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=24, longName="EffectProperties.Path.Scale[]" + { + static Definition* Children[2]; + Children[0] = PDEF_PTR(25); + Children[1] = PDEF_PTR(26); + + ParamDefTable[24].setChildren(Children, 2); + } + + // SetChildren for: nodeIndex=27, longName="EffectProperties.Path.Speed" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(28); + + ParamDefTable[27].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=28, longName="EffectProperties.Path.Speed[]" + { + static Definition* Children[2]; + Children[0] = PDEF_PTR(29); + Children[1] = PDEF_PTR(30); + + ParamDefTable[28].setChildren(Children, 2); + } + + mBuiltFlag = true; + +} +void NoiseFieldSamplerEffect::initStrings(void) +{ + EffectProperties.UserString.isAllocated = true; + EffectProperties.UserString.buf = NULL; +} + +void NoiseFieldSamplerEffect::initDynamicArrays(void) +{ + EffectProperties.Path.ControlPoints.buf = NULL; + EffectProperties.Path.ControlPoints.isAllocated = true; + EffectProperties.Path.ControlPoints.elementSize = sizeof(physx::PxTransform); + EffectProperties.Path.ControlPoints.arraySizes[0] = 0; + EffectProperties.Path.Scale.buf = NULL; + EffectProperties.Path.Scale.isAllocated = true; + EffectProperties.Path.Scale.elementSize = sizeof(ControlPoint_Type); + EffectProperties.Path.Scale.arraySizes[0] = 0; + EffectProperties.Path.Speed.buf = NULL; + EffectProperties.Path.Speed.isAllocated = true; + EffectProperties.Path.Speed.elementSize = sizeof(ControlPoint_Type); + EffectProperties.Path.Speed.arraySizes[0] = 0; +} + +void NoiseFieldSamplerEffect::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + EffectProperties.Enable = bool(1); + EffectProperties.Position.TranslateX = float(0.000000000); + EffectProperties.Position.TranslateY = float(0.000000000); + EffectProperties.Position.TranslateZ = float(0.000000000); + EffectProperties.Orientation.RotateX = float(0.000000000); + EffectProperties.Orientation.RotateY = float(0.000000000); + EffectProperties.Orientation.RotateZ = float(0.000000000); + EffectProperties.InitialDelayTime = float(0.000000000); + EffectProperties.Duration = float(0.000000000); + EffectProperties.RepeatCount = uint32_t(1); + EffectProperties.RepeatDelay = float(0.000000000); + EffectProperties.RandomizeRepeatTime = float(0.000000000); + EffectProperties.Path.PlaybackMode = (const char*)"LOOP"; + EffectProperties.Path.PathDuration = float(4.000000000); + EffectProperties.Path.LoopIndex = uint32_t(0); + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void NoiseFieldSamplerEffect::initReferences(void) +{ + NoiseFieldSampler = NULL; + +} + +void NoiseFieldSamplerEffect::freeDynamicArrays(void) +{ + if (EffectProperties.Path.ControlPoints.isAllocated && EffectProperties.Path.ControlPoints.buf) + { + mParameterizedTraits->free(EffectProperties.Path.ControlPoints.buf); + } + if (EffectProperties.Path.Scale.isAllocated && EffectProperties.Path.Scale.buf) + { + mParameterizedTraits->free(EffectProperties.Path.Scale.buf); + } + if (EffectProperties.Path.Speed.isAllocated && EffectProperties.Path.Speed.buf) + { + mParameterizedTraits->free(EffectProperties.Path.Speed.buf); + } +} + +void NoiseFieldSamplerEffect::freeStrings(void) +{ + + if (EffectProperties.UserString.isAllocated && EffectProperties.UserString.buf) + { + mParameterizedTraits->strfree((char*)EffectProperties.UserString.buf); + } +} + +void NoiseFieldSamplerEffect::freeReferences(void) +{ + if (NoiseFieldSampler) + { + NoiseFieldSampler->destroy(); + } + +} + +} // namespace particles +} // namespace nvidia diff --git a/APEX_1.4/module/particles/src/autogen/ParticleSimulationData.cpp b/APEX_1.4/module/particles/src/autogen/ParticleSimulationData.cpp new file mode 100644 index 00000000..456f9503 --- /dev/null +++ b/APEX_1.4/module/particles/src/autogen/ParticleSimulationData.cpp @@ -0,0 +1,363 @@ +// 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 "ParticleSimulationData.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace particles +{ + +using namespace ParticleSimulationDataNS; + +const char* const ParticleSimulationDataFactory::vptr = + NvParameterized::getVptr<ParticleSimulationData, ParticleSimulationData::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_STRING, false, (size_t)(&((ParametersStruct*)0)->Name), NULL, 0 }, // Name + { TYPE_REF, false, (size_t)(&((ParametersStruct*)0)->IOS), NULL, 0 }, // IOS +}; + + +bool ParticleSimulationData::mBuiltFlag = false; +NvParameterized::MutexType ParticleSimulationData::mBuiltFlagMutex; + +ParticleSimulationData::ParticleSimulationData(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &ParticleSimulationDataFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +ParticleSimulationData::~ParticleSimulationData() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void ParticleSimulationData::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->~ParticleSimulationData(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* ParticleSimulationData::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* ParticleSimulationData::getParameterDefinitionTree(void) const +{ + ParticleSimulationData* tmpParam = const_cast<ParticleSimulationData*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType ParticleSimulationData::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 ParticleSimulationData::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 ParticleSimulationData::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<ParticleSimulationData::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ + +void ParticleSimulationData::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 ParticleSimulationData::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", "Contains the asset properties for this particle simulation (IOS)", true); + ParamDefTable[0].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=1, longName="Name" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[1]; + ParamDef->init("Name", TYPE_STRING, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Basic IOS Name", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=2, longName="IOS" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[2]; + ParamDef->init("IOS", 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[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("INCLUDED", uint64_t(1), true); + HintTable[1].init("shortDescription", "Basic IOS properties", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + static const char* const RefVariantVals[] = { "BasicIOSAssetParam", "ParticleIosAssetParam" }; + ParamDefTable[2].setRefVariantVals((const char**)RefVariantVals, 2); + + + + } + + // 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 ParticleSimulationData::initStrings(void) +{ + Name.isAllocated = false; + Name.buf = (const char*)"defaultBasicIOS"; +} + +void ParticleSimulationData::initDynamicArrays(void) +{ +} + +void ParticleSimulationData::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void ParticleSimulationData::initReferences(void) +{ + IOS = NULL; + +} + +void ParticleSimulationData::freeDynamicArrays(void) +{ +} + +void ParticleSimulationData::freeStrings(void) +{ + + if (Name.isAllocated && Name.buf) + { + mParameterizedTraits->strfree((char*)Name.buf); + } +} + +void ParticleSimulationData::freeReferences(void) +{ + if (IOS) + { + IOS->destroy(); + } + +} + +} // namespace particles +} // namespace nvidia diff --git a/APEX_1.4/module/particles/src/autogen/ParticlesDebugRenderParams.cpp b/APEX_1.4/module/particles/src/autogen/ParticlesDebugRenderParams.cpp new file mode 100644 index 00000000..f052ee11 --- /dev/null +++ b/APEX_1.4/module/particles/src/autogen/ParticlesDebugRenderParams.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 "ParticlesDebugRenderParams.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace particles +{ + +using namespace ParticlesDebugRenderParamsNS; + +const char* const ParticlesDebugRenderParamsFactory::vptr = + NvParameterized::getVptr<ParticlesDebugRenderParams, ParticlesDebugRenderParams::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_BOOL, false, (size_t)(&((ParametersStruct*)0)->VISUALIZE_HEAT_SOURCE_ACTOR), NULL, 0 }, // VISUALIZE_HEAT_SOURCE_ACTOR + { TYPE_BOOL, false, (size_t)(&((ParametersStruct*)0)->VISUALIZE_EFFECT_PACKAGE_ACTOR), NULL, 0 }, // VISUALIZE_EFFECT_PACKAGE_ACTOR +}; + + +bool ParticlesDebugRenderParams::mBuiltFlag = false; +NvParameterized::MutexType ParticlesDebugRenderParams::mBuiltFlagMutex; + +ParticlesDebugRenderParams::ParticlesDebugRenderParams(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &ParticlesDebugRenderParamsFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +ParticlesDebugRenderParams::~ParticlesDebugRenderParams() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void ParticlesDebugRenderParams::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->~ParticlesDebugRenderParams(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* ParticlesDebugRenderParams::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* ParticlesDebugRenderParams::getParameterDefinitionTree(void) const +{ + ParticlesDebugRenderParams* tmpParam = const_cast<ParticlesDebugRenderParams*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType ParticlesDebugRenderParams::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 ParticlesDebugRenderParams::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 ParticlesDebugRenderParams::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<ParticlesDebugRenderParams::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ + +void ParticlesDebugRenderParams::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 ParticlesDebugRenderParams::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="VISUALIZE_HEAT_SOURCE_ACTOR" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[1]; + ParamDef->init("VISUALIZE_HEAT_SOURCE_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", "This option allows user to enable or disable debug visualization of a heat source actor", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=2, longName="VISUALIZE_EFFECT_PACKAGE_ACTOR" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[2]; + ParamDef->init("VISUALIZE_EFFECT_PACKAGE_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", "This option allows user to enable or disable debug visualization of an effect package actor", 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 ParticlesDebugRenderParams::initStrings(void) +{ +} + +void ParticlesDebugRenderParams::initDynamicArrays(void) +{ +} + +void ParticlesDebugRenderParams::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + VISUALIZE_HEAT_SOURCE_ACTOR = bool(false); + VISUALIZE_EFFECT_PACKAGE_ACTOR = bool(false); + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void ParticlesDebugRenderParams::initReferences(void) +{ +} + +void ParticlesDebugRenderParams::freeDynamicArrays(void) +{ +} + +void ParticlesDebugRenderParams::freeStrings(void) +{ +} + +void ParticlesDebugRenderParams::freeReferences(void) +{ +} + +} // namespace particles +} // namespace nvidia diff --git a/APEX_1.4/module/particles/src/autogen/ParticlesModuleParameters.cpp b/APEX_1.4/module/particles/src/autogen/ParticlesModuleParameters.cpp new file mode 100644 index 00000000..382ede54 --- /dev/null +++ b/APEX_1.4/module/particles/src/autogen/ParticlesModuleParameters.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 "ParticlesModuleParameters.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace particles +{ + +using namespace ParticlesModuleParametersNS; + +const char* const ParticlesModuleParametersFactory::vptr = + NvParameterized::getVptr<ParticlesModuleParameters, ParticlesModuleParameters::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 ParticlesModuleParameters::mBuiltFlag = false; +NvParameterized::MutexType ParticlesModuleParameters::mBuiltFlagMutex; + +ParticlesModuleParameters::ParticlesModuleParameters(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &ParticlesModuleParametersFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +ParticlesModuleParameters::~ParticlesModuleParameters() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void ParticlesModuleParameters::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->~ParticlesModuleParameters(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* ParticlesModuleParameters::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* ParticlesModuleParameters::getParameterDefinitionTree(void) const +{ + ParticlesModuleParameters* tmpParam = const_cast<ParticlesModuleParameters*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType ParticlesModuleParameters::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 ParticlesModuleParameters::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 ParticlesModuleParameters::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<ParticlesModuleParameters::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ + +void ParticlesModuleParameters::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 ParticlesModuleParameters::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 ModuleParticles.", 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 ParticlesModuleParameters::initStrings(void) +{ +} + +void ParticlesModuleParameters::initDynamicArrays(void) +{ +} + +void ParticlesModuleParameters::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + unused = uint32_t(0); + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void ParticlesModuleParameters::initReferences(void) +{ +} + +void ParticlesModuleParameters::freeDynamicArrays(void) +{ +} + +void ParticlesModuleParameters::freeStrings(void) +{ +} + +void ParticlesModuleParameters::freeReferences(void) +{ +} + +} // namespace particles +} // namespace nvidia diff --git a/APEX_1.4/module/particles/src/autogen/RigidBodyEffect.cpp b/APEX_1.4/module/particles/src/autogen/RigidBodyEffect.cpp new file mode 100644 index 00000000..0f6a1a42 --- /dev/null +++ b/APEX_1.4/module/particles/src/autogen/RigidBodyEffect.cpp @@ -0,0 +1,1587 @@ +// 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 "RigidBodyEffect.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace particles +{ + +using namespace RigidBodyEffectNS; + +const char* const RigidBodyEffectFactory::vptr = + NvParameterized::getVptr<RigidBodyEffect, RigidBodyEffect::ClassAlignment>(); + +const uint32_t NumParamDefs = 41; +static NvParameterized::DefinitionImpl* ParamDefTable; // now allocated in buildTree [NumParamDefs]; + + +static const size_t ParamLookupChildrenTable[] = +{ + 1, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 2, 3, 4, 8, 12, 13, 14, 15, 16, 17, 5, + 6, 7, 9, 10, 11, 18, 19, 20, 21, 23, 27, 22, 24, 25, 26, 28, 29, 30, +}; + +#define TENUM(type) nvidia::##type +#define CHILDREN(index) &ParamLookupChildrenTable[index] +static const NvParameterized::ParamLookupNode ParamLookupTable[NumParamDefs] = +{ + { TYPE_STRUCT, false, 0, CHILDREN(0), 11 }, + { TYPE_STRUCT, false, (size_t)(&((ParametersStruct*)0)->EffectProperties), CHILDREN(11), 10 }, // EffectProperties + { TYPE_STRING, false, (size_t)(&((EffectProperties_Type*)0)->UserString), NULL, 0 }, // EffectProperties.UserString + { TYPE_BOOL, false, (size_t)(&((EffectProperties_Type*)0)->Enable), NULL, 0 }, // EffectProperties.Enable + { TYPE_STRUCT, false, (size_t)(&((EffectProperties_Type*)0)->Position), CHILDREN(21), 3 }, // EffectProperties.Position + { TYPE_F32, false, (size_t)(&((TranslateObject_Type*)0)->TranslateX), NULL, 0 }, // EffectProperties.Position.TranslateX + { TYPE_F32, false, (size_t)(&((TranslateObject_Type*)0)->TranslateY), NULL, 0 }, // EffectProperties.Position.TranslateY + { TYPE_F32, false, (size_t)(&((TranslateObject_Type*)0)->TranslateZ), NULL, 0 }, // EffectProperties.Position.TranslateZ + { TYPE_STRUCT, false, (size_t)(&((EffectProperties_Type*)0)->Orientation), CHILDREN(24), 3 }, // EffectProperties.Orientation + { TYPE_F32, false, (size_t)(&((OrientObject_Type*)0)->RotateX), NULL, 0 }, // EffectProperties.Orientation.RotateX + { TYPE_F32, false, (size_t)(&((OrientObject_Type*)0)->RotateY), NULL, 0 }, // EffectProperties.Orientation.RotateY + { TYPE_F32, false, (size_t)(&((OrientObject_Type*)0)->RotateZ), NULL, 0 }, // EffectProperties.Orientation.RotateZ + { TYPE_F32, false, (size_t)(&((EffectProperties_Type*)0)->InitialDelayTime), NULL, 0 }, // EffectProperties.InitialDelayTime + { TYPE_F32, false, (size_t)(&((EffectProperties_Type*)0)->Duration), NULL, 0 }, // EffectProperties.Duration + { TYPE_U32, false, (size_t)(&((EffectProperties_Type*)0)->RepeatCount), NULL, 0 }, // EffectProperties.RepeatCount + { TYPE_F32, false, (size_t)(&((EffectProperties_Type*)0)->RepeatDelay), NULL, 0 }, // EffectProperties.RepeatDelay + { TYPE_F32, false, (size_t)(&((EffectProperties_Type*)0)->RandomizeRepeatTime), NULL, 0 }, // EffectProperties.RandomizeRepeatTime + { TYPE_STRUCT, false, (size_t)(&((EffectProperties_Type*)0)->Path), CHILDREN(27), 6 }, // EffectProperties.Path + { TYPE_ENUM, false, (size_t)(&((EffectPath_Type*)0)->PlaybackMode), NULL, 0 }, // EffectProperties.Path.PlaybackMode + { TYPE_F32, false, (size_t)(&((EffectPath_Type*)0)->PathDuration), NULL, 0 }, // EffectProperties.Path.PathDuration + { TYPE_U32, false, (size_t)(&((EffectPath_Type*)0)->LoopIndex), NULL, 0 }, // EffectProperties.Path.LoopIndex + { TYPE_ARRAY, true, (size_t)(&((EffectPath_Type*)0)->ControlPoints), CHILDREN(33), 1 }, // EffectProperties.Path.ControlPoints + { TYPE_TRANSFORM, false, 1 * sizeof(physx::PxTransform), NULL, 0 }, // EffectProperties.Path.ControlPoints[] + { TYPE_ARRAY, true, (size_t)(&((EffectPath_Type*)0)->Scale), CHILDREN(34), 1 }, // EffectProperties.Path.Scale + { TYPE_STRUCT, false, 1 * sizeof(ControlPoint_Type), CHILDREN(35), 2 }, // EffectProperties.Path.Scale[] + { TYPE_F32, false, (size_t)(&((ControlPoint_Type*)0)->x), NULL, 0 }, // EffectProperties.Path.Scale[].x + { TYPE_F32, false, (size_t)(&((ControlPoint_Type*)0)->y), NULL, 0 }, // EffectProperties.Path.Scale[].y + { TYPE_ARRAY, true, (size_t)(&((EffectPath_Type*)0)->Speed), CHILDREN(37), 1 }, // EffectProperties.Path.Speed + { TYPE_STRUCT, false, 1 * sizeof(ControlPoint_Type), CHILDREN(38), 2 }, // EffectProperties.Path.Speed[] + { TYPE_F32, false, (size_t)(&((ControlPoint_Type*)0)->x), NULL, 0 }, // EffectProperties.Path.Speed[].x + { TYPE_F32, false, (size_t)(&((ControlPoint_Type*)0)->y), NULL, 0 }, // EffectProperties.Path.Speed[].y + { TYPE_ENUM, false, (size_t)(&((ParametersStruct*)0)->Type), NULL, 0 }, // Type + { TYPE_STRING, false, (size_t)(&((ParametersStruct*)0)->CollisionFilterDataName), NULL, 0 }, // CollisionFilterDataName + { TYPE_BOOL, false, (size_t)(&((ParametersStruct*)0)->Dynamic), NULL, 0 }, // Dynamic + { TYPE_BOOL, false, (size_t)(&((ParametersStruct*)0)->Gravity), NULL, 0 }, // Gravity + { TYPE_VEC3, false, (size_t)(&((ParametersStruct*)0)->Extents), NULL, 0 }, // Extents + { TYPE_F32, false, (size_t)(&((ParametersStruct*)0)->Mass), NULL, 0 }, // Mass + { TYPE_VEC3, false, (size_t)(&((ParametersStruct*)0)->InitialLinearVelocity), NULL, 0 }, // InitialLinearVelocity + { TYPE_VEC3, false, (size_t)(&((ParametersStruct*)0)->InitialAngularVelocity), NULL, 0 }, // InitialAngularVelocity + { TYPE_F32, false, (size_t)(&((ParametersStruct*)0)->LinearDamping), NULL, 0 }, // LinearDamping + { TYPE_F32, false, (size_t)(&((ParametersStruct*)0)->AngularDamping), NULL, 0 }, // AngularDamping +}; + + +bool RigidBodyEffect::mBuiltFlag = false; +NvParameterized::MutexType RigidBodyEffect::mBuiltFlagMutex; + +RigidBodyEffect::RigidBodyEffect(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &RigidBodyEffectFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +RigidBodyEffect::~RigidBodyEffect() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void RigidBodyEffect::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->~RigidBodyEffect(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* RigidBodyEffect::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* RigidBodyEffect::getParameterDefinitionTree(void) const +{ + RigidBodyEffect* tmpParam = const_cast<RigidBodyEffect*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType RigidBodyEffect::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 RigidBodyEffect::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 RigidBodyEffect::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<RigidBodyEffect::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ + +void RigidBodyEffect::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 RigidBodyEffect::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", "An effect comprised of a primitive rigid body shape", true); + ParamDefTable[0].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=1, longName="EffectProperties" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[1]; + ParamDef->init("EffectProperties", TYPE_STRUCT, "EffectProperties", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("READONLY", uint64_t(0), true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("READONLY", uint64_t(0), true); + HintTable[1].init("shortDescription", "Rigid Body Properties", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=2, longName="EffectProperties.UserString" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[2]; + ParamDef->init("UserString", TYPE_STRING, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "An aribtrary user string that can be set by an artist/designer/programmer", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=3, longName="EffectProperties.Enable" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[3]; + ParamDef->init("Enable", TYPE_BOOL, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Whether or not this effect is to be initially enabled on startup", true); + ParamDefTable[3].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=4, longName="EffectProperties.Position" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[4]; + ParamDef->init("Position", TYPE_STRUCT, "TranslateObject", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "The position of this effect relative to the parent", true); + ParamDefTable[4].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=5, longName="EffectProperties.Position.TranslateX" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[5]; + ParamDef->init("TranslateX", 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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(500.000000000), true); + HintTable[2].init("min", double(-500.000000000), true); + ParamDefTable[5].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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(500.000000000), true); + HintTable[2].init("min", double(-500.000000000), true); + HintTable[3].init("shortDescription", "Nudge up to +/- one meter in each direction", true); + ParamDefTable[5].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=6, longName="EffectProperties.Position.TranslateY" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[6]; + ParamDef->init("TranslateY", 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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(500.000000000), true); + HintTable[2].init("min", double(-500.000000000), true); + ParamDefTable[6].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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(500.000000000), true); + HintTable[2].init("min", double(-500.000000000), true); + HintTable[3].init("shortDescription", "Nudge up to +/- one meter in each direction", true); + ParamDefTable[6].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=7, longName="EffectProperties.Position.TranslateZ" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[7]; + ParamDef->init("TranslateZ", 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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(500.000000000), true); + HintTable[2].init("min", double(-500.000000000), true); + ParamDefTable[7].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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(500.000000000), true); + HintTable[2].init("min", double(-500.000000000), true); + HintTable[3].init("shortDescription", "Nudge up to +/- one meter in each direction", true); + ParamDefTable[7].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=8, longName="EffectProperties.Orientation" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[8]; + ParamDef->init("Orientation", TYPE_STRUCT, "OrientObject", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "The orientation of this effect, relative to the parent orientation", true); + ParamDefTable[8].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=9, longName="EffectProperties.Orientation.RotateX" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[9]; + ParamDef->init("RotateX", 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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(360.000000000), true); + HintTable[2].init("min", double(0.000000000), true); + ParamDefTable[9].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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(360.000000000), true); + HintTable[2].init("min", double(0.000000000), true); + HintTable[3].init("shortDescription", "Rotate on the X axis (0-360 degrees)", true); + ParamDefTable[9].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=10, longName="EffectProperties.Orientation.RotateY" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[10]; + ParamDef->init("RotateY", 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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(360.000000000), true); + HintTable[2].init("min", double(0.000000000), true); + ParamDefTable[10].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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(360.000000000), true); + HintTable[2].init("min", double(0.000000000), true); + HintTable[3].init("shortDescription", "Rotate on the Y axis (0-360 degrees)", true); + ParamDefTable[10].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=11, longName="EffectProperties.Orientation.RotateZ" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[11]; + ParamDef->init("RotateZ", 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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(360.000000000), true); + HintTable[2].init("min", double(0.000000000), 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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(360.000000000), true); + HintTable[2].init("min", double(0.000000000), true); + HintTable[3].init("shortDescription", "Rotate on the Z axis (0-360 degrees)", true); + ParamDefTable[11].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=12, longName="EffectProperties.InitialDelayTime" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[12]; + ParamDef->init("InitialDelayTime", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("min", double(0.000000000), 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("min", double(0.000000000), true); + HintTable[1].init("shortDescription", "Initial time to delay before spawning this effect", true); + ParamDefTable[12].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=13, longName="EffectProperties.Duration" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[13]; + ParamDef->init("Duration", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("min", double(0.000000000), true); + ParamDefTable[13].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("min", double(0.000000000), true); + HintTable[1].init("shortDescription", "The duration of the effect in secontds", true); + ParamDefTable[13].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=14, longName="EffectProperties.RepeatCount" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[14]; + ParamDef->init("RepeatCount", TYPE_U32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("min", uint64_t(1), 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("min", uint64_t(1), true); + HintTable[1].init("shortDescription", "The number of times to repeat the effect; 9999 means repeate forever", true); + ParamDefTable[14].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=15, longName="EffectProperties.RepeatDelay" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[15]; + ParamDef->init("RepeatDelay", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("min", double(0.000000000), 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("min", double(0.000000000), true); + HintTable[1].init("shortDescription", "The time to delay activation each time the effect repeats in seconds; this can be different than the initial delay time", true); + ParamDefTable[15].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=16, longName="EffectProperties.RandomizeRepeatTime" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[16]; + ParamDef->init("RandomizeRepeatTime", 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", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), 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("max", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + HintTable[2].init("shortDescription", "Amount of randomization to the repeat cycle; a value of zero (default) means no random and a value of one means completely random.", true); + ParamDefTable[16].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=17, longName="EffectProperties.Path" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[17]; + ParamDef->init("Path", TYPE_STRUCT, "EffectPath", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "An optional pre-defined path for this effect to travel on", true); + ParamDefTable[17].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=18, longName="EffectProperties.Path.PlaybackMode" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[18]; + ParamDef->init("PlaybackMode", TYPE_ENUM, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "The mode to play back the path", true); + ParamDefTable[18].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + static const char* const EnumVals[] = { "LOOP", "PLAY_ONCE", "PING_PONG" }; + ParamDefTable[18].setEnumVals((const char**)EnumVals, 3); + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=19, longName="EffectProperties.Path.PathDuration" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[19]; + ParamDef->init("PathDuration", 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", double(1000.000000000), true); + HintTable[1].init("min", double(0.000010000), true); + ParamDefTable[19].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", double(1000.000000000), true); + HintTable[1].init("min", double(0.000010000), true); + HintTable[2].init("shortDescription", "The duration of the path if one is not otherwise provided", true); + ParamDefTable[19].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=20, longName="EffectProperties.Path.LoopIndex" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[20]; + ParamDef->init("LoopIndex", TYPE_U32, 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[20].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("min", uint64_t(0), true); + HintTable[1].init("shortDescription", "The array index to loop back to", true); + ParamDefTable[20].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=21, longName="EffectProperties.Path.ControlPoints" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[21]; + ParamDef->init("ControlPoints", TYPE_ARRAY, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("editorCurve", uint64_t(1), true); + HintTable[2].init("pathEditor", uint64_t(1), 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("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("editorCurve", uint64_t(1), true); + HintTable[2].init("pathEditor", uint64_t(1), true); + HintTable[3].init("shortDescription", "The array of control points to fit the curve to", true); + ParamDefTable[21].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + ParamDef->setArraySize(-1); + } + + // Initialize DefinitionImpl node: nodeIndex=22, longName="EffectProperties.Path.ControlPoints[]" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[22]; + ParamDef->init("ControlPoints", TYPE_TRANSFORM, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("editorCurve", uint64_t(1), true); + HintTable[2].init("pathEditor", uint64_t(1), 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("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("editorCurve", uint64_t(1), true); + HintTable[2].init("pathEditor", uint64_t(1), true); + HintTable[3].init("shortDescription", "The array of control points to fit the curve to", true); + ParamDefTable[22].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=23, longName="EffectProperties.Path.Scale" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[23]; + ParamDef->init("Scale", TYPE_ARRAY, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("xAxisLabel", "Over Time", true); + HintTable[4].init("yAxisLabel", "Scale", true); + ParamDefTable[23].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#else + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("shortDescription", "The array of scale values over time", true); + HintTable[4].init("xAxisLabel", "Over Time", true); + HintTable[5].init("yAxisLabel", "Scale", true); + ParamDefTable[23].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + ParamDef->setArraySize(-1); + } + + // Initialize DefinitionImpl node: nodeIndex=24, longName="EffectProperties.Path.Scale[]" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[24]; + ParamDef->init("Scale", TYPE_STRUCT, "ControlPoint", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("xAxisLabel", "Over Time", true); + HintTable[4].init("yAxisLabel", "Scale", true); + ParamDefTable[24].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#else + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("shortDescription", "The array of scale values over time", true); + HintTable[4].init("xAxisLabel", "Over Time", true); + HintTable[5].init("yAxisLabel", "Scale", true); + ParamDefTable[24].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=25, longName="EffectProperties.Path.Scale[].x" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[25]; + 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", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), 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("max", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + HintTable[2].init("shortDescription", "The x-axis value for this vector", true); + ParamDefTable[25].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=26, longName="EffectProperties.Path.Scale[].y" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[26]; + 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", "The y-axis value for this vector", true); + ParamDefTable[26].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=27, longName="EffectProperties.Path.Speed" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[27]; + ParamDef->init("Speed", TYPE_ARRAY, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("xAxisLabel", "Over Time", true); + HintTable[4].init("yAxisLabel", "Speed", true); + ParamDefTable[27].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#else + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("shortDescription", "The array of speed values over time", true); + HintTable[4].init("xAxisLabel", "Over Time", true); + HintTable[5].init("yAxisLabel", "Speed", true); + ParamDefTable[27].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + ParamDef->setArraySize(-1); + } + + // Initialize DefinitionImpl node: nodeIndex=28, longName="EffectProperties.Path.Speed[]" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[28]; + ParamDef->init("Speed", TYPE_STRUCT, "ControlPoint", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("xAxisLabel", "Over Time", true); + HintTable[4].init("yAxisLabel", "Speed", true); + ParamDefTable[28].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#else + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("shortDescription", "The array of speed values over time", true); + HintTable[4].init("xAxisLabel", "Over Time", true); + HintTable[5].init("yAxisLabel", "Speed", true); + ParamDefTable[28].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=29, longName="EffectProperties.Path.Speed[].x" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[29]; + 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", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + ParamDefTable[29].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", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + HintTable[2].init("shortDescription", "The x-axis value for this vector", true); + ParamDefTable[29].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=30, longName="EffectProperties.Path.Speed[].y" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[30]; + 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", "The y-axis value for this vector", true); + ParamDefTable[30].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=31, longName="Type" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[31]; + ParamDef->init("Type", TYPE_ENUM, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "What type of rigid body primitive this is", true); + ParamDefTable[31].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + static const char* const EnumVals[] = { "SPHERE", "CAPSULE", "BOX" }; + ParamDefTable[31].setEnumVals((const char**)EnumVals, 3); + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=32, longName="CollisionFilterDataName" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[32]; + ParamDef->init("CollisionFilterDataName", 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 collision filter data name", true); + ParamDefTable[32].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=33, longName="Dynamic" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[33]; + ParamDef->init("Dynamic", TYPE_BOOL, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Whether the rigid body is dynamic or kinematic", true); + ParamDefTable[33].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=34, longName="Gravity" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[34]; + ParamDef->init("Gravity", TYPE_BOOL, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "A flag to determine if the object responds to gravity or not", true); + ParamDefTable[34].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=35, longName="Extents" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[35]; + ParamDef->init("Extents", TYPE_VEC3, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "The extents of the primitve, radius, height, or box dimensions XYZ", true); + ParamDefTable[35].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=36, longName="Mass" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[36]; + ParamDef->init("Mass", 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 mass of the object", true); + ParamDefTable[36].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=37, longName="InitialLinearVelocity" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[37]; + ParamDef->init("InitialLinearVelocity", TYPE_VEC3, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "The initial linear velocity (if dynamic)", true); + ParamDefTable[37].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=38, longName="InitialAngularVelocity" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[38]; + ParamDef->init("InitialAngularVelocity", TYPE_VEC3, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "The initial angular velocity (if dynamic)", true); + ParamDefTable[38].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=39, longName="LinearDamping" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[39]; + ParamDef->init("LinearDamping", 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 linear damping on the rigid body", true); + ParamDefTable[39].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=40, longName="AngularDamping" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[40]; + ParamDef->init("AngularDamping", 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 angular damping on the rigid body", true); + ParamDefTable[40].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // SetChildren for: nodeIndex=0, longName="" + { + static Definition* Children[11]; + Children[0] = PDEF_PTR(1); + Children[1] = PDEF_PTR(31); + Children[2] = PDEF_PTR(32); + Children[3] = PDEF_PTR(33); + Children[4] = PDEF_PTR(34); + Children[5] = PDEF_PTR(35); + Children[6] = PDEF_PTR(36); + Children[7] = PDEF_PTR(37); + Children[8] = PDEF_PTR(38); + Children[9] = PDEF_PTR(39); + Children[10] = PDEF_PTR(40); + + ParamDefTable[0].setChildren(Children, 11); + } + + // SetChildren for: nodeIndex=1, longName="EffectProperties" + { + static Definition* Children[10]; + Children[0] = PDEF_PTR(2); + Children[1] = PDEF_PTR(3); + Children[2] = PDEF_PTR(4); + Children[3] = PDEF_PTR(8); + Children[4] = PDEF_PTR(12); + Children[5] = PDEF_PTR(13); + Children[6] = PDEF_PTR(14); + Children[7] = PDEF_PTR(15); + Children[8] = PDEF_PTR(16); + Children[9] = PDEF_PTR(17); + + ParamDefTable[1].setChildren(Children, 10); + } + + // SetChildren for: nodeIndex=4, longName="EffectProperties.Position" + { + static Definition* Children[3]; + Children[0] = PDEF_PTR(5); + Children[1] = PDEF_PTR(6); + Children[2] = PDEF_PTR(7); + + ParamDefTable[4].setChildren(Children, 3); + } + + // SetChildren for: nodeIndex=8, longName="EffectProperties.Orientation" + { + static Definition* Children[3]; + Children[0] = PDEF_PTR(9); + Children[1] = PDEF_PTR(10); + Children[2] = PDEF_PTR(11); + + ParamDefTable[8].setChildren(Children, 3); + } + + // SetChildren for: nodeIndex=17, longName="EffectProperties.Path" + { + static Definition* Children[6]; + Children[0] = PDEF_PTR(18); + Children[1] = PDEF_PTR(19); + Children[2] = PDEF_PTR(20); + Children[3] = PDEF_PTR(21); + Children[4] = PDEF_PTR(23); + Children[5] = PDEF_PTR(27); + + ParamDefTable[17].setChildren(Children, 6); + } + + // SetChildren for: nodeIndex=21, longName="EffectProperties.Path.ControlPoints" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(22); + + ParamDefTable[21].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=23, longName="EffectProperties.Path.Scale" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(24); + + ParamDefTable[23].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=24, longName="EffectProperties.Path.Scale[]" + { + static Definition* Children[2]; + Children[0] = PDEF_PTR(25); + Children[1] = PDEF_PTR(26); + + ParamDefTable[24].setChildren(Children, 2); + } + + // SetChildren for: nodeIndex=27, longName="EffectProperties.Path.Speed" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(28); + + ParamDefTable[27].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=28, longName="EffectProperties.Path.Speed[]" + { + static Definition* Children[2]; + Children[0] = PDEF_PTR(29); + Children[1] = PDEF_PTR(30); + + ParamDefTable[28].setChildren(Children, 2); + } + + mBuiltFlag = true; + +} +void RigidBodyEffect::initStrings(void) +{ + EffectProperties.UserString.isAllocated = true; + EffectProperties.UserString.buf = NULL; + CollisionFilterDataName.isAllocated = false; + CollisionFilterDataName.buf = (const char*)"rigidbody=all"; +} + +void RigidBodyEffect::initDynamicArrays(void) +{ + EffectProperties.Path.ControlPoints.buf = NULL; + EffectProperties.Path.ControlPoints.isAllocated = true; + EffectProperties.Path.ControlPoints.elementSize = sizeof(physx::PxTransform); + EffectProperties.Path.ControlPoints.arraySizes[0] = 0; + EffectProperties.Path.Scale.buf = NULL; + EffectProperties.Path.Scale.isAllocated = true; + EffectProperties.Path.Scale.elementSize = sizeof(ControlPoint_Type); + EffectProperties.Path.Scale.arraySizes[0] = 0; + EffectProperties.Path.Speed.buf = NULL; + EffectProperties.Path.Speed.isAllocated = true; + EffectProperties.Path.Speed.elementSize = sizeof(ControlPoint_Type); + EffectProperties.Path.Speed.arraySizes[0] = 0; +} + +void RigidBodyEffect::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + EffectProperties.Enable = bool(1); + EffectProperties.Position.TranslateX = float(0.000000000); + EffectProperties.Position.TranslateY = float(0.000000000); + EffectProperties.Position.TranslateZ = float(0.000000000); + EffectProperties.Orientation.RotateX = float(0.000000000); + EffectProperties.Orientation.RotateY = float(0.000000000); + EffectProperties.Orientation.RotateZ = float(0.000000000); + EffectProperties.InitialDelayTime = float(0.000000000); + EffectProperties.Duration = float(0.000000000); + EffectProperties.RepeatCount = uint32_t(1); + EffectProperties.RepeatDelay = float(0.000000000); + EffectProperties.RandomizeRepeatTime = float(0.000000000); + EffectProperties.Path.PlaybackMode = (const char*)"LOOP"; + EffectProperties.Path.PathDuration = float(4.000000000); + EffectProperties.Path.LoopIndex = uint32_t(0); + Type = (const char*)"SPHERE"; + Dynamic = bool(0); + Gravity = bool(1); + Extents = physx::PxVec3(init(1.000000000,1.000000000,1.000000000)); + Mass = float(1.000000000); + InitialLinearVelocity = physx::PxVec3(init(0.000000000,0.000000000,0.000000000)); + InitialAngularVelocity = physx::PxVec3(init(0.000000000,0.000000000,0.000000000)); + LinearDamping = float(0.000000000); + AngularDamping = float(0.000000000); + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void RigidBodyEffect::initReferences(void) +{ +} + +void RigidBodyEffect::freeDynamicArrays(void) +{ + if (EffectProperties.Path.ControlPoints.isAllocated && EffectProperties.Path.ControlPoints.buf) + { + mParameterizedTraits->free(EffectProperties.Path.ControlPoints.buf); + } + if (EffectProperties.Path.Scale.isAllocated && EffectProperties.Path.Scale.buf) + { + mParameterizedTraits->free(EffectProperties.Path.Scale.buf); + } + if (EffectProperties.Path.Speed.isAllocated && EffectProperties.Path.Speed.buf) + { + mParameterizedTraits->free(EffectProperties.Path.Speed.buf); + } +} + +void RigidBodyEffect::freeStrings(void) +{ + + if (EffectProperties.UserString.isAllocated && EffectProperties.UserString.buf) + { + mParameterizedTraits->strfree((char*)EffectProperties.UserString.buf); + } + + if (CollisionFilterDataName.isAllocated && CollisionFilterDataName.buf) + { + mParameterizedTraits->strfree((char*)CollisionFilterDataName.buf); + } +} + +void RigidBodyEffect::freeReferences(void) +{ +} + +} // namespace particles +} // namespace nvidia diff --git a/APEX_1.4/module/particles/src/autogen/SubstanceSourceData.cpp b/APEX_1.4/module/particles/src/autogen/SubstanceSourceData.cpp new file mode 100644 index 00000000..2bdbef5f --- /dev/null +++ b/APEX_1.4/module/particles/src/autogen/SubstanceSourceData.cpp @@ -0,0 +1,363 @@ +// 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 "SubstanceSourceData.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace particles +{ + +using namespace SubstanceSourceDataNS; + +const char* const SubstanceSourceDataFactory::vptr = + NvParameterized::getVptr<SubstanceSourceData, SubstanceSourceData::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_STRING, false, (size_t)(&((ParametersStruct*)0)->Name), NULL, 0 }, // Name + { TYPE_REF, false, (size_t)(&((ParametersStruct*)0)->SubstanceSource), NULL, 0 }, // SubstanceSource +}; + + +bool SubstanceSourceData::mBuiltFlag = false; +NvParameterized::MutexType SubstanceSourceData::mBuiltFlagMutex; + +SubstanceSourceData::SubstanceSourceData(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &SubstanceSourceDataFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +SubstanceSourceData::~SubstanceSourceData() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void SubstanceSourceData::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->~SubstanceSourceData(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* SubstanceSourceData::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* SubstanceSourceData::getParameterDefinitionTree(void) const +{ + SubstanceSourceData* tmpParam = const_cast<SubstanceSourceData*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType SubstanceSourceData::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 SubstanceSourceData::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 SubstanceSourceData::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<SubstanceSourceData::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ + +void SubstanceSourceData::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 SubstanceSourceData::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", "Contains the asset properties for this substance source", true); + ParamDefTable[0].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=1, longName="Name" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[1]; + ParamDef->init("Name", TYPE_STRING, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Substance Source Name", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=2, longName="SubstanceSource" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[2]; + ParamDef->init("SubstanceSource", 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[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("INCLUDED", uint64_t(1), true); + HintTable[1].init("shortDescription", "Substance Source properties", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + static const char* const RefVariantVals[] = { "SubstanceSourceAssetParams" }; + ParamDefTable[2].setRefVariantVals((const char**)RefVariantVals, 1); + + + + } + + // 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 SubstanceSourceData::initStrings(void) +{ + Name.isAllocated = false; + Name.buf = (const char*)"defaultSubstanceSource"; +} + +void SubstanceSourceData::initDynamicArrays(void) +{ +} + +void SubstanceSourceData::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void SubstanceSourceData::initReferences(void) +{ + SubstanceSource = NULL; + +} + +void SubstanceSourceData::freeDynamicArrays(void) +{ +} + +void SubstanceSourceData::freeStrings(void) +{ + + if (Name.isAllocated && Name.buf) + { + mParameterizedTraits->strfree((char*)Name.buf); + } +} + +void SubstanceSourceData::freeReferences(void) +{ + if (SubstanceSource) + { + SubstanceSource->destroy(); + } + +} + +} // namespace particles +} // namespace nvidia diff --git a/APEX_1.4/module/particles/src/autogen/SubstanceSourceEffect.cpp b/APEX_1.4/module/particles/src/autogen/SubstanceSourceEffect.cpp new file mode 100644 index 00000000..58007910 --- /dev/null +++ b/APEX_1.4/module/particles/src/autogen/SubstanceSourceEffect.cpp @@ -0,0 +1,1356 @@ +// 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 "SubstanceSourceEffect.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace particles +{ + +using namespace SubstanceSourceEffectNS; + +const char* const SubstanceSourceEffectFactory::vptr = + NvParameterized::getVptr<SubstanceSourceEffect, SubstanceSourceEffect::ClassAlignment>(); + +const uint32_t NumParamDefs = 32; +static NvParameterized::DefinitionImpl* ParamDefTable; // now allocated in buildTree [NumParamDefs]; + + +static const size_t ParamLookupChildrenTable[] = +{ + 1, 31, 2, 3, 4, 8, 12, 13, 14, 15, 16, 17, 5, 6, 7, 9, 10, 11, 18, 19, 20, 21, 23, + 27, 22, 24, 25, 26, 28, 29, 30, +}; + +#define TENUM(type) nvidia::##type +#define CHILDREN(index) &ParamLookupChildrenTable[index] +static const NvParameterized::ParamLookupNode ParamLookupTable[NumParamDefs] = +{ + { TYPE_STRUCT, false, 0, CHILDREN(0), 2 }, + { TYPE_STRUCT, false, (size_t)(&((ParametersStruct*)0)->EffectProperties), CHILDREN(2), 10 }, // EffectProperties + { TYPE_STRING, false, (size_t)(&((EffectProperties_Type*)0)->UserString), NULL, 0 }, // EffectProperties.UserString + { TYPE_BOOL, false, (size_t)(&((EffectProperties_Type*)0)->Enable), NULL, 0 }, // EffectProperties.Enable + { TYPE_STRUCT, false, (size_t)(&((EffectProperties_Type*)0)->Position), CHILDREN(12), 3 }, // EffectProperties.Position + { TYPE_F32, false, (size_t)(&((TranslateObject_Type*)0)->TranslateX), NULL, 0 }, // EffectProperties.Position.TranslateX + { TYPE_F32, false, (size_t)(&((TranslateObject_Type*)0)->TranslateY), NULL, 0 }, // EffectProperties.Position.TranslateY + { TYPE_F32, false, (size_t)(&((TranslateObject_Type*)0)->TranslateZ), NULL, 0 }, // EffectProperties.Position.TranslateZ + { TYPE_STRUCT, false, (size_t)(&((EffectProperties_Type*)0)->Orientation), CHILDREN(15), 3 }, // EffectProperties.Orientation + { TYPE_F32, false, (size_t)(&((OrientObject_Type*)0)->RotateX), NULL, 0 }, // EffectProperties.Orientation.RotateX + { TYPE_F32, false, (size_t)(&((OrientObject_Type*)0)->RotateY), NULL, 0 }, // EffectProperties.Orientation.RotateY + { TYPE_F32, false, (size_t)(&((OrientObject_Type*)0)->RotateZ), NULL, 0 }, // EffectProperties.Orientation.RotateZ + { TYPE_F32, false, (size_t)(&((EffectProperties_Type*)0)->InitialDelayTime), NULL, 0 }, // EffectProperties.InitialDelayTime + { TYPE_F32, false, (size_t)(&((EffectProperties_Type*)0)->Duration), NULL, 0 }, // EffectProperties.Duration + { TYPE_U32, false, (size_t)(&((EffectProperties_Type*)0)->RepeatCount), NULL, 0 }, // EffectProperties.RepeatCount + { TYPE_F32, false, (size_t)(&((EffectProperties_Type*)0)->RepeatDelay), NULL, 0 }, // EffectProperties.RepeatDelay + { TYPE_F32, false, (size_t)(&((EffectProperties_Type*)0)->RandomizeRepeatTime), NULL, 0 }, // EffectProperties.RandomizeRepeatTime + { TYPE_STRUCT, false, (size_t)(&((EffectProperties_Type*)0)->Path), CHILDREN(18), 6 }, // EffectProperties.Path + { TYPE_ENUM, false, (size_t)(&((EffectPath_Type*)0)->PlaybackMode), NULL, 0 }, // EffectProperties.Path.PlaybackMode + { TYPE_F32, false, (size_t)(&((EffectPath_Type*)0)->PathDuration), NULL, 0 }, // EffectProperties.Path.PathDuration + { TYPE_U32, false, (size_t)(&((EffectPath_Type*)0)->LoopIndex), NULL, 0 }, // EffectProperties.Path.LoopIndex + { TYPE_ARRAY, true, (size_t)(&((EffectPath_Type*)0)->ControlPoints), CHILDREN(24), 1 }, // EffectProperties.Path.ControlPoints + { TYPE_TRANSFORM, false, 1 * sizeof(physx::PxTransform), NULL, 0 }, // EffectProperties.Path.ControlPoints[] + { TYPE_ARRAY, true, (size_t)(&((EffectPath_Type*)0)->Scale), CHILDREN(25), 1 }, // EffectProperties.Path.Scale + { TYPE_STRUCT, false, 1 * sizeof(ControlPoint_Type), CHILDREN(26), 2 }, // EffectProperties.Path.Scale[] + { TYPE_F32, false, (size_t)(&((ControlPoint_Type*)0)->x), NULL, 0 }, // EffectProperties.Path.Scale[].x + { TYPE_F32, false, (size_t)(&((ControlPoint_Type*)0)->y), NULL, 0 }, // EffectProperties.Path.Scale[].y + { TYPE_ARRAY, true, (size_t)(&((EffectPath_Type*)0)->Speed), CHILDREN(28), 1 }, // EffectProperties.Path.Speed + { TYPE_STRUCT, false, 1 * sizeof(ControlPoint_Type), CHILDREN(29), 2 }, // EffectProperties.Path.Speed[] + { TYPE_F32, false, (size_t)(&((ControlPoint_Type*)0)->x), NULL, 0 }, // EffectProperties.Path.Speed[].x + { TYPE_F32, false, (size_t)(&((ControlPoint_Type*)0)->y), NULL, 0 }, // EffectProperties.Path.Speed[].y + { TYPE_REF, false, (size_t)(&((ParametersStruct*)0)->SubstanceSource), NULL, 0 }, // SubstanceSource +}; + + +bool SubstanceSourceEffect::mBuiltFlag = false; +NvParameterized::MutexType SubstanceSourceEffect::mBuiltFlagMutex; + +SubstanceSourceEffect::SubstanceSourceEffect(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &SubstanceSourceEffectFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +SubstanceSourceEffect::~SubstanceSourceEffect() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void SubstanceSourceEffect::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->~SubstanceSourceEffect(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* SubstanceSourceEffect::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* SubstanceSourceEffect::getParameterDefinitionTree(void) const +{ + SubstanceSourceEffect* tmpParam = const_cast<SubstanceSourceEffect*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType SubstanceSourceEffect::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 SubstanceSourceEffect::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 SubstanceSourceEffect::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<SubstanceSourceEffect::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ + +void SubstanceSourceEffect::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 SubstanceSourceEffect::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", "A substance source effect", true); + ParamDefTable[0].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=1, longName="EffectProperties" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[1]; + ParamDef->init("EffectProperties", TYPE_STRUCT, "EffectProperties", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Substance Source Properties", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=2, longName="EffectProperties.UserString" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[2]; + ParamDef->init("UserString", TYPE_STRING, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "An aribtrary user string that can be set by an artist/designer/programmer", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=3, longName="EffectProperties.Enable" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[3]; + ParamDef->init("Enable", TYPE_BOOL, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Whether or not this effect is to be initially enabled on startup", true); + ParamDefTable[3].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=4, longName="EffectProperties.Position" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[4]; + ParamDef->init("Position", TYPE_STRUCT, "TranslateObject", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "The position of this effect relative to the parent", true); + ParamDefTable[4].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=5, longName="EffectProperties.Position.TranslateX" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[5]; + ParamDef->init("TranslateX", 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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(500.000000000), true); + HintTable[2].init("min", double(-500.000000000), true); + ParamDefTable[5].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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(500.000000000), true); + HintTable[2].init("min", double(-500.000000000), true); + HintTable[3].init("shortDescription", "Nudge up to +/- one meter in each direction", true); + ParamDefTable[5].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=6, longName="EffectProperties.Position.TranslateY" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[6]; + ParamDef->init("TranslateY", 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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(500.000000000), true); + HintTable[2].init("min", double(-500.000000000), true); + ParamDefTable[6].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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(500.000000000), true); + HintTable[2].init("min", double(-500.000000000), true); + HintTable[3].init("shortDescription", "Nudge up to +/- one meter in each direction", true); + ParamDefTable[6].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=7, longName="EffectProperties.Position.TranslateZ" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[7]; + ParamDef->init("TranslateZ", 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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(500.000000000), true); + HintTable[2].init("min", double(-500.000000000), true); + ParamDefTable[7].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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(500.000000000), true); + HintTable[2].init("min", double(-500.000000000), true); + HintTable[3].init("shortDescription", "Nudge up to +/- one meter in each direction", true); + ParamDefTable[7].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=8, longName="EffectProperties.Orientation" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[8]; + ParamDef->init("Orientation", TYPE_STRUCT, "OrientObject", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "The orientation of this effect, relative to the parent orientation", true); + ParamDefTable[8].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=9, longName="EffectProperties.Orientation.RotateX" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[9]; + ParamDef->init("RotateX", 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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(360.000000000), true); + HintTable[2].init("min", double(0.000000000), true); + ParamDefTable[9].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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(360.000000000), true); + HintTable[2].init("min", double(0.000000000), true); + HintTable[3].init("shortDescription", "Rotate on the X axis (0-360 degrees)", true); + ParamDefTable[9].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=10, longName="EffectProperties.Orientation.RotateY" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[10]; + ParamDef->init("RotateY", 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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(360.000000000), true); + HintTable[2].init("min", double(0.000000000), true); + ParamDefTable[10].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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(360.000000000), true); + HintTable[2].init("min", double(0.000000000), true); + HintTable[3].init("shortDescription", "Rotate on the Y axis (0-360 degrees)", true); + ParamDefTable[10].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=11, longName="EffectProperties.Orientation.RotateZ" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[11]; + ParamDef->init("RotateZ", 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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(360.000000000), true); + HintTable[2].init("min", double(0.000000000), 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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(360.000000000), true); + HintTable[2].init("min", double(0.000000000), true); + HintTable[3].init("shortDescription", "Rotate on the Z axis (0-360 degrees)", true); + ParamDefTable[11].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=12, longName="EffectProperties.InitialDelayTime" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[12]; + ParamDef->init("InitialDelayTime", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("min", double(0.000000000), 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("min", double(0.000000000), true); + HintTable[1].init("shortDescription", "Initial time to delay before spawning this effect", true); + ParamDefTable[12].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=13, longName="EffectProperties.Duration" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[13]; + ParamDef->init("Duration", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("min", double(0.000000000), true); + ParamDefTable[13].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("min", double(0.000000000), true); + HintTable[1].init("shortDescription", "The duration of the effect in secontds", true); + ParamDefTable[13].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=14, longName="EffectProperties.RepeatCount" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[14]; + ParamDef->init("RepeatCount", TYPE_U32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("min", uint64_t(1), 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("min", uint64_t(1), true); + HintTable[1].init("shortDescription", "The number of times to repeat the effect; 9999 means repeate forever", true); + ParamDefTable[14].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=15, longName="EffectProperties.RepeatDelay" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[15]; + ParamDef->init("RepeatDelay", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("min", double(0.000000000), 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("min", double(0.000000000), true); + HintTable[1].init("shortDescription", "The time to delay activation each time the effect repeats in seconds; this can be different than the initial delay time", true); + ParamDefTable[15].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=16, longName="EffectProperties.RandomizeRepeatTime" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[16]; + ParamDef->init("RandomizeRepeatTime", 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", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), 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("max", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + HintTable[2].init("shortDescription", "Amount of randomization to the repeat cycle; a value of zero (default) means no random and a value of one means completely random.", true); + ParamDefTable[16].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=17, longName="EffectProperties.Path" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[17]; + ParamDef->init("Path", TYPE_STRUCT, "EffectPath", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "An optional pre-defined path for this effect to travel on", true); + ParamDefTable[17].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=18, longName="EffectProperties.Path.PlaybackMode" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[18]; + ParamDef->init("PlaybackMode", TYPE_ENUM, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "The mode to play back the path", true); + ParamDefTable[18].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + static const char* const EnumVals[] = { "LOOP", "PLAY_ONCE", "PING_PONG" }; + ParamDefTable[18].setEnumVals((const char**)EnumVals, 3); + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=19, longName="EffectProperties.Path.PathDuration" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[19]; + ParamDef->init("PathDuration", 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", double(1000.000000000), true); + HintTable[1].init("min", double(0.000010000), true); + ParamDefTable[19].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", double(1000.000000000), true); + HintTable[1].init("min", double(0.000010000), true); + HintTable[2].init("shortDescription", "The duration of the path if one is not otherwise provided", true); + ParamDefTable[19].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=20, longName="EffectProperties.Path.LoopIndex" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[20]; + ParamDef->init("LoopIndex", TYPE_U32, 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[20].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("min", uint64_t(0), true); + HintTable[1].init("shortDescription", "The array index to loop back to", true); + ParamDefTable[20].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=21, longName="EffectProperties.Path.ControlPoints" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[21]; + ParamDef->init("ControlPoints", TYPE_ARRAY, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("editorCurve", uint64_t(1), true); + HintTable[2].init("pathEditor", uint64_t(1), 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("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("editorCurve", uint64_t(1), true); + HintTable[2].init("pathEditor", uint64_t(1), true); + HintTable[3].init("shortDescription", "The array of control points to fit the curve to", true); + ParamDefTable[21].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + ParamDef->setArraySize(-1); + } + + // Initialize DefinitionImpl node: nodeIndex=22, longName="EffectProperties.Path.ControlPoints[]" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[22]; + ParamDef->init("ControlPoints", TYPE_TRANSFORM, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("editorCurve", uint64_t(1), true); + HintTable[2].init("pathEditor", uint64_t(1), 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("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("editorCurve", uint64_t(1), true); + HintTable[2].init("pathEditor", uint64_t(1), true); + HintTable[3].init("shortDescription", "The array of control points to fit the curve to", true); + ParamDefTable[22].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=23, longName="EffectProperties.Path.Scale" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[23]; + ParamDef->init("Scale", TYPE_ARRAY, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("xAxisLabel", "Over Time", true); + HintTable[4].init("yAxisLabel", "Scale", true); + ParamDefTable[23].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#else + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("shortDescription", "The array of scale values over time", true); + HintTable[4].init("xAxisLabel", "Over Time", true); + HintTable[5].init("yAxisLabel", "Scale", true); + ParamDefTable[23].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + ParamDef->setArraySize(-1); + } + + // Initialize DefinitionImpl node: nodeIndex=24, longName="EffectProperties.Path.Scale[]" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[24]; + ParamDef->init("Scale", TYPE_STRUCT, "ControlPoint", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("xAxisLabel", "Over Time", true); + HintTable[4].init("yAxisLabel", "Scale", true); + ParamDefTable[24].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#else + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("shortDescription", "The array of scale values over time", true); + HintTable[4].init("xAxisLabel", "Over Time", true); + HintTable[5].init("yAxisLabel", "Scale", true); + ParamDefTable[24].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=25, longName="EffectProperties.Path.Scale[].x" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[25]; + 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", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), 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("max", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + HintTable[2].init("shortDescription", "The x-axis value for this vector", true); + ParamDefTable[25].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=26, longName="EffectProperties.Path.Scale[].y" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[26]; + 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", "The y-axis value for this vector", true); + ParamDefTable[26].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=27, longName="EffectProperties.Path.Speed" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[27]; + ParamDef->init("Speed", TYPE_ARRAY, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("xAxisLabel", "Over Time", true); + HintTable[4].init("yAxisLabel", "Speed", true); + ParamDefTable[27].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#else + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("shortDescription", "The array of speed values over time", true); + HintTable[4].init("xAxisLabel", "Over Time", true); + HintTable[5].init("yAxisLabel", "Speed", true); + ParamDefTable[27].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + ParamDef->setArraySize(-1); + } + + // Initialize DefinitionImpl node: nodeIndex=28, longName="EffectProperties.Path.Speed[]" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[28]; + ParamDef->init("Speed", TYPE_STRUCT, "ControlPoint", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("xAxisLabel", "Over Time", true); + HintTable[4].init("yAxisLabel", "Speed", true); + ParamDefTable[28].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#else + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("shortDescription", "The array of speed values over time", true); + HintTable[4].init("xAxisLabel", "Over Time", true); + HintTable[5].init("yAxisLabel", "Speed", true); + ParamDefTable[28].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=29, longName="EffectProperties.Path.Speed[].x" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[29]; + 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", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + ParamDefTable[29].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", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + HintTable[2].init("shortDescription", "The x-axis value for this vector", true); + ParamDefTable[29].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=30, longName="EffectProperties.Path.Speed[].y" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[30]; + 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", "The y-axis value for this vector", true); + ParamDefTable[30].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=31, longName="SubstanceSource" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[31]; + ParamDef->init("SubstanceSource", TYPE_REF, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Substance Source Asset", true); + ParamDefTable[31].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + static const char* const RefVariantVals[] = { "SubstanceSourceAsset" }; + ParamDefTable[31].setRefVariantVals((const char**)RefVariantVals, 1); + + + + } + + // SetChildren for: nodeIndex=0, longName="" + { + static Definition* Children[2]; + Children[0] = PDEF_PTR(1); + Children[1] = PDEF_PTR(31); + + ParamDefTable[0].setChildren(Children, 2); + } + + // SetChildren for: nodeIndex=1, longName="EffectProperties" + { + static Definition* Children[10]; + Children[0] = PDEF_PTR(2); + Children[1] = PDEF_PTR(3); + Children[2] = PDEF_PTR(4); + Children[3] = PDEF_PTR(8); + Children[4] = PDEF_PTR(12); + Children[5] = PDEF_PTR(13); + Children[6] = PDEF_PTR(14); + Children[7] = PDEF_PTR(15); + Children[8] = PDEF_PTR(16); + Children[9] = PDEF_PTR(17); + + ParamDefTable[1].setChildren(Children, 10); + } + + // SetChildren for: nodeIndex=4, longName="EffectProperties.Position" + { + static Definition* Children[3]; + Children[0] = PDEF_PTR(5); + Children[1] = PDEF_PTR(6); + Children[2] = PDEF_PTR(7); + + ParamDefTable[4].setChildren(Children, 3); + } + + // SetChildren for: nodeIndex=8, longName="EffectProperties.Orientation" + { + static Definition* Children[3]; + Children[0] = PDEF_PTR(9); + Children[1] = PDEF_PTR(10); + Children[2] = PDEF_PTR(11); + + ParamDefTable[8].setChildren(Children, 3); + } + + // SetChildren for: nodeIndex=17, longName="EffectProperties.Path" + { + static Definition* Children[6]; + Children[0] = PDEF_PTR(18); + Children[1] = PDEF_PTR(19); + Children[2] = PDEF_PTR(20); + Children[3] = PDEF_PTR(21); + Children[4] = PDEF_PTR(23); + Children[5] = PDEF_PTR(27); + + ParamDefTable[17].setChildren(Children, 6); + } + + // SetChildren for: nodeIndex=21, longName="EffectProperties.Path.ControlPoints" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(22); + + ParamDefTable[21].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=23, longName="EffectProperties.Path.Scale" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(24); + + ParamDefTable[23].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=24, longName="EffectProperties.Path.Scale[]" + { + static Definition* Children[2]; + Children[0] = PDEF_PTR(25); + Children[1] = PDEF_PTR(26); + + ParamDefTable[24].setChildren(Children, 2); + } + + // SetChildren for: nodeIndex=27, longName="EffectProperties.Path.Speed" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(28); + + ParamDefTable[27].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=28, longName="EffectProperties.Path.Speed[]" + { + static Definition* Children[2]; + Children[0] = PDEF_PTR(29); + Children[1] = PDEF_PTR(30); + + ParamDefTable[28].setChildren(Children, 2); + } + + mBuiltFlag = true; + +} +void SubstanceSourceEffect::initStrings(void) +{ + EffectProperties.UserString.isAllocated = true; + EffectProperties.UserString.buf = NULL; +} + +void SubstanceSourceEffect::initDynamicArrays(void) +{ + EffectProperties.Path.ControlPoints.buf = NULL; + EffectProperties.Path.ControlPoints.isAllocated = true; + EffectProperties.Path.ControlPoints.elementSize = sizeof(physx::PxTransform); + EffectProperties.Path.ControlPoints.arraySizes[0] = 0; + EffectProperties.Path.Scale.buf = NULL; + EffectProperties.Path.Scale.isAllocated = true; + EffectProperties.Path.Scale.elementSize = sizeof(ControlPoint_Type); + EffectProperties.Path.Scale.arraySizes[0] = 0; + EffectProperties.Path.Speed.buf = NULL; + EffectProperties.Path.Speed.isAllocated = true; + EffectProperties.Path.Speed.elementSize = sizeof(ControlPoint_Type); + EffectProperties.Path.Speed.arraySizes[0] = 0; +} + +void SubstanceSourceEffect::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + EffectProperties.Enable = bool(1); + EffectProperties.Position.TranslateX = float(0.000000000); + EffectProperties.Position.TranslateY = float(0.000000000); + EffectProperties.Position.TranslateZ = float(0.000000000); + EffectProperties.Orientation.RotateX = float(0.000000000); + EffectProperties.Orientation.RotateY = float(0.000000000); + EffectProperties.Orientation.RotateZ = float(0.000000000); + EffectProperties.InitialDelayTime = float(0.000000000); + EffectProperties.Duration = float(0.000000000); + EffectProperties.RepeatCount = uint32_t(1); + EffectProperties.RepeatDelay = float(0.000000000); + EffectProperties.RandomizeRepeatTime = float(0.000000000); + EffectProperties.Path.PlaybackMode = (const char*)"LOOP"; + EffectProperties.Path.PathDuration = float(4.000000000); + EffectProperties.Path.LoopIndex = uint32_t(0); + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void SubstanceSourceEffect::initReferences(void) +{ + SubstanceSource = NULL; + +} + +void SubstanceSourceEffect::freeDynamicArrays(void) +{ + if (EffectProperties.Path.ControlPoints.isAllocated && EffectProperties.Path.ControlPoints.buf) + { + mParameterizedTraits->free(EffectProperties.Path.ControlPoints.buf); + } + if (EffectProperties.Path.Scale.isAllocated && EffectProperties.Path.Scale.buf) + { + mParameterizedTraits->free(EffectProperties.Path.Scale.buf); + } + if (EffectProperties.Path.Speed.isAllocated && EffectProperties.Path.Speed.buf) + { + mParameterizedTraits->free(EffectProperties.Path.Speed.buf); + } +} + +void SubstanceSourceEffect::freeStrings(void) +{ + + if (EffectProperties.UserString.isAllocated && EffectProperties.UserString.buf) + { + mParameterizedTraits->strfree((char*)EffectProperties.UserString.buf); + } +} + +void SubstanceSourceEffect::freeReferences(void) +{ + if (SubstanceSource) + { + SubstanceSource->destroy(); + } + +} + +} // namespace particles +} // namespace nvidia diff --git a/APEX_1.4/module/particles/src/autogen/TurbulenceFieldSamplerData.cpp b/APEX_1.4/module/particles/src/autogen/TurbulenceFieldSamplerData.cpp new file mode 100644 index 00000000..4816cf54 --- /dev/null +++ b/APEX_1.4/module/particles/src/autogen/TurbulenceFieldSamplerData.cpp @@ -0,0 +1,363 @@ +// 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 "TurbulenceFieldSamplerData.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace particles +{ + +using namespace TurbulenceFieldSamplerDataNS; + +const char* const TurbulenceFieldSamplerDataFactory::vptr = + NvParameterized::getVptr<TurbulenceFieldSamplerData, TurbulenceFieldSamplerData::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_STRING, false, (size_t)(&((ParametersStruct*)0)->Name), NULL, 0 }, // Name + { TYPE_REF, false, (size_t)(&((ParametersStruct*)0)->TurbulenceFieldSampler), NULL, 0 }, // TurbulenceFieldSampler +}; + + +bool TurbulenceFieldSamplerData::mBuiltFlag = false; +NvParameterized::MutexType TurbulenceFieldSamplerData::mBuiltFlagMutex; + +TurbulenceFieldSamplerData::TurbulenceFieldSamplerData(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &TurbulenceFieldSamplerDataFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +TurbulenceFieldSamplerData::~TurbulenceFieldSamplerData() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void TurbulenceFieldSamplerData::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->~TurbulenceFieldSamplerData(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* TurbulenceFieldSamplerData::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* TurbulenceFieldSamplerData::getParameterDefinitionTree(void) const +{ + TurbulenceFieldSamplerData* tmpParam = const_cast<TurbulenceFieldSamplerData*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType TurbulenceFieldSamplerData::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 TurbulenceFieldSamplerData::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 TurbulenceFieldSamplerData::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<TurbulenceFieldSamplerData::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ + +void TurbulenceFieldSamplerData::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 TurbulenceFieldSamplerData::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", "Contains the asset properties for this turbulence field sampler", true); + ParamDefTable[0].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=1, longName="Name" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[1]; + ParamDef->init("Name", TYPE_STRING, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Turbulence FS Name", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=2, longName="TurbulenceFieldSampler" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[2]; + ParamDef->init("TurbulenceFieldSampler", 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[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("INCLUDED", uint64_t(1), true); + HintTable[1].init("shortDescription", "Turbulence FS properties", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + static const char* const RefVariantVals[] = { "TurbulenceFSAssetParams" }; + ParamDefTable[2].setRefVariantVals((const char**)RefVariantVals, 1); + + + + } + + // 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 TurbulenceFieldSamplerData::initStrings(void) +{ + Name.isAllocated = false; + Name.buf = (const char*)"defaultTurbulenceFieldSampler"; +} + +void TurbulenceFieldSamplerData::initDynamicArrays(void) +{ +} + +void TurbulenceFieldSamplerData::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void TurbulenceFieldSamplerData::initReferences(void) +{ + TurbulenceFieldSampler = NULL; + +} + +void TurbulenceFieldSamplerData::freeDynamicArrays(void) +{ +} + +void TurbulenceFieldSamplerData::freeStrings(void) +{ + + if (Name.isAllocated && Name.buf) + { + mParameterizedTraits->strfree((char*)Name.buf); + } +} + +void TurbulenceFieldSamplerData::freeReferences(void) +{ + if (TurbulenceFieldSampler) + { + TurbulenceFieldSampler->destroy(); + } + +} + +} // namespace particles +} // namespace nvidia diff --git a/APEX_1.4/module/particles/src/autogen/TurbulenceFieldSamplerEffect.cpp b/APEX_1.4/module/particles/src/autogen/TurbulenceFieldSamplerEffect.cpp new file mode 100644 index 00000000..e7744755 --- /dev/null +++ b/APEX_1.4/module/particles/src/autogen/TurbulenceFieldSamplerEffect.cpp @@ -0,0 +1,1362 @@ +// 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 "TurbulenceFieldSamplerEffect.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace particles +{ + +using namespace TurbulenceFieldSamplerEffectNS; + +const char* const TurbulenceFieldSamplerEffectFactory::vptr = + NvParameterized::getVptr<TurbulenceFieldSamplerEffect, TurbulenceFieldSamplerEffect::ClassAlignment>(); + +const uint32_t NumParamDefs = 32; +static NvParameterized::DefinitionImpl* ParamDefTable; // now allocated in buildTree [NumParamDefs]; + + +static const size_t ParamLookupChildrenTable[] = +{ + 1, 31, 2, 3, 4, 8, 12, 13, 14, 15, 16, 17, 5, 6, 7, 9, 10, 11, 18, 19, 20, 21, 23, + 27, 22, 24, 25, 26, 28, 29, 30, +}; + +#define TENUM(type) nvidia::##type +#define CHILDREN(index) &ParamLookupChildrenTable[index] +static const NvParameterized::ParamLookupNode ParamLookupTable[NumParamDefs] = +{ + { TYPE_STRUCT, false, 0, CHILDREN(0), 2 }, + { TYPE_STRUCT, false, (size_t)(&((ParametersStruct*)0)->EffectProperties), CHILDREN(2), 10 }, // EffectProperties + { TYPE_STRING, false, (size_t)(&((EffectProperties_Type*)0)->UserString), NULL, 0 }, // EffectProperties.UserString + { TYPE_BOOL, false, (size_t)(&((EffectProperties_Type*)0)->Enable), NULL, 0 }, // EffectProperties.Enable + { TYPE_STRUCT, false, (size_t)(&((EffectProperties_Type*)0)->Position), CHILDREN(12), 3 }, // EffectProperties.Position + { TYPE_F32, false, (size_t)(&((TranslateObject_Type*)0)->TranslateX), NULL, 0 }, // EffectProperties.Position.TranslateX + { TYPE_F32, false, (size_t)(&((TranslateObject_Type*)0)->TranslateY), NULL, 0 }, // EffectProperties.Position.TranslateY + { TYPE_F32, false, (size_t)(&((TranslateObject_Type*)0)->TranslateZ), NULL, 0 }, // EffectProperties.Position.TranslateZ + { TYPE_STRUCT, false, (size_t)(&((EffectProperties_Type*)0)->Orientation), CHILDREN(15), 3 }, // EffectProperties.Orientation + { TYPE_F32, false, (size_t)(&((OrientObject_Type*)0)->RotateX), NULL, 0 }, // EffectProperties.Orientation.RotateX + { TYPE_F32, false, (size_t)(&((OrientObject_Type*)0)->RotateY), NULL, 0 }, // EffectProperties.Orientation.RotateY + { TYPE_F32, false, (size_t)(&((OrientObject_Type*)0)->RotateZ), NULL, 0 }, // EffectProperties.Orientation.RotateZ + { TYPE_F32, false, (size_t)(&((EffectProperties_Type*)0)->InitialDelayTime), NULL, 0 }, // EffectProperties.InitialDelayTime + { TYPE_F32, false, (size_t)(&((EffectProperties_Type*)0)->Duration), NULL, 0 }, // EffectProperties.Duration + { TYPE_U32, false, (size_t)(&((EffectProperties_Type*)0)->RepeatCount), NULL, 0 }, // EffectProperties.RepeatCount + { TYPE_F32, false, (size_t)(&((EffectProperties_Type*)0)->RepeatDelay), NULL, 0 }, // EffectProperties.RepeatDelay + { TYPE_F32, false, (size_t)(&((EffectProperties_Type*)0)->RandomizeRepeatTime), NULL, 0 }, // EffectProperties.RandomizeRepeatTime + { TYPE_STRUCT, false, (size_t)(&((EffectProperties_Type*)0)->Path), CHILDREN(18), 6 }, // EffectProperties.Path + { TYPE_ENUM, false, (size_t)(&((EffectPath_Type*)0)->PlaybackMode), NULL, 0 }, // EffectProperties.Path.PlaybackMode + { TYPE_F32, false, (size_t)(&((EffectPath_Type*)0)->PathDuration), NULL, 0 }, // EffectProperties.Path.PathDuration + { TYPE_U32, false, (size_t)(&((EffectPath_Type*)0)->LoopIndex), NULL, 0 }, // EffectProperties.Path.LoopIndex + { TYPE_ARRAY, true, (size_t)(&((EffectPath_Type*)0)->ControlPoints), CHILDREN(24), 1 }, // EffectProperties.Path.ControlPoints + { TYPE_TRANSFORM, false, 1 * sizeof(physx::PxTransform), NULL, 0 }, // EffectProperties.Path.ControlPoints[] + { TYPE_ARRAY, true, (size_t)(&((EffectPath_Type*)0)->Scale), CHILDREN(25), 1 }, // EffectProperties.Path.Scale + { TYPE_STRUCT, false, 1 * sizeof(ControlPoint_Type), CHILDREN(26), 2 }, // EffectProperties.Path.Scale[] + { TYPE_F32, false, (size_t)(&((ControlPoint_Type*)0)->x), NULL, 0 }, // EffectProperties.Path.Scale[].x + { TYPE_F32, false, (size_t)(&((ControlPoint_Type*)0)->y), NULL, 0 }, // EffectProperties.Path.Scale[].y + { TYPE_ARRAY, true, (size_t)(&((EffectPath_Type*)0)->Speed), CHILDREN(28), 1 }, // EffectProperties.Path.Speed + { TYPE_STRUCT, false, 1 * sizeof(ControlPoint_Type), CHILDREN(29), 2 }, // EffectProperties.Path.Speed[] + { TYPE_F32, false, (size_t)(&((ControlPoint_Type*)0)->x), NULL, 0 }, // EffectProperties.Path.Speed[].x + { TYPE_F32, false, (size_t)(&((ControlPoint_Type*)0)->y), NULL, 0 }, // EffectProperties.Path.Speed[].y + { TYPE_REF, false, (size_t)(&((ParametersStruct*)0)->TurbulenceFieldSampler), NULL, 0 }, // TurbulenceFieldSampler +}; + + +bool TurbulenceFieldSamplerEffect::mBuiltFlag = false; +NvParameterized::MutexType TurbulenceFieldSamplerEffect::mBuiltFlagMutex; + +TurbulenceFieldSamplerEffect::TurbulenceFieldSamplerEffect(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &TurbulenceFieldSamplerEffectFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +TurbulenceFieldSamplerEffect::~TurbulenceFieldSamplerEffect() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void TurbulenceFieldSamplerEffect::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->~TurbulenceFieldSamplerEffect(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* TurbulenceFieldSamplerEffect::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* TurbulenceFieldSamplerEffect::getParameterDefinitionTree(void) const +{ + TurbulenceFieldSamplerEffect* tmpParam = const_cast<TurbulenceFieldSamplerEffect*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType TurbulenceFieldSamplerEffect::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 TurbulenceFieldSamplerEffect::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 TurbulenceFieldSamplerEffect::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<TurbulenceFieldSamplerEffect::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ + +void TurbulenceFieldSamplerEffect::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 TurbulenceFieldSamplerEffect::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", "A turbulence effect", true); + ParamDefTable[0].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=1, longName="EffectProperties" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[1]; + ParamDef->init("EffectProperties", TYPE_STRUCT, "EffectProperties", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("READONLY", uint64_t(0), true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("READONLY", uint64_t(0), true); + HintTable[1].init("shortDescription", "Turbulence FS Properties", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=2, longName="EffectProperties.UserString" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[2]; + ParamDef->init("UserString", TYPE_STRING, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "An aribtrary user string that can be set by an artist/designer/programmer", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=3, longName="EffectProperties.Enable" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[3]; + ParamDef->init("Enable", TYPE_BOOL, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Whether or not this effect is to be initially enabled on startup", true); + ParamDefTable[3].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=4, longName="EffectProperties.Position" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[4]; + ParamDef->init("Position", TYPE_STRUCT, "TranslateObject", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "The position of this effect relative to the parent", true); + ParamDefTable[4].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=5, longName="EffectProperties.Position.TranslateX" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[5]; + ParamDef->init("TranslateX", 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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(500.000000000), true); + HintTable[2].init("min", double(-500.000000000), true); + ParamDefTable[5].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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(500.000000000), true); + HintTable[2].init("min", double(-500.000000000), true); + HintTable[3].init("shortDescription", "Nudge up to +/- one meter in each direction", true); + ParamDefTable[5].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=6, longName="EffectProperties.Position.TranslateY" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[6]; + ParamDef->init("TranslateY", 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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(500.000000000), true); + HintTable[2].init("min", double(-500.000000000), true); + ParamDefTable[6].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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(500.000000000), true); + HintTable[2].init("min", double(-500.000000000), true); + HintTable[3].init("shortDescription", "Nudge up to +/- one meter in each direction", true); + ParamDefTable[6].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=7, longName="EffectProperties.Position.TranslateZ" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[7]; + ParamDef->init("TranslateZ", 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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(500.000000000), true); + HintTable[2].init("min", double(-500.000000000), true); + ParamDefTable[7].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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(500.000000000), true); + HintTable[2].init("min", double(-500.000000000), true); + HintTable[3].init("shortDescription", "Nudge up to +/- one meter in each direction", true); + ParamDefTable[7].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=8, longName="EffectProperties.Orientation" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[8]; + ParamDef->init("Orientation", TYPE_STRUCT, "OrientObject", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "The orientation of this effect, relative to the parent orientation", true); + ParamDefTable[8].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=9, longName="EffectProperties.Orientation.RotateX" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[9]; + ParamDef->init("RotateX", 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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(360.000000000), true); + HintTable[2].init("min", double(0.000000000), true); + ParamDefTable[9].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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(360.000000000), true); + HintTable[2].init("min", double(0.000000000), true); + HintTable[3].init("shortDescription", "Rotate on the X axis (0-360 degrees)", true); + ParamDefTable[9].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=10, longName="EffectProperties.Orientation.RotateY" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[10]; + ParamDef->init("RotateY", 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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(360.000000000), true); + HintTable[2].init("min", double(0.000000000), true); + ParamDefTable[10].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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(360.000000000), true); + HintTable[2].init("min", double(0.000000000), true); + HintTable[3].init("shortDescription", "Rotate on the Y axis (0-360 degrees)", true); + ParamDefTable[10].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=11, longName="EffectProperties.Orientation.RotateZ" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[11]; + ParamDef->init("RotateZ", 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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(360.000000000), true); + HintTable[2].init("min", double(0.000000000), 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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(360.000000000), true); + HintTable[2].init("min", double(0.000000000), true); + HintTable[3].init("shortDescription", "Rotate on the Z axis (0-360 degrees)", true); + ParamDefTable[11].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=12, longName="EffectProperties.InitialDelayTime" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[12]; + ParamDef->init("InitialDelayTime", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("min", double(0.000000000), 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("min", double(0.000000000), true); + HintTable[1].init("shortDescription", "Initial time to delay before spawning this effect", true); + ParamDefTable[12].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=13, longName="EffectProperties.Duration" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[13]; + ParamDef->init("Duration", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("min", double(0.000000000), true); + ParamDefTable[13].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("min", double(0.000000000), true); + HintTable[1].init("shortDescription", "The duration of the effect in secontds", true); + ParamDefTable[13].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=14, longName="EffectProperties.RepeatCount" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[14]; + ParamDef->init("RepeatCount", TYPE_U32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("min", uint64_t(1), 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("min", uint64_t(1), true); + HintTable[1].init("shortDescription", "The number of times to repeat the effect; 9999 means repeate forever", true); + ParamDefTable[14].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=15, longName="EffectProperties.RepeatDelay" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[15]; + ParamDef->init("RepeatDelay", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("min", double(0.000000000), 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("min", double(0.000000000), true); + HintTable[1].init("shortDescription", "The time to delay activation each time the effect repeats in seconds; this can be different than the initial delay time", true); + ParamDefTable[15].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=16, longName="EffectProperties.RandomizeRepeatTime" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[16]; + ParamDef->init("RandomizeRepeatTime", 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", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), 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("max", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + HintTable[2].init("shortDescription", "Amount of randomization to the repeat cycle; a value of zero (default) means no random and a value of one means completely random.", true); + ParamDefTable[16].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=17, longName="EffectProperties.Path" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[17]; + ParamDef->init("Path", TYPE_STRUCT, "EffectPath", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "An optional pre-defined path for this effect to travel on", true); + ParamDefTable[17].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=18, longName="EffectProperties.Path.PlaybackMode" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[18]; + ParamDef->init("PlaybackMode", TYPE_ENUM, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "The mode to play back the path", true); + ParamDefTable[18].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + static const char* const EnumVals[] = { "LOOP", "PLAY_ONCE", "PING_PONG" }; + ParamDefTable[18].setEnumVals((const char**)EnumVals, 3); + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=19, longName="EffectProperties.Path.PathDuration" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[19]; + ParamDef->init("PathDuration", 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", double(1000.000000000), true); + HintTable[1].init("min", double(0.000010000), true); + ParamDefTable[19].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", double(1000.000000000), true); + HintTable[1].init("min", double(0.000010000), true); + HintTable[2].init("shortDescription", "The duration of the path if one is not otherwise provided", true); + ParamDefTable[19].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=20, longName="EffectProperties.Path.LoopIndex" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[20]; + ParamDef->init("LoopIndex", TYPE_U32, 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[20].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("min", uint64_t(0), true); + HintTable[1].init("shortDescription", "The array index to loop back to", true); + ParamDefTable[20].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=21, longName="EffectProperties.Path.ControlPoints" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[21]; + ParamDef->init("ControlPoints", TYPE_ARRAY, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("editorCurve", uint64_t(1), true); + HintTable[2].init("pathEditor", uint64_t(1), 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("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("editorCurve", uint64_t(1), true); + HintTable[2].init("pathEditor", uint64_t(1), true); + HintTable[3].init("shortDescription", "The array of control points to fit the curve to", true); + ParamDefTable[21].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + ParamDef->setArraySize(-1); + } + + // Initialize DefinitionImpl node: nodeIndex=22, longName="EffectProperties.Path.ControlPoints[]" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[22]; + ParamDef->init("ControlPoints", TYPE_TRANSFORM, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("editorCurve", uint64_t(1), true); + HintTable[2].init("pathEditor", uint64_t(1), 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("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("editorCurve", uint64_t(1), true); + HintTable[2].init("pathEditor", uint64_t(1), true); + HintTable[3].init("shortDescription", "The array of control points to fit the curve to", true); + ParamDefTable[22].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=23, longName="EffectProperties.Path.Scale" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[23]; + ParamDef->init("Scale", TYPE_ARRAY, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("xAxisLabel", "Over Time", true); + HintTable[4].init("yAxisLabel", "Scale", true); + ParamDefTable[23].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#else + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("shortDescription", "The array of scale values over time", true); + HintTable[4].init("xAxisLabel", "Over Time", true); + HintTable[5].init("yAxisLabel", "Scale", true); + ParamDefTable[23].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + ParamDef->setArraySize(-1); + } + + // Initialize DefinitionImpl node: nodeIndex=24, longName="EffectProperties.Path.Scale[]" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[24]; + ParamDef->init("Scale", TYPE_STRUCT, "ControlPoint", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("xAxisLabel", "Over Time", true); + HintTable[4].init("yAxisLabel", "Scale", true); + ParamDefTable[24].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#else + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("shortDescription", "The array of scale values over time", true); + HintTable[4].init("xAxisLabel", "Over Time", true); + HintTable[5].init("yAxisLabel", "Scale", true); + ParamDefTable[24].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=25, longName="EffectProperties.Path.Scale[].x" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[25]; + 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", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), 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("max", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + HintTable[2].init("shortDescription", "The x-axis value for this vector", true); + ParamDefTable[25].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=26, longName="EffectProperties.Path.Scale[].y" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[26]; + 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", "The y-axis value for this vector", true); + ParamDefTable[26].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=27, longName="EffectProperties.Path.Speed" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[27]; + ParamDef->init("Speed", TYPE_ARRAY, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("xAxisLabel", "Over Time", true); + HintTable[4].init("yAxisLabel", "Speed", true); + ParamDefTable[27].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#else + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("shortDescription", "The array of speed values over time", true); + HintTable[4].init("xAxisLabel", "Over Time", true); + HintTable[5].init("yAxisLabel", "Speed", true); + ParamDefTable[27].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + ParamDef->setArraySize(-1); + } + + // Initialize DefinitionImpl node: nodeIndex=28, longName="EffectProperties.Path.Speed[]" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[28]; + ParamDef->init("Speed", TYPE_STRUCT, "ControlPoint", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("xAxisLabel", "Over Time", true); + HintTable[4].init("yAxisLabel", "Speed", true); + ParamDefTable[28].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#else + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("shortDescription", "The array of speed values over time", true); + HintTable[4].init("xAxisLabel", "Over Time", true); + HintTable[5].init("yAxisLabel", "Speed", true); + ParamDefTable[28].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=29, longName="EffectProperties.Path.Speed[].x" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[29]; + 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", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + ParamDefTable[29].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", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + HintTable[2].init("shortDescription", "The x-axis value for this vector", true); + ParamDefTable[29].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=30, longName="EffectProperties.Path.Speed[].y" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[30]; + 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", "The y-axis value for this vector", true); + ParamDefTable[30].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=31, longName="TurbulenceFieldSampler" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[31]; + ParamDef->init("TurbulenceFieldSampler", TYPE_REF, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Turbulence FS Asset", true); + ParamDefTable[31].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + static const char* const RefVariantVals[] = { "TurbulenceFSAsset" }; + ParamDefTable[31].setRefVariantVals((const char**)RefVariantVals, 1); + + + + } + + // SetChildren for: nodeIndex=0, longName="" + { + static Definition* Children[2]; + Children[0] = PDEF_PTR(1); + Children[1] = PDEF_PTR(31); + + ParamDefTable[0].setChildren(Children, 2); + } + + // SetChildren for: nodeIndex=1, longName="EffectProperties" + { + static Definition* Children[10]; + Children[0] = PDEF_PTR(2); + Children[1] = PDEF_PTR(3); + Children[2] = PDEF_PTR(4); + Children[3] = PDEF_PTR(8); + Children[4] = PDEF_PTR(12); + Children[5] = PDEF_PTR(13); + Children[6] = PDEF_PTR(14); + Children[7] = PDEF_PTR(15); + Children[8] = PDEF_PTR(16); + Children[9] = PDEF_PTR(17); + + ParamDefTable[1].setChildren(Children, 10); + } + + // SetChildren for: nodeIndex=4, longName="EffectProperties.Position" + { + static Definition* Children[3]; + Children[0] = PDEF_PTR(5); + Children[1] = PDEF_PTR(6); + Children[2] = PDEF_PTR(7); + + ParamDefTable[4].setChildren(Children, 3); + } + + // SetChildren for: nodeIndex=8, longName="EffectProperties.Orientation" + { + static Definition* Children[3]; + Children[0] = PDEF_PTR(9); + Children[1] = PDEF_PTR(10); + Children[2] = PDEF_PTR(11); + + ParamDefTable[8].setChildren(Children, 3); + } + + // SetChildren for: nodeIndex=17, longName="EffectProperties.Path" + { + static Definition* Children[6]; + Children[0] = PDEF_PTR(18); + Children[1] = PDEF_PTR(19); + Children[2] = PDEF_PTR(20); + Children[3] = PDEF_PTR(21); + Children[4] = PDEF_PTR(23); + Children[5] = PDEF_PTR(27); + + ParamDefTable[17].setChildren(Children, 6); + } + + // SetChildren for: nodeIndex=21, longName="EffectProperties.Path.ControlPoints" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(22); + + ParamDefTable[21].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=23, longName="EffectProperties.Path.Scale" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(24); + + ParamDefTable[23].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=24, longName="EffectProperties.Path.Scale[]" + { + static Definition* Children[2]; + Children[0] = PDEF_PTR(25); + Children[1] = PDEF_PTR(26); + + ParamDefTable[24].setChildren(Children, 2); + } + + // SetChildren for: nodeIndex=27, longName="EffectProperties.Path.Speed" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(28); + + ParamDefTable[27].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=28, longName="EffectProperties.Path.Speed[]" + { + static Definition* Children[2]; + Children[0] = PDEF_PTR(29); + Children[1] = PDEF_PTR(30); + + ParamDefTable[28].setChildren(Children, 2); + } + + mBuiltFlag = true; + +} +void TurbulenceFieldSamplerEffect::initStrings(void) +{ + EffectProperties.UserString.isAllocated = true; + EffectProperties.UserString.buf = NULL; +} + +void TurbulenceFieldSamplerEffect::initDynamicArrays(void) +{ + EffectProperties.Path.ControlPoints.buf = NULL; + EffectProperties.Path.ControlPoints.isAllocated = true; + EffectProperties.Path.ControlPoints.elementSize = sizeof(physx::PxTransform); + EffectProperties.Path.ControlPoints.arraySizes[0] = 0; + EffectProperties.Path.Scale.buf = NULL; + EffectProperties.Path.Scale.isAllocated = true; + EffectProperties.Path.Scale.elementSize = sizeof(ControlPoint_Type); + EffectProperties.Path.Scale.arraySizes[0] = 0; + EffectProperties.Path.Speed.buf = NULL; + EffectProperties.Path.Speed.isAllocated = true; + EffectProperties.Path.Speed.elementSize = sizeof(ControlPoint_Type); + EffectProperties.Path.Speed.arraySizes[0] = 0; +} + +void TurbulenceFieldSamplerEffect::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + EffectProperties.Enable = bool(1); + EffectProperties.Position.TranslateX = float(0.000000000); + EffectProperties.Position.TranslateY = float(0.000000000); + EffectProperties.Position.TranslateZ = float(0.000000000); + EffectProperties.Orientation.RotateX = float(0.000000000); + EffectProperties.Orientation.RotateY = float(0.000000000); + EffectProperties.Orientation.RotateZ = float(0.000000000); + EffectProperties.InitialDelayTime = float(0.000000000); + EffectProperties.Duration = float(0.000000000); + EffectProperties.RepeatCount = uint32_t(1); + EffectProperties.RepeatDelay = float(0.000000000); + EffectProperties.RandomizeRepeatTime = float(0.000000000); + EffectProperties.Path.PlaybackMode = (const char*)"LOOP"; + EffectProperties.Path.PathDuration = float(4.000000000); + EffectProperties.Path.LoopIndex = uint32_t(0); + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void TurbulenceFieldSamplerEffect::initReferences(void) +{ + TurbulenceFieldSampler = NULL; + +} + +void TurbulenceFieldSamplerEffect::freeDynamicArrays(void) +{ + if (EffectProperties.Path.ControlPoints.isAllocated && EffectProperties.Path.ControlPoints.buf) + { + mParameterizedTraits->free(EffectProperties.Path.ControlPoints.buf); + } + if (EffectProperties.Path.Scale.isAllocated && EffectProperties.Path.Scale.buf) + { + mParameterizedTraits->free(EffectProperties.Path.Scale.buf); + } + if (EffectProperties.Path.Speed.isAllocated && EffectProperties.Path.Speed.buf) + { + mParameterizedTraits->free(EffectProperties.Path.Speed.buf); + } +} + +void TurbulenceFieldSamplerEffect::freeStrings(void) +{ + + if (EffectProperties.UserString.isAllocated && EffectProperties.UserString.buf) + { + mParameterizedTraits->strfree((char*)EffectProperties.UserString.buf); + } +} + +void TurbulenceFieldSamplerEffect::freeReferences(void) +{ + if (TurbulenceFieldSampler) + { + TurbulenceFieldSampler->destroy(); + } + +} + +} // namespace particles +} // namespace nvidia diff --git a/APEX_1.4/module/particles/src/autogen/VelocitySourceData.cpp b/APEX_1.4/module/particles/src/autogen/VelocitySourceData.cpp new file mode 100644 index 00000000..32ceac93 --- /dev/null +++ b/APEX_1.4/module/particles/src/autogen/VelocitySourceData.cpp @@ -0,0 +1,363 @@ +// 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 "VelocitySourceData.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace particles +{ + +using namespace VelocitySourceDataNS; + +const char* const VelocitySourceDataFactory::vptr = + NvParameterized::getVptr<VelocitySourceData, VelocitySourceData::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_STRING, false, (size_t)(&((ParametersStruct*)0)->Name), NULL, 0 }, // Name + { TYPE_REF, false, (size_t)(&((ParametersStruct*)0)->VelocitySource), NULL, 0 }, // VelocitySource +}; + + +bool VelocitySourceData::mBuiltFlag = false; +NvParameterized::MutexType VelocitySourceData::mBuiltFlagMutex; + +VelocitySourceData::VelocitySourceData(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &VelocitySourceDataFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +VelocitySourceData::~VelocitySourceData() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void VelocitySourceData::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->~VelocitySourceData(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* VelocitySourceData::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* VelocitySourceData::getParameterDefinitionTree(void) const +{ + VelocitySourceData* tmpParam = const_cast<VelocitySourceData*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType VelocitySourceData::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 VelocitySourceData::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 VelocitySourceData::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<VelocitySourceData::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ + +void VelocitySourceData::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 VelocitySourceData::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", "Contains the asset properties for this velocity source", true); + ParamDefTable[0].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=1, longName="Name" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[1]; + ParamDef->init("Name", TYPE_STRING, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Velocity Source Name", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=2, longName="VelocitySource" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[2]; + ParamDef->init("VelocitySource", 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[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("INCLUDED", uint64_t(1), true); + HintTable[1].init("shortDescription", "Velocity Source properties", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + static const char* const RefVariantVals[] = { "VelocitySourceAssetParams" }; + ParamDefTable[2].setRefVariantVals((const char**)RefVariantVals, 1); + + + + } + + // 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 VelocitySourceData::initStrings(void) +{ + Name.isAllocated = false; + Name.buf = (const char*)"defaultVelocitySource"; +} + +void VelocitySourceData::initDynamicArrays(void) +{ +} + +void VelocitySourceData::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void VelocitySourceData::initReferences(void) +{ + VelocitySource = NULL; + +} + +void VelocitySourceData::freeDynamicArrays(void) +{ +} + +void VelocitySourceData::freeStrings(void) +{ + + if (Name.isAllocated && Name.buf) + { + mParameterizedTraits->strfree((char*)Name.buf); + } +} + +void VelocitySourceData::freeReferences(void) +{ + if (VelocitySource) + { + VelocitySource->destroy(); + } + +} + +} // namespace particles +} // namespace nvidia diff --git a/APEX_1.4/module/particles/src/autogen/VelocitySourceEffect.cpp b/APEX_1.4/module/particles/src/autogen/VelocitySourceEffect.cpp new file mode 100644 index 00000000..71af2d18 --- /dev/null +++ b/APEX_1.4/module/particles/src/autogen/VelocitySourceEffect.cpp @@ -0,0 +1,1356 @@ +// 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 "VelocitySourceEffect.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace particles +{ + +using namespace VelocitySourceEffectNS; + +const char* const VelocitySourceEffectFactory::vptr = + NvParameterized::getVptr<VelocitySourceEffect, VelocitySourceEffect::ClassAlignment>(); + +const uint32_t NumParamDefs = 32; +static NvParameterized::DefinitionImpl* ParamDefTable; // now allocated in buildTree [NumParamDefs]; + + +static const size_t ParamLookupChildrenTable[] = +{ + 1, 31, 2, 3, 4, 8, 12, 13, 14, 15, 16, 17, 5, 6, 7, 9, 10, 11, 18, 19, 20, 21, 23, + 27, 22, 24, 25, 26, 28, 29, 30, +}; + +#define TENUM(type) nvidia::##type +#define CHILDREN(index) &ParamLookupChildrenTable[index] +static const NvParameterized::ParamLookupNode ParamLookupTable[NumParamDefs] = +{ + { TYPE_STRUCT, false, 0, CHILDREN(0), 2 }, + { TYPE_STRUCT, false, (size_t)(&((ParametersStruct*)0)->EffectProperties), CHILDREN(2), 10 }, // EffectProperties + { TYPE_STRING, false, (size_t)(&((EffectProperties_Type*)0)->UserString), NULL, 0 }, // EffectProperties.UserString + { TYPE_BOOL, false, (size_t)(&((EffectProperties_Type*)0)->Enable), NULL, 0 }, // EffectProperties.Enable + { TYPE_STRUCT, false, (size_t)(&((EffectProperties_Type*)0)->Position), CHILDREN(12), 3 }, // EffectProperties.Position + { TYPE_F32, false, (size_t)(&((TranslateObject_Type*)0)->TranslateX), NULL, 0 }, // EffectProperties.Position.TranslateX + { TYPE_F32, false, (size_t)(&((TranslateObject_Type*)0)->TranslateY), NULL, 0 }, // EffectProperties.Position.TranslateY + { TYPE_F32, false, (size_t)(&((TranslateObject_Type*)0)->TranslateZ), NULL, 0 }, // EffectProperties.Position.TranslateZ + { TYPE_STRUCT, false, (size_t)(&((EffectProperties_Type*)0)->Orientation), CHILDREN(15), 3 }, // EffectProperties.Orientation + { TYPE_F32, false, (size_t)(&((OrientObject_Type*)0)->RotateX), NULL, 0 }, // EffectProperties.Orientation.RotateX + { TYPE_F32, false, (size_t)(&((OrientObject_Type*)0)->RotateY), NULL, 0 }, // EffectProperties.Orientation.RotateY + { TYPE_F32, false, (size_t)(&((OrientObject_Type*)0)->RotateZ), NULL, 0 }, // EffectProperties.Orientation.RotateZ + { TYPE_F32, false, (size_t)(&((EffectProperties_Type*)0)->InitialDelayTime), NULL, 0 }, // EffectProperties.InitialDelayTime + { TYPE_F32, false, (size_t)(&((EffectProperties_Type*)0)->Duration), NULL, 0 }, // EffectProperties.Duration + { TYPE_U32, false, (size_t)(&((EffectProperties_Type*)0)->RepeatCount), NULL, 0 }, // EffectProperties.RepeatCount + { TYPE_F32, false, (size_t)(&((EffectProperties_Type*)0)->RepeatDelay), NULL, 0 }, // EffectProperties.RepeatDelay + { TYPE_F32, false, (size_t)(&((EffectProperties_Type*)0)->RandomizeRepeatTime), NULL, 0 }, // EffectProperties.RandomizeRepeatTime + { TYPE_STRUCT, false, (size_t)(&((EffectProperties_Type*)0)->Path), CHILDREN(18), 6 }, // EffectProperties.Path + { TYPE_ENUM, false, (size_t)(&((EffectPath_Type*)0)->PlaybackMode), NULL, 0 }, // EffectProperties.Path.PlaybackMode + { TYPE_F32, false, (size_t)(&((EffectPath_Type*)0)->PathDuration), NULL, 0 }, // EffectProperties.Path.PathDuration + { TYPE_U32, false, (size_t)(&((EffectPath_Type*)0)->LoopIndex), NULL, 0 }, // EffectProperties.Path.LoopIndex + { TYPE_ARRAY, true, (size_t)(&((EffectPath_Type*)0)->ControlPoints), CHILDREN(24), 1 }, // EffectProperties.Path.ControlPoints + { TYPE_TRANSFORM, false, 1 * sizeof(physx::PxTransform), NULL, 0 }, // EffectProperties.Path.ControlPoints[] + { TYPE_ARRAY, true, (size_t)(&((EffectPath_Type*)0)->Scale), CHILDREN(25), 1 }, // EffectProperties.Path.Scale + { TYPE_STRUCT, false, 1 * sizeof(ControlPoint_Type), CHILDREN(26), 2 }, // EffectProperties.Path.Scale[] + { TYPE_F32, false, (size_t)(&((ControlPoint_Type*)0)->x), NULL, 0 }, // EffectProperties.Path.Scale[].x + { TYPE_F32, false, (size_t)(&((ControlPoint_Type*)0)->y), NULL, 0 }, // EffectProperties.Path.Scale[].y + { TYPE_ARRAY, true, (size_t)(&((EffectPath_Type*)0)->Speed), CHILDREN(28), 1 }, // EffectProperties.Path.Speed + { TYPE_STRUCT, false, 1 * sizeof(ControlPoint_Type), CHILDREN(29), 2 }, // EffectProperties.Path.Speed[] + { TYPE_F32, false, (size_t)(&((ControlPoint_Type*)0)->x), NULL, 0 }, // EffectProperties.Path.Speed[].x + { TYPE_F32, false, (size_t)(&((ControlPoint_Type*)0)->y), NULL, 0 }, // EffectProperties.Path.Speed[].y + { TYPE_REF, false, (size_t)(&((ParametersStruct*)0)->VelocitySource), NULL, 0 }, // VelocitySource +}; + + +bool VelocitySourceEffect::mBuiltFlag = false; +NvParameterized::MutexType VelocitySourceEffect::mBuiltFlagMutex; + +VelocitySourceEffect::VelocitySourceEffect(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &VelocitySourceEffectFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +VelocitySourceEffect::~VelocitySourceEffect() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void VelocitySourceEffect::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->~VelocitySourceEffect(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* VelocitySourceEffect::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* VelocitySourceEffect::getParameterDefinitionTree(void) const +{ + VelocitySourceEffect* tmpParam = const_cast<VelocitySourceEffect*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType VelocitySourceEffect::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 VelocitySourceEffect::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 VelocitySourceEffect::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<VelocitySourceEffect::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ + +void VelocitySourceEffect::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 VelocitySourceEffect::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", "A velocity source effect", true); + ParamDefTable[0].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=1, longName="EffectProperties" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[1]; + ParamDef->init("EffectProperties", TYPE_STRUCT, "EffectProperties", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Velocity Source Properties", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=2, longName="EffectProperties.UserString" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[2]; + ParamDef->init("UserString", TYPE_STRING, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "An aribtrary user string that can be set by an artist/designer/programmer", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=3, longName="EffectProperties.Enable" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[3]; + ParamDef->init("Enable", TYPE_BOOL, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Whether or not this effect is to be initially enabled on startup", true); + ParamDefTable[3].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=4, longName="EffectProperties.Position" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[4]; + ParamDef->init("Position", TYPE_STRUCT, "TranslateObject", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "The position of this effect relative to the parent", true); + ParamDefTable[4].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=5, longName="EffectProperties.Position.TranslateX" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[5]; + ParamDef->init("TranslateX", 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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(500.000000000), true); + HintTable[2].init("min", double(-500.000000000), true); + ParamDefTable[5].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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(500.000000000), true); + HintTable[2].init("min", double(-500.000000000), true); + HintTable[3].init("shortDescription", "Nudge up to +/- one meter in each direction", true); + ParamDefTable[5].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=6, longName="EffectProperties.Position.TranslateY" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[6]; + ParamDef->init("TranslateY", 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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(500.000000000), true); + HintTable[2].init("min", double(-500.000000000), true); + ParamDefTable[6].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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(500.000000000), true); + HintTable[2].init("min", double(-500.000000000), true); + HintTable[3].init("shortDescription", "Nudge up to +/- one meter in each direction", true); + ParamDefTable[6].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=7, longName="EffectProperties.Position.TranslateZ" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[7]; + ParamDef->init("TranslateZ", 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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(500.000000000), true); + HintTable[2].init("min", double(-500.000000000), true); + ParamDefTable[7].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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(500.000000000), true); + HintTable[2].init("min", double(-500.000000000), true); + HintTable[3].init("shortDescription", "Nudge up to +/- one meter in each direction", true); + ParamDefTable[7].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=8, longName="EffectProperties.Orientation" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[8]; + ParamDef->init("Orientation", TYPE_STRUCT, "OrientObject", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "The orientation of this effect, relative to the parent orientation", true); + ParamDefTable[8].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=9, longName="EffectProperties.Orientation.RotateX" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[9]; + ParamDef->init("RotateX", 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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(360.000000000), true); + HintTable[2].init("min", double(0.000000000), true); + ParamDefTable[9].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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(360.000000000), true); + HintTable[2].init("min", double(0.000000000), true); + HintTable[3].init("shortDescription", "Rotate on the X axis (0-360 degrees)", true); + ParamDefTable[9].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=10, longName="EffectProperties.Orientation.RotateY" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[10]; + ParamDef->init("RotateY", 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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(360.000000000), true); + HintTable[2].init("min", double(0.000000000), true); + ParamDefTable[10].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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(360.000000000), true); + HintTable[2].init("min", double(0.000000000), true); + HintTable[3].init("shortDescription", "Rotate on the Y axis (0-360 degrees)", true); + ParamDefTable[10].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=11, longName="EffectProperties.Orientation.RotateZ" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[11]; + ParamDef->init("RotateZ", 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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(360.000000000), true); + HintTable[2].init("min", double(0.000000000), 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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(360.000000000), true); + HintTable[2].init("min", double(0.000000000), true); + HintTable[3].init("shortDescription", "Rotate on the Z axis (0-360 degrees)", true); + ParamDefTable[11].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=12, longName="EffectProperties.InitialDelayTime" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[12]; + ParamDef->init("InitialDelayTime", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("min", double(0.000000000), 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("min", double(0.000000000), true); + HintTable[1].init("shortDescription", "Initial time to delay before spawning this effect", true); + ParamDefTable[12].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=13, longName="EffectProperties.Duration" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[13]; + ParamDef->init("Duration", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("min", double(0.000000000), true); + ParamDefTable[13].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("min", double(0.000000000), true); + HintTable[1].init("shortDescription", "The duration of the effect in secontds", true); + ParamDefTable[13].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=14, longName="EffectProperties.RepeatCount" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[14]; + ParamDef->init("RepeatCount", TYPE_U32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("min", uint64_t(1), 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("min", uint64_t(1), true); + HintTable[1].init("shortDescription", "The number of times to repeat the effect; 9999 means repeate forever", true); + ParamDefTable[14].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=15, longName="EffectProperties.RepeatDelay" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[15]; + ParamDef->init("RepeatDelay", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("min", double(0.000000000), 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("min", double(0.000000000), true); + HintTable[1].init("shortDescription", "The time to delay activation each time the effect repeats in seconds; this can be different than the initial delay time", true); + ParamDefTable[15].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=16, longName="EffectProperties.RandomizeRepeatTime" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[16]; + ParamDef->init("RandomizeRepeatTime", 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", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), 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("max", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + HintTable[2].init("shortDescription", "Amount of randomization to the repeat cycle; a value of zero (default) means no random and a value of one means completely random.", true); + ParamDefTable[16].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=17, longName="EffectProperties.Path" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[17]; + ParamDef->init("Path", TYPE_STRUCT, "EffectPath", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "An optional pre-defined path for this effect to travel on", true); + ParamDefTable[17].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=18, longName="EffectProperties.Path.PlaybackMode" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[18]; + ParamDef->init("PlaybackMode", TYPE_ENUM, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "The mode to play back the path", true); + ParamDefTable[18].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + static const char* const EnumVals[] = { "LOOP", "PLAY_ONCE", "PING_PONG" }; + ParamDefTable[18].setEnumVals((const char**)EnumVals, 3); + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=19, longName="EffectProperties.Path.PathDuration" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[19]; + ParamDef->init("PathDuration", 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", double(1000.000000000), true); + HintTable[1].init("min", double(0.000010000), true); + ParamDefTable[19].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", double(1000.000000000), true); + HintTable[1].init("min", double(0.000010000), true); + HintTable[2].init("shortDescription", "The duration of the path if one is not otherwise provided", true); + ParamDefTable[19].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=20, longName="EffectProperties.Path.LoopIndex" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[20]; + ParamDef->init("LoopIndex", TYPE_U32, 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[20].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("min", uint64_t(0), true); + HintTable[1].init("shortDescription", "The array index to loop back to", true); + ParamDefTable[20].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=21, longName="EffectProperties.Path.ControlPoints" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[21]; + ParamDef->init("ControlPoints", TYPE_ARRAY, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("editorCurve", uint64_t(1), true); + HintTable[2].init("pathEditor", uint64_t(1), 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("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("editorCurve", uint64_t(1), true); + HintTable[2].init("pathEditor", uint64_t(1), true); + HintTable[3].init("shortDescription", "The array of control points to fit the curve to", true); + ParamDefTable[21].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + ParamDef->setArraySize(-1); + } + + // Initialize DefinitionImpl node: nodeIndex=22, longName="EffectProperties.Path.ControlPoints[]" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[22]; + ParamDef->init("ControlPoints", TYPE_TRANSFORM, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("editorCurve", uint64_t(1), true); + HintTable[2].init("pathEditor", uint64_t(1), 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("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("editorCurve", uint64_t(1), true); + HintTable[2].init("pathEditor", uint64_t(1), true); + HintTable[3].init("shortDescription", "The array of control points to fit the curve to", true); + ParamDefTable[22].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=23, longName="EffectProperties.Path.Scale" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[23]; + ParamDef->init("Scale", TYPE_ARRAY, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("xAxisLabel", "Over Time", true); + HintTable[4].init("yAxisLabel", "Scale", true); + ParamDefTable[23].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#else + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("shortDescription", "The array of scale values over time", true); + HintTable[4].init("xAxisLabel", "Over Time", true); + HintTable[5].init("yAxisLabel", "Scale", true); + ParamDefTable[23].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + ParamDef->setArraySize(-1); + } + + // Initialize DefinitionImpl node: nodeIndex=24, longName="EffectProperties.Path.Scale[]" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[24]; + ParamDef->init("Scale", TYPE_STRUCT, "ControlPoint", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("xAxisLabel", "Over Time", true); + HintTable[4].init("yAxisLabel", "Scale", true); + ParamDefTable[24].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#else + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("shortDescription", "The array of scale values over time", true); + HintTable[4].init("xAxisLabel", "Over Time", true); + HintTable[5].init("yAxisLabel", "Scale", true); + ParamDefTable[24].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=25, longName="EffectProperties.Path.Scale[].x" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[25]; + 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", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), 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("max", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + HintTable[2].init("shortDescription", "The x-axis value for this vector", true); + ParamDefTable[25].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=26, longName="EffectProperties.Path.Scale[].y" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[26]; + 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", "The y-axis value for this vector", true); + ParamDefTable[26].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=27, longName="EffectProperties.Path.Speed" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[27]; + ParamDef->init("Speed", TYPE_ARRAY, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("xAxisLabel", "Over Time", true); + HintTable[4].init("yAxisLabel", "Speed", true); + ParamDefTable[27].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#else + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("shortDescription", "The array of speed values over time", true); + HintTable[4].init("xAxisLabel", "Over Time", true); + HintTable[5].init("yAxisLabel", "Speed", true); + ParamDefTable[27].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + ParamDef->setArraySize(-1); + } + + // Initialize DefinitionImpl node: nodeIndex=28, longName="EffectProperties.Path.Speed[]" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[28]; + ParamDef->init("Speed", TYPE_STRUCT, "ControlPoint", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("xAxisLabel", "Over Time", true); + HintTable[4].init("yAxisLabel", "Speed", true); + ParamDefTable[28].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#else + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("shortDescription", "The array of speed values over time", true); + HintTable[4].init("xAxisLabel", "Over Time", true); + HintTable[5].init("yAxisLabel", "Speed", true); + ParamDefTable[28].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=29, longName="EffectProperties.Path.Speed[].x" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[29]; + 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", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + ParamDefTable[29].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", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + HintTable[2].init("shortDescription", "The x-axis value for this vector", true); + ParamDefTable[29].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=30, longName="EffectProperties.Path.Speed[].y" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[30]; + 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", "The y-axis value for this vector", true); + ParamDefTable[30].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=31, longName="VelocitySource" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[31]; + ParamDef->init("VelocitySource", TYPE_REF, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Velocity Source Asset", true); + ParamDefTable[31].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + static const char* const RefVariantVals[] = { "VelocitySourceAsset" }; + ParamDefTable[31].setRefVariantVals((const char**)RefVariantVals, 1); + + + + } + + // SetChildren for: nodeIndex=0, longName="" + { + static Definition* Children[2]; + Children[0] = PDEF_PTR(1); + Children[1] = PDEF_PTR(31); + + ParamDefTable[0].setChildren(Children, 2); + } + + // SetChildren for: nodeIndex=1, longName="EffectProperties" + { + static Definition* Children[10]; + Children[0] = PDEF_PTR(2); + Children[1] = PDEF_PTR(3); + Children[2] = PDEF_PTR(4); + Children[3] = PDEF_PTR(8); + Children[4] = PDEF_PTR(12); + Children[5] = PDEF_PTR(13); + Children[6] = PDEF_PTR(14); + Children[7] = PDEF_PTR(15); + Children[8] = PDEF_PTR(16); + Children[9] = PDEF_PTR(17); + + ParamDefTable[1].setChildren(Children, 10); + } + + // SetChildren for: nodeIndex=4, longName="EffectProperties.Position" + { + static Definition* Children[3]; + Children[0] = PDEF_PTR(5); + Children[1] = PDEF_PTR(6); + Children[2] = PDEF_PTR(7); + + ParamDefTable[4].setChildren(Children, 3); + } + + // SetChildren for: nodeIndex=8, longName="EffectProperties.Orientation" + { + static Definition* Children[3]; + Children[0] = PDEF_PTR(9); + Children[1] = PDEF_PTR(10); + Children[2] = PDEF_PTR(11); + + ParamDefTable[8].setChildren(Children, 3); + } + + // SetChildren for: nodeIndex=17, longName="EffectProperties.Path" + { + static Definition* Children[6]; + Children[0] = PDEF_PTR(18); + Children[1] = PDEF_PTR(19); + Children[2] = PDEF_PTR(20); + Children[3] = PDEF_PTR(21); + Children[4] = PDEF_PTR(23); + Children[5] = PDEF_PTR(27); + + ParamDefTable[17].setChildren(Children, 6); + } + + // SetChildren for: nodeIndex=21, longName="EffectProperties.Path.ControlPoints" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(22); + + ParamDefTable[21].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=23, longName="EffectProperties.Path.Scale" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(24); + + ParamDefTable[23].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=24, longName="EffectProperties.Path.Scale[]" + { + static Definition* Children[2]; + Children[0] = PDEF_PTR(25); + Children[1] = PDEF_PTR(26); + + ParamDefTable[24].setChildren(Children, 2); + } + + // SetChildren for: nodeIndex=27, longName="EffectProperties.Path.Speed" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(28); + + ParamDefTable[27].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=28, longName="EffectProperties.Path.Speed[]" + { + static Definition* Children[2]; + Children[0] = PDEF_PTR(29); + Children[1] = PDEF_PTR(30); + + ParamDefTable[28].setChildren(Children, 2); + } + + mBuiltFlag = true; + +} +void VelocitySourceEffect::initStrings(void) +{ + EffectProperties.UserString.isAllocated = true; + EffectProperties.UserString.buf = NULL; +} + +void VelocitySourceEffect::initDynamicArrays(void) +{ + EffectProperties.Path.ControlPoints.buf = NULL; + EffectProperties.Path.ControlPoints.isAllocated = true; + EffectProperties.Path.ControlPoints.elementSize = sizeof(physx::PxTransform); + EffectProperties.Path.ControlPoints.arraySizes[0] = 0; + EffectProperties.Path.Scale.buf = NULL; + EffectProperties.Path.Scale.isAllocated = true; + EffectProperties.Path.Scale.elementSize = sizeof(ControlPoint_Type); + EffectProperties.Path.Scale.arraySizes[0] = 0; + EffectProperties.Path.Speed.buf = NULL; + EffectProperties.Path.Speed.isAllocated = true; + EffectProperties.Path.Speed.elementSize = sizeof(ControlPoint_Type); + EffectProperties.Path.Speed.arraySizes[0] = 0; +} + +void VelocitySourceEffect::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + EffectProperties.Enable = bool(1); + EffectProperties.Position.TranslateX = float(0.000000000); + EffectProperties.Position.TranslateY = float(0.000000000); + EffectProperties.Position.TranslateZ = float(0.000000000); + EffectProperties.Orientation.RotateX = float(0.000000000); + EffectProperties.Orientation.RotateY = float(0.000000000); + EffectProperties.Orientation.RotateZ = float(0.000000000); + EffectProperties.InitialDelayTime = float(0.000000000); + EffectProperties.Duration = float(0.000000000); + EffectProperties.RepeatCount = uint32_t(1); + EffectProperties.RepeatDelay = float(0.000000000); + EffectProperties.RandomizeRepeatTime = float(0.000000000); + EffectProperties.Path.PlaybackMode = (const char*)"LOOP"; + EffectProperties.Path.PathDuration = float(4.000000000); + EffectProperties.Path.LoopIndex = uint32_t(0); + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void VelocitySourceEffect::initReferences(void) +{ + VelocitySource = NULL; + +} + +void VelocitySourceEffect::freeDynamicArrays(void) +{ + if (EffectProperties.Path.ControlPoints.isAllocated && EffectProperties.Path.ControlPoints.buf) + { + mParameterizedTraits->free(EffectProperties.Path.ControlPoints.buf); + } + if (EffectProperties.Path.Scale.isAllocated && EffectProperties.Path.Scale.buf) + { + mParameterizedTraits->free(EffectProperties.Path.Scale.buf); + } + if (EffectProperties.Path.Speed.isAllocated && EffectProperties.Path.Speed.buf) + { + mParameterizedTraits->free(EffectProperties.Path.Speed.buf); + } +} + +void VelocitySourceEffect::freeStrings(void) +{ + + if (EffectProperties.UserString.isAllocated && EffectProperties.UserString.buf) + { + mParameterizedTraits->strfree((char*)EffectProperties.UserString.buf); + } +} + +void VelocitySourceEffect::freeReferences(void) +{ + if (VelocitySource) + { + VelocitySource->destroy(); + } + +} + +} // namespace particles +} // namespace nvidia diff --git a/APEX_1.4/module/particles/src/autogen/VolumeRenderMaterialData.cpp b/APEX_1.4/module/particles/src/autogen/VolumeRenderMaterialData.cpp new file mode 100644 index 00000000..a62c9463 --- /dev/null +++ b/APEX_1.4/module/particles/src/autogen/VolumeRenderMaterialData.cpp @@ -0,0 +1,1349 @@ +// 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 "VolumeRenderMaterialData.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace particles +{ + +using namespace VolumeRenderMaterialDataNS; + +const char* const VolumeRenderMaterialDataFactory::vptr = + NvParameterized::getVptr<VolumeRenderMaterialData, VolumeRenderMaterialData::ClassAlignment>(); + +const uint32_t NumParamDefs = 36; +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, 26, 27, 28, 29, 30, 34, 35, 31, 32, 33, +}; + +#define TENUM(type) nvidia::##type +#define CHILDREN(index) &ParamLookupChildrenTable[index] +static const NvParameterized::ParamLookupNode ParamLookupTable[NumParamDefs] = +{ + { TYPE_STRUCT, false, 0, CHILDREN(0), 32 }, + { TYPE_STRING, false, (size_t)(&((ParametersStruct*)0)->Name), NULL, 0 }, // Name + { TYPE_STRING, false, (size_t)(&((ParametersStruct*)0)->ApplicationMaterialName), NULL, 0 }, // ApplicationMaterialName + { TYPE_STRING, false, (size_t)(&((ParametersStruct*)0)->UserProperties), NULL, 0 }, // UserProperties + { TYPE_ENUM, false, (size_t)(&((ParametersStruct*)0)->RenderMode), NULL, 0 }, // RenderMode + { TYPE_ENUM, false, (size_t)(&((ParametersStruct*)0)->RenderMethod), NULL, 0 }, // RenderMethod + { TYPE_ENUM, false, (size_t)(&((ParametersStruct*)0)->ResolutionScale), NULL, 0 }, // ResolutionScale + { TYPE_ENUM, false, (size_t)(&((ParametersStruct*)0)->FillMode), NULL, 0 }, // FillMode + { TYPE_BOOL, false, (size_t)(&((ParametersStruct*)0)->GenerateShadows), NULL, 0 }, // GenerateShadows + { TYPE_BOOL, false, (size_t)(&((ParametersStruct*)0)->BlurShadows), NULL, 0 }, // BlurShadows + { TYPE_BOOL, false, (size_t)(&((ParametersStruct*)0)->GenerateMipmaps), NULL, 0 }, // GenerateMipmaps + { TYPE_BOOL, false, (size_t)(&((ParametersStruct*)0)->EnableStencilOpt), NULL, 0 }, // EnableStencilOpt + { TYPE_F32, false, (size_t)(&((ParametersStruct*)0)->StepScale), NULL, 0 }, // StepScale + { TYPE_F32, false, (size_t)(&((ParametersStruct*)0)->Density), NULL, 0 }, // Density + { TYPE_F32, false, (size_t)(&((ParametersStruct*)0)->EdgeFade), NULL, 0 }, // EdgeFade + { TYPE_F32, false, (size_t)(&((ParametersStruct*)0)->OpacityThreshold), NULL, 0 }, // OpacityThreshold + { TYPE_F32, false, (size_t)(&((ParametersStruct*)0)->RayJitter), NULL, 0 }, // RayJitter + { TYPE_F32, false, (size_t)(&((ParametersStruct*)0)->IsoValue), NULL, 0 }, // IsoValue + { TYPE_F32, false, (size_t)(&((ParametersStruct*)0)->IsoValueSign), NULL, 0 }, // IsoValueSign + { TYPE_U32, false, (size_t)(&((ParametersStruct*)0)->ShadowSamples), NULL, 0 }, // ShadowSamples + { TYPE_F32, false, (size_t)(&((ParametersStruct*)0)->ShadowDistance), NULL, 0 }, // ShadowDistance + { TYPE_F32, false, (size_t)(&((ParametersStruct*)0)->ShadowDensity), NULL, 0 }, // ShadowDensity + { TYPE_F32, false, (size_t)(&((ParametersStruct*)0)->ShadowJitter), NULL, 0 }, // ShadowJitter + { TYPE_F32, false, (size_t)(&((ParametersStruct*)0)->ShadowAmount), NULL, 0 }, // ShadowAmount + { TYPE_VEC3, false, (size_t)(&((ParametersStruct*)0)->LightDir), NULL, 0 }, // LightDir + { TYPE_VEC4, false, (size_t)(&((ParametersStruct*)0)->LightColor), NULL, 0 }, // LightColor + { TYPE_F32, false, (size_t)(&((ParametersStruct*)0)->BlockEmptyThreshold), NULL, 0 }, // BlockEmptyThreshold + { TYPE_BOOL, false, (size_t)(&((ParametersStruct*)0)->ReadDepth), NULL, 0 }, // ReadDepth + { TYPE_F32, false, (size_t)(&((ParametersStruct*)0)->ColorMapScale), NULL, 0 }, // ColorMapScale + { TYPE_F32, false, (size_t)(&((ParametersStruct*)0)->ColorMapOffset), NULL, 0 }, // ColorMapOffset + { TYPE_ARRAY, true, (size_t)(&((ParametersStruct*)0)->ColorMap), CHILDREN(32), 1 }, // ColorMap + { TYPE_STRUCT, false, 1 * sizeof(colorLifeStruct_Type), CHILDREN(33), 2 }, // ColorMap[] + { TYPE_F32, false, (size_t)(&((colorLifeStruct_Type*)0)->density), NULL, 0 }, // ColorMap[].density + { TYPE_VEC4, false, (size_t)(&((colorLifeStruct_Type*)0)->color), NULL, 0 }, // ColorMap[].color + { TYPE_F32, false, (size_t)(&((ParametersStruct*)0)->TextureRangeMin), NULL, 0 }, // TextureRangeMin + { TYPE_F32, false, (size_t)(&((ParametersStruct*)0)->TextureRangeMax), NULL, 0 }, // TextureRangeMax +}; + + +bool VolumeRenderMaterialData::mBuiltFlag = false; +NvParameterized::MutexType VolumeRenderMaterialData::mBuiltFlagMutex; + +VolumeRenderMaterialData::VolumeRenderMaterialData(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &VolumeRenderMaterialDataFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +VolumeRenderMaterialData::~VolumeRenderMaterialData() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void VolumeRenderMaterialData::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->~VolumeRenderMaterialData(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* VolumeRenderMaterialData::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* VolumeRenderMaterialData::getParameterDefinitionTree(void) const +{ + VolumeRenderMaterialData* tmpParam = const_cast<VolumeRenderMaterialData*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType VolumeRenderMaterialData::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 VolumeRenderMaterialData::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 VolumeRenderMaterialData::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<VolumeRenderMaterialData::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ + +void VolumeRenderMaterialData::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 VolumeRenderMaterialData::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", "Contains the volume render material properties for this asset", true); + ParamDefTable[0].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=1, longName="Name" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[1]; + ParamDef->init("Name", TYPE_STRING, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("READONLY", uint64_t(0), true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("READONLY", uint64_t(0), true); + HintTable[1].init("shortDescription", "The name of this volume render material", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=2, longName="ApplicationMaterialName" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[2]; + ParamDef->init("ApplicationMaterialName", 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 material to match up with the application's material system", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=3, longName="UserProperties" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[3]; + ParamDef->init("UserProperties", TYPE_STRING, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Optional user properties string", true); + ParamDefTable[3].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=4, longName="RenderMode" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[4]; + ParamDef->init("RenderMode", TYPE_ENUM, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Volume rendering mode", true); + ParamDefTable[4].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + static const char* const EnumVals[] = { "VOLUME", "VOLUME_COLORMAP", "VOLUME_SHADOWED", "VOXELS", "ISOSURFACE" }; + ParamDefTable[4].setEnumVals((const char**)EnumVals, 5); + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=5, longName="RenderMethod" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[5]; + ParamDef->init("RenderMethod", TYPE_ENUM, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Determines whether to do raycasting or slice based rendering, default is raycasting", true); + ParamDefTable[5].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + static const char* const EnumVals[] = { "RAYCASTING", "SLICE_BASED" }; + ParamDefTable[5].setEnumVals((const char**)EnumVals, 2); + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=6, longName="ResolutionScale" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[6]; + ParamDef->init("ResolutionScale", TYPE_ENUM, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Resolution scale to use", true); + ParamDefTable[6].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + static const char* const EnumVals[] = { "NO_SCALE", "HALF_SCALE", "QUARTER_SCALE" }; + ParamDefTable[6].setEnumVals((const char**)EnumVals, 3); + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=7, longName="FillMode" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[7]; + ParamDef->init("FillMode", TYPE_ENUM, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Debugging option to render the volume in wireframe mode; default is solid of course", true); + ParamDefTable[7].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + static const char* const EnumVals[] = { "SOLID", "WIREFRAME" }; + ParamDefTable[7].setEnumVals((const char**)EnumVals, 2); + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=8, longName="GenerateShadows" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[8]; + ParamDef->init("GenerateShadows", TYPE_BOOL, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Generate shadow volume", true); + ParamDefTable[8].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=9, longName="BlurShadows" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[9]; + ParamDef->init("BlurShadows", TYPE_BOOL, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Blur shadow volume", true); + ParamDefTable[9].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=10, longName="GenerateMipmaps" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[10]; + ParamDef->init("GenerateMipmaps", TYPE_BOOL, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "The maximum clamp range to use when copying velocity/desnity to the 3d volume texture; this range will be scaled 0-255; it's important to tune the proper range value", true); + ParamDefTable[10].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=11, longName="EnableStencilOpt" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[11]; + ParamDef->init("EnableStencilOpt", TYPE_BOOL, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Enable stencil optimization", true); + ParamDefTable[11].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=12, longName="StepScale" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[12]; + ParamDef->init("StepScale", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Scale ray march step - e.g. 1.0 == voxel size, 0.5 == half voxel size", true); + ParamDefTable[12].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=13, longName="Density" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[13]; + ParamDef->init("Density", 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", double(1000.000000000), true); + HintTable[1].init("min", double(0.000000000), 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("max", double(1000.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + HintTable[2].init("shortDescription", "Volume density [0, 1000.0]", true); + ParamDefTable[13].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=14, longName="EdgeFade" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[14]; + ParamDef->init("EdgeFade", 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", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + ParamDefTable[14].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", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + HintTable[2].init("shortDescription", "Edge fade distance [0, 1]", true); + ParamDefTable[14].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=15, longName="OpacityThreshold" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[15]; + ParamDef->init("OpacityThreshold", 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", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), 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("max", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + HintTable[2].init("shortDescription", "Stop ray marching once opacity has reached this threshold [0, 1]", true); + ParamDefTable[15].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=16, longName="RayJitter" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[16]; + ParamDef->init("RayJitter", 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", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), 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("max", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + HintTable[2].init("shortDescription", "Amount to jitter view rays [0, 1]", true); + ParamDefTable[16].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=17, longName="IsoValue" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[17]; + ParamDef->init("IsoValue", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Surface Isovalue for Isovalue render mode", true); + ParamDefTable[17].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=18, longName="IsoValueSign" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[18]; + ParamDef->init("IsoValueSign", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Isovalue sign, density is multiplied by this value before comparison (usually 1.0 or -1.0)", true); + ParamDefTable[18].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=19, longName="ShadowSamples" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[19]; + ParamDef->init("ShadowSamples", TYPE_U32, 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(256), true); + HintTable[1].init("min", uint64_t(0), true); + ParamDefTable[19].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(256), true); + HintTable[1].init("min", uint64_t(0), true); + HintTable[2].init("shortDescription", "Number of samples for shadows [0, 256]", true); + ParamDefTable[19].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=20, longName="ShadowDistance" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[20]; + ParamDef->init("ShadowDistance", 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", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), 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("max", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + HintTable[2].init("shortDescription", "Distance to ray march shadows [0, 1]", true); + ParamDefTable[20].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=21, longName="ShadowDensity" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[21]; + ParamDef->init("ShadowDensity", 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", double(1000.000000000), true); + HintTable[1].init("min", double(0.000000000), 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("max", double(1000.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + HintTable[2].init("shortDescription", "Shadow density [0, 1000]", true); + ParamDefTable[21].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=22, longName="ShadowJitter" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[22]; + ParamDef->init("ShadowJitter", 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", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + ParamDefTable[22].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", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + HintTable[2].init("shortDescription", "Amount to jitter shadow rays [0, 1]", true); + ParamDefTable[22].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=23, longName="ShadowAmount" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[23]; + ParamDef->init("ShadowAmount", 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", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), 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("max", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + HintTable[2].init("shortDescription", "Amount of shadowing [0, 1]", true); + ParamDefTable[23].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=24, longName="LightDir" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[24]; + ParamDef->init("LightDir", TYPE_VEC3, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Normalized light direction", true); + ParamDefTable[24].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=25, longName="LightColor" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[25]; + ParamDef->init("LightColor", TYPE_VEC4, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("COLOR", uint64_t(1), 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("COLOR", uint64_t(1), true); + HintTable[1].init("shortDescription", "The color to use for the 'light' on this volume render", true); + ParamDefTable[25].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=26, longName="BlockEmptyThreshold" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[26]; + ParamDef->init("BlockEmptyThreshold", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Threshold above which block is considered non-empty for empty space skipping (typically close to 0.0)", true); + ParamDefTable[26].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=27, longName="ReadDepth" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[27]; + ParamDef->init("ReadDepth", TYPE_BOOL, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Read background depth during compositing", true); + ParamDefTable[27].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=28, longName="ColorMapScale" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[28]; + ParamDef->init("ColorMapScale", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Color map scale", true); + ParamDefTable[28].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=29, longName="ColorMapOffset" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[29]; + ParamDef->init("ColorMapOffset", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Color map offset", true); + ParamDefTable[29].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=30, longName="ColorMap" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[30]; + ParamDef->init("ColorMap", TYPE_ARRAY, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("CURVE_X_SCALE", uint64_t(1), true); + HintTable[1].init("CURVE_Y_SCALE", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("xAxisLabel", "''Fluid Density''", true); + HintTable[4].init("yAxisLabel", "''Alpha + Color''", true); + ParamDefTable[30].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#else + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("CURVE_X_SCALE", uint64_t(1), true); + HintTable[1].init("CURVE_Y_SCALE", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("shortDescription", "Control points for color map", true); + HintTable[4].init("xAxisLabel", "''Fluid Density''", true); + HintTable[5].init("yAxisLabel", "''Alpha + Color''", true); + ParamDefTable[30].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + ParamDef->setArraySize(-1); + } + + // Initialize DefinitionImpl node: nodeIndex=31, longName="ColorMap[]" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[31]; + ParamDef->init("ColorMap", TYPE_STRUCT, "colorLifeStruct", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("CURVE_X_SCALE", uint64_t(1), true); + HintTable[1].init("CURVE_Y_SCALE", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("xAxisLabel", "''Fluid Density''", true); + HintTable[4].init("yAxisLabel", "''Alpha + Color''", true); + ParamDefTable[31].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#else + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("CURVE_X_SCALE", uint64_t(1), true); + HintTable[1].init("CURVE_Y_SCALE", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("shortDescription", "Control points for color map", true); + HintTable[4].init("xAxisLabel", "''Fluid Density''", true); + HintTable[5].init("yAxisLabel", "''Alpha + Color''", true); + ParamDefTable[31].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=32, longName="ColorMap[].density" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[32]; + ParamDef->init("density", 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", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + ParamDefTable[32].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", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + HintTable[2].init("shortDescription", "Density", true); + ParamDefTable[32].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=33, longName="ColorMap[].color" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[33]; + ParamDef->init("color", TYPE_VEC4, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Color is formated x=R, y=G, z=B, w=A", true); + ParamDefTable[33].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=34, longName="TextureRangeMin" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[34]; + ParamDef->init("TextureRangeMin", 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", double(5000.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + ParamDefTable[34].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", double(5000.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + HintTable[2].init("shortDescription", "For APEX turbulence, controls the minimum density range to copy to the density texture", true); + ParamDefTable[34].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=35, longName="TextureRangeMax" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[35]; + ParamDef->init("TextureRangeMax", 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", double(5000.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + ParamDefTable[35].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", double(5000.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + HintTable[2].init("shortDescription", "For APEX turbulence, controls the maximum density range to copy to the density texture", true); + ParamDefTable[35].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // SetChildren for: nodeIndex=0, longName="" + { + static Definition* Children[32]; + 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); + Children[13] = PDEF_PTR(14); + Children[14] = PDEF_PTR(15); + Children[15] = PDEF_PTR(16); + Children[16] = PDEF_PTR(17); + Children[17] = PDEF_PTR(18); + Children[18] = PDEF_PTR(19); + Children[19] = PDEF_PTR(20); + Children[20] = PDEF_PTR(21); + Children[21] = PDEF_PTR(22); + Children[22] = PDEF_PTR(23); + Children[23] = PDEF_PTR(24); + Children[24] = PDEF_PTR(25); + Children[25] = PDEF_PTR(26); + Children[26] = PDEF_PTR(27); + Children[27] = PDEF_PTR(28); + Children[28] = PDEF_PTR(29); + Children[29] = PDEF_PTR(30); + Children[30] = PDEF_PTR(34); + Children[31] = PDEF_PTR(35); + + ParamDefTable[0].setChildren(Children, 32); + } + + // SetChildren for: nodeIndex=30, longName="ColorMap" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(31); + + ParamDefTable[30].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=31, longName="ColorMap[]" + { + static Definition* Children[2]; + Children[0] = PDEF_PTR(32); + Children[1] = PDEF_PTR(33); + + ParamDefTable[31].setChildren(Children, 2); + } + + mBuiltFlag = true; + +} +void VolumeRenderMaterialData::initStrings(void) +{ + Name.isAllocated = false; + Name.buf = (const char*)"defaultVolumeRenderMaterial"; + ApplicationMaterialName.isAllocated = true; + ApplicationMaterialName.buf = NULL; + UserProperties.isAllocated = true; + UserProperties.buf = NULL; +} + +void VolumeRenderMaterialData::initDynamicArrays(void) +{ + ColorMap.buf = NULL; + ColorMap.isAllocated = true; + ColorMap.elementSize = sizeof(colorLifeStruct_Type); + ColorMap.arraySizes[0] = 0; +} + +void VolumeRenderMaterialData::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + RenderMode = (const char*)"VOLUME"; + RenderMethod = (const char*)"RAYCASTING"; + ResolutionScale = (const char*)"NO_SCALE"; + FillMode = (const char*)"SOLID"; + GenerateShadows = bool(0); + BlurShadows = bool(1); + GenerateMipmaps = bool(0); + EnableStencilOpt = bool(0); + StepScale = float(0.500000000); + Density = float(50.000000000); + EdgeFade = float(0.100000001); + OpacityThreshold = float(0.990000010); + RayJitter = float(0.000000000); + IsoValue = float(0.500000000); + IsoValueSign = float(1.000000000); + ShadowSamples = uint32_t(4); + ShadowDistance = float(0.200000003); + ShadowDensity = float(20.000000000); + ShadowJitter = float(1.000000000); + ShadowAmount = float(1.000000000); + LightDir = physx::PxVec3(init(1.000000000,1.000000000,1.000000000)); + LightColor = physx::PxVec4(initVec4(1.000000000,1.000000000,1.000000000,1.000000000)); + BlockEmptyThreshold = float(0.000000000); + ReadDepth = bool(1); + ColorMapScale = float(1.000000000); + ColorMapOffset = float(0.000000000); + TextureRangeMin = float(0.000000000); + TextureRangeMax = float(500.000000000); + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void VolumeRenderMaterialData::initReferences(void) +{ +} + +void VolumeRenderMaterialData::freeDynamicArrays(void) +{ + if (ColorMap.isAllocated && ColorMap.buf) + { + mParameterizedTraits->free(ColorMap.buf); + } +} + +void VolumeRenderMaterialData::freeStrings(void) +{ + + if (Name.isAllocated && Name.buf) + { + mParameterizedTraits->strfree((char*)Name.buf); + } + + if (ApplicationMaterialName.isAllocated && ApplicationMaterialName.buf) + { + mParameterizedTraits->strfree((char*)ApplicationMaterialName.buf); + } + + if (UserProperties.isAllocated && UserProperties.buf) + { + mParameterizedTraits->strfree((char*)UserProperties.buf); + } +} + +void VolumeRenderMaterialData::freeReferences(void) +{ +} + +} // namespace particles +} // namespace nvidia diff --git a/APEX_1.4/module/particles/src/autogen/VortexFieldSamplerData.cpp b/APEX_1.4/module/particles/src/autogen/VortexFieldSamplerData.cpp new file mode 100644 index 00000000..357e302d --- /dev/null +++ b/APEX_1.4/module/particles/src/autogen/VortexFieldSamplerData.cpp @@ -0,0 +1,363 @@ +// 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 "VortexFieldSamplerData.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace particles +{ + +using namespace VortexFieldSamplerDataNS; + +const char* const VortexFieldSamplerDataFactory::vptr = + NvParameterized::getVptr<VortexFieldSamplerData, VortexFieldSamplerData::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_STRING, false, (size_t)(&((ParametersStruct*)0)->Name), NULL, 0 }, // Name + { TYPE_REF, false, (size_t)(&((ParametersStruct*)0)->VortexFieldSampler), NULL, 0 }, // VortexFieldSampler +}; + + +bool VortexFieldSamplerData::mBuiltFlag = false; +NvParameterized::MutexType VortexFieldSamplerData::mBuiltFlagMutex; + +VortexFieldSamplerData::VortexFieldSamplerData(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &VortexFieldSamplerDataFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +VortexFieldSamplerData::~VortexFieldSamplerData() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void VortexFieldSamplerData::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->~VortexFieldSamplerData(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* VortexFieldSamplerData::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* VortexFieldSamplerData::getParameterDefinitionTree(void) const +{ + VortexFieldSamplerData* tmpParam = const_cast<VortexFieldSamplerData*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType VortexFieldSamplerData::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 VortexFieldSamplerData::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 VortexFieldSamplerData::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<VortexFieldSamplerData::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ + +void VortexFieldSamplerData::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 VortexFieldSamplerData::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", "Contains the asset properties for this vortex field sampler", true); + ParamDefTable[0].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=1, longName="Name" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[1]; + ParamDef->init("Name", TYPE_STRING, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Vortex FS Name", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=2, longName="VortexFieldSampler" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[2]; + ParamDef->init("VortexFieldSampler", 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[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("INCLUDED", uint64_t(1), true); + HintTable[1].init("shortDescription", "Vortex FS properties", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + static const char* const RefVariantVals[] = { "VortexFSAssetParams" }; + ParamDefTable[2].setRefVariantVals((const char**)RefVariantVals, 1); + + + + } + + // 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 VortexFieldSamplerData::initStrings(void) +{ + Name.isAllocated = false; + Name.buf = (const char*)"defaultVortexFieldSampler"; +} + +void VortexFieldSamplerData::initDynamicArrays(void) +{ +} + +void VortexFieldSamplerData::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void VortexFieldSamplerData::initReferences(void) +{ + VortexFieldSampler = NULL; + +} + +void VortexFieldSamplerData::freeDynamicArrays(void) +{ +} + +void VortexFieldSamplerData::freeStrings(void) +{ + + if (Name.isAllocated && Name.buf) + { + mParameterizedTraits->strfree((char*)Name.buf); + } +} + +void VortexFieldSamplerData::freeReferences(void) +{ + if (VortexFieldSampler) + { + VortexFieldSampler->destroy(); + } + +} + +} // namespace particles +} // namespace nvidia diff --git a/APEX_1.4/module/particles/src/autogen/VortexFieldSamplerEffect.cpp b/APEX_1.4/module/particles/src/autogen/VortexFieldSamplerEffect.cpp new file mode 100644 index 00000000..06a3bf04 --- /dev/null +++ b/APEX_1.4/module/particles/src/autogen/VortexFieldSamplerEffect.cpp @@ -0,0 +1,1362 @@ +// 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 "VortexFieldSamplerEffect.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace particles +{ + +using namespace VortexFieldSamplerEffectNS; + +const char* const VortexFieldSamplerEffectFactory::vptr = + NvParameterized::getVptr<VortexFieldSamplerEffect, VortexFieldSamplerEffect::ClassAlignment>(); + +const uint32_t NumParamDefs = 32; +static NvParameterized::DefinitionImpl* ParamDefTable; // now allocated in buildTree [NumParamDefs]; + + +static const size_t ParamLookupChildrenTable[] = +{ + 1, 31, 2, 3, 4, 8, 12, 13, 14, 15, 16, 17, 5, 6, 7, 9, 10, 11, 18, 19, 20, 21, 23, + 27, 22, 24, 25, 26, 28, 29, 30, +}; + +#define TENUM(type) nvidia::##type +#define CHILDREN(index) &ParamLookupChildrenTable[index] +static const NvParameterized::ParamLookupNode ParamLookupTable[NumParamDefs] = +{ + { TYPE_STRUCT, false, 0, CHILDREN(0), 2 }, + { TYPE_STRUCT, false, (size_t)(&((ParametersStruct*)0)->EffectProperties), CHILDREN(2), 10 }, // EffectProperties + { TYPE_STRING, false, (size_t)(&((EffectProperties_Type*)0)->UserString), NULL, 0 }, // EffectProperties.UserString + { TYPE_BOOL, false, (size_t)(&((EffectProperties_Type*)0)->Enable), NULL, 0 }, // EffectProperties.Enable + { TYPE_STRUCT, false, (size_t)(&((EffectProperties_Type*)0)->Position), CHILDREN(12), 3 }, // EffectProperties.Position + { TYPE_F32, false, (size_t)(&((TranslateObject_Type*)0)->TranslateX), NULL, 0 }, // EffectProperties.Position.TranslateX + { TYPE_F32, false, (size_t)(&((TranslateObject_Type*)0)->TranslateY), NULL, 0 }, // EffectProperties.Position.TranslateY + { TYPE_F32, false, (size_t)(&((TranslateObject_Type*)0)->TranslateZ), NULL, 0 }, // EffectProperties.Position.TranslateZ + { TYPE_STRUCT, false, (size_t)(&((EffectProperties_Type*)0)->Orientation), CHILDREN(15), 3 }, // EffectProperties.Orientation + { TYPE_F32, false, (size_t)(&((OrientObject_Type*)0)->RotateX), NULL, 0 }, // EffectProperties.Orientation.RotateX + { TYPE_F32, false, (size_t)(&((OrientObject_Type*)0)->RotateY), NULL, 0 }, // EffectProperties.Orientation.RotateY + { TYPE_F32, false, (size_t)(&((OrientObject_Type*)0)->RotateZ), NULL, 0 }, // EffectProperties.Orientation.RotateZ + { TYPE_F32, false, (size_t)(&((EffectProperties_Type*)0)->InitialDelayTime), NULL, 0 }, // EffectProperties.InitialDelayTime + { TYPE_F32, false, (size_t)(&((EffectProperties_Type*)0)->Duration), NULL, 0 }, // EffectProperties.Duration + { TYPE_U32, false, (size_t)(&((EffectProperties_Type*)0)->RepeatCount), NULL, 0 }, // EffectProperties.RepeatCount + { TYPE_F32, false, (size_t)(&((EffectProperties_Type*)0)->RepeatDelay), NULL, 0 }, // EffectProperties.RepeatDelay + { TYPE_F32, false, (size_t)(&((EffectProperties_Type*)0)->RandomizeRepeatTime), NULL, 0 }, // EffectProperties.RandomizeRepeatTime + { TYPE_STRUCT, false, (size_t)(&((EffectProperties_Type*)0)->Path), CHILDREN(18), 6 }, // EffectProperties.Path + { TYPE_ENUM, false, (size_t)(&((EffectPath_Type*)0)->PlaybackMode), NULL, 0 }, // EffectProperties.Path.PlaybackMode + { TYPE_F32, false, (size_t)(&((EffectPath_Type*)0)->PathDuration), NULL, 0 }, // EffectProperties.Path.PathDuration + { TYPE_U32, false, (size_t)(&((EffectPath_Type*)0)->LoopIndex), NULL, 0 }, // EffectProperties.Path.LoopIndex + { TYPE_ARRAY, true, (size_t)(&((EffectPath_Type*)0)->ControlPoints), CHILDREN(24), 1 }, // EffectProperties.Path.ControlPoints + { TYPE_TRANSFORM, false, 1 * sizeof(physx::PxTransform), NULL, 0 }, // EffectProperties.Path.ControlPoints[] + { TYPE_ARRAY, true, (size_t)(&((EffectPath_Type*)0)->Scale), CHILDREN(25), 1 }, // EffectProperties.Path.Scale + { TYPE_STRUCT, false, 1 * sizeof(ControlPoint_Type), CHILDREN(26), 2 }, // EffectProperties.Path.Scale[] + { TYPE_F32, false, (size_t)(&((ControlPoint_Type*)0)->x), NULL, 0 }, // EffectProperties.Path.Scale[].x + { TYPE_F32, false, (size_t)(&((ControlPoint_Type*)0)->y), NULL, 0 }, // EffectProperties.Path.Scale[].y + { TYPE_ARRAY, true, (size_t)(&((EffectPath_Type*)0)->Speed), CHILDREN(28), 1 }, // EffectProperties.Path.Speed + { TYPE_STRUCT, false, 1 * sizeof(ControlPoint_Type), CHILDREN(29), 2 }, // EffectProperties.Path.Speed[] + { TYPE_F32, false, (size_t)(&((ControlPoint_Type*)0)->x), NULL, 0 }, // EffectProperties.Path.Speed[].x + { TYPE_F32, false, (size_t)(&((ControlPoint_Type*)0)->y), NULL, 0 }, // EffectProperties.Path.Speed[].y + { TYPE_REF, false, (size_t)(&((ParametersStruct*)0)->VortexFieldSampler), NULL, 0 }, // VortexFieldSampler +}; + + +bool VortexFieldSamplerEffect::mBuiltFlag = false; +NvParameterized::MutexType VortexFieldSamplerEffect::mBuiltFlagMutex; + +VortexFieldSamplerEffect::VortexFieldSamplerEffect(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &VortexFieldSamplerEffectFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +VortexFieldSamplerEffect::~VortexFieldSamplerEffect() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void VortexFieldSamplerEffect::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->~VortexFieldSamplerEffect(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* VortexFieldSamplerEffect::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* VortexFieldSamplerEffect::getParameterDefinitionTree(void) const +{ + VortexFieldSamplerEffect* tmpParam = const_cast<VortexFieldSamplerEffect*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType VortexFieldSamplerEffect::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 VortexFieldSamplerEffect::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 VortexFieldSamplerEffect::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<VortexFieldSamplerEffect::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ + +void VortexFieldSamplerEffect::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 VortexFieldSamplerEffect::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", "A vortex field sampler effect", true); + ParamDefTable[0].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=1, longName="EffectProperties" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[1]; + ParamDef->init("EffectProperties", TYPE_STRUCT, "EffectProperties", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("READONLY", uint64_t(0), true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("READONLY", uint64_t(0), true); + HintTable[1].init("shortDescription", "Vortex FS Properties", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=2, longName="EffectProperties.UserString" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[2]; + ParamDef->init("UserString", TYPE_STRING, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "An aribtrary user string that can be set by an artist/designer/programmer", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=3, longName="EffectProperties.Enable" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[3]; + ParamDef->init("Enable", TYPE_BOOL, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Whether or not this effect is to be initially enabled on startup", true); + ParamDefTable[3].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=4, longName="EffectProperties.Position" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[4]; + ParamDef->init("Position", TYPE_STRUCT, "TranslateObject", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "The position of this effect relative to the parent", true); + ParamDefTable[4].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=5, longName="EffectProperties.Position.TranslateX" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[5]; + ParamDef->init("TranslateX", 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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(500.000000000), true); + HintTable[2].init("min", double(-500.000000000), true); + ParamDefTable[5].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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(500.000000000), true); + HintTable[2].init("min", double(-500.000000000), true); + HintTable[3].init("shortDescription", "Nudge up to +/- one meter in each direction", true); + ParamDefTable[5].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=6, longName="EffectProperties.Position.TranslateY" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[6]; + ParamDef->init("TranslateY", 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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(500.000000000), true); + HintTable[2].init("min", double(-500.000000000), true); + ParamDefTable[6].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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(500.000000000), true); + HintTable[2].init("min", double(-500.000000000), true); + HintTable[3].init("shortDescription", "Nudge up to +/- one meter in each direction", true); + ParamDefTable[6].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=7, longName="EffectProperties.Position.TranslateZ" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[7]; + ParamDef->init("TranslateZ", 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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(500.000000000), true); + HintTable[2].init("min", double(-500.000000000), true); + ParamDefTable[7].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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(500.000000000), true); + HintTable[2].init("min", double(-500.000000000), true); + HintTable[3].init("shortDescription", "Nudge up to +/- one meter in each direction", true); + ParamDefTable[7].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=8, longName="EffectProperties.Orientation" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[8]; + ParamDef->init("Orientation", TYPE_STRUCT, "OrientObject", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "The orientation of this effect, relative to the parent orientation", true); + ParamDefTable[8].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=9, longName="EffectProperties.Orientation.RotateX" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[9]; + ParamDef->init("RotateX", 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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(360.000000000), true); + HintTable[2].init("min", double(0.000000000), true); + ParamDefTable[9].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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(360.000000000), true); + HintTable[2].init("min", double(0.000000000), true); + HintTable[3].init("shortDescription", "Rotate on the X axis (0-360 degrees)", true); + ParamDefTable[9].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=10, longName="EffectProperties.Orientation.RotateY" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[10]; + ParamDef->init("RotateY", 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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(360.000000000), true); + HintTable[2].init("min", double(0.000000000), true); + ParamDefTable[10].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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(360.000000000), true); + HintTable[2].init("min", double(0.000000000), true); + HintTable[3].init("shortDescription", "Rotate on the Y axis (0-360 degrees)", true); + ParamDefTable[10].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=11, longName="EffectProperties.Orientation.RotateZ" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[11]; + ParamDef->init("RotateZ", 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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(360.000000000), true); + HintTable[2].init("min", double(0.000000000), 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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(360.000000000), true); + HintTable[2].init("min", double(0.000000000), true); + HintTable[3].init("shortDescription", "Rotate on the Z axis (0-360 degrees)", true); + ParamDefTable[11].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=12, longName="EffectProperties.InitialDelayTime" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[12]; + ParamDef->init("InitialDelayTime", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("min", double(0.000000000), 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("min", double(0.000000000), true); + HintTable[1].init("shortDescription", "Initial time to delay before spawning this effect", true); + ParamDefTable[12].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=13, longName="EffectProperties.Duration" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[13]; + ParamDef->init("Duration", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("min", double(0.000000000), true); + ParamDefTable[13].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("min", double(0.000000000), true); + HintTable[1].init("shortDescription", "The duration of the effect in secontds", true); + ParamDefTable[13].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=14, longName="EffectProperties.RepeatCount" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[14]; + ParamDef->init("RepeatCount", TYPE_U32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("min", uint64_t(1), 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("min", uint64_t(1), true); + HintTable[1].init("shortDescription", "The number of times to repeat the effect; 9999 means repeate forever", true); + ParamDefTable[14].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=15, longName="EffectProperties.RepeatDelay" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[15]; + ParamDef->init("RepeatDelay", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("min", double(0.000000000), 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("min", double(0.000000000), true); + HintTable[1].init("shortDescription", "The time to delay activation each time the effect repeats in seconds; this can be different than the initial delay time", true); + ParamDefTable[15].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=16, longName="EffectProperties.RandomizeRepeatTime" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[16]; + ParamDef->init("RandomizeRepeatTime", 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", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), 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("max", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + HintTable[2].init("shortDescription", "Amount of randomization to the repeat cycle; a value of zero (default) means no random and a value of one means completely random.", true); + ParamDefTable[16].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=17, longName="EffectProperties.Path" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[17]; + ParamDef->init("Path", TYPE_STRUCT, "EffectPath", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "An optional pre-defined path for this effect to travel on", true); + ParamDefTable[17].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=18, longName="EffectProperties.Path.PlaybackMode" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[18]; + ParamDef->init("PlaybackMode", TYPE_ENUM, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "The mode to play back the path", true); + ParamDefTable[18].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + static const char* const EnumVals[] = { "LOOP", "PLAY_ONCE", "PING_PONG" }; + ParamDefTable[18].setEnumVals((const char**)EnumVals, 3); + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=19, longName="EffectProperties.Path.PathDuration" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[19]; + ParamDef->init("PathDuration", 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", double(1000.000000000), true); + HintTable[1].init("min", double(0.000010000), true); + ParamDefTable[19].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", double(1000.000000000), true); + HintTable[1].init("min", double(0.000010000), true); + HintTable[2].init("shortDescription", "The duration of the path if one is not otherwise provided", true); + ParamDefTable[19].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=20, longName="EffectProperties.Path.LoopIndex" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[20]; + ParamDef->init("LoopIndex", TYPE_U32, 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[20].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("min", uint64_t(0), true); + HintTable[1].init("shortDescription", "The array index to loop back to", true); + ParamDefTable[20].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=21, longName="EffectProperties.Path.ControlPoints" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[21]; + ParamDef->init("ControlPoints", TYPE_ARRAY, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("editorCurve", uint64_t(1), true); + HintTable[2].init("pathEditor", uint64_t(1), 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("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("editorCurve", uint64_t(1), true); + HintTable[2].init("pathEditor", uint64_t(1), true); + HintTable[3].init("shortDescription", "The array of control points to fit the curve to", true); + ParamDefTable[21].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + ParamDef->setArraySize(-1); + } + + // Initialize DefinitionImpl node: nodeIndex=22, longName="EffectProperties.Path.ControlPoints[]" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[22]; + ParamDef->init("ControlPoints", TYPE_TRANSFORM, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("editorCurve", uint64_t(1), true); + HintTable[2].init("pathEditor", uint64_t(1), 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("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("editorCurve", uint64_t(1), true); + HintTable[2].init("pathEditor", uint64_t(1), true); + HintTable[3].init("shortDescription", "The array of control points to fit the curve to", true); + ParamDefTable[22].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=23, longName="EffectProperties.Path.Scale" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[23]; + ParamDef->init("Scale", TYPE_ARRAY, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("xAxisLabel", "Over Time", true); + HintTable[4].init("yAxisLabel", "Scale", true); + ParamDefTable[23].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#else + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("shortDescription", "The array of scale values over time", true); + HintTable[4].init("xAxisLabel", "Over Time", true); + HintTable[5].init("yAxisLabel", "Scale", true); + ParamDefTable[23].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + ParamDef->setArraySize(-1); + } + + // Initialize DefinitionImpl node: nodeIndex=24, longName="EffectProperties.Path.Scale[]" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[24]; + ParamDef->init("Scale", TYPE_STRUCT, "ControlPoint", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("xAxisLabel", "Over Time", true); + HintTable[4].init("yAxisLabel", "Scale", true); + ParamDefTable[24].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#else + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("shortDescription", "The array of scale values over time", true); + HintTable[4].init("xAxisLabel", "Over Time", true); + HintTable[5].init("yAxisLabel", "Scale", true); + ParamDefTable[24].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=25, longName="EffectProperties.Path.Scale[].x" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[25]; + 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", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), 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("max", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + HintTable[2].init("shortDescription", "The x-axis value for this vector", true); + ParamDefTable[25].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=26, longName="EffectProperties.Path.Scale[].y" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[26]; + 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", "The y-axis value for this vector", true); + ParamDefTable[26].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=27, longName="EffectProperties.Path.Speed" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[27]; + ParamDef->init("Speed", TYPE_ARRAY, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("xAxisLabel", "Over Time", true); + HintTable[4].init("yAxisLabel", "Speed", true); + ParamDefTable[27].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#else + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("shortDescription", "The array of speed values over time", true); + HintTable[4].init("xAxisLabel", "Over Time", true); + HintTable[5].init("yAxisLabel", "Speed", true); + ParamDefTable[27].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + ParamDef->setArraySize(-1); + } + + // Initialize DefinitionImpl node: nodeIndex=28, longName="EffectProperties.Path.Speed[]" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[28]; + ParamDef->init("Speed", TYPE_STRUCT, "ControlPoint", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("xAxisLabel", "Over Time", true); + HintTable[4].init("yAxisLabel", "Speed", true); + ParamDefTable[28].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#else + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("shortDescription", "The array of speed values over time", true); + HintTable[4].init("xAxisLabel", "Over Time", true); + HintTable[5].init("yAxisLabel", "Speed", true); + ParamDefTable[28].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=29, longName="EffectProperties.Path.Speed[].x" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[29]; + 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", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + ParamDefTable[29].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", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + HintTable[2].init("shortDescription", "The x-axis value for this vector", true); + ParamDefTable[29].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=30, longName="EffectProperties.Path.Speed[].y" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[30]; + 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", "The y-axis value for this vector", true); + ParamDefTable[30].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=31, longName="VortexFieldSampler" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[31]; + ParamDef->init("VortexFieldSampler", TYPE_REF, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Vortex FS Asset", true); + ParamDefTable[31].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + static const char* const RefVariantVals[] = { "VortexFSAsset" }; + ParamDefTable[31].setRefVariantVals((const char**)RefVariantVals, 1); + + + + } + + // SetChildren for: nodeIndex=0, longName="" + { + static Definition* Children[2]; + Children[0] = PDEF_PTR(1); + Children[1] = PDEF_PTR(31); + + ParamDefTable[0].setChildren(Children, 2); + } + + // SetChildren for: nodeIndex=1, longName="EffectProperties" + { + static Definition* Children[10]; + Children[0] = PDEF_PTR(2); + Children[1] = PDEF_PTR(3); + Children[2] = PDEF_PTR(4); + Children[3] = PDEF_PTR(8); + Children[4] = PDEF_PTR(12); + Children[5] = PDEF_PTR(13); + Children[6] = PDEF_PTR(14); + Children[7] = PDEF_PTR(15); + Children[8] = PDEF_PTR(16); + Children[9] = PDEF_PTR(17); + + ParamDefTable[1].setChildren(Children, 10); + } + + // SetChildren for: nodeIndex=4, longName="EffectProperties.Position" + { + static Definition* Children[3]; + Children[0] = PDEF_PTR(5); + Children[1] = PDEF_PTR(6); + Children[2] = PDEF_PTR(7); + + ParamDefTable[4].setChildren(Children, 3); + } + + // SetChildren for: nodeIndex=8, longName="EffectProperties.Orientation" + { + static Definition* Children[3]; + Children[0] = PDEF_PTR(9); + Children[1] = PDEF_PTR(10); + Children[2] = PDEF_PTR(11); + + ParamDefTable[8].setChildren(Children, 3); + } + + // SetChildren for: nodeIndex=17, longName="EffectProperties.Path" + { + static Definition* Children[6]; + Children[0] = PDEF_PTR(18); + Children[1] = PDEF_PTR(19); + Children[2] = PDEF_PTR(20); + Children[3] = PDEF_PTR(21); + Children[4] = PDEF_PTR(23); + Children[5] = PDEF_PTR(27); + + ParamDefTable[17].setChildren(Children, 6); + } + + // SetChildren for: nodeIndex=21, longName="EffectProperties.Path.ControlPoints" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(22); + + ParamDefTable[21].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=23, longName="EffectProperties.Path.Scale" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(24); + + ParamDefTable[23].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=24, longName="EffectProperties.Path.Scale[]" + { + static Definition* Children[2]; + Children[0] = PDEF_PTR(25); + Children[1] = PDEF_PTR(26); + + ParamDefTable[24].setChildren(Children, 2); + } + + // SetChildren for: nodeIndex=27, longName="EffectProperties.Path.Speed" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(28); + + ParamDefTable[27].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=28, longName="EffectProperties.Path.Speed[]" + { + static Definition* Children[2]; + Children[0] = PDEF_PTR(29); + Children[1] = PDEF_PTR(30); + + ParamDefTable[28].setChildren(Children, 2); + } + + mBuiltFlag = true; + +} +void VortexFieldSamplerEffect::initStrings(void) +{ + EffectProperties.UserString.isAllocated = true; + EffectProperties.UserString.buf = NULL; +} + +void VortexFieldSamplerEffect::initDynamicArrays(void) +{ + EffectProperties.Path.ControlPoints.buf = NULL; + EffectProperties.Path.ControlPoints.isAllocated = true; + EffectProperties.Path.ControlPoints.elementSize = sizeof(physx::PxTransform); + EffectProperties.Path.ControlPoints.arraySizes[0] = 0; + EffectProperties.Path.Scale.buf = NULL; + EffectProperties.Path.Scale.isAllocated = true; + EffectProperties.Path.Scale.elementSize = sizeof(ControlPoint_Type); + EffectProperties.Path.Scale.arraySizes[0] = 0; + EffectProperties.Path.Speed.buf = NULL; + EffectProperties.Path.Speed.isAllocated = true; + EffectProperties.Path.Speed.elementSize = sizeof(ControlPoint_Type); + EffectProperties.Path.Speed.arraySizes[0] = 0; +} + +void VortexFieldSamplerEffect::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + EffectProperties.Enable = bool(1); + EffectProperties.Position.TranslateX = float(0.000000000); + EffectProperties.Position.TranslateY = float(0.000000000); + EffectProperties.Position.TranslateZ = float(0.000000000); + EffectProperties.Orientation.RotateX = float(0.000000000); + EffectProperties.Orientation.RotateY = float(0.000000000); + EffectProperties.Orientation.RotateZ = float(0.000000000); + EffectProperties.InitialDelayTime = float(0.000000000); + EffectProperties.Duration = float(0.000000000); + EffectProperties.RepeatCount = uint32_t(1); + EffectProperties.RepeatDelay = float(0.000000000); + EffectProperties.RandomizeRepeatTime = float(0.000000000); + EffectProperties.Path.PlaybackMode = (const char*)"LOOP"; + EffectProperties.Path.PathDuration = float(4.000000000); + EffectProperties.Path.LoopIndex = uint32_t(0); + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void VortexFieldSamplerEffect::initReferences(void) +{ + VortexFieldSampler = NULL; + +} + +void VortexFieldSamplerEffect::freeDynamicArrays(void) +{ + if (EffectProperties.Path.ControlPoints.isAllocated && EffectProperties.Path.ControlPoints.buf) + { + mParameterizedTraits->free(EffectProperties.Path.ControlPoints.buf); + } + if (EffectProperties.Path.Scale.isAllocated && EffectProperties.Path.Scale.buf) + { + mParameterizedTraits->free(EffectProperties.Path.Scale.buf); + } + if (EffectProperties.Path.Speed.isAllocated && EffectProperties.Path.Speed.buf) + { + mParameterizedTraits->free(EffectProperties.Path.Speed.buf); + } +} + +void VortexFieldSamplerEffect::freeStrings(void) +{ + + if (EffectProperties.UserString.isAllocated && EffectProperties.UserString.buf) + { + mParameterizedTraits->strfree((char*)EffectProperties.UserString.buf); + } +} + +void VortexFieldSamplerEffect::freeReferences(void) +{ + if (VortexFieldSampler) + { + VortexFieldSampler->destroy(); + } + +} + +} // namespace particles +} // namespace nvidia diff --git a/APEX_1.4/module/particles/src/autogen/WindFieldSamplerData.cpp b/APEX_1.4/module/particles/src/autogen/WindFieldSamplerData.cpp new file mode 100644 index 00000000..9d5308f7 --- /dev/null +++ b/APEX_1.4/module/particles/src/autogen/WindFieldSamplerData.cpp @@ -0,0 +1,363 @@ +// 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 "WindFieldSamplerData.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace particles +{ + +using namespace WindFieldSamplerDataNS; + +const char* const WindFieldSamplerDataFactory::vptr = + NvParameterized::getVptr<WindFieldSamplerData, WindFieldSamplerData::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_STRING, false, (size_t)(&((ParametersStruct*)0)->Name), NULL, 0 }, // Name + { TYPE_REF, false, (size_t)(&((ParametersStruct*)0)->WindFieldSampler), NULL, 0 }, // WindFieldSampler +}; + + +bool WindFieldSamplerData::mBuiltFlag = false; +NvParameterized::MutexType WindFieldSamplerData::mBuiltFlagMutex; + +WindFieldSamplerData::WindFieldSamplerData(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &WindFieldSamplerDataFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +WindFieldSamplerData::~WindFieldSamplerData() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void WindFieldSamplerData::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->~WindFieldSamplerData(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* WindFieldSamplerData::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* WindFieldSamplerData::getParameterDefinitionTree(void) const +{ + WindFieldSamplerData* tmpParam = const_cast<WindFieldSamplerData*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType WindFieldSamplerData::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 WindFieldSamplerData::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 WindFieldSamplerData::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<WindFieldSamplerData::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ + +void WindFieldSamplerData::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 WindFieldSamplerData::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", "Contains the asset properties for this wind field sampler", true); + ParamDefTable[0].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=1, longName="Name" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[1]; + ParamDef->init("Name", TYPE_STRING, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Wind FS Name", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=2, longName="WindFieldSampler" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[2]; + ParamDef->init("WindFieldSampler", 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[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("INCLUDED", uint64_t(1), true); + HintTable[1].init("shortDescription", "Wind FS properties", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + static const char* const RefVariantVals[] = { "WindFSAssetParams" }; + ParamDefTable[2].setRefVariantVals((const char**)RefVariantVals, 1); + + + + } + + // 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 WindFieldSamplerData::initStrings(void) +{ + Name.isAllocated = false; + Name.buf = (const char*)"defaultWindFieldSampler"; +} + +void WindFieldSamplerData::initDynamicArrays(void) +{ +} + +void WindFieldSamplerData::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void WindFieldSamplerData::initReferences(void) +{ + WindFieldSampler = NULL; + +} + +void WindFieldSamplerData::freeDynamicArrays(void) +{ +} + +void WindFieldSamplerData::freeStrings(void) +{ + + if (Name.isAllocated && Name.buf) + { + mParameterizedTraits->strfree((char*)Name.buf); + } +} + +void WindFieldSamplerData::freeReferences(void) +{ + if (WindFieldSampler) + { + WindFieldSampler->destroy(); + } + +} + +} // namespace particles +} // namespace nvidia diff --git a/APEX_1.4/module/particles/src/autogen/WindFieldSamplerEffect.cpp b/APEX_1.4/module/particles/src/autogen/WindFieldSamplerEffect.cpp new file mode 100644 index 00000000..f431ff3b --- /dev/null +++ b/APEX_1.4/module/particles/src/autogen/WindFieldSamplerEffect.cpp @@ -0,0 +1,1362 @@ +// 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 "WindFieldSamplerEffect.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace particles +{ + +using namespace WindFieldSamplerEffectNS; + +const char* const WindFieldSamplerEffectFactory::vptr = + NvParameterized::getVptr<WindFieldSamplerEffect, WindFieldSamplerEffect::ClassAlignment>(); + +const uint32_t NumParamDefs = 32; +static NvParameterized::DefinitionImpl* ParamDefTable; // now allocated in buildTree [NumParamDefs]; + + +static const size_t ParamLookupChildrenTable[] = +{ + 1, 31, 2, 3, 4, 8, 12, 13, 14, 15, 16, 17, 5, 6, 7, 9, 10, 11, 18, 19, 20, 21, 23, + 27, 22, 24, 25, 26, 28, 29, 30, +}; + +#define TENUM(type) nvidia::##type +#define CHILDREN(index) &ParamLookupChildrenTable[index] +static const NvParameterized::ParamLookupNode ParamLookupTable[NumParamDefs] = +{ + { TYPE_STRUCT, false, 0, CHILDREN(0), 2 }, + { TYPE_STRUCT, false, (size_t)(&((ParametersStruct*)0)->EffectProperties), CHILDREN(2), 10 }, // EffectProperties + { TYPE_STRING, false, (size_t)(&((EffectProperties_Type*)0)->UserString), NULL, 0 }, // EffectProperties.UserString + { TYPE_BOOL, false, (size_t)(&((EffectProperties_Type*)0)->Enable), NULL, 0 }, // EffectProperties.Enable + { TYPE_STRUCT, false, (size_t)(&((EffectProperties_Type*)0)->Position), CHILDREN(12), 3 }, // EffectProperties.Position + { TYPE_F32, false, (size_t)(&((TranslateObject_Type*)0)->TranslateX), NULL, 0 }, // EffectProperties.Position.TranslateX + { TYPE_F32, false, (size_t)(&((TranslateObject_Type*)0)->TranslateY), NULL, 0 }, // EffectProperties.Position.TranslateY + { TYPE_F32, false, (size_t)(&((TranslateObject_Type*)0)->TranslateZ), NULL, 0 }, // EffectProperties.Position.TranslateZ + { TYPE_STRUCT, false, (size_t)(&((EffectProperties_Type*)0)->Orientation), CHILDREN(15), 3 }, // EffectProperties.Orientation + { TYPE_F32, false, (size_t)(&((OrientObject_Type*)0)->RotateX), NULL, 0 }, // EffectProperties.Orientation.RotateX + { TYPE_F32, false, (size_t)(&((OrientObject_Type*)0)->RotateY), NULL, 0 }, // EffectProperties.Orientation.RotateY + { TYPE_F32, false, (size_t)(&((OrientObject_Type*)0)->RotateZ), NULL, 0 }, // EffectProperties.Orientation.RotateZ + { TYPE_F32, false, (size_t)(&((EffectProperties_Type*)0)->InitialDelayTime), NULL, 0 }, // EffectProperties.InitialDelayTime + { TYPE_F32, false, (size_t)(&((EffectProperties_Type*)0)->Duration), NULL, 0 }, // EffectProperties.Duration + { TYPE_U32, false, (size_t)(&((EffectProperties_Type*)0)->RepeatCount), NULL, 0 }, // EffectProperties.RepeatCount + { TYPE_F32, false, (size_t)(&((EffectProperties_Type*)0)->RepeatDelay), NULL, 0 }, // EffectProperties.RepeatDelay + { TYPE_F32, false, (size_t)(&((EffectProperties_Type*)0)->RandomizeRepeatTime), NULL, 0 }, // EffectProperties.RandomizeRepeatTime + { TYPE_STRUCT, false, (size_t)(&((EffectProperties_Type*)0)->Path), CHILDREN(18), 6 }, // EffectProperties.Path + { TYPE_ENUM, false, (size_t)(&((EffectPath_Type*)0)->PlaybackMode), NULL, 0 }, // EffectProperties.Path.PlaybackMode + { TYPE_F32, false, (size_t)(&((EffectPath_Type*)0)->PathDuration), NULL, 0 }, // EffectProperties.Path.PathDuration + { TYPE_U32, false, (size_t)(&((EffectPath_Type*)0)->LoopIndex), NULL, 0 }, // EffectProperties.Path.LoopIndex + { TYPE_ARRAY, true, (size_t)(&((EffectPath_Type*)0)->ControlPoints), CHILDREN(24), 1 }, // EffectProperties.Path.ControlPoints + { TYPE_TRANSFORM, false, 1 * sizeof(physx::PxTransform), NULL, 0 }, // EffectProperties.Path.ControlPoints[] + { TYPE_ARRAY, true, (size_t)(&((EffectPath_Type*)0)->Scale), CHILDREN(25), 1 }, // EffectProperties.Path.Scale + { TYPE_STRUCT, false, 1 * sizeof(ControlPoint_Type), CHILDREN(26), 2 }, // EffectProperties.Path.Scale[] + { TYPE_F32, false, (size_t)(&((ControlPoint_Type*)0)->x), NULL, 0 }, // EffectProperties.Path.Scale[].x + { TYPE_F32, false, (size_t)(&((ControlPoint_Type*)0)->y), NULL, 0 }, // EffectProperties.Path.Scale[].y + { TYPE_ARRAY, true, (size_t)(&((EffectPath_Type*)0)->Speed), CHILDREN(28), 1 }, // EffectProperties.Path.Speed + { TYPE_STRUCT, false, 1 * sizeof(ControlPoint_Type), CHILDREN(29), 2 }, // EffectProperties.Path.Speed[] + { TYPE_F32, false, (size_t)(&((ControlPoint_Type*)0)->x), NULL, 0 }, // EffectProperties.Path.Speed[].x + { TYPE_F32, false, (size_t)(&((ControlPoint_Type*)0)->y), NULL, 0 }, // EffectProperties.Path.Speed[].y + { TYPE_REF, false, (size_t)(&((ParametersStruct*)0)->WindFieldSampler), NULL, 0 }, // WindFieldSampler +}; + + +bool WindFieldSamplerEffect::mBuiltFlag = false; +NvParameterized::MutexType WindFieldSamplerEffect::mBuiltFlagMutex; + +WindFieldSamplerEffect::WindFieldSamplerEffect(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &WindFieldSamplerEffectFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +WindFieldSamplerEffect::~WindFieldSamplerEffect() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void WindFieldSamplerEffect::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->~WindFieldSamplerEffect(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* WindFieldSamplerEffect::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* WindFieldSamplerEffect::getParameterDefinitionTree(void) const +{ + WindFieldSamplerEffect* tmpParam = const_cast<WindFieldSamplerEffect*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType WindFieldSamplerEffect::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 WindFieldSamplerEffect::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 WindFieldSamplerEffect::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<WindFieldSamplerEffect::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ + +void WindFieldSamplerEffect::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 WindFieldSamplerEffect::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", "A wind field sampler effect", true); + ParamDefTable[0].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=1, longName="EffectProperties" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[1]; + ParamDef->init("EffectProperties", TYPE_STRUCT, "EffectProperties", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("READONLY", uint64_t(0), true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("READONLY", uint64_t(0), true); + HintTable[1].init("shortDescription", "Wind FS Properties", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=2, longName="EffectProperties.UserString" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[2]; + ParamDef->init("UserString", TYPE_STRING, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "An aribtrary user string that can be set by an artist/designer/programmer", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=3, longName="EffectProperties.Enable" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[3]; + ParamDef->init("Enable", TYPE_BOOL, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Whether or not this effect is to be initially enabled on startup", true); + ParamDefTable[3].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=4, longName="EffectProperties.Position" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[4]; + ParamDef->init("Position", TYPE_STRUCT, "TranslateObject", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "The position of this effect relative to the parent", true); + ParamDefTable[4].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=5, longName="EffectProperties.Position.TranslateX" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[5]; + ParamDef->init("TranslateX", 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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(500.000000000), true); + HintTable[2].init("min", double(-500.000000000), true); + ParamDefTable[5].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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(500.000000000), true); + HintTable[2].init("min", double(-500.000000000), true); + HintTable[3].init("shortDescription", "Nudge up to +/- one meter in each direction", true); + ParamDefTable[5].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=6, longName="EffectProperties.Position.TranslateY" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[6]; + ParamDef->init("TranslateY", 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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(500.000000000), true); + HintTable[2].init("min", double(-500.000000000), true); + ParamDefTable[6].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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(500.000000000), true); + HintTable[2].init("min", double(-500.000000000), true); + HintTable[3].init("shortDescription", "Nudge up to +/- one meter in each direction", true); + ParamDefTable[6].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=7, longName="EffectProperties.Position.TranslateZ" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[7]; + ParamDef->init("TranslateZ", 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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(500.000000000), true); + HintTable[2].init("min", double(-500.000000000), true); + ParamDefTable[7].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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(500.000000000), true); + HintTable[2].init("min", double(-500.000000000), true); + HintTable[3].init("shortDescription", "Nudge up to +/- one meter in each direction", true); + ParamDefTable[7].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=8, longName="EffectProperties.Orientation" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[8]; + ParamDef->init("Orientation", TYPE_STRUCT, "OrientObject", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "The orientation of this effect, relative to the parent orientation", true); + ParamDefTable[8].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=9, longName="EffectProperties.Orientation.RotateX" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[9]; + ParamDef->init("RotateX", 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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(360.000000000), true); + HintTable[2].init("min", double(0.000000000), true); + ParamDefTable[9].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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(360.000000000), true); + HintTable[2].init("min", double(0.000000000), true); + HintTable[3].init("shortDescription", "Rotate on the X axis (0-360 degrees)", true); + ParamDefTable[9].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=10, longName="EffectProperties.Orientation.RotateY" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[10]; + ParamDef->init("RotateY", 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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(360.000000000), true); + HintTable[2].init("min", double(0.000000000), true); + ParamDefTable[10].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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(360.000000000), true); + HintTable[2].init("min", double(0.000000000), true); + HintTable[3].init("shortDescription", "Rotate on the Y axis (0-360 degrees)", true); + ParamDefTable[10].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=11, longName="EffectProperties.Orientation.RotateZ" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[11]; + ParamDef->init("RotateZ", 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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(360.000000000), true); + HintTable[2].init("min", double(0.000000000), 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("READONLY", uint64_t(0), true); + HintTable[1].init("max", double(360.000000000), true); + HintTable[2].init("min", double(0.000000000), true); + HintTable[3].init("shortDescription", "Rotate on the Z axis (0-360 degrees)", true); + ParamDefTable[11].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=12, longName="EffectProperties.InitialDelayTime" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[12]; + ParamDef->init("InitialDelayTime", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("min", double(0.000000000), 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("min", double(0.000000000), true); + HintTable[1].init("shortDescription", "Initial time to delay before spawning this effect", true); + ParamDefTable[12].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=13, longName="EffectProperties.Duration" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[13]; + ParamDef->init("Duration", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("min", double(0.000000000), true); + ParamDefTable[13].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("min", double(0.000000000), true); + HintTable[1].init("shortDescription", "The duration of the effect in secontds", true); + ParamDefTable[13].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=14, longName="EffectProperties.RepeatCount" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[14]; + ParamDef->init("RepeatCount", TYPE_U32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("min", uint64_t(1), 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("min", uint64_t(1), true); + HintTable[1].init("shortDescription", "The number of times to repeat the effect; 9999 means repeate forever", true); + ParamDefTable[14].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=15, longName="EffectProperties.RepeatDelay" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[15]; + ParamDef->init("RepeatDelay", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("min", double(0.000000000), 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("min", double(0.000000000), true); + HintTable[1].init("shortDescription", "The time to delay activation each time the effect repeats in seconds; this can be different than the initial delay time", true); + ParamDefTable[15].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=16, longName="EffectProperties.RandomizeRepeatTime" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[16]; + ParamDef->init("RandomizeRepeatTime", 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", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), 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("max", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + HintTable[2].init("shortDescription", "Amount of randomization to the repeat cycle; a value of zero (default) means no random and a value of one means completely random.", true); + ParamDefTable[16].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=17, longName="EffectProperties.Path" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[17]; + ParamDef->init("Path", TYPE_STRUCT, "EffectPath", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "An optional pre-defined path for this effect to travel on", true); + ParamDefTable[17].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=18, longName="EffectProperties.Path.PlaybackMode" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[18]; + ParamDef->init("PlaybackMode", TYPE_ENUM, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "The mode to play back the path", true); + ParamDefTable[18].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + static const char* const EnumVals[] = { "LOOP", "PLAY_ONCE", "PING_PONG" }; + ParamDefTable[18].setEnumVals((const char**)EnumVals, 3); + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=19, longName="EffectProperties.Path.PathDuration" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[19]; + ParamDef->init("PathDuration", 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", double(1000.000000000), true); + HintTable[1].init("min", double(0.000010000), true); + ParamDefTable[19].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", double(1000.000000000), true); + HintTable[1].init("min", double(0.000010000), true); + HintTable[2].init("shortDescription", "The duration of the path if one is not otherwise provided", true); + ParamDefTable[19].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=20, longName="EffectProperties.Path.LoopIndex" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[20]; + ParamDef->init("LoopIndex", TYPE_U32, 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[20].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("min", uint64_t(0), true); + HintTable[1].init("shortDescription", "The array index to loop back to", true); + ParamDefTable[20].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=21, longName="EffectProperties.Path.ControlPoints" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[21]; + ParamDef->init("ControlPoints", TYPE_ARRAY, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("editorCurve", uint64_t(1), true); + HintTable[2].init("pathEditor", uint64_t(1), 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("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("editorCurve", uint64_t(1), true); + HintTable[2].init("pathEditor", uint64_t(1), true); + HintTable[3].init("shortDescription", "The array of control points to fit the curve to", true); + ParamDefTable[21].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + ParamDef->setArraySize(-1); + } + + // Initialize DefinitionImpl node: nodeIndex=22, longName="EffectProperties.Path.ControlPoints[]" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[22]; + ParamDef->init("ControlPoints", TYPE_TRANSFORM, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("editorCurve", uint64_t(1), true); + HintTable[2].init("pathEditor", uint64_t(1), 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("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("editorCurve", uint64_t(1), true); + HintTable[2].init("pathEditor", uint64_t(1), true); + HintTable[3].init("shortDescription", "The array of control points to fit the curve to", true); + ParamDefTable[22].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=23, longName="EffectProperties.Path.Scale" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[23]; + ParamDef->init("Scale", TYPE_ARRAY, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("xAxisLabel", "Over Time", true); + HintTable[4].init("yAxisLabel", "Scale", true); + ParamDefTable[23].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#else + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("shortDescription", "The array of scale values over time", true); + HintTable[4].init("xAxisLabel", "Over Time", true); + HintTable[5].init("yAxisLabel", "Scale", true); + ParamDefTable[23].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + ParamDef->setArraySize(-1); + } + + // Initialize DefinitionImpl node: nodeIndex=24, longName="EffectProperties.Path.Scale[]" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[24]; + ParamDef->init("Scale", TYPE_STRUCT, "ControlPoint", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("xAxisLabel", "Over Time", true); + HintTable[4].init("yAxisLabel", "Scale", true); + ParamDefTable[24].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#else + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("shortDescription", "The array of scale values over time", true); + HintTable[4].init("xAxisLabel", "Over Time", true); + HintTable[5].init("yAxisLabel", "Scale", true); + ParamDefTable[24].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=25, longName="EffectProperties.Path.Scale[].x" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[25]; + 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", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), 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("max", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + HintTable[2].init("shortDescription", "The x-axis value for this vector", true); + ParamDefTable[25].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=26, longName="EffectProperties.Path.Scale[].y" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[26]; + 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", "The y-axis value for this vector", true); + ParamDefTable[26].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=27, longName="EffectProperties.Path.Speed" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[27]; + ParamDef->init("Speed", TYPE_ARRAY, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("xAxisLabel", "Over Time", true); + HintTable[4].init("yAxisLabel", "Speed", true); + ParamDefTable[27].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#else + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("shortDescription", "The array of speed values over time", true); + HintTable[4].init("xAxisLabel", "Over Time", true); + HintTable[5].init("yAxisLabel", "Speed", true); + ParamDefTable[27].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + ParamDef->setArraySize(-1); + } + + // Initialize DefinitionImpl node: nodeIndex=28, longName="EffectProperties.Path.Speed[]" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[28]; + ParamDef->init("Speed", TYPE_STRUCT, "ControlPoint", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("xAxisLabel", "Over Time", true); + HintTable[4].init("yAxisLabel", "Speed", true); + ParamDefTable[28].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#else + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("RIGHT_CLICK", "COPY_PATH PASTE_PATH CLEAR_PATH", true); + HintTable[1].init("UseSpline", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("shortDescription", "The array of speed values over time", true); + HintTable[4].init("xAxisLabel", "Over Time", true); + HintTable[5].init("yAxisLabel", "Speed", true); + ParamDefTable[28].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=29, longName="EffectProperties.Path.Speed[].x" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[29]; + 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", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + ParamDefTable[29].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", double(1.000000000), true); + HintTable[1].init("min", double(0.000000000), true); + HintTable[2].init("shortDescription", "The x-axis value for this vector", true); + ParamDefTable[29].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=30, longName="EffectProperties.Path.Speed[].y" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[30]; + 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", "The y-axis value for this vector", true); + ParamDefTable[30].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=31, longName="WindFieldSampler" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[31]; + ParamDef->init("WindFieldSampler", TYPE_REF, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Wind FS Asset", true); + ParamDefTable[31].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + static const char* const RefVariantVals[] = { "WindFSAsset" }; + ParamDefTable[31].setRefVariantVals((const char**)RefVariantVals, 1); + + + + } + + // SetChildren for: nodeIndex=0, longName="" + { + static Definition* Children[2]; + Children[0] = PDEF_PTR(1); + Children[1] = PDEF_PTR(31); + + ParamDefTable[0].setChildren(Children, 2); + } + + // SetChildren for: nodeIndex=1, longName="EffectProperties" + { + static Definition* Children[10]; + Children[0] = PDEF_PTR(2); + Children[1] = PDEF_PTR(3); + Children[2] = PDEF_PTR(4); + Children[3] = PDEF_PTR(8); + Children[4] = PDEF_PTR(12); + Children[5] = PDEF_PTR(13); + Children[6] = PDEF_PTR(14); + Children[7] = PDEF_PTR(15); + Children[8] = PDEF_PTR(16); + Children[9] = PDEF_PTR(17); + + ParamDefTable[1].setChildren(Children, 10); + } + + // SetChildren for: nodeIndex=4, longName="EffectProperties.Position" + { + static Definition* Children[3]; + Children[0] = PDEF_PTR(5); + Children[1] = PDEF_PTR(6); + Children[2] = PDEF_PTR(7); + + ParamDefTable[4].setChildren(Children, 3); + } + + // SetChildren for: nodeIndex=8, longName="EffectProperties.Orientation" + { + static Definition* Children[3]; + Children[0] = PDEF_PTR(9); + Children[1] = PDEF_PTR(10); + Children[2] = PDEF_PTR(11); + + ParamDefTable[8].setChildren(Children, 3); + } + + // SetChildren for: nodeIndex=17, longName="EffectProperties.Path" + { + static Definition* Children[6]; + Children[0] = PDEF_PTR(18); + Children[1] = PDEF_PTR(19); + Children[2] = PDEF_PTR(20); + Children[3] = PDEF_PTR(21); + Children[4] = PDEF_PTR(23); + Children[5] = PDEF_PTR(27); + + ParamDefTable[17].setChildren(Children, 6); + } + + // SetChildren for: nodeIndex=21, longName="EffectProperties.Path.ControlPoints" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(22); + + ParamDefTable[21].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=23, longName="EffectProperties.Path.Scale" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(24); + + ParamDefTable[23].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=24, longName="EffectProperties.Path.Scale[]" + { + static Definition* Children[2]; + Children[0] = PDEF_PTR(25); + Children[1] = PDEF_PTR(26); + + ParamDefTable[24].setChildren(Children, 2); + } + + // SetChildren for: nodeIndex=27, longName="EffectProperties.Path.Speed" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(28); + + ParamDefTable[27].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=28, longName="EffectProperties.Path.Speed[]" + { + static Definition* Children[2]; + Children[0] = PDEF_PTR(29); + Children[1] = PDEF_PTR(30); + + ParamDefTable[28].setChildren(Children, 2); + } + + mBuiltFlag = true; + +} +void WindFieldSamplerEffect::initStrings(void) +{ + EffectProperties.UserString.isAllocated = true; + EffectProperties.UserString.buf = NULL; +} + +void WindFieldSamplerEffect::initDynamicArrays(void) +{ + EffectProperties.Path.ControlPoints.buf = NULL; + EffectProperties.Path.ControlPoints.isAllocated = true; + EffectProperties.Path.ControlPoints.elementSize = sizeof(physx::PxTransform); + EffectProperties.Path.ControlPoints.arraySizes[0] = 0; + EffectProperties.Path.Scale.buf = NULL; + EffectProperties.Path.Scale.isAllocated = true; + EffectProperties.Path.Scale.elementSize = sizeof(ControlPoint_Type); + EffectProperties.Path.Scale.arraySizes[0] = 0; + EffectProperties.Path.Speed.buf = NULL; + EffectProperties.Path.Speed.isAllocated = true; + EffectProperties.Path.Speed.elementSize = sizeof(ControlPoint_Type); + EffectProperties.Path.Speed.arraySizes[0] = 0; +} + +void WindFieldSamplerEffect::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + EffectProperties.Enable = bool(1); + EffectProperties.Position.TranslateX = float(0.000000000); + EffectProperties.Position.TranslateY = float(0.000000000); + EffectProperties.Position.TranslateZ = float(0.000000000); + EffectProperties.Orientation.RotateX = float(0.000000000); + EffectProperties.Orientation.RotateY = float(0.000000000); + EffectProperties.Orientation.RotateZ = float(0.000000000); + EffectProperties.InitialDelayTime = float(0.000000000); + EffectProperties.Duration = float(0.000000000); + EffectProperties.RepeatCount = uint32_t(1); + EffectProperties.RepeatDelay = float(0.000000000); + EffectProperties.RandomizeRepeatTime = float(0.000000000); + EffectProperties.Path.PlaybackMode = (const char*)"LOOP"; + EffectProperties.Path.PathDuration = float(4.000000000); + EffectProperties.Path.LoopIndex = uint32_t(0); + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void WindFieldSamplerEffect::initReferences(void) +{ + WindFieldSampler = NULL; + +} + +void WindFieldSamplerEffect::freeDynamicArrays(void) +{ + if (EffectProperties.Path.ControlPoints.isAllocated && EffectProperties.Path.ControlPoints.buf) + { + mParameterizedTraits->free(EffectProperties.Path.ControlPoints.buf); + } + if (EffectProperties.Path.Scale.isAllocated && EffectProperties.Path.Scale.buf) + { + mParameterizedTraits->free(EffectProperties.Path.Scale.buf); + } + if (EffectProperties.Path.Speed.isAllocated && EffectProperties.Path.Speed.buf) + { + mParameterizedTraits->free(EffectProperties.Path.Speed.buf); + } +} + +void WindFieldSamplerEffect::freeStrings(void) +{ + + if (EffectProperties.UserString.isAllocated && EffectProperties.UserString.buf) + { + mParameterizedTraits->strfree((char*)EffectProperties.UserString.buf); + } +} + +void WindFieldSamplerEffect::freeReferences(void) +{ + if (WindFieldSampler) + { + WindFieldSampler->destroy(); + } + +} + +} // namespace particles +} // namespace nvidia |