diff options
| author | git perforce import user <a@b> | 2016-10-25 12:29:14 -0600 |
|---|---|---|
| committer | Sheikh Dawood Abdul Ajees <Sheikh Dawood Abdul Ajees> | 2016-10-25 18:56:37 -0500 |
| commit | 3dfe2108cfab31ba3ee5527e217d0d8e99a51162 (patch) | |
| tree | fa6485c169e50d7415a651bf838f5bcd0fd3bfbd /APEX_1.4/module/emitter/include | |
| download | physx-3.4-3dfe2108cfab31ba3ee5527e217d0d8e99a51162.tar.xz physx-3.4-3dfe2108cfab31ba3ee5527e217d0d8e99a51162.zip | |
Initial commit:
PhysX 3.4.0 Update @ 21294896
APEX 1.4.0 Update @ 21275617
[CL 21300167]
Diffstat (limited to 'APEX_1.4/module/emitter/include')
35 files changed, 7742 insertions, 0 deletions
diff --git a/APEX_1.4/module/emitter/include/EmitterActorImpl.h b/APEX_1.4/module/emitter/include/EmitterActorImpl.h new file mode 100644 index 00000000..57200983 --- /dev/null +++ b/APEX_1.4/module/emitter/include/EmitterActorImpl.h @@ -0,0 +1,361 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + + +#ifndef __EMITTER_ACTOR_IMPL_H__ +#define __EMITTER_ACTOR_IMPL_H__ + +#include "Apex.h" + +#include "EmitterActor.h" +#include "ApexActor.h" +#include "EmitterScene.h" +#include "EmitterLodParamDesc.h" +#include "ApexRWLockable.h" +#include "ApexRand.h" +#include "ReadCheck.h" +#include "WriteCheck.h" + +namespace nvidia +{ +namespace apex +{ +class EmitterAsset; +} +namespace emitter +{ +class EmitterAssetImpl; +class EmitterGeomBase; + +class EmitterActorImpl : public EmitterActor, public EmitterActorBase, public ApexResourceInterface, public ApexResource, public ApexRWLockable +{ +public: + APEX_RW_LOCKABLE_BOILERPLATE + + /* EmitterActor methods */ + EmitterActorImpl(const EmitterActorDesc&, EmitterAssetImpl&, ResourceList&, EmitterScene&); + ~EmitterActorImpl(); + + EmitterAsset* getEmitterAsset() const; + PxMat44 getGlobalPose() const + { + READ_ZONE(); + return PxMat44(mPose); + } + void setCurrentPose(const PxTransform& pose) + { + WRITE_ZONE(); + mPose = pose; + } + void setCurrentPosition(const PxVec3& pos) + { + WRITE_ZONE(); + mPose.p = pos; + } + Renderable* getRenderable() + { + READ_ZONE(); + return NULL; + } + Actor* getActor() + { + READ_ZONE(); + return this; + } + void removeActorAtIndex(uint32_t index); + + void getLodRange(float& min, float& max, bool& intOnly) const; + float getActiveLod() const; + void forceLod(float lod); + /** + \brief Selectively enables/disables debug visualization of a specific APEX actor. Default value it true. + */ + virtual void setEnableDebugVisualization(bool state) + { + WRITE_ZONE(); + ApexActor::setEnableDebugVisualization(state); + } + + EmitterGeomExplicit* isExplicitGeom(); + + const EmitterLodParamDesc& getLodParamDesc() const + { + READ_ZONE(); + return mLodParams; + } + void setLodParamDesc(const EmitterLodParamDesc& d); + + /* ApexResourceInterface, ApexResource */ + void release(); + uint32_t getListIndex() const + { + READ_ZONE(); + return m_listIndex; + } + void setListIndex(class ResourceList& list, uint32_t index) + { + WRITE_ZONE(); + m_list = &list; + m_listIndex = index; + } + + /* EmitterActorBase */ + void destroy(); + Asset* getOwner() const; + void visualize(RenderDebugInterface& renderDebug); + + void setPhysXScene(PxScene* s) + { + WRITE_ZONE(); + mPxScene = s; + } + PxScene* getPhysXScene() const + { + READ_ZONE(); + return mPxScene; + } + PxScene* mPxScene; + + void submitTasks(); + void setTaskDependencies(); + void fetchResults(); + + void setDensity(const float& r) + { + WRITE_ZONE(); + mDensity = r; + } + + void setRate(const float& r) + { + WRITE_ZONE(); + mRate = r; + } + + void setVelocityLow(const PxVec3& r) + { + WRITE_ZONE(); + mVelocityLow = r; + } + + void setVelocityHigh(const PxVec3& r) + { + WRITE_ZONE(); + mVelocityHigh = r; + } + + void setLifetimeLow(const float& r) + { + WRITE_ZONE(); + mLifetimeLow = r; + } + + void setLifetimeHigh(const float& r) + { + WRITE_ZONE(); + mLifetimeHigh = r; + } + + void getRate(float& r) const + { + READ_ZONE(); + r = mRate; + } + + void setOverlapTestCollisionGroups(uint32_t g) + { + WRITE_ZONE(); + mOverlapTestCollisionGroups = g; + } + + uint32_t getOverlapTestCollisionGroups() const + { + READ_ZONE(); + return mOverlapTestCollisionGroups; + } + + virtual void setDensityGridPosition(const PxVec3 &pos); + + virtual void setApexEmitterValidateCallback(EmitterValidateCallback *callback) + { + WRITE_ZONE(); + mEmitterValidateCallback = callback; + } + + PX_DEPRECATED void setObjectScale(float scale) + { + WRITE_ZONE(); + setCurrentScale(scale); + } + + PX_DEPRECATED float getObjectScale(void) const + { + READ_ZONE(); + return getObjectScale(); + } + + virtual void setCurrentScale(float scale) + { + WRITE_ZONE(); + mObjectScale = scale; + if (mInjector) + { + mInjector->setObjectScale(mObjectScale); + } + } + + virtual float getCurrentScale(void) const + { + READ_ZONE(); + return mObjectScale; + } + + void startEmit(bool persistent); + void stopEmit(); + bool isEmitting() const + { + READ_ZONE(); + return mDoEmit; + } + + void emitAssetParticles(bool enable) + { + WRITE_ZONE(); + mEmitAssetParticles = enable; + } + bool getEmitAssetParticles() const + { + READ_ZONE(); + return mEmitAssetParticles; + } + + void setAttachActor(PxActor* a) + { + WRITE_ZONE(); + mAttachActor = a; + } + const PxActor* getAttachActor() const + { + READ_ZONE(); + return mAttachActor; + } + PxActor* mAttachActor; + + void setAttachRelativePose(const PxTransform& p) + { + WRITE_ZONE(); + mAttachRelativePose = p; + } + + const PxMat44 getAttachRelativePose() const + { + READ_ZONE(); + return PxMat44(mAttachRelativePose); + } + float getObjectRadius() const + { + READ_ZONE(); + return mObjectRadius; + } + void setPreferredRenderVolume(nvidia::apex::RenderVolume*); + + static PxVec3 random(const PxVec3& low, const PxVec3& high, QDSRand& rand); + static float random(const float& low, const float& high, QDSRand& rand); + + void setSeed(uint32_t seed) + { + mRand.setSeed(seed); + } + + virtual uint32_t getSimParticlesCount() const + { + READ_ZONE(); + return mInjector->getSimParticlesCount(); + } + + virtual uint32_t getActiveParticleCount() const; + +protected: + uint32_t computeNbEmittedFromRate(float dt, float currate); + void emitObjects(const PxTransform& pose, uint32_t toEmitNum, bool useFullVolume); + void emitObjects(const physx::Array<PxVec3>& positions); + void tick(); + + EmitterValidateCallback *mEmitterValidateCallback; + IosInjectorIntl* mInjector; + InstancedObjectSimulationIntl *mIOS; + EmitterAssetImpl* mAsset; + EmitterScene* mScene; + PxBounds3 mOverlapAABB; + PxBounds3 mLastNonEmptyOverlapAABB; + + float mObjectScale; + /* runtime state */ + PxTransform mPose; + physx::Array<PxTransform> mPoses; + bool mFirstStartEmitCall; + bool mDoEmit; + bool mEmitAssetParticles; + bool mPersist; + float mRemainder; + float mEmitterVolume; + bool mIsOldPoseInitialized; + PxTransform mOldPose; + float mDensity; + float mRate; + PxVec3 mVelocityLow; + PxVec3 mVelocityHigh; + float mLifetimeLow; + float mLifetimeHigh; + float mObjectRadius; + float mEmitDuration; + float mDescEmitDuration; + uint32_t mOverlapTestCollisionGroups; + bool mShouldUseGroupsMask; + physx::Array<IosNewObject> mNewObjectArray; + physx::Array<PxVec3> mNewPositions; + physx::Array<PxVec3> mNewVelocities; + physx::Array<uint32_t> mNewUserData; + + EmitterGeomBase* mExplicitGeom; + EmitterLodParamDesc mLodParams; + PxTransform mAttachRelativePose; + + nvidia::QDSRand mRand; + + class ApexEmitterTickTask : public PxTask + { + private: + ApexEmitterTickTask& operator=(const ApexEmitterTickTask&); + + public: + ApexEmitterTickTask(EmitterActorImpl& actor) : mActor(actor) {} + + const char* getName() const + { + return "EmitterActorImpl::TickTask"; + } + void run() + { + mActor.tick(); + } + + protected: + EmitterActorImpl& mActor; + }; + ApexEmitterTickTask mTickTask; + + friend class EmitterScene; +}; + +} +} // end namespace nvidia + +#endif diff --git a/APEX_1.4/module/emitter/include/EmitterAssetImpl.h b/APEX_1.4/module/emitter/include/EmitterAssetImpl.h new file mode 100644 index 00000000..8621ea6b --- /dev/null +++ b/APEX_1.4/module/emitter/include/EmitterAssetImpl.h @@ -0,0 +1,532 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + + +#ifndef EMITTER_ASSET_IMPL_H +#define EMITTER_ASSET_IMPL_H + +#include "Apex.h" +#include "EmitterAsset.h" +#include "EmitterGeomBase.h" +#include "ApexSDKHelpers.h" +#include "ApexAssetAuthoring.h" +#include "ApexAssetTracker.h" +#include "ApexString.h" +#include "ResourceProviderIntl.h" +#include "InstancedObjectSimulationIntl.h" +#include "EmitterLodParamDesc.h" +#include "ApexAuthorableObject.h" +#include "ApexEmitterAssetParameters.h" +#include "ApexEmitterActorParameters.h" +#include "EmitterAssetPreviewParameters.h" +#include "ApexUsingNamespace.h" +#include "CurveImpl.h" +#include "ApexRWLockable.h" +#include "ReadCheck.h" +#include "WriteCheck.h" +#include "ApexAuthorableObject.h" + +namespace nvidia +{ +namespace iofx +{ +class IofxAsset; +} + +namespace emitter +{ + +class EmitterActorImpl; +class ModuleEmitterImpl; + +/** + Descriptor used to create an ApexEmitter preview. +*/ +class EmitterPreviewDesc : public ApexDesc +{ +public: + PxTransform mPose; ///< pose of the preview renderer + float mScale; ///< scaling factor of renderable + + /** + \brief Constructor sets to default. + */ + PX_INLINE EmitterPreviewDesc() : ApexDesc() + { + setToDefault(); + } + + /** + \brief Sets to default values. + */ + PX_INLINE void setToDefault() + { + ApexDesc::setToDefault(); + + mPose = PxTransform(PxIdentity); + mScale = 1.0f; + } + + /** + \brief checks the valididty of parameters. + */ + PX_INLINE bool isValid() const + { + return ApexDesc::isValid(); + } +}; + + +class EmitterActorDesc : public ApexDesc +{ +public: + PxTransform initialPose; ///< the pose of the emitter immediately after addding to the scene. + + PxActor* attachActor; ///< the actor to which the emitter will be attatched. May be NULL to keep the emitter unattatched. + + PxTransform attachRelativePose; ///< the pose of the emitter in the space of the actor, to which it is attatched. Overrides the initial pose. + + uint32_t overlapTestCollisionGroups; ///< collision groups used to reject particles overlapping with the geometry + + bool emitAssetParticles; ///< indicates whether authored asset particle list will be emitted, defaults to true + + float emitterDuration; + + float initialScale; + + /** + \brief constructor sets to default. + */ + PX_INLINE EmitterActorDesc() : ApexDesc() + { + init(); + } + + /** + \brief sets members to default values. + */ + PX_INLINE void setToDefault() + { + ApexDesc::setToDefault(); + init(); + } + + /** + \brief checks if this is a valid descriptor. + */ + PX_INLINE bool isValid() const + { + if (!ApexDesc::isValid()) + { + return false; + } + + return true; + } + +private: + + PX_INLINE void init() + { + initialPose = PxTransform(PxIdentity); + attachActor = NULL; + attachRelativePose = PxTransform(PxIdentity); + overlapTestCollisionGroups = 0; + emitAssetParticles = true; + emitterDuration = PX_MAX_F32; + initialScale = 1.0f; + } +}; + +class EmitterAssetImpl : public EmitterAsset, + public ApexResourceInterface, + public ApexResource, + public NvParameterized::SerializationCallback, + public ApexRWLockable +{ + friend class ApexEmitterAssetDummyAuthoring; +public: + APEX_RW_LOCKABLE_BOILERPLATE + + EmitterAssetImpl(ModuleEmitterImpl*, ResourceList&, const char* name); + EmitterAssetImpl(ModuleEmitterImpl* module, + ResourceList& list, + NvParameterized::Interface* params, + const char* name); + + ~EmitterAssetImpl(); + + /* Asset */ + const char* getName() const + { + return mName.c_str(); + } + AuthObjTypeID getObjTypeID() const + { + READ_ZONE(); + return mAssetTypeID; + } + const char* getObjTypeName() const + { + return getClassName(); + } + uint32_t forceLoadAssets(); + + /* ApexInterface */ + virtual void release(); + + /* ApexResourceInterface, ApexResource */ + uint32_t getListIndex() const + { + return m_listIndex; + } + void setListIndex(class ResourceList& list, uint32_t index) + { + m_list = &list; + m_listIndex = index; + } + + /* EmitterAsset specific methods */ + + EmitterGeomExplicit* isExplicitGeom(); + const EmitterGeomExplicit* isExplicitGeom() const; + + const EmitterGeom* getGeom() const + { + return mGeom->getEmitterGeom(); + } + + const char* getInstancedObjectEffectsAssetName(void) const + { + READ_ZONE(); + return mParams->iofxAssetName->name(); + } + const char* getInstancedObjectSimulatorAssetName(void) const + { + READ_ZONE(); + return mParams->iosAssetName->name(); + } + const char* getInstancedObjectSimulatorTypeName(void) const + { + READ_ZONE(); + return mParams->iosAssetName->className(); + } + + const float & getDensity() const + { + READ_ZONE(); + return mParams->density; + } + + const float & getRate() const + { + READ_ZONE(); + return mParams->rate; + } + + const PxVec3 & getVelocityLow() const + { + READ_ZONE(); + return mParams->velocityLow; + } + + const PxVec3 & getVelocityHigh() const + { + READ_ZONE(); + return mParams->velocityHigh; + } + + const float & getLifetimeLow() const + { + READ_ZONE(); + return mParams->lifetimeLow; + } + + const float & getLifetimeHigh() const + { + READ_ZONE(); + return mParams->lifetimeHigh; + } + + uint32_t getMaxSamples() const + { + READ_ZONE(); + return mParams->maxSamples; + } + + float getEmitDuration() const + { + READ_ZONE(); + return mParams->emitterDuration; + } + + const EmitterLodParamDesc& getLodParamDesc() const + { + READ_ZONE(); + return mLodDesc; + } + + EmitterActor* createEmitterActor(const EmitterActorDesc&, const Scene&); + void releaseEmitterActor(EmitterActor&); + void destroy(); + + EmitterPreview* createEmitterPreview(const EmitterPreviewDesc& desc, AssetPreviewScene* previewScene); + void releaseEmitterPreview(EmitterPreview& preview); + + const NvParameterized::Interface* getAssetNvParameterized() const + { + READ_ZONE(); + return mParams; + } + /** + * \brief Releases the ApexAsset but returns the NvParameterized::Interface and *ownership* to the caller. + */ + virtual NvParameterized::Interface* releaseAndReturnNvParameterizedInterface(void) + { + WRITE_ZONE(); + NvParameterized::Interface* ret = mParams; + mParams = NULL; + release(); + return ret; + } + + NvParameterized::Interface* getDefaultActorDesc(); + NvParameterized::Interface* getDefaultAssetPreviewDesc(); + virtual Actor* createApexActor(const NvParameterized::Interface& params, Scene& apexScene); + virtual AssetPreview* createApexAssetPreview(const NvParameterized::Interface& params, AssetPreviewScene* previewScene); + virtual bool isValidForActorCreation(const ::NvParameterized::Interface& actorParams, Scene& /*apexScene*/) const; + + virtual bool isDirty() const + { + READ_ZONE(); + return false; + } + +protected: + /* Typical asset members */ + static const char* getClassName() + { + return EMITTER_AUTHORING_TYPE_NAME; + } + static AuthObjTypeID mAssetTypeID; + + IofxAsset* getIofxAsset(); // callable by actors + + /* NvParameterized Serialization callbacks */ + void preSerialize(void* userData_ = NULL) + { + PX_UNUSED(userData_); + } + void postDeserialize(void* userData_ = NULL); + + void copyLodDesc2(EmitterLodParamDesc& dst, + const ApexEmitterAssetParametersNS::emitterLodParamDesc_Type& src); + void copyLodDesc2(ApexEmitterAssetParametersNS::emitterLodParamDesc_Type& dst, + const EmitterLodParamDesc& src); + + + ApexEmitterAssetParameters* mParams; + ApexEmitterActorParameters* mDefaultActorParams; + EmitterAssetPreviewParameters* mDefaultPreviewParams; + + ModuleEmitterImpl* mModule; + ResourceList mEmitterActors; + ApexSimpleString mName; + + /* EmitterAsset specific asset members */ + EmitterGeomBase* mGeom; + + /* this lod is only for the getter and setter, it should mirror the parameterized lod desc */ + EmitterLodParamDesc mLodDesc; + + /* objects that assist in force loading and proper "assets own assets" behavior */ + ApexAssetTracker mIofxAssetTracker; + ApexAssetTracker mIosAssetTracker; + void initializeAssetNameTable(); + + CurveImpl mRateVsTimeCurve; + + friend class ModuleEmitterImpl; + friend class EmitterActorImpl; + friend class EmitterAssetPreview; + template <class T_Module, class T_Asset, class T_AssetAuthoring> friend class nvidia::apex::ApexAuthorableObject; +}; + +#ifndef WITHOUT_APEX_AUTHORING +class EmitterAssetAuthoringImpl : public EmitterAssetImpl, public ApexAssetAuthoring, public EmitterAssetAuthoring +{ +public: + APEX_RW_LOCKABLE_BOILERPLATE + + /* EmitterAssetAuthoring */ + EmitterAssetAuthoringImpl(ModuleEmitterImpl* m, ResourceList& l) : + EmitterAssetImpl(m, l, "ApexEmitterAuthor") {} + + EmitterAssetAuthoringImpl(ModuleEmitterImpl* m, ResourceList& l, const char* name) : + EmitterAssetImpl(m, l, name) {} + + EmitterAssetAuthoringImpl(ModuleEmitterImpl* m, ResourceList& l, NvParameterized::Interface* params, const char* name) : + EmitterAssetImpl(m, l, params, name) {} + + ~EmitterAssetAuthoringImpl() {} + + EmitterGeomBox* setBoxGeom(); + EmitterGeomSphere* setSphereGeom(); + EmitterGeomSphereShell* setSphereShellGeom(); + EmitterGeomExplicit* setExplicitGeom(); + + void setInstancedObjectEffectsAssetName(const char*); + void setInstancedObjectSimulatorAssetName(const char*); + void setInstancedObjectSimulatorTypeName(const char*); + + void setDensity(const float& r) + { + mParams->density = r; + } + + void setRate(const float& r) + { + mParams->rate = r; + } + + // Noise parameters + void setVelocityLow(const PxVec3& v) + { + mParams->velocityLow.x = v.x; + mParams->velocityLow.y = v.y; + mParams->velocityLow.z = v.z; + } + void setVelocityHigh(const PxVec3& v) + { + mParams->velocityHigh.x = v.x; + mParams->velocityHigh.y = v.y; + mParams->velocityHigh.z = v.z; + } + + void setLifetimeLow(const float& l) + { + mParams->lifetimeLow = l; + } + + void setLifetimeHigh(const float& l) + { + mParams->lifetimeHigh = l; + } + + + /* Max samples is ignored if using explicit geometry */ + void setMaxSamples(uint32_t max) + { + mParams->maxSamples = max; + } + + void setLodParamDesc(const EmitterLodParamDesc& d) + { + mLodDesc = d; + copyLodDesc2(mParams->lodParamDesc, d); + } + + const EmitterGeom* getGeom() const + { + READ_ZONE(); + return EmitterAssetImpl::getGeom(); + } + const char* getInstancedObjectEffectsAssetName(void) const + { + return EmitterAssetImpl::getInstancedObjectEffectsAssetName(); + } + const char* getInstancedObjectSimulatorAssetName(void) const + { + return EmitterAssetImpl::getInstancedObjectSimulatorAssetName(); + } + const char* getInstancedObjectSimulatorTypeName(void) const + { + return EmitterAssetImpl::getInstancedObjectSimulatorTypeName(); + } + const float& getDensity() const + { + return EmitterAssetImpl::getDensity(); + } + const float& getRate() const + { + return EmitterAssetImpl::getRate(); + } + const PxVec3& getVelocityLow() const + { + return EmitterAssetImpl::getVelocityLow(); + } + const PxVec3& getVelocityHigh() const + { + return EmitterAssetImpl::getVelocityHigh(); + } + const float& getLifetimeLow() const + { + return EmitterAssetImpl::getLifetimeLow(); + } + const float& getLifetimeHigh() const + { + return EmitterAssetImpl::getLifetimeHigh(); + } + uint32_t getMaxSamples() const + { + return EmitterAssetImpl::getMaxSamples(); + } + const EmitterLodParamDesc& getLodParamDesc() const + { + READ_ZONE(); + return EmitterAssetImpl::getLodParamDesc(); + } + + /* AssetAuthoring */ + const char* getName(void) const + { + READ_ZONE(); + return EmitterAssetImpl::getName(); + } + const char* getObjTypeName() const + { + READ_ZONE(); + return EmitterAssetImpl::getClassName(); + } + virtual bool prepareForPlatform(nvidia::apex::PlatformTag) + { + APEX_INVALID_OPERATION("Not Implemented."); + return false; + } + void setToolString(const char* toolName, const char* toolVersion, uint32_t toolChangelist) + { + ApexAssetAuthoring::setToolString(toolName, toolVersion, toolChangelist); + } + NvParameterized::Interface* getNvParameterized() const + { + return (NvParameterized::Interface*)getAssetNvParameterized(); + } + + /** + * \brief Releases the ApexAsset but returns the NvParameterized::Interface and *ownership* to the caller. + */ + virtual NvParameterized::Interface* releaseAndReturnNvParameterizedInterface(void) + { + NvParameterized::Interface* ret = getNvParameterized(); + mParams = NULL; + release(); + return ret; + } + + + /* ApexInterface */ + virtual void release(); +}; +#endif + +} +} // end namespace nvidia + +#endif // EMITTER_ASSET_IMPL_H diff --git a/APEX_1.4/module/emitter/include/EmitterAssetPreview.h b/APEX_1.4/module/emitter/include/EmitterAssetPreview.h new file mode 100644 index 00000000..7bad148e --- /dev/null +++ b/APEX_1.4/module/emitter/include/EmitterAssetPreview.h @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + + +#ifndef __EMITTER_ASSET_PREVIEW_H__ +#define __EMITTER_ASSET_PREVIEW_H__ + +#include "ApexPreview.h" + +#include "ApexSDKIntl.h" +#include "EmitterPreview.h" +#include "RenderDebugInterface.h" +#include "EmitterAssetImpl.h" +#include "ApexRWLockable.h" + +namespace nvidia +{ +namespace emitter +{ + +class EmitterAssetPreview : public EmitterPreview, public ApexResource, public ApexPreview, public ApexRWLockable +{ +public: + APEX_RW_LOCKABLE_BOILERPLATE + + EmitterAssetPreview(const EmitterPreviewDesc& pdesc, const EmitterAssetImpl& asset, AssetPreviewScene* previewScene, ApexSDK* myApexSDK); + + bool isValid() const; + + void drawEmitterPreview(void); + void drawPreviewAssetInfo(void); + void drawInfoLine(uint32_t lineNum, const char* str); + void destroy(); + + void setPose(const PxMat44& pose); // Sets the preview instance's pose. This may include scaling. + const PxMat44 getPose() const; + + // from RenderDataProvider + void lockRenderResources(void); + void unlockRenderResources(void); + void updateRenderResources(bool rewriteBuffers = false, void* userRenderData = 0); + + // from Renderable.h + void dispatchRenderResources(UserRenderer& renderer); + PxBounds3 getBounds(void) const; + + // from ApexResource.h + void release(void); + +private: + ~EmitterAssetPreview(); + + void toggleDrawPreview(); + void setDrawGroupsPose(); + + + AuthObjTypeID mModuleID; // the module ID of Emitter. + ApexSDK* mApexSDK; // pointer to the APEX SDK + RenderDebugInterface* mApexRenderDebug; // Pointer to the RenderLines class to draw the + PxMat44 mPose; // the pose for the preview rendering + float mScale; + const EmitterAssetImpl* mAsset; + int32_t mGroupID; + AssetPreviewScene* mPreviewScene; + + void setScale(float scale); +}; + +} +} // end namespace nvidia + +#endif // __EMITTER_ASSET_PREVIEW_H__ diff --git a/APEX_1.4/module/emitter/include/EmitterGeomBase.h b/APEX_1.4/module/emitter/include/EmitterGeomBase.h new file mode 100644 index 00000000..3df1f830 --- /dev/null +++ b/APEX_1.4/module/emitter/include/EmitterGeomBase.h @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + + +#ifndef __EMITTER_GEOM_BASE_H__ +#define __EMITTER_GEOM_BASE_H__ + +#include "Apex.h" +#include "EmitterGeoms.h" +#include "PsArray.h" +#include "PsUserAllocated.h" +#include <ApexUsingNamespace.h> +#include "ApexRand.h" + +namespace nvidia +{ +namespace apex +{ +class RenderDebugInterface; +} +namespace emitter +{ + +/* Implementation base class for all EmitterGeom derivations */ + +class EmitterGeomBase : public UserAllocated +{ +public: + /* Asset callable functions */ + virtual EmitterGeom* getEmitterGeom() = 0; + virtual void destroy() = 0; + + /* ApexEmitterActor runtime access methods */ + virtual float computeEmitterVolume() const = 0; + virtual void computeFillPositions(physx::Array<PxVec3>& positions, + physx::Array<PxVec3>& velocities, + const PxTransform&, + const PxVec3&, + float, + PxBounds3& outBounds, + QDSRand& rand) const = 0; + + virtual PxVec3 randomPosInFullVolume(const PxMat44&, QDSRand&) const = 0; + + /* AssetPreview methods */ + virtual void drawPreview(float scale, RenderDebugInterface* renderDebug) const = 0; + + /* Optional override functions */ + virtual void visualize(const PxTransform&, RenderDebugInterface&) { } + + virtual float computeNewlyCoveredVolume(const PxMat44&, const PxMat44&, float, QDSRand&) const; + virtual PxVec3 randomPosInNewlyCoveredVolume(const PxMat44&, const PxMat44&, QDSRand&) const; + +protected: + virtual bool isInEmitter(const PxVec3& pos, const PxMat44& pose) const = 0; +}; + +} +} // end namespace nvidia + +#endif diff --git a/APEX_1.4/module/emitter/include/EmitterGeomBoxImpl.h b/APEX_1.4/module/emitter/include/EmitterGeomBoxImpl.h new file mode 100644 index 00000000..aa9be32e --- /dev/null +++ b/APEX_1.4/module/emitter/include/EmitterGeomBoxImpl.h @@ -0,0 +1,94 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + + +#ifndef __EMITTER_GEOM_BOX_IMPL_H__ +#define __EMITTER_GEOM_BOX_IMPL_H__ + +#include "EmitterGeomBase.h" +#include "PsUserAllocated.h" +#include "EmitterGeomBoxParams.h" + +namespace NvParameterized +{ +class Interface; +}; + +namespace nvidia +{ +namespace emitter +{ + +class EmitterGeomBoxImpl : public EmitterGeomBox, public EmitterGeomBase +{ +public: + EmitterGeomBoxImpl(NvParameterized::Interface* params); + + /* Asset callable methods */ + EmitterGeom* getEmitterGeom(); + const EmitterGeomBox* isBoxGeom() const + { + return this; + } + EmitterType::Enum getEmitterType() const + { + return mType; + } + void setEmitterType(EmitterType::Enum t); + void setExtents(const PxVec3& extents) + { + *mExtents = extents; + } + PxVec3 getExtents() const + { + return *mExtents; + } + void destroy() + { + delete this; + } + + /* AssetPreview methods */ + void drawPreview(float scale, RenderDebugInterface* renderDebug) const; + + /* Actor callable methods */ + void visualize(const PxTransform& pose, RenderDebugInterface& renderDebug); + float computeNewlyCoveredVolume(const PxMat44&, const PxMat44&, float, QDSRand&) const; + + void computeFillPositions(physx::Array<PxVec3>& positions, + physx::Array<PxVec3>& velocities, + const PxTransform&, + const PxVec3&, + float, + PxBounds3& outBounds, + QDSRand& rand) const; + + float computeEmitterVolume() const; + PxVec3 randomPosInFullVolume( + const PxMat44& pose, + QDSRand& rand) const; + PxVec3 randomPosInNewlyCoveredVolume( + const PxMat44& pose, + const PxMat44& oldPose, + QDSRand& rand) const; + bool isInEmitter( + const PxVec3& pos, + const PxMat44& pose) const; + +protected: + EmitterType::Enum mType; + PxVec3* mExtents; + EmitterGeomBoxParams* mGeomParams; +}; + +} +} // end namespace nvidia + +#endif
\ No newline at end of file diff --git a/APEX_1.4/module/emitter/include/EmitterGeomCylinderImpl.h b/APEX_1.4/module/emitter/include/EmitterGeomCylinderImpl.h new file mode 100644 index 00000000..816c0628 --- /dev/null +++ b/APEX_1.4/module/emitter/include/EmitterGeomCylinderImpl.h @@ -0,0 +1,94 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + + +#ifndef __EMITTER_GEOM_CYLINDER_IMPL_H__ +#define __EMITTER_GEOM_CYLINDER_IMPL_H__ + +#include "EmitterGeomBase.h" +#include "PsUserAllocated.h" +#include "EmitterGeomCylinderParams.h" + +namespace NvParameterized +{ +class Interface; +}; + +namespace nvidia +{ +namespace emitter +{ + +class EmitterGeomCylinderImpl : public EmitterGeomCylinder, public EmitterGeomBase +{ +public: + EmitterGeomCylinderImpl(NvParameterized::Interface* params); + + /* Asset callable methods */ + EmitterGeom* getEmitterGeom(); + const EmitterGeomCylinder* isCylinderGeom() const + { + return this; + } + EmitterType::Enum getEmitterType() const + { + return mType; + } + void setEmitterType(EmitterType::Enum t); + void setRadius(float radius) + { + *mRadius = radius; + } + float getRadius() const + { + return *mRadius; + } + void setHeight(float height) + { + *mHeight = height; + } + float getHeight() const + { + return *mHeight; + } + void destroy() + { + delete this; + } + + /* AssetPreview methods */ + void drawPreview(float scale, RenderDebugInterface* renderDebug) const; + + /* Actor callable methods */ + void visualize(const PxTransform& pose, RenderDebugInterface& renderDebug); + + void computeFillPositions(physx::Array<PxVec3>& positions, + physx::Array<PxVec3>& velocities, + const PxTransform&, + const PxVec3&, + float, + PxBounds3& outBounds, + QDSRand& rand) const; + + float computeEmitterVolume() const; + PxVec3 randomPosInFullVolume(const PxMat44& pose, QDSRand& rand) const; + bool isInEmitter(const PxVec3& pos, const PxMat44& pose) const; + +protected: + EmitterType::Enum mType; + float* mRadius; + float* mHeight; + EmitterGeomCylinderParams* mGeomParams; +}; + +} +} // end namespace nvidia + +#endif diff --git a/APEX_1.4/module/emitter/include/EmitterGeomExplicitImpl.h b/APEX_1.4/module/emitter/include/EmitterGeomExplicitImpl.h new file mode 100644 index 00000000..74156d45 --- /dev/null +++ b/APEX_1.4/module/emitter/include/EmitterGeomExplicitImpl.h @@ -0,0 +1,256 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + + +#ifndef __EMITTER_GEOM_EXPLICIT_IMPL_H__ +#define __EMITTER_GEOM_EXPLICIT_IMPL_H__ + +#include "EmitterGeomBase.h" +#include "PsUserAllocated.h" +#include "EmitterGeomExplicitParams.h" +#include "ApexRand.h" + +namespace NvParameterized +{ +class Interface; +}; + +namespace nvidia +{ +namespace emitter +{ + + +class EmitterGeomExplicitImpl : public EmitterGeomExplicit, public EmitterGeomBase +{ + void updateAssetPoints(); + +public: + EmitterGeomExplicitImpl(NvParameterized::Interface* params); + EmitterGeomExplicitImpl(); + + virtual ~EmitterGeomExplicitImpl() {} + + /* Asset callable methods */ + EmitterGeom* getEmitterGeom(); + const EmitterGeomExplicit* isExplicitGeom() const + { + return this; + } + EmitterType::Enum getEmitterType() const + { + return EmitterType::ET_FILL; + } + void setEmitterType(EmitterType::Enum) {} // PX_ASSERT(t == EmitterType::ET_FILL); + void destroy() + { + delete this; + } + + /* AssetPreview methods */ + void drawPreview(float scale, RenderDebugInterface* renderDebug) const; + + /* Actor callable methods */ + void visualize(const PxTransform& pose, RenderDebugInterface& renderDebug); + void computeFillPositions(physx::Array<PxVec3>& positions, + physx::Array<PxVec3>& velocities, + const PxTransform& pose, + const PxVec3& scale, + float density, + PxBounds3& outBounds, + QDSRand& rand) const + { + computeFillPositions(positions, velocities, NULL, pose, scale, density, outBounds, rand); + } + + void computeFillPositions(physx::Array<PxVec3>& positions, + physx::Array<PxVec3>& velocities, + physx::Array<uint32_t>* userDataArrayPtr, + const PxTransform&, + const PxVec3&, + float, + PxBounds3& outBounds, + QDSRand& rand) const; + + /* Stubs */ + float computeNewlyCoveredVolume(const PxTransform&, const PxTransform&) const + { + return 0.0f; + } + float computeEmitterVolume() const + { + return 0.0f; + } + PxVec3 randomPosInFullVolume(const PxMat44&, QDSRand&) const + { + return PxVec3(0.0f, 0.0f, 0.0f); + } + PxVec3 randomPosInNewlyCoveredVolume(const PxMat44& , const PxMat44&, QDSRand&) const + { + return PxVec3(0.0f, 0.0f, 0.0f); + } + bool isInEmitter(const PxVec3&, const PxMat44&) const + { + return false; + } + + void resetParticleList() + { + mPoints.clear(); + mVelocities.clear(); + mPointsUserData.clear(); + + mSpheres.clear(); + mSphereVelocities.clear(); + + mEllipsoids.clear(); + mEllipsoidVelocities.clear(); + } + + void addParticleList(uint32_t count, + const PointParams* params, + const PxVec3* velocities = 0); + + void addParticleList(uint32_t count, + const PxVec3* positions, + const PxVec3* velocities = 0); + + void addParticleList(uint32_t count, + const PointListData& data); + + void addSphereList(uint32_t count, + const SphereParams* params, + const PxVec3* velocities = 0); + + void addEllipsoidList(uint32_t count, + const EllipsoidParams* params, + const PxVec3* velocities = 0); + + void getParticleList(const PointParams* ¶ms, + uint32_t& numPoints, + const PxVec3* &velocities, + uint32_t& numVelocities) const; + + void getSphereList(const SphereParams* ¶ms, + uint32_t& numSpheres, + const PxVec3* &velocities, + uint32_t& numVelocities) const; + + void getEllipsoidList(const EllipsoidParams* ¶ms, + uint32_t& numEllipsoids, + const PxVec3* &velocities, + uint32_t& numVelocities) const; + + uint32_t getParticleCount() const + { + return mPoints.size(); + } + PxVec3 getParticlePos(uint32_t index) const + { + return mPoints[ index ].position; + } + + uint32_t getSphereCount() const + { + return mSpheres.size(); + } + PxVec3 getSphereCenter(uint32_t index) const + { + return mSpheres[ index ].center; + } + float getSphereRadius(uint32_t index) const + { + return mSpheres[ index ].radius; + } + + uint32_t getEllipsoidCount() const + { + return mEllipsoids.size(); + } + PxVec3 getEllipsoidCenter(uint32_t index) const + { + return mEllipsoids[ index ].center; + } + float getEllipsoidRadius(uint32_t index) const + { + return mEllipsoids[ index ].radius; + } + PxVec3 getEllipsoidNormal(uint32_t index) const + { + return mEllipsoids[ index ].normal; + } + float getEllipsoidPolarRadius(uint32_t index) const + { + return mEllipsoids[ index ].polarRadius; + } + + float getDistance() const + { + return mDistance; + } + +protected: + mutable QDSRand mRand; + +# define MAX_COLLISION_SHAPES 5 + + struct CollisionList + { + uint32_t shapeIndices[MAX_COLLISION_SHAPES]; + uint32_t next; + + PX_INLINE CollisionList(): next(0) {} + + PX_INLINE void pushBack(uint32_t shapeIdx) + { + if (next >= MAX_COLLISION_SHAPES) + { + PX_ASSERT(0 && "Too many colliding shapes in explicit emitter"); + return; + } + + shapeIndices[next++] = shapeIdx; + } + }; + + // Collision table holds indices of shapes which collide with some shape + // Shape indexing: firstly go spheres, then ellipsoids, then points + physx::Array<CollisionList> mCollisions; + physx::Array<PxBounds3> mBboxes; + + void updateCollisions(); + bool isInside(const PxVec3& x, uint32_t shapeIdx) const; + + void AddParticle(physx::Array<PxVec3>& positions, physx::Array<PxVec3>& velocities, + physx::Array<uint32_t>* userDataArrayPtr, + const PxTransform& pose, float cutoff, PxBounds3& outBounds, + const PxVec3& pos, const PxVec3& vel, uint32_t userData, + uint32_t srcShapeIdx, + QDSRand& rand) const; + + physx::Array<SphereParams> mSpheres; + physx::Array<PxVec3> mSphereVelocities; + + physx::Array<EllipsoidParams> mEllipsoids; + physx::Array<PxVec3> mEllipsoidVelocities; + + physx::Array<PointParams> mPoints; + physx::Array<PxVec3> mVelocities; + physx::Array<uint32_t> mPointsUserData; + + float mDistance, mInvDistance; + + EmitterGeomExplicitParams* mGeomParams; +}; + +} +} // end namespace nvidia + +#endif
\ No newline at end of file diff --git a/APEX_1.4/module/emitter/include/EmitterGeomSphereImpl.h b/APEX_1.4/module/emitter/include/EmitterGeomSphereImpl.h new file mode 100644 index 00000000..f86923c3 --- /dev/null +++ b/APEX_1.4/module/emitter/include/EmitterGeomSphereImpl.h @@ -0,0 +1,94 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + + +#ifndef __EMITTER_GEOM_SPHERE_IMPL_H__ +#define __EMITTER_GEOM_SPHERE_IMPL_H__ + +#include "EmitterGeomBase.h" +#include "PsUserAllocated.h" +#include "EmitterGeomSphereParams.h" + +namespace NvParameterized +{ +class Interface; +}; + +namespace nvidia +{ +namespace emitter +{ + +class EmitterGeomSphereImpl : public EmitterGeomSphere, public EmitterGeomBase +{ +public: + EmitterGeomSphereImpl(NvParameterized::Interface* params); + + /* Asset callable methods */ + EmitterGeom* getEmitterGeom(); + const EmitterGeomSphere* isSphereGeom() const + { + return this; + } + EmitterType::Enum getEmitterType() const + { + return mType; + } + void setEmitterType(EmitterType::Enum t); + void setRadius(float radius) + { + *mRadius = radius; + } + float getRadius() const + { + return *mRadius; + } + void setHemisphere(float hemisphere) + { + *mHemisphere = hemisphere; + } + float getHemisphere() const + { + return *mHemisphere; + } + void destroy() + { + delete this; + } + + /* AssetPreview methods */ + void drawPreview(float scale, RenderDebugInterface* renderDebug) const; + + /* Actor callable methods */ + void visualize(const PxTransform& pose, RenderDebugInterface& renderDebug); + + void computeFillPositions(physx::Array<PxVec3>& positions, + physx::Array<PxVec3>& velocities, + const PxTransform&, + const PxVec3&, + float, + PxBounds3& outBounds, + QDSRand& rand) const; + + float computeEmitterVolume() const; + PxVec3 randomPosInFullVolume(const PxMat44& pose, QDSRand& rand) const; + bool isInEmitter(const PxVec3& pos, const PxMat44& pose) const; + +protected: + EmitterType::Enum mType; + float* mRadius; + float* mHemisphere; + EmitterGeomSphereParams* mGeomParams; +}; + +} +} // end namespace nvidia + +#endif diff --git a/APEX_1.4/module/emitter/include/EmitterGeomSphereShellImpl.h b/APEX_1.4/module/emitter/include/EmitterGeomSphereShellImpl.h new file mode 100644 index 00000000..ce76042c --- /dev/null +++ b/APEX_1.4/module/emitter/include/EmitterGeomSphereShellImpl.h @@ -0,0 +1,97 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + + +#ifndef __EMITTER_GEOM_SPHERE_SHELL_IMPL_H__ +#define __EMITTER_GEOM_SPHERE_SHELL_IMPL_H__ + +#include "EmitterGeomBase.h" +#include "PsUserAllocated.h" +#include "EmitterGeomSphereShellParams.h" + +namespace NvParameterized +{ +class Interface; +}; + +namespace nvidia +{ +namespace emitter +{ + +class EmitterGeomSphereShellImpl : public EmitterGeomSphereShell, public EmitterGeomBase +{ +public: + EmitterGeomSphereShellImpl(NvParameterized::Interface* params); + + /* Asset callable methods */ + EmitterGeom* getEmitterGeom(); + const EmitterGeomSphereShell* isSphereShellGeom() const + { + return this; + } + EmitterType::Enum getEmitterType() const + { + return mType; + } + void setEmitterType(EmitterType::Enum t); + void setRadius(float radius) + { + *mRadius = radius; + } + float getRadius() const + { + return *mRadius; + } + void setShellThickness(float thickness) + { + *mShellThickness = thickness; + } + float getShellThickness() const + { + return *mShellThickness; + } + void destroy() + { + delete this; + } + + /* AssetPreview methods */ + void drawPreview(float scale, RenderDebugInterface* renderDebug) const; + + /* Actor callable methods */ + void visualize(const PxTransform& pose, RenderDebugInterface& renderDebug); + + void computeFillPositions(physx::Array<PxVec3>& positions, + physx::Array<PxVec3>& velocities, + const PxTransform&, + const PxVec3&, + float, + PxBounds3& outBounds, + QDSRand& rand) const; + + float computeEmitterVolume() const; + PxVec3 randomPosInFullVolume(const PxMat44& pose, QDSRand& rand) const; + bool isInEmitter(const PxVec3& pos, const PxMat44& pose) const; + +protected: + PxVec3 randomPointOnUnitSphere(QDSRand& rand) const; + + EmitterType::Enum mType; + float* mRadius; + float* mShellThickness; + float* mHemisphere; + EmitterGeomSphereShellParams* mGeomParams; +}; + +} +} // end namespace nvidia + +#endif diff --git a/APEX_1.4/module/emitter/include/EmitterScene.h b/APEX_1.4/module/emitter/include/EmitterScene.h new file mode 100644 index 00000000..8cdf4a89 --- /dev/null +++ b/APEX_1.4/module/emitter/include/EmitterScene.h @@ -0,0 +1,141 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + + +#ifndef __EMITTER_SCENE_H__ +#define __EMITTER_SCENE_H__ + +#include "Apex.h" + +#include "ModuleEmitterImpl.h" +#include "ApexSDKIntl.h" +#include "ModuleIntl.h" +#include "ApexContext.h" +#include "ApexSDKHelpers.h" +#include "ApexActor.h" + +#include "DebugRenderParams.h" +#include "EmitterDebugRenderParams.h" + +#include "PxTask.h" + +namespace nvidia +{ +namespace apex +{ +class SceneIntl; +} +namespace emitter +{ + +class ModuleEmitterImpl; + + +/* Each Emitter Actor should derive this class, so the scene can deal with it */ +class EmitterActorBase : public ApexActor +{ +public: + virtual bool isValid() + { + return mValid; + } + virtual void tick() = 0; + virtual void visualize(RenderDebugInterface& renderDebug) = 0; + + virtual void submitTasks() = 0; + virtual void setTaskDependencies() = 0; + virtual void fetchResults() = 0; + +protected: + EmitterActorBase() : mValid(false) {} + + bool mValid; +}; + +class EmitterScene : public ModuleSceneIntl, public ApexContext, public ApexResourceInterface, public ApexResource +{ +public: + EmitterScene(ModuleEmitterImpl& module, SceneIntl& scene, RenderDebugInterface* debugRender, ResourceList& list); + ~EmitterScene(); + + /* ModuleSceneIntl */ + void visualize(); + void setModulePhysXScene(PxScene* s); + PxScene* getModulePhysXScene() const + { + return mPhysXScene; + } + PxScene* mPhysXScene; + + Module* getModule() + { + return mModule; + } + + void fetchResults(); + + virtual SceneStats* getStats() + { + return 0; + } + + bool lockRenderResources() + { + renderLockAllActors(); // Lock options not implemented yet + return true; + } + + bool unlockRenderResources() + { + renderUnLockAllActors(); // Lock options not implemented yet + return true; + } + + /* ApexResourceInterface */ + uint32_t getListIndex() const + { + return m_listIndex; + } + void setListIndex(ResourceList& list, uint32_t index) + { + m_listIndex = index; + m_list = &list; + } + void release() + { + mModule->releaseModuleSceneIntl(*this); + } + + void submitTasks(float elapsedTime, float substepSize, uint32_t numSubSteps); + void setTaskDependencies(); + +protected: + void destroy(); + + ModuleEmitterImpl* mModule; + SceneIntl* mApexScene; + + float mSumBenefit; +private: + RenderDebugInterface* mDebugRender; + + DebugRenderParams* mDebugRenderParams; + EmitterDebugRenderParams* mEmitterDebugRenderParams; + + friend class ModuleEmitterImpl; + friend class EmitterActorImpl; + friend class GroundEmitterActorImpl; + friend class ImpactEmitterActorImpl; +}; + +} +} // end namespace nvidia + +#endif diff --git a/APEX_1.4/module/emitter/include/GroundEmitterActorImpl.h b/APEX_1.4/module/emitter/include/GroundEmitterActorImpl.h new file mode 100644 index 00000000..918feb67 --- /dev/null +++ b/APEX_1.4/module/emitter/include/GroundEmitterActorImpl.h @@ -0,0 +1,397 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + + +#ifndef __GROUND_EMITTER_ACTOR_IMPL_H__ +#define __GROUND_EMITTER_ACTOR_IMPL_H__ + +#include "GroundEmitterActor.h" +#include "GroundEmitterAssetImpl.h" +#include "EmitterScene.h" +#include "ApexActor.h" +#include "ApexFIFO.h" +#include "ApexSharedUtils.h" +#include "PsUserAllocated.h" +#include "PxPlane.h" + +namespace nvidia +{ +namespace emitter +{ + +template<typename T> +struct ApexVec2 +{ + T x; + T y; +}; + +class InjectorData : public UserAllocated +{ +public: + virtual ~InjectorData() + { + } + + IosInjectorIntl* mInjector; // For emitting + float mObjectRadius; + + ApexSimpleString iofxAssetName; + ApexSimpleString iosAssetName; + + physx::Array<IosNewObject> particles; + + class InjectTask : public PxTask + { + public: + InjectTask() {} + void run(); + const char* getName() const + { + return "GroundEmitterActor::InjectTask"; + } + GroundEmitterActorImpl* mActor; + InjectorData* mData; + }; + void initTask(GroundEmitterActorImpl& actor, InjectorData& data) + { + mTask.mActor = &actor; + mTask.mData = &data; + } + + InjectTask mTask; +}; + + +struct MaterialData +{ + physx::Array<uint32_t> injectorIndices; + physx::Array<float> accumWeights; + physx::Array<float> maxSlopeAngles; + + uint32_t chooseIOFX(float& maxSlopeAngle, QDSRand& rand) + { + PX_ASSERT(injectorIndices.size() == accumWeights.size()); + + float u = rand.getScaled(0, accumWeights.back()); + for (uint32_t i = 0; i < accumWeights.size(); i++) + { + if (u <= accumWeights[i]) + { + maxSlopeAngle = maxSlopeAngles[i]; + return injectorIndices[i]; + } + } + + PX_ALWAYS_ASSERT(); + return (uint32_t) - 1; + } +}; + + +class GroundEmitterActorImpl : public GroundEmitterActor, public EmitterActorBase, public ApexResourceInterface, public ApexResource, public ApexRWLockable +{ +private: + GroundEmitterActorImpl& operator=(const GroundEmitterActorImpl&); + +public: + APEX_RW_LOCKABLE_BOILERPLATE + + GroundEmitterActorImpl(const GroundEmitterActorDesc&, GroundEmitterAssetImpl&, ResourceList&, EmitterScene&); + ~GroundEmitterActorImpl(); + + Renderable* getRenderable() + { + return NULL; + } + Actor* getActor() + { + return this; + } + void removeActorAtIndex(uint32_t index); + + void getLodRange(float& min, float& max, bool& intOnly) const; + float getActiveLod() const; + void forceLod(float lod); + /** + \brief Selectively enables/disables debug visualization of a specific APEX actor. Default value it true. + */ + virtual void setEnableDebugVisualization(bool state) + { + ApexActor::setEnableDebugVisualization(state); + } + + /* ApexResourceInterface, ApexResource */ + void release(); + uint32_t getListIndex() const + { + return m_listIndex; + } + void setListIndex(class ResourceList& list, uint32_t index) + { + m_list = &list; + m_listIndex = index; + } + + /* EmitterActorBase */ + void destroy(); + Asset* getOwner() const; + void visualize(RenderDebugInterface& renderDebug); + + void setPhysXScene(PxScene*); + PxScene* getPhysXScene() const + { + return mPxScene; + } + PxScene* mPxScene; + + void submitTasks(); + void setTaskDependencies(); + void fetchResults(); + + GroundEmitterAsset* getEmitterAsset() const; + + const PxMat44 getPose() const; + void setPose(const PxMat44& pos); + + const PxVec3& getPosition() const + { + return mLocalPlayerPosition; + } + void setPosition(const PxVec3& pos); + const PxTransform& getRotation() const + { + return mPose; + } + void setRotation(const PxTransform& rotation); + const PxVec3 &getVelocityLow() const + { + return mAsset->getVelocityLow(); + } + const PxVec3 &getVelocityHigh() const + { + return mAsset->getVelocityHigh(); + } + const float &getLifetimeLow() const + { + return mAsset->getLifetimeLow(); + } + const float &getLifetimeHigh() const + { + return mAsset->getLifetimeHigh(); + } + uint32_t getRaycastCollisionGroups() const + { + READ_ZONE(); + return mRaycastCollisionGroups; + } + void setRaycastCollisionGroups(uint32_t g) + { + WRITE_ZONE(); + mRaycastCollisionGroups = g; + } + + const physx::PxFilterData* getRaycastCollisionGroupsMask() const + { + READ_ZONE(); + return mShouldUseGroupsMask ? &mRaycastCollisionGroupsMask : NULL; + } + void setRaycastCollisionGroupsMask(physx::PxFilterData*); + + void setMaterialLookupCallback(MaterialLookupCallback* mlc) + { + WRITE_ZONE(); + mMaterialCallback = mlc; + } + MaterialLookupCallback* getMaterialLookupCallback() const + { + READ_ZONE(); + return mMaterialCallback; + } + + void setAttachActor(PxActor* a) + { + WRITE_ZONE(); + mAttachActor = a; + } + const PxActor* getAttachActor() const + { + READ_ZONE(); + return mAttachActor; + } + PxActor* mAttachActor; + + void setAttachRelativePosition(const PxVec3& pos) + { + WRITE_ZONE(); + mAttachRelativePosition = pos; + } + + const PxVec3& getAttachRelativePosition() const + { + READ_ZONE(); + return mAttachRelativePosition; + } + + bool addMeshForGroundMaterial(const MaterialFactoryMappingDesc&, const EmitterLodParamDesc&); + void setDensity(const float& d) + { + READ_ZONE(); + mDensity = d; + } + void setMaxRaycastsPerFrame(uint32_t m) + { + WRITE_ZONE(); + mMaxNumRaycastsPerFrame = m; + } + void setRaycastHeight(float h) + { + WRITE_ZONE(); + mRaycastHeight = h; + } + void setSpawnHeight(float h) + { + WRITE_ZONE(); + mSpawnHeight = h; + } + void setRadius(float); + void setPreferredRenderVolume(nvidia::apex::RenderVolume*); + + + const float &getDensity() const + { + READ_ZONE(); + return mDensity; + } + float getRadius() const + { + READ_ZONE(); + return mRadius; + } + uint32_t getMaxRaycastsPerFrame() const + { + READ_ZONE(); + return mMaxNumRaycastsPerFrame; + } + float getRaycastHeight() const + { + READ_ZONE(); + return mRaycastHeight; + } + float getSpawnHeight() const + { + READ_ZONE(); + return mSpawnHeight; + } + + void setSeed(uint32_t seed) + { + mRand.setSeed(seed); + } + +protected: + /* internal methods */ + void submitRaycasts(); + void injectParticles(InjectorData& data); + void refreshCircle(bool edgeOnly); + void tick(); + + bool onRaycastQuery(uint32_t nbHits, const physx::PxRaycastHit* hits); + + GroundEmitterAssetImpl* mAsset; + EmitterScene* mScene; + + /* Actor modifiable versions of asset data */ + float mDensity; + float mRadius; + uint32_t mMaxNumRaycastsPerFrame; + float mRaycastHeight; + float mSpawnHeight; + PxVec3 mLocalUpDirection; + PxTransform mPose; + PxTransform mInversePose; + uint32_t mRaycastCollisionGroups; + physx::PxFilterData mRaycastCollisionGroupsMask; + + PxVec3 mAttachRelativePosition; + + MaterialLookupCallback* mMaterialCallback; + physx::Array<MaterialLookupCallback::MaterialRequest> mMaterialRequestArray; + + /* Actor local data */ + Bank<MaterialData, uint16_t> mPerMaterialData; + physx::Array<InjectorData*> mInjectorList; + physx::Array<InstancedObjectSimulationIntl*> mIosList; + float mGridCellSize; + uint32_t mTotalElapsedTimeMs; + + struct RaycastVisInfo + { + PxVec3 rayStart; + uint32_t timeSubmittedMs; // running time in milliseconds (should last for 50 days or so) + }; + physx::Array<RaycastVisInfo> mVisualizeRaycastsList; + + + // use FIFO so it does the earliest (that are probably the closest to the player first) + ApexFIFO<PxVec3> mToRaycast; + physx::Array<uint32_t> mCellLastRefreshSteps; + uint32_t mSimulationSteps; + ApexVec2<int32_t> mNextGridCell; + + /* runtime state members */ + + PxVec3 mLocalPlayerPosition; + PxVec3 mWorldPlayerPosition; + PxVec3 mOldLocalPlayerPosition; // used to determine when to clear per cell step counts + float mStepsize; + PxPlane mHorizonPlane; + + float mCurrentDensity; + float mRadius2; + float mCircleArea; + bool mShouldUseGroupsMask; + float mMaxStepSize; + bool mRefreshFullCircle; + + nvidia::Mutex mInjectorDataLock; + + nvidia::QDSRand mRand; + + class GroundEmitterTickTask : public PxTask + { + public: + GroundEmitterTickTask(GroundEmitterActorImpl& actor) : mActor(actor) {} + + const char* getName() const + { + return "GroundEmitterActor::TickTask"; + } + void run() + { + mActor.tick(); + } + + protected: + GroundEmitterActorImpl& mActor; + + private: + GroundEmitterTickTask& operator=(const GroundEmitterTickTask&); + }; + GroundEmitterTickTask mTickTask; + + friend class InjectorData::InjectTask; + friend class QueryReport; +}; + +} +} // end namespace nvidia + +#endif diff --git a/APEX_1.4/module/emitter/include/GroundEmitterAssetImpl.h b/APEX_1.4/module/emitter/include/GroundEmitterAssetImpl.h new file mode 100644 index 00000000..f6a3bf15 --- /dev/null +++ b/APEX_1.4/module/emitter/include/GroundEmitterAssetImpl.h @@ -0,0 +1,574 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + + +#ifndef GROUND_EMITTER_ASSET_IMPL_H +#define GROUND_EMITTER_ASSET_IMPL_H + +#include "GroundEmitterAsset.h" +#include "GroundEmitterActor.h" +#include "ApexSDKHelpers.h" +#include "ApexAssetAuthoring.h" +#include "ApexAssetTracker.h" +#include "ApexString.h" +#include "EmitterLodParamDesc.h" +#include "InstancedObjectSimulationIntl.h" +#include "ResourceProviderIntl.h" +#include "IofxAsset.h" +#include "ApexUsingNamespace.h" +// NvParam test +#include "nvparameterized/NvParameterized.h" +#include "ParamArray.h" +#include "GroundEmitterAssetParameters.h" +#include "GroundEmitterActorParameters.h" +#include "EmitterAssetPreviewParameters.h" +#include "ApexRWLockable.h" +#include "ReadCheck.h" +#include "WriteCheck.h" +#include "ApexAuthorableObject.h" + +namespace nvidia +{ +namespace apex +{ +class GroundEmitterActor; +class GroundEmitterPreview; +} +namespace emitter +{ + +class GroundEmitterActorImpl; +class ModuleEmitterImpl; + +///Class used to bind the emitter to a specific material +class MaterialFactoryMappingDesc : ApexDesc +{ +public: + /** \brief User defined material name. + * The ground emitter will convert this name into an + * MaterialID at runtime by a getResource() call to the named resource provider. + * Note this is the physical material, not rendering material. + */ + const char* physicalMaterialName; + + /** \brief The name of the instanced object effects asset that will render your particles */ + const char* instancedObjectEffectsAssetName; + + /** \brief The asset name of the particle system that will simulate your particles */ + const char* instancedObjectSimulationAssetName; + + /** \brief The asset type of the particle system that will simulate your particles, aka 'BasicIosAsset' */ + const char* instancedObjectSimulationTypeName; + + /** \brief The weight of this factory relative to other factories on the same material */ + float weight; + + /** \brief The maximum slope at which particles will be added to the surface in degrees where 0 is horizontal + * and 90 is vertical. + */ + float maxSlopeAngle; + + /** + \brief constructor sets to default. + */ + PX_INLINE MaterialFactoryMappingDesc() : ApexDesc() + { + init(); + } + + /** + \brief sets members to default values. + */ + PX_INLINE void setToDefault() + { + ApexDesc::setToDefault(); + init(); + } + + /** + \brief checks if this is a valid descriptor. + */ + PX_INLINE bool isValid() const + { + if (!ApexDesc::isValid()) + { + return false; + } + + if (!physicalMaterialName || + !instancedObjectEffectsAssetName || + !instancedObjectSimulationAssetName || + !instancedObjectSimulationTypeName) + { + return false; + } + + if (maxSlopeAngle > 90.0f || maxSlopeAngle < 0.0f) + { + return false; + } + + return true; + } + +private: + + PX_INLINE void init() + { + physicalMaterialName = NULL; + instancedObjectEffectsAssetName = NULL; + instancedObjectSimulationAssetName = NULL; + instancedObjectSimulationTypeName = "BasicIosAsset"; + weight = 1.0f; + maxSlopeAngle = 90.0f; // in default, spawn on even vertical faces + } +}; + +///Ground Emitter actor descriptor. Used to create Ground Emitter actors +class GroundEmitterActorDesc : public ApexDesc +{ +public: + uint32_t raycastCollisionGroups; + + float radius; ///< The ground emitter actor will create objects within a circle of size 'radius'. + uint32_t maxRaycastsPerFrame; ///< The maximum raycasts number per frame. + float raycastHeight; ///< The height from which the ground emitter will cast rays at terrain/objects opposite of the 'upDirection'. + /** + \brief The height above the ground to emit particles. + If greater than 0, the ground emitter will refresh a disc above the player's position rather than + refreshing a circle around the player's position. + + */ + float density; + float spawnHeight; + ///< but it will back off to the minimum density if the actor is LOD resource limited. + PxActor* attachActor; ///< The actor to whuch the emitter will be attatched + + PxVec3 attachRelativePosition; ///< The position of the emitter in the space of the actor, to which it is attatched. + PxVec3 initialPosition; ///< The position of the emitter immediately after addding to the scene. + + /** + \brief Orientatiom of the emitter. + An identity matrix will result in a +Y up ground emitter, provide a + rotation if another orientation is desired. + */ + PxTransform rotation; + + + /** + \brief Pointer to callback that will be used to request materials from positions. Can be NULL; in such case a case ray will be cast + */ + MaterialLookupCallback* materialCallback; + + /** + \brief constructor sets to default. + */ + PX_INLINE GroundEmitterActorDesc() : ApexDesc() + { + init(); + } + + /** + \brief sets members to default values. + */ + PX_INLINE void setToDefault() + { + ApexDesc::setToDefault(); + init(); + } + + /** + \brief checks if this is a valid descriptor. + */ + PX_INLINE bool isValid() const + { + if (!ApexDesc::isValid()) + { + return false; + } + + if (!rotation.p.isZero()) + { + return false; + } + + return true; + } + +private: + + PX_INLINE void init() + { + // authored values will be used if these defaults remain + raycastCollisionGroups = uint32_t(-1); + radius = 0.0f; + maxRaycastsPerFrame = 0; + raycastHeight = 0.0f; + spawnHeight = -1.0f; + + attachActor = NULL; + attachRelativePosition = PxVec3(0.0f); + initialPosition = PxVec3(0.0f); + rotation = PxTransform(PxIdentity); + + materialCallback = NULL; + } +}; + +/** + Descriptor used to create an ApexEmitter preview. +*/ +class GroundEmitterPreviewDesc : public ApexDesc +{ +public: + PxTransform mPose; // pose of the preview renderer + float mScale; // scaling factor of renderable + + /** + \brief Constructor sets to default. + */ + PX_INLINE GroundEmitterPreviewDesc() : ApexDesc() + { + setToDefault(); + } + + /** + \brief Sets parameters to default. + */ + PX_INLINE void setToDefault() + { + ApexDesc::setToDefault(); + + mPose = PxTransform(PxIdentity); + mScale = 1.0f; + } + + /** + \brief Cchecks the validity of the parameters. + */ + PX_INLINE bool isValid() const + { + return ApexDesc::isValid(); + } +}; + + +class GroundEmitterAssetImpl : public GroundEmitterAsset, + public ApexResourceInterface, + public ApexResource, + public ApexRWLockable +{ + friend class GroundEmitterAssetDummyAuthoring; +public: + APEX_RW_LOCKABLE_BOILERPLATE + + GroundEmitterAssetImpl(ModuleEmitterImpl*, ResourceList&, const char* name); + GroundEmitterAssetImpl(ModuleEmitterImpl* module, + ResourceList& list, + NvParameterized::Interface* params, + const char* name); + ~GroundEmitterAssetImpl(); + + /* Asset */ + const char* getName() const + { + return mName.c_str(); + } + AuthObjTypeID getObjTypeID() const + { + return mAssetTypeID; + } + const char* getObjTypeName() const + { + return getClassName(); + } + uint32_t forceLoadAssets(); + + /* ApexInterface */ + virtual void release(); + + /* ApexResourceInterface, ApexResource */ + uint32_t getListIndex() const + { + return m_listIndex; + } + void setListIndex(class ResourceList& list, uint32_t index) + { + m_list = &list; + m_listIndex = index; + } + + GroundEmitterActor* createActor(const GroundEmitterActorDesc&, Scene&); + void releaseActor(GroundEmitterActor&); + + GroundEmitterPreview* createEmitterPreview(const GroundEmitterPreviewDesc& desc, AssetPreviewScene* previewScene); + void releaseEmitterPreview(GroundEmitterPreview& preview); + + const float & getDensity() const + { + READ_ZONE(); + return mParams->density; + } + + const PxVec3 & getVelocityLow() const + { + READ_ZONE(); + return mParams->velocityLow; + } + + const PxVec3 & getVelocityHigh() const + { + READ_ZONE(); + return mParams->velocityHigh; + } + + const float & getLifetimeLow() const + { + READ_ZONE(); + return mParams->lifetimeLow; + } + + const float & getLifetimeHigh() const + { + READ_ZONE(); + return mParams->lifetimeHigh; + } + + float getRadius() const + { + READ_ZONE(); + return mParams->radius; + } + uint32_t getMaxRaycastsPerFrame() const + { + READ_ZONE(); + return mParams->maxRaycastsPerFrame; + } + float getRaycastHeight() const + { + READ_ZONE(); + return mParams->raycastHeight; + } + float getSpawnHeight() const + { + READ_ZONE(); + return mParams->spawnHeight; + } + const char* getRaycastCollisionGroupMaskName() const + { + READ_ZONE(); + return mParams->raycastCollisionGroupMaskName; + } + + /* objects that assist in force loading and proper "assets own assets" behavior */ + ApexAssetTracker mIofxAssetTracker; + ApexAssetTracker mIosAssetTracker; + + const NvParameterized::Interface* getAssetNvParameterized() const + { + return mParams; + } + /** + * \brief Releases the ApexAsset but returns the NvParameterized::Interface and *ownership* to the caller. + */ + virtual NvParameterized::Interface* releaseAndReturnNvParameterizedInterface(void) + { + NvParameterized::Interface* ret = mParams; + mParams = NULL; + release(); + return ret; + } + NvParameterized::Interface* getDefaultActorDesc(); + NvParameterized::Interface* getDefaultAssetPreviewDesc(); + virtual Actor* createApexActor(const NvParameterized::Interface& parms, Scene& apexScene); + virtual AssetPreview* createApexAssetPreview(const NvParameterized::Interface& params, AssetPreviewScene* previewScene); + + virtual bool isValidForActorCreation(const ::NvParameterized::Interface& /*parms*/, Scene& /*apexScene*/) const + { + return true; // TODO implement this method + } + + virtual bool isDirty() const + { + return false; + } + +protected: + /* Typical asset members */ + static const char* getClassName() + { + return GROUND_EMITTER_AUTHORING_TYPE_NAME; + } + static AuthObjTypeID mAssetTypeID; + + void postDeserialize(void* userData_ = NULL); + + void destroy(); + ModuleEmitterImpl* mModule; + ResourceList mEmitterActors; + ApexSimpleString mName; + + //GroundEmitterAssetParameters mParams; + PxFileBuf& serializeMaterialFactory(PxFileBuf& stream, uint32_t matFactoryIdx) const; + PxFileBuf& deserializeMaterialFactory(PxFileBuf& stream, + uint32_t matFactoryIdx, + uint32_t headerVersion, + uint32_t assetVersion); + + static void copyLodDesc(EmitterLodParamDesc& dst, const GroundEmitterAssetParametersNS::emitterLodParamDesc_Type& src); + static void copyLodDesc(GroundEmitterAssetParametersNS::emitterLodParamDesc_Type& dst, const EmitterLodParamDesc& src); + + ParamArray<GroundEmitterAssetParametersNS::materialFactoryMapping_Type> *mMaterialFactoryMaps; + + void initializeAssetNameTable(); + + + GroundEmitterAssetParameters* mParams; + GroundEmitterActorParameters* mDefaultActorParams; + EmitterAssetPreviewParameters* mDefaultPreviewParams; + + uint32_t mRaycastCollisionGroups; // cache lookup value + physx::PxFilterData mRaycastCollisionGroupsMask; + + bool mShouldUseGroupsMask; + + friend class ModuleEmitterImpl; + friend class GroundEmitterActorImpl; + friend class GroundEmitterAssetPreview; + template <class T_Module, class T_Asset, class T_AssetAuthoring> friend class nvidia::apex::ApexAuthorableObject; +}; + +#ifndef WITHOUT_APEX_AUTHORING +class GroundEmitterAssetAuthoringImpl : public GroundEmitterAssetAuthoring, public ApexAssetAuthoring, public GroundEmitterAssetImpl +{ +protected: + APEX_RW_LOCKABLE_BOILERPLATE + + GroundEmitterAssetAuthoringImpl(ModuleEmitterImpl* m, ResourceList& l) : + GroundEmitterAssetImpl(m, l, "GroundEmitterAuthor") {} + + GroundEmitterAssetAuthoringImpl(ModuleEmitterImpl* m, ResourceList& l, const char* name) : + GroundEmitterAssetImpl(m, l, name) {} + + GroundEmitterAssetAuthoringImpl(ModuleEmitterImpl* m, ResourceList& l, NvParameterized::Interface* params, const char* name) : + GroundEmitterAssetImpl(m, l, params, name) {} + + ~GroundEmitterAssetAuthoringImpl(); + + EmitterLodParamDesc mCurLodParamDesc; + +public: + void release(); + const char* getName(void) const + { + READ_ZONE(); + return GroundEmitterAssetImpl::getName(); + } + const char* getObjTypeName() const + { + READ_ZONE(); + return GroundEmitterAssetImpl::getClassName(); + } + virtual bool prepareForPlatform(nvidia::apex::PlatformTag) + { + WRITE_ZONE(); + APEX_INVALID_OPERATION("Not Implemented."); + return false; + } + void setToolString(const char* toolName, const char* toolVersion, uint32_t toolChangelist) + { + WRITE_ZONE(); + ApexAssetAuthoring::setToolString(toolName, toolVersion, toolChangelist); + } + + void setDensity(const float& d) + { + mParams->density = d; + } + + void setVelocityLow(const PxVec3& v) + { + mParams->velocityLow = v; + } + + void setVelocityHigh(const PxVec3& v) + { + mParams->velocityHigh = v; + } + + void setLifetimeLow(const float& l) + { + mParams->lifetimeLow = l; + } + + void setLifetimeHigh(const float& l) + { + mParams->lifetimeHigh = l; + } + + void setRadius(float r) + { + mParams->radius = r; + } + + void setMaxRaycastsPerFrame(uint32_t m) + { + mParams->maxRaycastsPerFrame = m; + } + + void setRaycastHeight(float h) + { + mParams->raycastHeight = h; + } + + void setSpawnHeight(float h) + { + mParams->spawnHeight = h; + } + + void setRaycastCollisionGroupMaskName(const char* n) + { + NvParameterized::Handle stringHandle(*mParams); + mParams->getParameterHandle("raycastCollisionGroupMaskName", stringHandle); + mParams->setParamString(stringHandle, n); + } + + void setCurLodParamDesc(const EmitterLodParamDesc& d) + { + mCurLodParamDesc = d; + } + void addMeshForGroundMaterial(const MaterialFactoryMappingDesc&); + + NvParameterized::Interface* getNvParameterized() const + { + READ_ZONE(); + return (NvParameterized::Interface*)getAssetNvParameterized(); + } + + /** + * \brief Releases the ApexAsset but returns the NvParameterized::Interface and *ownership* to the caller. + */ + virtual NvParameterized::Interface* releaseAndReturnNvParameterizedInterface(void) + { + WRITE_ZONE(); + NvParameterized::Interface* ret = mParams; + mParams = NULL; + release(); + return ret; + } + + template <class T_Module, class T_Asset, class T_AssetAuthoring> friend class nvidia::apex::ApexAuthorableObject; +}; +#endif + +} +} // end namespace nvidia + +#endif // GROUND_EMITTER_ASSET_IMPL_H diff --git a/APEX_1.4/module/emitter/include/GroundEmitterAssetPreview.h b/APEX_1.4/module/emitter/include/GroundEmitterAssetPreview.h new file mode 100644 index 00000000..8ca0350e --- /dev/null +++ b/APEX_1.4/module/emitter/include/GroundEmitterAssetPreview.h @@ -0,0 +1,88 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + + +#ifndef __GROUND_EMITTER_ASSET_PREVIEW_H__ +#define __GROUND_EMITTER_ASSET_PREVIEW_H__ + +#include "ApexPreview.h" + +#include "ApexSDKIntl.h" +#include "GroundEmitterPreview.h" +#include "RenderDebugInterface.h" +#include "GroundEmitterAssetImpl.h" +#include "ApexRWLockable.h" + +namespace nvidia +{ +namespace emitter +{ + +class GroundEmitterAssetPreview : public GroundEmitterPreview, public ApexResource, public ApexPreview, public ApexRWLockable +{ +public: + APEX_RW_LOCKABLE_BOILERPLATE + + GroundEmitterAssetPreview(const GroundEmitterPreviewDesc& pdesc, const GroundEmitterAssetImpl& asset, ApexSDK* myApexSDK, AssetPreviewScene* previewScene) : + mApexSDK(myApexSDK), + mApexRenderDebug(0), + mScale(pdesc.mScale), + mAsset(&asset), + mPreviewScene(previewScene), + mGroupID(0) + { +#ifndef WITHOUT_DEBUG_VISUALIZE + setPose(pdesc.mPose); + drawEmitterPreview(); +#endif + }; + + bool isValid() const + { + return mApexRenderDebug != NULL; + } + void drawEmitterPreview(void); + void destroy(); + + void setPose(const PxMat44& pose); // Sets the preview instance's pose. This may include scaling. + const PxMat44 getPose() const; + + // from RenderDataProvider + void lockRenderResources(void); + void unlockRenderResources(void); + void updateRenderResources(bool rewriteBuffers = false, void* userRenderData = 0); + + // from Renderable.h + void dispatchRenderResources(UserRenderer& renderer); + PxBounds3 getBounds(void) const; + + // from ApexResource.h + void release(void); + +private: + ~GroundEmitterAssetPreview(); + + AuthObjTypeID mModuleID; // the module ID of Emitter. + UserRenderResourceManager* mRrm; // pointer to the users render resource manager + ApexSDK* mApexSDK; // pointer to the APEX SDK + RenderDebugInterface* mApexRenderDebug; // Pointer to the RenderLines class to draw the + PxTransform mPose; // the pose for the preview rendering + float mScale; + const GroundEmitterAssetImpl* mAsset; + int32_t mGroupID; + AssetPreviewScene* mPreviewScene; + + void setScale(float scale); +}; + +} +} // end namespace nvidia + +#endif // __APEX_EMITTER_ASSET_PREVIEW_H__ diff --git a/APEX_1.4/module/emitter/include/ImpactEmitterActorImpl.h b/APEX_1.4/module/emitter/include/ImpactEmitterActorImpl.h new file mode 100644 index 00000000..4480e834 --- /dev/null +++ b/APEX_1.4/module/emitter/include/ImpactEmitterActorImpl.h @@ -0,0 +1,267 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + + +#ifndef __IMPACT_EMITTER_ACTOR_IMPL_H__ +#define __IMPACT_EMITTER_ACTOR_IMPL_H__ + +//////////////////////////////////////////////////////////////////////////////// + +#include "ImpactEmitterActor.h" +#include "ImpactEmitterAssetImpl.h" +#include "EmitterScene.h" +#include "ApexActor.h" +#include "ApexFIFO.h" +#include "ApexSharedUtils.h" +#include "PsUserAllocated.h" +#include "ApexRand.h" +#include "ApexRWLockable.h" + +//////////////////////////////////////////////////////////////////////////////// + +class ImpactEmitterBaseEvent; + +namespace NvParameterized +{ +class Interface; +}; + +namespace nvidia +{ +namespace apex +{ +class InstancedObjectSimulationIntl; +} +namespace emitter +{ + +//////////////////////////////////////////////////////////////////////////////// + +struct ImpactEventTriggerParams +{ + PxVec3 hitPos; + PxVec3 hitDir; + PxVec3 hitNorm; + + ImpactEventTriggerParams() {} + ImpactEventTriggerParams(const PxVec3& p, const PxVec3& d, const PxVec3& n) : hitPos(p), hitDir(d), hitNorm(n) {} +}; + +class ImpactEmitterBaseEvent : public UserAllocated +{ +public: + ImpactEmitterBaseEvent(ImpactEmitterActorImpl* emitterActor) : mOwner(emitterActor), mValid(false) {} + virtual ~ImpactEmitterBaseEvent() {} + virtual void removeActorReference(ApexActor* a) = 0; + + virtual bool isValid() + { + return mValid; + } + virtual void trigger(const ImpactEventTriggerParams& params) = 0; + virtual void setPreferredRenderVolume(RenderVolume*) = 0; + + virtual void submitTasks(PxTaskManager*) {} + virtual void setTaskDependencies(PxTask*) {} + +protected: + ImpactEmitterActorImpl* mOwner; + bool mValid; +}; + +//////////////////////////////////////////////////////////////////////////////// + +class ImpactEmitterParticleEvent : public ImpactEmitterBaseEvent +{ +public: + static const size_t MAX_PARTICLES = 2048; + + enum eAxisType { AXIS_INCIDENT = 0, AXIS_NORMAL, AXIS_REFLECTION }; + + ImpactEmitterParticleEvent(NvParameterized::Interface* eventParamPtr, ImpactEmitterAssetImpl& asset, ImpactEmitterActorImpl* emitterActor); + + virtual ~ImpactEmitterParticleEvent(); + + virtual void removeActorReference(ApexActor* a) + { + if (mParticleInjector == a) + { + mParticleInjector = NULL; + } + } + + virtual void trigger(const ImpactEventTriggerParams& params); + + virtual void submitTasks(PxTaskManager* tm); + virtual void setTaskDependencies(PxTask* tickTask); + virtual void setPreferredRenderVolume(nvidia::apex::RenderVolume* vol); + +protected: + void run(); + + void trigger(const PxVec3& hitPos, const PxVec3& hitDir, const PxVec3& hitNorm); + void initParticle(const PxVec3& pos, const PxVec3 basis[], PxVec3& outPos, PxVec3& outVel, float& outLife); + + typedef physx::Array<ImpactEventTriggerParams> TriggerQueue; + TriggerQueue mTriggerQueue; + PxTask* mEventTask; + friend class ParticleEventTask; + + eAxisType mAxis; + float mMinAngle; + float mMaxAngle; + float mMinSpeed; + float mMaxSpeed; + float mMinLife; + float mMaxLife; + uint32_t mParticleSpawnCount; + IosInjectorIntl* mParticleInjector; +}; + +//////////////////////////////////////////////////////////////////////////////// + +class ImpactEmitterEventSet : public UserAllocated +{ +public: + struct EventSetEntry + { + float dly; + ImpactEmitterBaseEvent* evnt; + + EventSetEntry() : dly(0.0f), evnt(NULL) {}; + EventSetEntry(float d, ImpactEmitterBaseEvent* e) : dly(d), evnt(e) {}; + }; + + ImpactEmitterEventSet() {}; + virtual ~ImpactEmitterEventSet(); + + bool AddEvent(NvParameterized::Interface* eventParamPtr, ImpactEmitterAssetImpl& asset, ImpactEmitterActorImpl* emitterActor); + + physx::Array<EventSetEntry> entries; + +}; + +//////////////////////////////////////////////////////////////////////////////// + +class ImpactEmitterActorImpl : public ImpactEmitterActor, public EmitterActorBase, public ApexResourceInterface, public ApexResource, public ApexRWLockable +{ +public: + APEX_RW_LOCKABLE_BOILERPLATE + + class QueuedImpactEvent + { + public: + QueuedImpactEvent() {}; + QueuedImpactEvent(const PxVec3& p, const PxVec3& d, const PxVec3& n, float t, ImpactEmitterBaseEvent* e) + : triggerParams(p, d, n), triggerTime(t), eventDef(e) {} + + bool trigger(float time); + + protected: + ImpactEventTriggerParams triggerParams; + float triggerTime; + ImpactEmitterBaseEvent* eventDef; + }; + typedef physx::Array<QueuedImpactEvent> ImpactEventQueue; + + ImpactEmitterActorImpl(const ImpactEmitterActorDesc&, ImpactEmitterAssetImpl&, ResourceList&, EmitterScene&); + ImpactEmitterActorImpl(const NvParameterized::Interface&, ImpactEmitterAssetImpl&, ResourceList&, EmitterScene&); + + ~ImpactEmitterActorImpl(); + + Renderable* getRenderable() + { + return NULL; + } + Actor* getActor() + { + return this; + } + + void getLodRange(float& min, float& max, bool& intOnly) const; + float getActiveLod() const; + void forceLod(float lod); + /** + \brief Selectively enables/disables debug visualization of a specific APEX actor. Default value it true. + */ + virtual void setEnableDebugVisualization(bool state) + { + WRITE_ZONE(); + ApexActor::setEnableDebugVisualization(state); + } + + /* ApexResourceInterface, ApexResource */ + void release(); + uint32_t getListIndex() const + { + return m_listIndex; + } + void setListIndex(class ResourceList& list, uint32_t index) + { + m_list = &list; + m_listIndex = index; + } + + /* EmitterActorBase */ + void destroy(); + Asset* getOwner() const; + void visualize(RenderDebugInterface&); + + void setPhysXScene(PxScene*) {} + PxScene* getPhysXScene() const + { + return NULL; + } + + void submitTasks(); + void setTaskDependencies(); + void fetchResults(); + + SceneIntl* getApexScene() const; + void removeActorAtIndex(uint32_t index); + void setPreferredRenderVolume(nvidia::apex::RenderVolume*); + + ImpactEmitterAsset* getEmitterAsset() const; + + /* Override some asset settings at run time */ + + /* Actor callable methods */ + void registerImpact(const PxVec3& hitPos, const PxVec3& hitDir, const PxVec3& surfNorm, uint32_t surfType); + + void setSeed(uint32_t seed) + { + mRand.setSeed(seed); + } + +protected: + void tick(); + + float mTime; + physx::Array<ImpactEmitterEventSet> mEventSets; + + physx::Array<IosInjectorIntl*> mActiveParticleInjectors; + ImpactEventQueue mPendingEvents; + + ImpactEmitterAssetImpl* mAsset; + EmitterScene* mScene; + + PxTask* mTickTask; + friend class ImpactEmitterTickTask; + + nvidia::QDSRand mRand; + + friend class ImpactEmitterParticleEvent; +}; + +} +} // end namespace nvidia + +//////////////////////////////////////////////////////////////////////////////// +#endif diff --git a/APEX_1.4/module/emitter/include/ImpactEmitterAssetImpl.h b/APEX_1.4/module/emitter/include/ImpactEmitterAssetImpl.h new file mode 100644 index 00000000..1e91a8eb --- /dev/null +++ b/APEX_1.4/module/emitter/include/ImpactEmitterAssetImpl.h @@ -0,0 +1,318 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + + +#ifndef IMPACT_EMITTER_ASSET_IMPL_H +#define IMPACT_EMITTER_ASSET_IMPL_H + +#include "ImpactEmitterAsset.h" +#include "ApexSDKHelpers.h" +#include "ApexAssetAuthoring.h" +#include "ApexAssetTracker.h" +#include "ApexString.h" +#include "ResourceProviderIntl.h" +#include "ApexAuthorableObject.h" +#include "ImpactEmitterAssetParameters.h" +#include "ImpactEmitterActorParameters.h" +#include "EmitterAssetPreviewParameters.h" +#include "ImpactObjectEvent.h" +#include "ApexRWLockable.h" +#include "ReadCheck.h" +#include "WriteCheck.h" +#include "ApexAuthorableObject.h" + +#include "ApexUsingNamespace.h" + +namespace nvidia +{ +namespace emitter +{ + +class ImpactEmitterActorImpl; +class ModuleEmitterImpl; + +///Impact emitter actor descriptor. Used to create Impact emitter actors. +class ImpactEmitterActorDesc : public ApexDesc +{ +public: + + /** + \brief constructor sets to default. + */ + PX_INLINE ImpactEmitterActorDesc() : ApexDesc() + { + init(); + } + + /** + \brief sets members to default values. + */ + PX_INLINE void setToDefault() + { + ApexDesc::setToDefault(); + init(); + } + + /** + \brief checks if this is a valid descriptor. + */ + PX_INLINE bool isValid() const + { + if (!ApexDesc::isValid()) + { + return false; + } + + return true; + } + +private: + + + PX_INLINE void init() + { + } +}; + + +/** + Descriptor used to create a Destructible preview. +*/ +class ImpactEmitterPreviewDesc : public ApexDesc +{ +public: + + /** + \brief Constructor sets to default. + */ + PX_INLINE ImpactEmitterPreviewDesc() + { + setToDefault(); + } + + + /** + \brief Resets descriptor to default settings. + */ + PX_INLINE void setToDefault() + { + ApexDesc::setToDefault(); + + mPose = PxIdentity; + mScale = 1.0f; + } + + /** + Returns true iff an object can be created using this descriptor. + */ + PX_INLINE bool isValid() const + { + return ApexDesc::isValid(); + } + + /** + Initial global pose of preview mesh + */ + PxMat44 mPose; + float mScale; +}; + + +class ImpactEmitterAssetImpl : public ImpactEmitterAsset, + public ApexResourceInterface, + public ApexResource, + public NvParameterized::SerializationCallback, + public ApexRWLockable +{ + friend class ImpactEmitterAssetDummyAuthoring; +public: + APEX_RW_LOCKABLE_BOILERPLATE + + ImpactEmitterAssetImpl(ModuleEmitterImpl*, ResourceList&, const char* name); + ImpactEmitterAssetImpl(ModuleEmitterImpl* module, + ResourceList& list, + NvParameterized::Interface* params, + const char* name); + + ~ImpactEmitterAssetImpl(); + + /* Asset */ + const char* getName() const + { + READ_ZONE(); + return mName.c_str(); + } + AuthObjTypeID getObjTypeID() const + { + READ_ZONE(); + return mAssetTypeID; + } + const char* getObjTypeName() const + { + READ_ZONE(); + return getClassName(); + } + uint32_t forceLoadAssets(); + + /* ApexInterface */ + virtual void release(); + + /* ApexResourceInterface, ApexResource */ + uint32_t getListIndex() const + { + return m_listIndex; + } + void setListIndex(class ResourceList& list, uint32_t index) + { + m_list = &list; + m_listIndex = index; + } + + uint32_t querySetID(const char* setName); + void getSetNames(const char** outSetNames, uint32_t& inOutNameCount) const; + + const NvParameterized::Interface* getAssetNvParameterized() const + { + READ_ZONE(); + return mParams; + } + /** + * \brief Releases the ApexAsset but returns the NvParameterized::Interface and *ownership* to the caller. + */ + virtual NvParameterized::Interface* releaseAndReturnNvParameterizedInterface(void) + { + NvParameterized::Interface* ret = mParams; + mParams = NULL; + release(); + return ret; + } + NvParameterized::Interface* getDefaultActorDesc(); + NvParameterized::Interface* getDefaultAssetPreviewDesc(); + virtual Actor* createApexActor(const NvParameterized::Interface& parms, Scene& apexScene); + virtual AssetPreview* createApexAssetPreview(const NvParameterized::Interface& params, AssetPreviewScene* previewScene); + virtual bool isValidForActorCreation(const ::NvParameterized::Interface& /*parms*/, Scene& /*apexScene*/) const + { + READ_ZONE(); + return true; // TODO implement this method + } + + virtual bool isDirty() const + { + READ_ZONE(); + return false; + } + +protected: + /* Typical asset members */ + static const char* getClassName() + { + return IMPACT_EMITTER_AUTHORING_TYPE_NAME; + } + static AuthObjTypeID mAssetTypeID; + void initializeAssetNameTable(); + void destroy(); + + /* NvParameterized Serialization callbacks */ + void preSerialize(void* userData_ = NULL); + void postDeserialize(void* userData_ = NULL); + void buildEventNameIndexMap(); + + ModuleEmitterImpl* mModule; + ResourceList mEmitterActors; + ApexSimpleString mName; + + /* objects that assist in force loading and proper "assets own assets" behavior */ + ApexAssetTracker mIofxAssetTracker; + ApexAssetTracker mIosAssetTracker; + + /* asset values */ + class EventNameIndexMap : public UserAllocated + { + public: + ApexSimpleString eventSetName; + physx::Array<uint16_t> eventIndices; + }; + + ImpactEmitterAssetParameters* mParams; + ImpactEmitterActorParameters* mDefaultActorParams; + EmitterAssetPreviewParameters* mDefaultPreviewParams; + physx::Array<EventNameIndexMap*> mEventNameIndexMaps; + + friend class ModuleEmitterImpl; + friend class ImpactEmitterActorImpl; + friend class ImpactEmitterParticleEvent; + + template <class T_Module, class T_Asset, class T_AssetAuthoring> friend class nvidia::apex::ApexAuthorableObject; +}; + +#ifndef WITHOUT_APEX_AUTHORING +class ImpactEmitterAssetAuthoringImpl : public ImpactEmitterAssetAuthoring, public ApexAssetAuthoring, public ImpactEmitterAssetImpl +{ +protected: + APEX_RW_LOCKABLE_BOILERPLATE + + ImpactEmitterAssetAuthoringImpl(ModuleEmitterImpl* m, ResourceList& l) : + ImpactEmitterAssetImpl(m, l, "ImpactEmitterAuthor") {} + + ImpactEmitterAssetAuthoringImpl(ModuleEmitterImpl* m, ResourceList& l, const char* name) : + ImpactEmitterAssetImpl(m, l, name) {} + + ImpactEmitterAssetAuthoringImpl(ModuleEmitterImpl* m, ResourceList& l, NvParameterized::Interface* params, const char* name) : + ImpactEmitterAssetImpl(m, l, params, name) {} + +public: + void release(); + const char* getName(void) const + { + READ_ZONE(); + return ImpactEmitterAssetImpl::getName(); + } + const char* getObjTypeName() const + { + READ_ZONE(); + return ImpactEmitterAssetImpl::getClassName(); + } + virtual bool prepareForPlatform(nvidia::apex::PlatformTag) + { + WRITE_ZONE(); + APEX_INVALID_OPERATION("Not Implemented."); + return false; + } + void setToolString(const char* toolName, const char* toolVersion, uint32_t toolChangelist) + { + WRITE_ZONE(); + ApexAssetAuthoring::setToolString(toolName, toolVersion, toolChangelist); + } + + NvParameterized::Interface* getNvParameterized() const + { + READ_ZONE(); + return (NvParameterized::Interface*)getAssetNvParameterized(); + } + /** + * \brief Releases the ApexAsset but returns the NvParameterized::Interface and *ownership* to the caller. + */ + virtual NvParameterized::Interface* releaseAndReturnNvParameterizedInterface(void) + { + WRITE_ZONE(); + NvParameterized::Interface* ret = mParams; + mParams = NULL; + release(); + return ret; + } + + template <class T_Module, class T_Asset, class T_AssetAuthoring> friend class nvidia::apex::ApexAuthorableObject; +}; +#endif + +} +} // end namespace nvidia + +#endif // IMPACT_EMITTER_ASSET_IMPL_H diff --git a/APEX_1.4/module/emitter/include/ModuleEmitterImpl.h b/APEX_1.4/module/emitter/include/ModuleEmitterImpl.h new file mode 100644 index 00000000..059cc0be --- /dev/null +++ b/APEX_1.4/module/emitter/include/ModuleEmitterImpl.h @@ -0,0 +1,158 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + + +#ifndef __MODULE_EMITTER_IMPL_H__ +#define __MODULE_EMITTER_IMPL_H__ + +#include "Apex.h" +#include "ModuleEmitter.h" +#include "ApexSDKIntl.h" +#include "ModuleBase.h" +#include "ModuleIntl.h" +#include "EmitterAssetImpl.h" +#include "GroundEmitterAssetImpl.h" +#include "ModulePerfScope.h" +#include "ImpactObjectEvent.h" + +#include "ModuleEmitterRegistration.h" +#include "ApexRWLockable.h" +#include "ReadCheck.h" +#include "WriteCheck.h" + +namespace nvidia +{ +namespace emitter +{ + +class EmitterScene; + +class ModuleEmitterDesc : public ApexDesc +{ +public: + + /** + \brief constructor sets to default. + */ + PX_INLINE ModuleEmitterDesc() : ApexDesc() + { + init(); + } + + /** + \brief sets members to default values. + */ + PX_INLINE void setToDefault() + { + ApexDesc::setToDefault(); + init(); + } + + /** + \brief checks if this is a valid descriptor. + */ + PX_INLINE bool isValid() const + { + bool retVal = ApexDesc::isValid(); + return retVal; + } + + +private: + + PX_INLINE void init() + { + } +}; + +class ModuleEmitterImpl : public ModuleEmitter, public ModuleIntl, public ModuleBase, public ApexRWLockable +{ +public: + APEX_RW_LOCKABLE_BOILERPLATE + + ModuleEmitterImpl(ApexSDKIntl* inSdk); + ~ModuleEmitterImpl(); + + void init(const ModuleEmitterDesc& moduleEmitterDesc); + + // base class methods + void init(NvParameterized::Interface&) {} + NvParameterized::Interface* getDefaultModuleDesc(); + void release() + { + ModuleBase::release(); + } + void destroy(); + const char* getName() const + { + READ_ZONE(); + return ModuleBase::getName(); + } + + RenderableIterator* createRenderableIterator(const Scene&); + ModuleSceneIntl* createInternalModuleScene(SceneIntl&, RenderDebugInterface*); + void releaseModuleSceneIntl(ModuleSceneIntl&); + uint32_t forceLoadAssets(); + + AuthObjTypeID getModuleID() const; + AuthObjTypeID getEmitterAssetTypeID() const; + + ApexActor* getApexActor(Actor*, AuthObjTypeID) const; + + float getRateScale() const + { + return mRateScale; + } + float getDensityScale() const + { + return mDensityScale; + } + float getGroundDensityScale() const + { + return mGroundDensityScale; + } + + void setRateScale(float rateScale) + { + mRateScale = rateScale; + } + void setDensityScale(float densityScale) + { + mDensityScale = densityScale; + } + void setGroundDensityScale(float groundDensityScale) + { + mGroundDensityScale = groundDensityScale; + } + +private: + EmitterScene* getEmitterScene(const Scene& apexScene); + ResourceList mAuthorableObjects; + ResourceList mEmitterScenes; + +private: + + EmitterModuleParameters* mModuleParams; + + float mRateScale; + float mDensityScale; + float mGroundDensityScale; + + friend class EmitterAssetImpl; + friend class GroundEmitterAssetImpl; + friend class GroundEmitterActorImpl; + friend class ImpactEmitterAssetImpl; + friend class ImpactEmitterActorImpl; +}; + +} +} // namespace nvidia::apex + +#endif // __MODULE_EMITTER_IMPL_H__ diff --git a/APEX_1.4/module/emitter/include/ModuleEventDefs.h b/APEX_1.4/module/emitter/include/ModuleEventDefs.h new file mode 100644 index 00000000..53a3b926 --- /dev/null +++ b/APEX_1.4/module/emitter/include/ModuleEventDefs.h @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + + +// This file is used to define a list of AgPerfMon events. + +DEFINE_EVENT(EmitterSceneBeforeTick) +DEFINE_EVENT(EmitterSceneFetchResults) + +DEFINE_EVENT(EmitterActorOverlapAABBSceneQuery) +DEFINE_EVENT(EmitterActorOverlapSphereSceneQuery) + +DEFINE_EVENT(GroundParticlesEmitterTick) +DEFINE_EVENT(GroundParticlesEmitterInjection) +DEFINE_EVENT(GroundParticlesEmitterRefreshCircle) +DEFINE_EVENT(GroundParticlesEmitterGridInspect) +DEFINE_EVENT(GroundParticlesEmitterRaycasts) +DEFINE_EVENT(GroundParticlesEmitterFetchResults) +DEFINE_EVENT(GroundParticlesEmitterOnRaycastQuery) + diff --git a/APEX_1.4/module/emitter/include/ModulePerfScope.h b/APEX_1.4/module/emitter/include/ModulePerfScope.h new file mode 100644 index 00000000..7e50b46f --- /dev/null +++ b/APEX_1.4/module/emitter/include/ModulePerfScope.h @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + + +#ifndef __MODULE_PERF_SCOPE_H___ +#define __MODULE_PERF_SCOPE_H___ + +#define MODULE_NAMESPACE emitter +#include "ModuleProfileCommon.h" + +#endif
\ No newline at end of file diff --git a/APEX_1.4/module/emitter/include/autogen/ApexEmitterActorParameters.h b/APEX_1.4/module/emitter/include/autogen/ApexEmitterActorParameters.h new file mode 100644 index 00000000..1a3b2a2e --- /dev/null +++ b/APEX_1.4/module/emitter/include/autogen/ApexEmitterActorParameters.h @@ -0,0 +1,236 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#ifndef HEADER_ApexEmitterActorParameters_h +#define HEADER_ApexEmitterActorParameters_h + +#include "NvParametersTypes.h" + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +#include "nvparameterized/NvParameterized.h" +#include "nvparameterized/NvParameterizedTraits.h" +#include "NvParameters.h" +#include "NvTraitsInternal.h" +#endif + +namespace nvidia +{ +namespace emitter +{ + +#if PX_VC +#pragma warning(push) +#pragma warning(disable: 4324) // structure was padded due to __declspec(align()) +#endif + +namespace ApexEmitterActorParametersNS +{ + + + +struct ParametersStruct +{ + + physx::PxTransform initialPose; + float initialScale; + physx::PxTransform attachRelativePose; + bool emitAssetParticles; + NvParameterized::DummyStringStruct overlapTestGroupMaskName; + NvParameterized::DummyStringStruct overlapTestGroupsMask128Name; + float emitterDuration; + +}; + +static const uint32_t checksum[] = { 0x8bce9917, 0xda429410, 0xa3ec8f9b, 0x8e2223cf, }; + +} // namespace ApexEmitterActorParametersNS + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +class ApexEmitterActorParameters : public NvParameterized::NvParameters, public ApexEmitterActorParametersNS::ParametersStruct +{ +public: + ApexEmitterActorParameters(NvParameterized::Traits* traits, void* buf = 0, int32_t* refCount = 0); + + virtual ~ApexEmitterActorParameters(); + + virtual void destroy(); + + static const char* staticClassName(void) + { + return("ApexEmitterActorParameters"); + } + + const char* className(void) const + { + return(staticClassName()); + } + + static const uint32_t ClassVersion = ((uint32_t)0 << 16) + (uint32_t)2; + + static uint32_t staticVersion(void) + { + return ClassVersion; + } + + uint32_t version(void) const + { + return(staticVersion()); + } + + static const uint32_t ClassAlignment = 8; + + static const uint32_t* staticChecksum(uint32_t& bits) + { + bits = 8 * sizeof(ApexEmitterActorParametersNS::checksum); + return ApexEmitterActorParametersNS::checksum; + } + + static void freeParameterDefinitionTable(NvParameterized::Traits* traits); + + const uint32_t* checksum(uint32_t& bits) const + { + return staticChecksum(bits); + } + + const ApexEmitterActorParametersNS::ParametersStruct& parameters(void) const + { + ApexEmitterActorParameters* tmpThis = const_cast<ApexEmitterActorParameters*>(this); + return *(static_cast<ApexEmitterActorParametersNS::ParametersStruct*>(tmpThis)); + } + + ApexEmitterActorParametersNS::ParametersStruct& parameters(void) + { + return *(static_cast<ApexEmitterActorParametersNS::ParametersStruct*>(this)); + } + + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle) const; + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle); + + void initDefaults(void); + +protected: + + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void); + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void) const; + + + virtual void getVarPtr(const NvParameterized::Handle& handle, void*& ptr, size_t& offset) const; + +private: + + void buildTree(void); + void initDynamicArrays(void); + void initStrings(void); + void initReferences(void); + void freeDynamicArrays(void); + void freeStrings(void); + void freeReferences(void); + + static bool mBuiltFlag; + static NvParameterized::MutexType mBuiltFlagMutex; +}; + +class ApexEmitterActorParametersFactory : public NvParameterized::Factory +{ + static const char* const vptr; + +public: + + virtual void freeParameterDefinitionTable(NvParameterized::Traits* traits) + { + ApexEmitterActorParameters::freeParameterDefinitionTable(traits); + } + + virtual NvParameterized::Interface* create(NvParameterized::Traits* paramTraits) + { + // placement new on this class using mParameterizedTraits + + void* newPtr = paramTraits->alloc(sizeof(ApexEmitterActorParameters), ApexEmitterActorParameters::ClassAlignment); + if (!NvParameterized::IsAligned(newPtr, ApexEmitterActorParameters::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class ApexEmitterActorParameters"); + paramTraits->free(newPtr); + return 0; + } + + memset(newPtr, 0, sizeof(ApexEmitterActorParameters)); // always initialize memory allocated to zero for default values + return NV_PARAM_PLACEMENT_NEW(newPtr, ApexEmitterActorParameters)(paramTraits); + } + + virtual NvParameterized::Interface* finish(NvParameterized::Traits* paramTraits, void* bufObj, void* bufStart, int32_t* refCount) + { + if (!NvParameterized::IsAligned(bufObj, ApexEmitterActorParameters::ClassAlignment) + || !NvParameterized::IsAligned(bufStart, ApexEmitterActorParameters::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class ApexEmitterActorParameters"); + return 0; + } + + // Init NvParameters-part + // We used to call empty constructor of ApexEmitterActorParameters here + // but it may call default constructors of members and spoil the data + NV_PARAM_PLACEMENT_NEW(bufObj, NvParameterized::NvParameters)(paramTraits, bufStart, refCount); + + // Init vtable (everything else is already initialized) + *(const char**)bufObj = vptr; + + return (ApexEmitterActorParameters*)bufObj; + } + + virtual const char* getClassName() + { + return (ApexEmitterActorParameters::staticClassName()); + } + + virtual uint32_t getVersion() + { + return (ApexEmitterActorParameters::staticVersion()); + } + + virtual uint32_t getAlignment() + { + return (ApexEmitterActorParameters::ClassAlignment); + } + + virtual const uint32_t* getChecksum(uint32_t& bits) + { + return (ApexEmitterActorParameters::staticChecksum(bits)); + } +}; +#endif // NV_PARAMETERIZED_ONLY_LAYOUTS + +} // namespace emitter +} // namespace nvidia + +#if PX_VC +#pragma warning(pop) +#endif + +#endif diff --git a/APEX_1.4/module/emitter/include/autogen/ApexEmitterAssetParameters.h b/APEX_1.4/module/emitter/include/autogen/ApexEmitterAssetParameters.h new file mode 100644 index 00000000..accfc5e8 --- /dev/null +++ b/APEX_1.4/module/emitter/include/autogen/ApexEmitterAssetParameters.h @@ -0,0 +1,269 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#ifndef HEADER_ApexEmitterAssetParameters_h +#define HEADER_ApexEmitterAssetParameters_h + +#include "NvParametersTypes.h" + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +#include "nvparameterized/NvParameterized.h" +#include "nvparameterized/NvParameterizedTraits.h" +#include "NvParameters.h" +#include "NvTraitsInternal.h" +#endif + +namespace nvidia +{ +namespace emitter +{ + +#if PX_VC +#pragma warning(push) +#pragma warning(disable: 4324) // structure was padded due to __declspec(align()) +#endif + +namespace ApexEmitterAssetParametersNS +{ + +struct emitterLodParamDesc_Type; +struct rateVsTimeCurvePoint_Type; + +struct rateVsTimeCurvePoint_DynamicArray1D_Type +{ + rateVsTimeCurvePoint_Type* buf; + bool isAllocated; + int32_t elementSize; + int32_t arraySizes[1]; +}; + +struct emitterLodParamDesc_Type +{ + uint32_t version; + float maxDistance; + float distanceWeight; + float speedWeight; + float lifeWeight; + float separationWeight; + float bias; +}; +struct rateVsTimeCurvePoint_Type +{ + float x; + float y; +}; + +struct ParametersStruct +{ + + float density; + float rate; + float lifetimeLow; + float lifetimeHigh; + physx::PxVec3 velocityLow; + physx::PxVec3 velocityHigh; + uint32_t maxSamples; + emitterLodParamDesc_Type lodParamDesc; + NvParameterized::Interface* iofxAssetName; + NvParameterized::Interface* iosAssetName; + NvParameterized::Interface* geometryType; + float emitterDuration; + float emitterVelocityScale; + uint32_t minSamplingFPS; + rateVsTimeCurvePoint_DynamicArray1D_Type rateVsTimeCurvePoints; + +}; + +static const uint32_t checksum[] = { 0x1835d790, 0xa1bfdb02, 0xf76e9154, 0xae351ee1, }; + +} // namespace ApexEmitterAssetParametersNS + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +class ApexEmitterAssetParameters : public NvParameterized::NvParameters, public ApexEmitterAssetParametersNS::ParametersStruct +{ +public: + ApexEmitterAssetParameters(NvParameterized::Traits* traits, void* buf = 0, int32_t* refCount = 0); + + virtual ~ApexEmitterAssetParameters(); + + virtual void destroy(); + + static const char* staticClassName(void) + { + return("ApexEmitterAssetParameters"); + } + + const char* className(void) const + { + return(staticClassName()); + } + + static const uint32_t ClassVersion = ((uint32_t)0 << 16) + (uint32_t)8; + + static uint32_t staticVersion(void) + { + return ClassVersion; + } + + uint32_t version(void) const + { + return(staticVersion()); + } + + static const uint32_t ClassAlignment = 8; + + static const uint32_t* staticChecksum(uint32_t& bits) + { + bits = 8 * sizeof(ApexEmitterAssetParametersNS::checksum); + return ApexEmitterAssetParametersNS::checksum; + } + + static void freeParameterDefinitionTable(NvParameterized::Traits* traits); + + const uint32_t* checksum(uint32_t& bits) const + { + return staticChecksum(bits); + } + + const ApexEmitterAssetParametersNS::ParametersStruct& parameters(void) const + { + ApexEmitterAssetParameters* tmpThis = const_cast<ApexEmitterAssetParameters*>(this); + return *(static_cast<ApexEmitterAssetParametersNS::ParametersStruct*>(tmpThis)); + } + + ApexEmitterAssetParametersNS::ParametersStruct& parameters(void) + { + return *(static_cast<ApexEmitterAssetParametersNS::ParametersStruct*>(this)); + } + + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle) const; + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle); + + void initDefaults(void); + +protected: + + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void); + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void) const; + + + virtual void getVarPtr(const NvParameterized::Handle& handle, void*& ptr, size_t& offset) const; + +private: + + void buildTree(void); + void initDynamicArrays(void); + void initStrings(void); + void initReferences(void); + void freeDynamicArrays(void); + void freeStrings(void); + void freeReferences(void); + + static bool mBuiltFlag; + static NvParameterized::MutexType mBuiltFlagMutex; +}; + +class ApexEmitterAssetParametersFactory : public NvParameterized::Factory +{ + static const char* const vptr; + +public: + + virtual void freeParameterDefinitionTable(NvParameterized::Traits* traits) + { + ApexEmitterAssetParameters::freeParameterDefinitionTable(traits); + } + + virtual NvParameterized::Interface* create(NvParameterized::Traits* paramTraits) + { + // placement new on this class using mParameterizedTraits + + void* newPtr = paramTraits->alloc(sizeof(ApexEmitterAssetParameters), ApexEmitterAssetParameters::ClassAlignment); + if (!NvParameterized::IsAligned(newPtr, ApexEmitterAssetParameters::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class ApexEmitterAssetParameters"); + paramTraits->free(newPtr); + return 0; + } + + memset(newPtr, 0, sizeof(ApexEmitterAssetParameters)); // always initialize memory allocated to zero for default values + return NV_PARAM_PLACEMENT_NEW(newPtr, ApexEmitterAssetParameters)(paramTraits); + } + + virtual NvParameterized::Interface* finish(NvParameterized::Traits* paramTraits, void* bufObj, void* bufStart, int32_t* refCount) + { + if (!NvParameterized::IsAligned(bufObj, ApexEmitterAssetParameters::ClassAlignment) + || !NvParameterized::IsAligned(bufStart, ApexEmitterAssetParameters::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class ApexEmitterAssetParameters"); + return 0; + } + + // Init NvParameters-part + // We used to call empty constructor of ApexEmitterAssetParameters here + // but it may call default constructors of members and spoil the data + NV_PARAM_PLACEMENT_NEW(bufObj, NvParameterized::NvParameters)(paramTraits, bufStart, refCount); + + // Init vtable (everything else is already initialized) + *(const char**)bufObj = vptr; + + return (ApexEmitterAssetParameters*)bufObj; + } + + virtual const char* getClassName() + { + return (ApexEmitterAssetParameters::staticClassName()); + } + + virtual uint32_t getVersion() + { + return (ApexEmitterAssetParameters::staticVersion()); + } + + virtual uint32_t getAlignment() + { + return (ApexEmitterAssetParameters::ClassAlignment); + } + + virtual const uint32_t* getChecksum(uint32_t& bits) + { + return (ApexEmitterAssetParameters::staticChecksum(bits)); + } +}; +#endif // NV_PARAMETERIZED_ONLY_LAYOUTS + +} // namespace emitter +} // namespace nvidia + +#if PX_VC +#pragma warning(pop) +#endif + +#endif diff --git a/APEX_1.4/module/emitter/include/autogen/EmitterAssetPreviewParameters.h b/APEX_1.4/module/emitter/include/autogen/EmitterAssetPreviewParameters.h new file mode 100644 index 00000000..eb5367d0 --- /dev/null +++ b/APEX_1.4/module/emitter/include/autogen/EmitterAssetPreviewParameters.h @@ -0,0 +1,231 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#ifndef HEADER_EmitterAssetPreviewParameters_h +#define HEADER_EmitterAssetPreviewParameters_h + +#include "NvParametersTypes.h" + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +#include "nvparameterized/NvParameterized.h" +#include "nvparameterized/NvParameterizedTraits.h" +#include "NvParameters.h" +#include "NvTraitsInternal.h" +#endif + +namespace nvidia +{ +namespace emitter +{ + +#if PX_VC +#pragma warning(push) +#pragma warning(disable: 4324) // structure was padded due to __declspec(align()) +#endif + +namespace EmitterAssetPreviewParametersNS +{ + + + +struct ParametersStruct +{ + + physx::PxTransform pose; + float scale; + +}; + +static const uint32_t checksum[] = { 0x13ebeb0d, 0xd2df2f41, 0x19fe6d06, 0x63eac053, }; + +} // namespace EmitterAssetPreviewParametersNS + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +class EmitterAssetPreviewParameters : public NvParameterized::NvParameters, public EmitterAssetPreviewParametersNS::ParametersStruct +{ +public: + EmitterAssetPreviewParameters(NvParameterized::Traits* traits, void* buf = 0, int32_t* refCount = 0); + + virtual ~EmitterAssetPreviewParameters(); + + virtual void destroy(); + + static const char* staticClassName(void) + { + return("EmitterAssetPreviewParameters"); + } + + const char* className(void) const + { + return(staticClassName()); + } + + static const uint32_t ClassVersion = ((uint32_t)0 << 16) + (uint32_t)2; + + static uint32_t staticVersion(void) + { + return ClassVersion; + } + + uint32_t version(void) const + { + return(staticVersion()); + } + + static const uint32_t ClassAlignment = 8; + + static const uint32_t* staticChecksum(uint32_t& bits) + { + bits = 8 * sizeof(EmitterAssetPreviewParametersNS::checksum); + return EmitterAssetPreviewParametersNS::checksum; + } + + static void freeParameterDefinitionTable(NvParameterized::Traits* traits); + + const uint32_t* checksum(uint32_t& bits) const + { + return staticChecksum(bits); + } + + const EmitterAssetPreviewParametersNS::ParametersStruct& parameters(void) const + { + EmitterAssetPreviewParameters* tmpThis = const_cast<EmitterAssetPreviewParameters*>(this); + return *(static_cast<EmitterAssetPreviewParametersNS::ParametersStruct*>(tmpThis)); + } + + EmitterAssetPreviewParametersNS::ParametersStruct& parameters(void) + { + return *(static_cast<EmitterAssetPreviewParametersNS::ParametersStruct*>(this)); + } + + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle) const; + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle); + + void initDefaults(void); + +protected: + + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void); + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void) const; + + + virtual void getVarPtr(const NvParameterized::Handle& handle, void*& ptr, size_t& offset) const; + +private: + + void buildTree(void); + void initDynamicArrays(void); + void initStrings(void); + void initReferences(void); + void freeDynamicArrays(void); + void freeStrings(void); + void freeReferences(void); + + static bool mBuiltFlag; + static NvParameterized::MutexType mBuiltFlagMutex; +}; + +class EmitterAssetPreviewParametersFactory : public NvParameterized::Factory +{ + static const char* const vptr; + +public: + + virtual void freeParameterDefinitionTable(NvParameterized::Traits* traits) + { + EmitterAssetPreviewParameters::freeParameterDefinitionTable(traits); + } + + virtual NvParameterized::Interface* create(NvParameterized::Traits* paramTraits) + { + // placement new on this class using mParameterizedTraits + + void* newPtr = paramTraits->alloc(sizeof(EmitterAssetPreviewParameters), EmitterAssetPreviewParameters::ClassAlignment); + if (!NvParameterized::IsAligned(newPtr, EmitterAssetPreviewParameters::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class EmitterAssetPreviewParameters"); + paramTraits->free(newPtr); + return 0; + } + + memset(newPtr, 0, sizeof(EmitterAssetPreviewParameters)); // always initialize memory allocated to zero for default values + return NV_PARAM_PLACEMENT_NEW(newPtr, EmitterAssetPreviewParameters)(paramTraits); + } + + virtual NvParameterized::Interface* finish(NvParameterized::Traits* paramTraits, void* bufObj, void* bufStart, int32_t* refCount) + { + if (!NvParameterized::IsAligned(bufObj, EmitterAssetPreviewParameters::ClassAlignment) + || !NvParameterized::IsAligned(bufStart, EmitterAssetPreviewParameters::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class EmitterAssetPreviewParameters"); + return 0; + } + + // Init NvParameters-part + // We used to call empty constructor of EmitterAssetPreviewParameters here + // but it may call default constructors of members and spoil the data + NV_PARAM_PLACEMENT_NEW(bufObj, NvParameterized::NvParameters)(paramTraits, bufStart, refCount); + + // Init vtable (everything else is already initialized) + *(const char**)bufObj = vptr; + + return (EmitterAssetPreviewParameters*)bufObj; + } + + virtual const char* getClassName() + { + return (EmitterAssetPreviewParameters::staticClassName()); + } + + virtual uint32_t getVersion() + { + return (EmitterAssetPreviewParameters::staticVersion()); + } + + virtual uint32_t getAlignment() + { + return (EmitterAssetPreviewParameters::ClassAlignment); + } + + virtual const uint32_t* getChecksum(uint32_t& bits) + { + return (EmitterAssetPreviewParameters::staticChecksum(bits)); + } +}; +#endif // NV_PARAMETERIZED_ONLY_LAYOUTS + +} // namespace emitter +} // namespace nvidia + +#if PX_VC +#pragma warning(pop) +#endif + +#endif diff --git a/APEX_1.4/module/emitter/include/autogen/EmitterDebugRenderParams.h b/APEX_1.4/module/emitter/include/autogen/EmitterDebugRenderParams.h new file mode 100644 index 00000000..d6b52119 --- /dev/null +++ b/APEX_1.4/module/emitter/include/autogen/EmitterDebugRenderParams.h @@ -0,0 +1,260 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#ifndef HEADER_EmitterDebugRenderParams_h +#define HEADER_EmitterDebugRenderParams_h + +#include "NvParametersTypes.h" + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +#include "nvparameterized/NvParameterized.h" +#include "nvparameterized/NvParameterizedTraits.h" +#include "NvParameters.h" +#include "NvTraitsInternal.h" +#endif + +namespace nvidia +{ +namespace emitter +{ + +#if PX_VC +#pragma warning(push) +#pragma warning(disable: 4324) // structure was padded due to __declspec(align()) +#endif + +namespace EmitterDebugRenderParamsNS +{ + +struct ApexEmitterParameters_Type; +struct GroundEmitterParameters_Type; +struct ImpactEmitterParameters_Type; + +struct ApexEmitterParameters_Type +{ + bool VISUALIZE_APEX_EMITTER_ACTOR; + bool VISUALIZE_TOTAL_INJECTED_AABB; + bool VISUALIZE_APEX_EMITTER_ACTOR_POSE; + float THRESHOLD_DISTANCE_APEX_EMITTER_ACTOR_POSE; + bool VISUALIZE_APEX_EMITTER_ACTOR_NAME; + float THRESHOLD_DISTANCE_APEX_EMITTER_ACTOR_NAME; +}; +struct GroundEmitterParameters_Type +{ + bool VISUALIZE_GROUND_EMITTER_ACTOR; + bool VISUALIZE_GROUND_EMITTER_SPHERE; + bool VISUALIZE_GROUND_EMITTER_GRID; + bool VISUALIZE_GROUND_EMITTER_RAYCAST; + bool VISUALIZE_GROUND_EMITTER_ACTOR_POSE; + bool VISUALIZE_GROUND_EMITTER_ACTOR_NAME; +}; +struct ImpactEmitterParameters_Type +{ + bool VISUALIZE_IMPACT_EMITTER_ACTOR; + bool VISUALIZE_IMPACT_EMITTER_RAYCAST; + bool VISUALIZE_IMPACT_EMITTER_ACTOR_NAME; + float THRESHOLD_DISTANCE_IMPACT_EMITTER_ACTOR_NAME; +}; + +struct ParametersStruct +{ + + ApexEmitterParameters_Type apexEmitterParameters; + GroundEmitterParameters_Type groundEmitterParameters; + ImpactEmitterParameters_Type impactEmitterParameters; + +}; + +static const uint32_t checksum[] = { 0xbb1ad1fe, 0xd2ead5bd, 0x3bbab888, 0x61ee4e9a, }; + +} // namespace EmitterDebugRenderParamsNS + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +class EmitterDebugRenderParams : public NvParameterized::NvParameters, public EmitterDebugRenderParamsNS::ParametersStruct +{ +public: + EmitterDebugRenderParams(NvParameterized::Traits* traits, void* buf = 0, int32_t* refCount = 0); + + virtual ~EmitterDebugRenderParams(); + + virtual void destroy(); + + static const char* staticClassName(void) + { + return("EmitterDebugRenderParams"); + } + + const char* className(void) const + { + return(staticClassName()); + } + + static const uint32_t ClassVersion = ((uint32_t)0 << 16) + (uint32_t)0; + + static uint32_t staticVersion(void) + { + return ClassVersion; + } + + uint32_t version(void) const + { + return(staticVersion()); + } + + static const uint32_t ClassAlignment = 8; + + static const uint32_t* staticChecksum(uint32_t& bits) + { + bits = 8 * sizeof(EmitterDebugRenderParamsNS::checksum); + return EmitterDebugRenderParamsNS::checksum; + } + + static void freeParameterDefinitionTable(NvParameterized::Traits* traits); + + const uint32_t* checksum(uint32_t& bits) const + { + return staticChecksum(bits); + } + + const EmitterDebugRenderParamsNS::ParametersStruct& parameters(void) const + { + EmitterDebugRenderParams* tmpThis = const_cast<EmitterDebugRenderParams*>(this); + return *(static_cast<EmitterDebugRenderParamsNS::ParametersStruct*>(tmpThis)); + } + + EmitterDebugRenderParamsNS::ParametersStruct& parameters(void) + { + return *(static_cast<EmitterDebugRenderParamsNS::ParametersStruct*>(this)); + } + + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle) const; + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle); + + void initDefaults(void); + +protected: + + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void); + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void) const; + + + virtual void getVarPtr(const NvParameterized::Handle& handle, void*& ptr, size_t& offset) const; + +private: + + void buildTree(void); + void initDynamicArrays(void); + void initStrings(void); + void initReferences(void); + void freeDynamicArrays(void); + void freeStrings(void); + void freeReferences(void); + + static bool mBuiltFlag; + static NvParameterized::MutexType mBuiltFlagMutex; +}; + +class EmitterDebugRenderParamsFactory : public NvParameterized::Factory +{ + static const char* const vptr; + +public: + + virtual void freeParameterDefinitionTable(NvParameterized::Traits* traits) + { + EmitterDebugRenderParams::freeParameterDefinitionTable(traits); + } + + virtual NvParameterized::Interface* create(NvParameterized::Traits* paramTraits) + { + // placement new on this class using mParameterizedTraits + + void* newPtr = paramTraits->alloc(sizeof(EmitterDebugRenderParams), EmitterDebugRenderParams::ClassAlignment); + if (!NvParameterized::IsAligned(newPtr, EmitterDebugRenderParams::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class EmitterDebugRenderParams"); + paramTraits->free(newPtr); + return 0; + } + + memset(newPtr, 0, sizeof(EmitterDebugRenderParams)); // always initialize memory allocated to zero for default values + return NV_PARAM_PLACEMENT_NEW(newPtr, EmitterDebugRenderParams)(paramTraits); + } + + virtual NvParameterized::Interface* finish(NvParameterized::Traits* paramTraits, void* bufObj, void* bufStart, int32_t* refCount) + { + if (!NvParameterized::IsAligned(bufObj, EmitterDebugRenderParams::ClassAlignment) + || !NvParameterized::IsAligned(bufStart, EmitterDebugRenderParams::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class EmitterDebugRenderParams"); + return 0; + } + + // Init NvParameters-part + // We used to call empty constructor of EmitterDebugRenderParams here + // but it may call default constructors of members and spoil the data + NV_PARAM_PLACEMENT_NEW(bufObj, NvParameterized::NvParameters)(paramTraits, bufStart, refCount); + + // Init vtable (everything else is already initialized) + *(const char**)bufObj = vptr; + + return (EmitterDebugRenderParams*)bufObj; + } + + virtual const char* getClassName() + { + return (EmitterDebugRenderParams::staticClassName()); + } + + virtual uint32_t getVersion() + { + return (EmitterDebugRenderParams::staticVersion()); + } + + virtual uint32_t getAlignment() + { + return (EmitterDebugRenderParams::ClassAlignment); + } + + virtual const uint32_t* getChecksum(uint32_t& bits) + { + return (EmitterDebugRenderParams::staticChecksum(bits)); + } +}; +#endif // NV_PARAMETERIZED_ONLY_LAYOUTS + +} // namespace emitter +} // namespace nvidia + +#if PX_VC +#pragma warning(pop) +#endif + +#endif diff --git a/APEX_1.4/module/emitter/include/autogen/EmitterGeomBoxParams.h b/APEX_1.4/module/emitter/include/autogen/EmitterGeomBoxParams.h new file mode 100644 index 00000000..c1ef1e56 --- /dev/null +++ b/APEX_1.4/module/emitter/include/autogen/EmitterGeomBoxParams.h @@ -0,0 +1,231 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#ifndef HEADER_EmitterGeomBoxParams_h +#define HEADER_EmitterGeomBoxParams_h + +#include "NvParametersTypes.h" + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +#include "nvparameterized/NvParameterized.h" +#include "nvparameterized/NvParameterizedTraits.h" +#include "NvParameters.h" +#include "NvTraitsInternal.h" +#endif + +namespace nvidia +{ +namespace emitter +{ + +#if PX_VC +#pragma warning(push) +#pragma warning(disable: 4324) // structure was padded due to __declspec(align()) +#endif + +namespace EmitterGeomBoxParamsNS +{ + + + +struct ParametersStruct +{ + + const char* emitterType; + physx::PxVec3 extents; + +}; + +static const uint32_t checksum[] = { 0x27d775c2, 0xfe93d203, 0xcf7ddf42, 0x77074efc, }; + +} // namespace EmitterGeomBoxParamsNS + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +class EmitterGeomBoxParams : public NvParameterized::NvParameters, public EmitterGeomBoxParamsNS::ParametersStruct +{ +public: + EmitterGeomBoxParams(NvParameterized::Traits* traits, void* buf = 0, int32_t* refCount = 0); + + virtual ~EmitterGeomBoxParams(); + + virtual void destroy(); + + static const char* staticClassName(void) + { + return("EmitterGeomBoxParams"); + } + + const char* className(void) const + { + return(staticClassName()); + } + + static const uint32_t ClassVersion = ((uint32_t)0 << 16) + (uint32_t)0; + + static uint32_t staticVersion(void) + { + return ClassVersion; + } + + uint32_t version(void) const + { + return(staticVersion()); + } + + static const uint32_t ClassAlignment = 8; + + static const uint32_t* staticChecksum(uint32_t& bits) + { + bits = 8 * sizeof(EmitterGeomBoxParamsNS::checksum); + return EmitterGeomBoxParamsNS::checksum; + } + + static void freeParameterDefinitionTable(NvParameterized::Traits* traits); + + const uint32_t* checksum(uint32_t& bits) const + { + return staticChecksum(bits); + } + + const EmitterGeomBoxParamsNS::ParametersStruct& parameters(void) const + { + EmitterGeomBoxParams* tmpThis = const_cast<EmitterGeomBoxParams*>(this); + return *(static_cast<EmitterGeomBoxParamsNS::ParametersStruct*>(tmpThis)); + } + + EmitterGeomBoxParamsNS::ParametersStruct& parameters(void) + { + return *(static_cast<EmitterGeomBoxParamsNS::ParametersStruct*>(this)); + } + + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle) const; + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle); + + void initDefaults(void); + +protected: + + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void); + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void) const; + + + virtual void getVarPtr(const NvParameterized::Handle& handle, void*& ptr, size_t& offset) const; + +private: + + void buildTree(void); + void initDynamicArrays(void); + void initStrings(void); + void initReferences(void); + void freeDynamicArrays(void); + void freeStrings(void); + void freeReferences(void); + + static bool mBuiltFlag; + static NvParameterized::MutexType mBuiltFlagMutex; +}; + +class EmitterGeomBoxParamsFactory : public NvParameterized::Factory +{ + static const char* const vptr; + +public: + + virtual void freeParameterDefinitionTable(NvParameterized::Traits* traits) + { + EmitterGeomBoxParams::freeParameterDefinitionTable(traits); + } + + virtual NvParameterized::Interface* create(NvParameterized::Traits* paramTraits) + { + // placement new on this class using mParameterizedTraits + + void* newPtr = paramTraits->alloc(sizeof(EmitterGeomBoxParams), EmitterGeomBoxParams::ClassAlignment); + if (!NvParameterized::IsAligned(newPtr, EmitterGeomBoxParams::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class EmitterGeomBoxParams"); + paramTraits->free(newPtr); + return 0; + } + + memset(newPtr, 0, sizeof(EmitterGeomBoxParams)); // always initialize memory allocated to zero for default values + return NV_PARAM_PLACEMENT_NEW(newPtr, EmitterGeomBoxParams)(paramTraits); + } + + virtual NvParameterized::Interface* finish(NvParameterized::Traits* paramTraits, void* bufObj, void* bufStart, int32_t* refCount) + { + if (!NvParameterized::IsAligned(bufObj, EmitterGeomBoxParams::ClassAlignment) + || !NvParameterized::IsAligned(bufStart, EmitterGeomBoxParams::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class EmitterGeomBoxParams"); + return 0; + } + + // Init NvParameters-part + // We used to call empty constructor of EmitterGeomBoxParams here + // but it may call default constructors of members and spoil the data + NV_PARAM_PLACEMENT_NEW(bufObj, NvParameterized::NvParameters)(paramTraits, bufStart, refCount); + + // Init vtable (everything else is already initialized) + *(const char**)bufObj = vptr; + + return (EmitterGeomBoxParams*)bufObj; + } + + virtual const char* getClassName() + { + return (EmitterGeomBoxParams::staticClassName()); + } + + virtual uint32_t getVersion() + { + return (EmitterGeomBoxParams::staticVersion()); + } + + virtual uint32_t getAlignment() + { + return (EmitterGeomBoxParams::ClassAlignment); + } + + virtual const uint32_t* getChecksum(uint32_t& bits) + { + return (EmitterGeomBoxParams::staticChecksum(bits)); + } +}; +#endif // NV_PARAMETERIZED_ONLY_LAYOUTS + +} // namespace emitter +} // namespace nvidia + +#if PX_VC +#pragma warning(pop) +#endif + +#endif diff --git a/APEX_1.4/module/emitter/include/autogen/EmitterGeomCylinderParams.h b/APEX_1.4/module/emitter/include/autogen/EmitterGeomCylinderParams.h new file mode 100644 index 00000000..3edf8bfe --- /dev/null +++ b/APEX_1.4/module/emitter/include/autogen/EmitterGeomCylinderParams.h @@ -0,0 +1,232 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#ifndef HEADER_EmitterGeomCylinderParams_h +#define HEADER_EmitterGeomCylinderParams_h + +#include "NvParametersTypes.h" + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +#include "nvparameterized/NvParameterized.h" +#include "nvparameterized/NvParameterizedTraits.h" +#include "NvParameters.h" +#include "NvTraitsInternal.h" +#endif + +namespace nvidia +{ +namespace emitter +{ + +#if PX_VC +#pragma warning(push) +#pragma warning(disable: 4324) // structure was padded due to __declspec(align()) +#endif + +namespace EmitterGeomCylinderParamsNS +{ + + + +struct ParametersStruct +{ + + const char* emitterType; + float radius; + float height; + +}; + +static const uint32_t checksum[] = { 0xeb300980, 0x72a774b1, 0xa1ae40e5, 0xb586df5e, }; + +} // namespace EmitterGeomCylinderParamsNS + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +class EmitterGeomCylinderParams : public NvParameterized::NvParameters, public EmitterGeomCylinderParamsNS::ParametersStruct +{ +public: + EmitterGeomCylinderParams(NvParameterized::Traits* traits, void* buf = 0, int32_t* refCount = 0); + + virtual ~EmitterGeomCylinderParams(); + + virtual void destroy(); + + static const char* staticClassName(void) + { + return("EmitterGeomCylinderParams"); + } + + const char* className(void) const + { + return(staticClassName()); + } + + static const uint32_t ClassVersion = ((uint32_t)0 << 16) + (uint32_t)0; + + static uint32_t staticVersion(void) + { + return ClassVersion; + } + + uint32_t version(void) const + { + return(staticVersion()); + } + + static const uint32_t ClassAlignment = 8; + + static const uint32_t* staticChecksum(uint32_t& bits) + { + bits = 8 * sizeof(EmitterGeomCylinderParamsNS::checksum); + return EmitterGeomCylinderParamsNS::checksum; + } + + static void freeParameterDefinitionTable(NvParameterized::Traits* traits); + + const uint32_t* checksum(uint32_t& bits) const + { + return staticChecksum(bits); + } + + const EmitterGeomCylinderParamsNS::ParametersStruct& parameters(void) const + { + EmitterGeomCylinderParams* tmpThis = const_cast<EmitterGeomCylinderParams*>(this); + return *(static_cast<EmitterGeomCylinderParamsNS::ParametersStruct*>(tmpThis)); + } + + EmitterGeomCylinderParamsNS::ParametersStruct& parameters(void) + { + return *(static_cast<EmitterGeomCylinderParamsNS::ParametersStruct*>(this)); + } + + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle) const; + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle); + + void initDefaults(void); + +protected: + + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void); + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void) const; + + + virtual void getVarPtr(const NvParameterized::Handle& handle, void*& ptr, size_t& offset) const; + +private: + + void buildTree(void); + void initDynamicArrays(void); + void initStrings(void); + void initReferences(void); + void freeDynamicArrays(void); + void freeStrings(void); + void freeReferences(void); + + static bool mBuiltFlag; + static NvParameterized::MutexType mBuiltFlagMutex; +}; + +class EmitterGeomCylinderParamsFactory : public NvParameterized::Factory +{ + static const char* const vptr; + +public: + + virtual void freeParameterDefinitionTable(NvParameterized::Traits* traits) + { + EmitterGeomCylinderParams::freeParameterDefinitionTable(traits); + } + + virtual NvParameterized::Interface* create(NvParameterized::Traits* paramTraits) + { + // placement new on this class using mParameterizedTraits + + void* newPtr = paramTraits->alloc(sizeof(EmitterGeomCylinderParams), EmitterGeomCylinderParams::ClassAlignment); + if (!NvParameterized::IsAligned(newPtr, EmitterGeomCylinderParams::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class EmitterGeomCylinderParams"); + paramTraits->free(newPtr); + return 0; + } + + memset(newPtr, 0, sizeof(EmitterGeomCylinderParams)); // always initialize memory allocated to zero for default values + return NV_PARAM_PLACEMENT_NEW(newPtr, EmitterGeomCylinderParams)(paramTraits); + } + + virtual NvParameterized::Interface* finish(NvParameterized::Traits* paramTraits, void* bufObj, void* bufStart, int32_t* refCount) + { + if (!NvParameterized::IsAligned(bufObj, EmitterGeomCylinderParams::ClassAlignment) + || !NvParameterized::IsAligned(bufStart, EmitterGeomCylinderParams::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class EmitterGeomCylinderParams"); + return 0; + } + + // Init NvParameters-part + // We used to call empty constructor of EmitterGeomCylinderParams here + // but it may call default constructors of members and spoil the data + NV_PARAM_PLACEMENT_NEW(bufObj, NvParameterized::NvParameters)(paramTraits, bufStart, refCount); + + // Init vtable (everything else is already initialized) + *(const char**)bufObj = vptr; + + return (EmitterGeomCylinderParams*)bufObj; + } + + virtual const char* getClassName() + { + return (EmitterGeomCylinderParams::staticClassName()); + } + + virtual uint32_t getVersion() + { + return (EmitterGeomCylinderParams::staticVersion()); + } + + virtual uint32_t getAlignment() + { + return (EmitterGeomCylinderParams::ClassAlignment); + } + + virtual const uint32_t* getChecksum(uint32_t& bits) + { + return (EmitterGeomCylinderParams::staticChecksum(bits)); + } +}; +#endif // NV_PARAMETERIZED_ONLY_LAYOUTS + +} // namespace emitter +} // namespace nvidia + +#if PX_VC +#pragma warning(pop) +#endif + +#endif diff --git a/APEX_1.4/module/emitter/include/autogen/EmitterGeomExplicitParams.h b/APEX_1.4/module/emitter/include/autogen/EmitterGeomExplicitParams.h new file mode 100644 index 00000000..d7fb5575 --- /dev/null +++ b/APEX_1.4/module/emitter/include/autogen/EmitterGeomExplicitParams.h @@ -0,0 +1,305 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#ifndef HEADER_EmitterGeomExplicitParams_h +#define HEADER_EmitterGeomExplicitParams_h + +#include "NvParametersTypes.h" + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +#include "nvparameterized/NvParameterized.h" +#include "nvparameterized/NvParameterizedTraits.h" +#include "NvParameters.h" +#include "NvTraitsInternal.h" +#endif + +namespace nvidia +{ +namespace emitter +{ + +#if PX_VC +#pragma warning(push) +#pragma warning(disable: 4324) // structure was padded due to __declspec(align()) +#endif + +namespace EmitterGeomExplicitParamsNS +{ + +struct PointParams_Type; +struct ExplicitPoints_Type; +struct SphereParams_Type; +struct ExplicitSpheres_Type; +struct EllipsoidParams_Type; +struct ExplicitEllipsoids_Type; + +struct PointParams_DynamicArray1D_Type +{ + PointParams_Type* buf; + bool isAllocated; + int32_t elementSize; + int32_t arraySizes[1]; +}; + +struct VEC3_DynamicArray1D_Type +{ + physx::PxVec3* buf; + bool isAllocated; + int32_t elementSize; + int32_t arraySizes[1]; +}; + +struct SphereParams_DynamicArray1D_Type +{ + SphereParams_Type* buf; + bool isAllocated; + int32_t elementSize; + int32_t arraySizes[1]; +}; + +struct EllipsoidParams_DynamicArray1D_Type +{ + EllipsoidParams_Type* buf; + bool isAllocated; + int32_t elementSize; + int32_t arraySizes[1]; +}; + +struct PointParams_Type +{ + physx::PxVec3 position; + bool doDetectOverlaps; +}; +struct ExplicitPoints_Type +{ + PointParams_DynamicArray1D_Type positions; + VEC3_DynamicArray1D_Type velocities; +}; +struct SphereParams_Type +{ + physx::PxVec3 center; + float radius; + bool doDetectOverlaps; +}; +struct EllipsoidParams_Type +{ + physx::PxVec3 center; + float radius; + physx::PxVec3 normal; + float polarRadius; + bool doDetectOverlaps; +}; +struct ExplicitEllipsoids_Type +{ + EllipsoidParams_DynamicArray1D_Type positions; + VEC3_DynamicArray1D_Type velocities; +}; +struct ExplicitSpheres_Type +{ + SphereParams_DynamicArray1D_Type positions; + VEC3_DynamicArray1D_Type velocities; +}; + +struct ParametersStruct +{ + + float distance; + ExplicitPoints_Type points; + ExplicitSpheres_Type spheres; + ExplicitEllipsoids_Type ellipsoids; + +}; + +static const uint32_t checksum[] = { 0xe09894f3, 0xce4efef3, 0x4e950875, 0x6ea40ff1, }; + +} // namespace EmitterGeomExplicitParamsNS + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +class EmitterGeomExplicitParams : public NvParameterized::NvParameters, public EmitterGeomExplicitParamsNS::ParametersStruct +{ +public: + EmitterGeomExplicitParams(NvParameterized::Traits* traits, void* buf = 0, int32_t* refCount = 0); + + virtual ~EmitterGeomExplicitParams(); + + virtual void destroy(); + + static const char* staticClassName(void) + { + return("EmitterGeomExplicitParams"); + } + + const char* className(void) const + { + return(staticClassName()); + } + + static const uint32_t ClassVersion = ((uint32_t)0 << 16) + (uint32_t)1; + + static uint32_t staticVersion(void) + { + return ClassVersion; + } + + uint32_t version(void) const + { + return(staticVersion()); + } + + static const uint32_t ClassAlignment = 8; + + static const uint32_t* staticChecksum(uint32_t& bits) + { + bits = 8 * sizeof(EmitterGeomExplicitParamsNS::checksum); + return EmitterGeomExplicitParamsNS::checksum; + } + + static void freeParameterDefinitionTable(NvParameterized::Traits* traits); + + const uint32_t* checksum(uint32_t& bits) const + { + return staticChecksum(bits); + } + + const EmitterGeomExplicitParamsNS::ParametersStruct& parameters(void) const + { + EmitterGeomExplicitParams* tmpThis = const_cast<EmitterGeomExplicitParams*>(this); + return *(static_cast<EmitterGeomExplicitParamsNS::ParametersStruct*>(tmpThis)); + } + + EmitterGeomExplicitParamsNS::ParametersStruct& parameters(void) + { + return *(static_cast<EmitterGeomExplicitParamsNS::ParametersStruct*>(this)); + } + + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle) const; + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle); + + void initDefaults(void); + +protected: + + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void); + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void) const; + + + virtual void getVarPtr(const NvParameterized::Handle& handle, void*& ptr, size_t& offset) const; + +private: + + void buildTree(void); + void initDynamicArrays(void); + void initStrings(void); + void initReferences(void); + void freeDynamicArrays(void); + void freeStrings(void); + void freeReferences(void); + + static bool mBuiltFlag; + static NvParameterized::MutexType mBuiltFlagMutex; +}; + +class EmitterGeomExplicitParamsFactory : public NvParameterized::Factory +{ + static const char* const vptr; + +public: + + virtual void freeParameterDefinitionTable(NvParameterized::Traits* traits) + { + EmitterGeomExplicitParams::freeParameterDefinitionTable(traits); + } + + virtual NvParameterized::Interface* create(NvParameterized::Traits* paramTraits) + { + // placement new on this class using mParameterizedTraits + + void* newPtr = paramTraits->alloc(sizeof(EmitterGeomExplicitParams), EmitterGeomExplicitParams::ClassAlignment); + if (!NvParameterized::IsAligned(newPtr, EmitterGeomExplicitParams::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class EmitterGeomExplicitParams"); + paramTraits->free(newPtr); + return 0; + } + + memset(newPtr, 0, sizeof(EmitterGeomExplicitParams)); // always initialize memory allocated to zero for default values + return NV_PARAM_PLACEMENT_NEW(newPtr, EmitterGeomExplicitParams)(paramTraits); + } + + virtual NvParameterized::Interface* finish(NvParameterized::Traits* paramTraits, void* bufObj, void* bufStart, int32_t* refCount) + { + if (!NvParameterized::IsAligned(bufObj, EmitterGeomExplicitParams::ClassAlignment) + || !NvParameterized::IsAligned(bufStart, EmitterGeomExplicitParams::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class EmitterGeomExplicitParams"); + return 0; + } + + // Init NvParameters-part + // We used to call empty constructor of EmitterGeomExplicitParams here + // but it may call default constructors of members and spoil the data + NV_PARAM_PLACEMENT_NEW(bufObj, NvParameterized::NvParameters)(paramTraits, bufStart, refCount); + + // Init vtable (everything else is already initialized) + *(const char**)bufObj = vptr; + + return (EmitterGeomExplicitParams*)bufObj; + } + + virtual const char* getClassName() + { + return (EmitterGeomExplicitParams::staticClassName()); + } + + virtual uint32_t getVersion() + { + return (EmitterGeomExplicitParams::staticVersion()); + } + + virtual uint32_t getAlignment() + { + return (EmitterGeomExplicitParams::ClassAlignment); + } + + virtual const uint32_t* getChecksum(uint32_t& bits) + { + return (EmitterGeomExplicitParams::staticChecksum(bits)); + } +}; +#endif // NV_PARAMETERIZED_ONLY_LAYOUTS + +} // namespace emitter +} // namespace nvidia + +#if PX_VC +#pragma warning(pop) +#endif + +#endif diff --git a/APEX_1.4/module/emitter/include/autogen/EmitterGeomSphereParams.h b/APEX_1.4/module/emitter/include/autogen/EmitterGeomSphereParams.h new file mode 100644 index 00000000..81d9ac99 --- /dev/null +++ b/APEX_1.4/module/emitter/include/autogen/EmitterGeomSphereParams.h @@ -0,0 +1,232 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#ifndef HEADER_EmitterGeomSphereParams_h +#define HEADER_EmitterGeomSphereParams_h + +#include "NvParametersTypes.h" + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +#include "nvparameterized/NvParameterized.h" +#include "nvparameterized/NvParameterizedTraits.h" +#include "NvParameters.h" +#include "NvTraitsInternal.h" +#endif + +namespace nvidia +{ +namespace emitter +{ + +#if PX_VC +#pragma warning(push) +#pragma warning(disable: 4324) // structure was padded due to __declspec(align()) +#endif + +namespace EmitterGeomSphereParamsNS +{ + + + +struct ParametersStruct +{ + + const char* emitterType; + float radius; + float hemisphere; + +}; + +static const uint32_t checksum[] = { 0x79a261ec, 0x91a7400d, 0xfb6ba037, 0x3c13e11f, }; + +} // namespace EmitterGeomSphereParamsNS + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +class EmitterGeomSphereParams : public NvParameterized::NvParameters, public EmitterGeomSphereParamsNS::ParametersStruct +{ +public: + EmitterGeomSphereParams(NvParameterized::Traits* traits, void* buf = 0, int32_t* refCount = 0); + + virtual ~EmitterGeomSphereParams(); + + virtual void destroy(); + + static const char* staticClassName(void) + { + return("EmitterGeomSphereParams"); + } + + const char* className(void) const + { + return(staticClassName()); + } + + static const uint32_t ClassVersion = ((uint32_t)0 << 16) + (uint32_t)1; + + static uint32_t staticVersion(void) + { + return ClassVersion; + } + + uint32_t version(void) const + { + return(staticVersion()); + } + + static const uint32_t ClassAlignment = 8; + + static const uint32_t* staticChecksum(uint32_t& bits) + { + bits = 8 * sizeof(EmitterGeomSphereParamsNS::checksum); + return EmitterGeomSphereParamsNS::checksum; + } + + static void freeParameterDefinitionTable(NvParameterized::Traits* traits); + + const uint32_t* checksum(uint32_t& bits) const + { + return staticChecksum(bits); + } + + const EmitterGeomSphereParamsNS::ParametersStruct& parameters(void) const + { + EmitterGeomSphereParams* tmpThis = const_cast<EmitterGeomSphereParams*>(this); + return *(static_cast<EmitterGeomSphereParamsNS::ParametersStruct*>(tmpThis)); + } + + EmitterGeomSphereParamsNS::ParametersStruct& parameters(void) + { + return *(static_cast<EmitterGeomSphereParamsNS::ParametersStruct*>(this)); + } + + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle) const; + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle); + + void initDefaults(void); + +protected: + + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void); + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void) const; + + + virtual void getVarPtr(const NvParameterized::Handle& handle, void*& ptr, size_t& offset) const; + +private: + + void buildTree(void); + void initDynamicArrays(void); + void initStrings(void); + void initReferences(void); + void freeDynamicArrays(void); + void freeStrings(void); + void freeReferences(void); + + static bool mBuiltFlag; + static NvParameterized::MutexType mBuiltFlagMutex; +}; + +class EmitterGeomSphereParamsFactory : public NvParameterized::Factory +{ + static const char* const vptr; + +public: + + virtual void freeParameterDefinitionTable(NvParameterized::Traits* traits) + { + EmitterGeomSphereParams::freeParameterDefinitionTable(traits); + } + + virtual NvParameterized::Interface* create(NvParameterized::Traits* paramTraits) + { + // placement new on this class using mParameterizedTraits + + void* newPtr = paramTraits->alloc(sizeof(EmitterGeomSphereParams), EmitterGeomSphereParams::ClassAlignment); + if (!NvParameterized::IsAligned(newPtr, EmitterGeomSphereParams::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class EmitterGeomSphereParams"); + paramTraits->free(newPtr); + return 0; + } + + memset(newPtr, 0, sizeof(EmitterGeomSphereParams)); // always initialize memory allocated to zero for default values + return NV_PARAM_PLACEMENT_NEW(newPtr, EmitterGeomSphereParams)(paramTraits); + } + + virtual NvParameterized::Interface* finish(NvParameterized::Traits* paramTraits, void* bufObj, void* bufStart, int32_t* refCount) + { + if (!NvParameterized::IsAligned(bufObj, EmitterGeomSphereParams::ClassAlignment) + || !NvParameterized::IsAligned(bufStart, EmitterGeomSphereParams::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class EmitterGeomSphereParams"); + return 0; + } + + // Init NvParameters-part + // We used to call empty constructor of EmitterGeomSphereParams here + // but it may call default constructors of members and spoil the data + NV_PARAM_PLACEMENT_NEW(bufObj, NvParameterized::NvParameters)(paramTraits, bufStart, refCount); + + // Init vtable (everything else is already initialized) + *(const char**)bufObj = vptr; + + return (EmitterGeomSphereParams*)bufObj; + } + + virtual const char* getClassName() + { + return (EmitterGeomSphereParams::staticClassName()); + } + + virtual uint32_t getVersion() + { + return (EmitterGeomSphereParams::staticVersion()); + } + + virtual uint32_t getAlignment() + { + return (EmitterGeomSphereParams::ClassAlignment); + } + + virtual const uint32_t* getChecksum(uint32_t& bits) + { + return (EmitterGeomSphereParams::staticChecksum(bits)); + } +}; +#endif // NV_PARAMETERIZED_ONLY_LAYOUTS + +} // namespace emitter +} // namespace nvidia + +#if PX_VC +#pragma warning(pop) +#endif + +#endif diff --git a/APEX_1.4/module/emitter/include/autogen/EmitterGeomSphereShellParams.h b/APEX_1.4/module/emitter/include/autogen/EmitterGeomSphereShellParams.h new file mode 100644 index 00000000..ec0e7191 --- /dev/null +++ b/APEX_1.4/module/emitter/include/autogen/EmitterGeomSphereShellParams.h @@ -0,0 +1,233 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#ifndef HEADER_EmitterGeomSphereShellParams_h +#define HEADER_EmitterGeomSphereShellParams_h + +#include "NvParametersTypes.h" + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +#include "nvparameterized/NvParameterized.h" +#include "nvparameterized/NvParameterizedTraits.h" +#include "NvParameters.h" +#include "NvTraitsInternal.h" +#endif + +namespace nvidia +{ +namespace emitter +{ + +#if PX_VC +#pragma warning(push) +#pragma warning(disable: 4324) // structure was padded due to __declspec(align()) +#endif + +namespace EmitterGeomSphereShellParamsNS +{ + + + +struct ParametersStruct +{ + + const char* emitterType; + float radius; + float shellThickness; + float hemisphere; + +}; + +static const uint32_t checksum[] = { 0xa7e5ed8e, 0xbce14b67, 0x71503704, 0x616eed9e, }; + +} // namespace EmitterGeomSphereShellParamsNS + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +class EmitterGeomSphereShellParams : public NvParameterized::NvParameters, public EmitterGeomSphereShellParamsNS::ParametersStruct +{ +public: + EmitterGeomSphereShellParams(NvParameterized::Traits* traits, void* buf = 0, int32_t* refCount = 0); + + virtual ~EmitterGeomSphereShellParams(); + + virtual void destroy(); + + static const char* staticClassName(void) + { + return("EmitterGeomSphereShellParams"); + } + + const char* className(void) const + { + return(staticClassName()); + } + + static const uint32_t ClassVersion = ((uint32_t)0 << 16) + (uint32_t)1; + + static uint32_t staticVersion(void) + { + return ClassVersion; + } + + uint32_t version(void) const + { + return(staticVersion()); + } + + static const uint32_t ClassAlignment = 8; + + static const uint32_t* staticChecksum(uint32_t& bits) + { + bits = 8 * sizeof(EmitterGeomSphereShellParamsNS::checksum); + return EmitterGeomSphereShellParamsNS::checksum; + } + + static void freeParameterDefinitionTable(NvParameterized::Traits* traits); + + const uint32_t* checksum(uint32_t& bits) const + { + return staticChecksum(bits); + } + + const EmitterGeomSphereShellParamsNS::ParametersStruct& parameters(void) const + { + EmitterGeomSphereShellParams* tmpThis = const_cast<EmitterGeomSphereShellParams*>(this); + return *(static_cast<EmitterGeomSphereShellParamsNS::ParametersStruct*>(tmpThis)); + } + + EmitterGeomSphereShellParamsNS::ParametersStruct& parameters(void) + { + return *(static_cast<EmitterGeomSphereShellParamsNS::ParametersStruct*>(this)); + } + + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle) const; + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle); + + void initDefaults(void); + +protected: + + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void); + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void) const; + + + virtual void getVarPtr(const NvParameterized::Handle& handle, void*& ptr, size_t& offset) const; + +private: + + void buildTree(void); + void initDynamicArrays(void); + void initStrings(void); + void initReferences(void); + void freeDynamicArrays(void); + void freeStrings(void); + void freeReferences(void); + + static bool mBuiltFlag; + static NvParameterized::MutexType mBuiltFlagMutex; +}; + +class EmitterGeomSphereShellParamsFactory : public NvParameterized::Factory +{ + static const char* const vptr; + +public: + + virtual void freeParameterDefinitionTable(NvParameterized::Traits* traits) + { + EmitterGeomSphereShellParams::freeParameterDefinitionTable(traits); + } + + virtual NvParameterized::Interface* create(NvParameterized::Traits* paramTraits) + { + // placement new on this class using mParameterizedTraits + + void* newPtr = paramTraits->alloc(sizeof(EmitterGeomSphereShellParams), EmitterGeomSphereShellParams::ClassAlignment); + if (!NvParameterized::IsAligned(newPtr, EmitterGeomSphereShellParams::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class EmitterGeomSphereShellParams"); + paramTraits->free(newPtr); + return 0; + } + + memset(newPtr, 0, sizeof(EmitterGeomSphereShellParams)); // always initialize memory allocated to zero for default values + return NV_PARAM_PLACEMENT_NEW(newPtr, EmitterGeomSphereShellParams)(paramTraits); + } + + virtual NvParameterized::Interface* finish(NvParameterized::Traits* paramTraits, void* bufObj, void* bufStart, int32_t* refCount) + { + if (!NvParameterized::IsAligned(bufObj, EmitterGeomSphereShellParams::ClassAlignment) + || !NvParameterized::IsAligned(bufStart, EmitterGeomSphereShellParams::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class EmitterGeomSphereShellParams"); + return 0; + } + + // Init NvParameters-part + // We used to call empty constructor of EmitterGeomSphereShellParams here + // but it may call default constructors of members and spoil the data + NV_PARAM_PLACEMENT_NEW(bufObj, NvParameterized::NvParameters)(paramTraits, bufStart, refCount); + + // Init vtable (everything else is already initialized) + *(const char**)bufObj = vptr; + + return (EmitterGeomSphereShellParams*)bufObj; + } + + virtual const char* getClassName() + { + return (EmitterGeomSphereShellParams::staticClassName()); + } + + virtual uint32_t getVersion() + { + return (EmitterGeomSphereShellParams::staticVersion()); + } + + virtual uint32_t getAlignment() + { + return (EmitterGeomSphereShellParams::ClassAlignment); + } + + virtual const uint32_t* getChecksum(uint32_t& bits) + { + return (EmitterGeomSphereShellParams::staticChecksum(bits)); + } +}; +#endif // NV_PARAMETERIZED_ONLY_LAYOUTS + +} // namespace emitter +} // namespace nvidia + +#if PX_VC +#pragma warning(pop) +#endif + +#endif diff --git a/APEX_1.4/module/emitter/include/autogen/EmitterModuleParameters.h b/APEX_1.4/module/emitter/include/autogen/EmitterModuleParameters.h new file mode 100644 index 00000000..48c7bbf0 --- /dev/null +++ b/APEX_1.4/module/emitter/include/autogen/EmitterModuleParameters.h @@ -0,0 +1,230 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#ifndef HEADER_EmitterModuleParameters_h +#define HEADER_EmitterModuleParameters_h + +#include "NvParametersTypes.h" + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +#include "nvparameterized/NvParameterized.h" +#include "nvparameterized/NvParameterizedTraits.h" +#include "NvParameters.h" +#include "NvTraitsInternal.h" +#endif + +namespace nvidia +{ +namespace emitter +{ + +#if PX_VC +#pragma warning(push) +#pragma warning(disable: 4324) // structure was padded due to __declspec(align()) +#endif + +namespace EmitterModuleParametersNS +{ + + + +struct ParametersStruct +{ + + uint32_t unused; + +}; + +static const uint32_t checksum[] = { 0xa747fb88, 0x02cb8a6c, 0xc4b8a1de, 0x0263bab7, }; + +} // namespace EmitterModuleParametersNS + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +class EmitterModuleParameters : public NvParameterized::NvParameters, public EmitterModuleParametersNS::ParametersStruct +{ +public: + EmitterModuleParameters(NvParameterized::Traits* traits, void* buf = 0, int32_t* refCount = 0); + + virtual ~EmitterModuleParameters(); + + virtual void destroy(); + + static const char* staticClassName(void) + { + return("EmitterModuleParameters"); + } + + const char* className(void) const + { + return(staticClassName()); + } + + static const uint32_t ClassVersion = ((uint32_t)0 << 16) + (uint32_t)0; + + static uint32_t staticVersion(void) + { + return ClassVersion; + } + + uint32_t version(void) const + { + return(staticVersion()); + } + + static const uint32_t ClassAlignment = 8; + + static const uint32_t* staticChecksum(uint32_t& bits) + { + bits = 8 * sizeof(EmitterModuleParametersNS::checksum); + return EmitterModuleParametersNS::checksum; + } + + static void freeParameterDefinitionTable(NvParameterized::Traits* traits); + + const uint32_t* checksum(uint32_t& bits) const + { + return staticChecksum(bits); + } + + const EmitterModuleParametersNS::ParametersStruct& parameters(void) const + { + EmitterModuleParameters* tmpThis = const_cast<EmitterModuleParameters*>(this); + return *(static_cast<EmitterModuleParametersNS::ParametersStruct*>(tmpThis)); + } + + EmitterModuleParametersNS::ParametersStruct& parameters(void) + { + return *(static_cast<EmitterModuleParametersNS::ParametersStruct*>(this)); + } + + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle) const; + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle); + + void initDefaults(void); + +protected: + + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void); + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void) const; + + + virtual void getVarPtr(const NvParameterized::Handle& handle, void*& ptr, size_t& offset) const; + +private: + + void buildTree(void); + void initDynamicArrays(void); + void initStrings(void); + void initReferences(void); + void freeDynamicArrays(void); + void freeStrings(void); + void freeReferences(void); + + static bool mBuiltFlag; + static NvParameterized::MutexType mBuiltFlagMutex; +}; + +class EmitterModuleParametersFactory : public NvParameterized::Factory +{ + static const char* const vptr; + +public: + + virtual void freeParameterDefinitionTable(NvParameterized::Traits* traits) + { + EmitterModuleParameters::freeParameterDefinitionTable(traits); + } + + virtual NvParameterized::Interface* create(NvParameterized::Traits* paramTraits) + { + // placement new on this class using mParameterizedTraits + + void* newPtr = paramTraits->alloc(sizeof(EmitterModuleParameters), EmitterModuleParameters::ClassAlignment); + if (!NvParameterized::IsAligned(newPtr, EmitterModuleParameters::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class EmitterModuleParameters"); + paramTraits->free(newPtr); + return 0; + } + + memset(newPtr, 0, sizeof(EmitterModuleParameters)); // always initialize memory allocated to zero for default values + return NV_PARAM_PLACEMENT_NEW(newPtr, EmitterModuleParameters)(paramTraits); + } + + virtual NvParameterized::Interface* finish(NvParameterized::Traits* paramTraits, void* bufObj, void* bufStart, int32_t* refCount) + { + if (!NvParameterized::IsAligned(bufObj, EmitterModuleParameters::ClassAlignment) + || !NvParameterized::IsAligned(bufStart, EmitterModuleParameters::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class EmitterModuleParameters"); + return 0; + } + + // Init NvParameters-part + // We used to call empty constructor of EmitterModuleParameters here + // but it may call default constructors of members and spoil the data + NV_PARAM_PLACEMENT_NEW(bufObj, NvParameterized::NvParameters)(paramTraits, bufStart, refCount); + + // Init vtable (everything else is already initialized) + *(const char**)bufObj = vptr; + + return (EmitterModuleParameters*)bufObj; + } + + virtual const char* getClassName() + { + return (EmitterModuleParameters::staticClassName()); + } + + virtual uint32_t getVersion() + { + return (EmitterModuleParameters::staticVersion()); + } + + virtual uint32_t getAlignment() + { + return (EmitterModuleParameters::ClassAlignment); + } + + virtual const uint32_t* getChecksum(uint32_t& bits) + { + return (EmitterModuleParameters::staticChecksum(bits)); + } +}; +#endif // NV_PARAMETERIZED_ONLY_LAYOUTS + +} // namespace emitter +} // namespace nvidia + +#if PX_VC +#pragma warning(pop) +#endif + +#endif diff --git a/APEX_1.4/module/emitter/include/autogen/GroundEmitterActorParameters.h b/APEX_1.4/module/emitter/include/autogen/GroundEmitterActorParameters.h new file mode 100644 index 00000000..7eaef20d --- /dev/null +++ b/APEX_1.4/module/emitter/include/autogen/GroundEmitterActorParameters.h @@ -0,0 +1,238 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#ifndef HEADER_GroundEmitterActorParameters_h +#define HEADER_GroundEmitterActorParameters_h + +#include "NvParametersTypes.h" + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +#include "nvparameterized/NvParameterized.h" +#include "nvparameterized/NvParameterizedTraits.h" +#include "NvParameters.h" +#include "NvTraitsInternal.h" +#endif + +namespace nvidia +{ +namespace emitter +{ + +#if PX_VC +#pragma warning(push) +#pragma warning(disable: 4324) // structure was padded due to __declspec(align()) +#endif + +namespace GroundEmitterActorParametersNS +{ + + + +struct ParametersStruct +{ + + float density; + float radius; + physx::PxVec3 upDirection; + float raycastHeight; + float spawnHeight; + uint32_t maxRaycastsPerFrame; + NvParameterized::DummyStringStruct raycastCollisionGroupMaskName; + physx::PxVec3 attachRelativePosition; + physx::PxTransform globalPose; + +}; + +static const uint32_t checksum[] = { 0xd3e25aee, 0x7c2db6c5, 0x857bb739, 0xd8a21775, }; + +} // namespace GroundEmitterActorParametersNS + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +class GroundEmitterActorParameters : public NvParameterized::NvParameters, public GroundEmitterActorParametersNS::ParametersStruct +{ +public: + GroundEmitterActorParameters(NvParameterized::Traits* traits, void* buf = 0, int32_t* refCount = 0); + + virtual ~GroundEmitterActorParameters(); + + virtual void destroy(); + + static const char* staticClassName(void) + { + return("GroundEmitterActorParameters"); + } + + const char* className(void) const + { + return(staticClassName()); + } + + static const uint32_t ClassVersion = ((uint32_t)0 << 16) + (uint32_t)3; + + static uint32_t staticVersion(void) + { + return ClassVersion; + } + + uint32_t version(void) const + { + return(staticVersion()); + } + + static const uint32_t ClassAlignment = 8; + + static const uint32_t* staticChecksum(uint32_t& bits) + { + bits = 8 * sizeof(GroundEmitterActorParametersNS::checksum); + return GroundEmitterActorParametersNS::checksum; + } + + static void freeParameterDefinitionTable(NvParameterized::Traits* traits); + + const uint32_t* checksum(uint32_t& bits) const + { + return staticChecksum(bits); + } + + const GroundEmitterActorParametersNS::ParametersStruct& parameters(void) const + { + GroundEmitterActorParameters* tmpThis = const_cast<GroundEmitterActorParameters*>(this); + return *(static_cast<GroundEmitterActorParametersNS::ParametersStruct*>(tmpThis)); + } + + GroundEmitterActorParametersNS::ParametersStruct& parameters(void) + { + return *(static_cast<GroundEmitterActorParametersNS::ParametersStruct*>(this)); + } + + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle) const; + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle); + + void initDefaults(void); + +protected: + + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void); + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void) const; + + + virtual void getVarPtr(const NvParameterized::Handle& handle, void*& ptr, size_t& offset) const; + +private: + + void buildTree(void); + void initDynamicArrays(void); + void initStrings(void); + void initReferences(void); + void freeDynamicArrays(void); + void freeStrings(void); + void freeReferences(void); + + static bool mBuiltFlag; + static NvParameterized::MutexType mBuiltFlagMutex; +}; + +class GroundEmitterActorParametersFactory : public NvParameterized::Factory +{ + static const char* const vptr; + +public: + + virtual void freeParameterDefinitionTable(NvParameterized::Traits* traits) + { + GroundEmitterActorParameters::freeParameterDefinitionTable(traits); + } + + virtual NvParameterized::Interface* create(NvParameterized::Traits* paramTraits) + { + // placement new on this class using mParameterizedTraits + + void* newPtr = paramTraits->alloc(sizeof(GroundEmitterActorParameters), GroundEmitterActorParameters::ClassAlignment); + if (!NvParameterized::IsAligned(newPtr, GroundEmitterActorParameters::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class GroundEmitterActorParameters"); + paramTraits->free(newPtr); + return 0; + } + + memset(newPtr, 0, sizeof(GroundEmitterActorParameters)); // always initialize memory allocated to zero for default values + return NV_PARAM_PLACEMENT_NEW(newPtr, GroundEmitterActorParameters)(paramTraits); + } + + virtual NvParameterized::Interface* finish(NvParameterized::Traits* paramTraits, void* bufObj, void* bufStart, int32_t* refCount) + { + if (!NvParameterized::IsAligned(bufObj, GroundEmitterActorParameters::ClassAlignment) + || !NvParameterized::IsAligned(bufStart, GroundEmitterActorParameters::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class GroundEmitterActorParameters"); + return 0; + } + + // Init NvParameters-part + // We used to call empty constructor of GroundEmitterActorParameters here + // but it may call default constructors of members and spoil the data + NV_PARAM_PLACEMENT_NEW(bufObj, NvParameterized::NvParameters)(paramTraits, bufStart, refCount); + + // Init vtable (everything else is already initialized) + *(const char**)bufObj = vptr; + + return (GroundEmitterActorParameters*)bufObj; + } + + virtual const char* getClassName() + { + return (GroundEmitterActorParameters::staticClassName()); + } + + virtual uint32_t getVersion() + { + return (GroundEmitterActorParameters::staticVersion()); + } + + virtual uint32_t getAlignment() + { + return (GroundEmitterActorParameters::ClassAlignment); + } + + virtual const uint32_t* getChecksum(uint32_t& bits) + { + return (GroundEmitterActorParameters::staticChecksum(bits)); + } +}; +#endif // NV_PARAMETERIZED_ONLY_LAYOUTS + +} // namespace emitter +} // namespace nvidia + +#if PX_VC +#pragma warning(pop) +#endif + +#endif diff --git a/APEX_1.4/module/emitter/include/autogen/GroundEmitterAssetParameters.h b/APEX_1.4/module/emitter/include/autogen/GroundEmitterAssetParameters.h new file mode 100644 index 00000000..59204959 --- /dev/null +++ b/APEX_1.4/module/emitter/include/autogen/GroundEmitterAssetParameters.h @@ -0,0 +1,269 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#ifndef HEADER_GroundEmitterAssetParameters_h +#define HEADER_GroundEmitterAssetParameters_h + +#include "NvParametersTypes.h" + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +#include "nvparameterized/NvParameterized.h" +#include "nvparameterized/NvParameterizedTraits.h" +#include "NvParameters.h" +#include "NvTraitsInternal.h" +#endif + +namespace nvidia +{ +namespace emitter +{ + +#if PX_VC +#pragma warning(push) +#pragma warning(disable: 4324) // structure was padded due to __declspec(align()) +#endif + +namespace GroundEmitterAssetParametersNS +{ + +struct emitterLodParamDesc_Type; +struct materialFactoryMapping_Type; + +struct materialFactoryMapping_DynamicArray1D_Type +{ + materialFactoryMapping_Type* buf; + bool isAllocated; + int32_t elementSize; + int32_t arraySizes[1]; +}; + +struct emitterLodParamDesc_Type +{ + uint32_t version; + float maxDistance; + float distanceWeight; + float speedWeight; + float lifeWeight; + float separationWeight; + float bias; +}; +struct materialFactoryMapping_Type +{ + NvParameterized::Interface* iofxAssetName; + NvParameterized::Interface* iosAssetName; + NvParameterized::DummyStringStruct physMatName; + float weight; + float maxSlopeAngle; + emitterLodParamDesc_Type lodParamDesc; +}; + +struct ParametersStruct +{ + + float density; + float lifetimeLow; + float lifetimeHigh; + physx::PxVec3 velocityLow; + physx::PxVec3 velocityHigh; + float radius; + float raycastHeight; + float spawnHeight; + uint32_t maxRaycastsPerFrame; + NvParameterized::DummyStringStruct raycastCollisionGroupMaskName; + materialFactoryMapping_DynamicArray1D_Type materialFactoryMapList; + +}; + +static const uint32_t checksum[] = { 0xfc4571c0, 0x0157d03c, 0xb1fe5ac6, 0xd7d25449, }; + +} // namespace GroundEmitterAssetParametersNS + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +class GroundEmitterAssetParameters : public NvParameterized::NvParameters, public GroundEmitterAssetParametersNS::ParametersStruct +{ +public: + GroundEmitterAssetParameters(NvParameterized::Traits* traits, void* buf = 0, int32_t* refCount = 0); + + virtual ~GroundEmitterAssetParameters(); + + virtual void destroy(); + + static const char* staticClassName(void) + { + return("GroundEmitterAssetParameters"); + } + + const char* className(void) const + { + return(staticClassName()); + } + + static const uint32_t ClassVersion = ((uint32_t)0 << 16) + (uint32_t)2; + + static uint32_t staticVersion(void) + { + return ClassVersion; + } + + uint32_t version(void) const + { + return(staticVersion()); + } + + static const uint32_t ClassAlignment = 8; + + static const uint32_t* staticChecksum(uint32_t& bits) + { + bits = 8 * sizeof(GroundEmitterAssetParametersNS::checksum); + return GroundEmitterAssetParametersNS::checksum; + } + + static void freeParameterDefinitionTable(NvParameterized::Traits* traits); + + const uint32_t* checksum(uint32_t& bits) const + { + return staticChecksum(bits); + } + + const GroundEmitterAssetParametersNS::ParametersStruct& parameters(void) const + { + GroundEmitterAssetParameters* tmpThis = const_cast<GroundEmitterAssetParameters*>(this); + return *(static_cast<GroundEmitterAssetParametersNS::ParametersStruct*>(tmpThis)); + } + + GroundEmitterAssetParametersNS::ParametersStruct& parameters(void) + { + return *(static_cast<GroundEmitterAssetParametersNS::ParametersStruct*>(this)); + } + + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle) const; + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle); + + void initDefaults(void); + +protected: + + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void); + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void) const; + + + virtual void getVarPtr(const NvParameterized::Handle& handle, void*& ptr, size_t& offset) const; + +private: + + void buildTree(void); + void initDynamicArrays(void); + void initStrings(void); + void initReferences(void); + void freeDynamicArrays(void); + void freeStrings(void); + void freeReferences(void); + + static bool mBuiltFlag; + static NvParameterized::MutexType mBuiltFlagMutex; +}; + +class GroundEmitterAssetParametersFactory : public NvParameterized::Factory +{ + static const char* const vptr; + +public: + + virtual void freeParameterDefinitionTable(NvParameterized::Traits* traits) + { + GroundEmitterAssetParameters::freeParameterDefinitionTable(traits); + } + + virtual NvParameterized::Interface* create(NvParameterized::Traits* paramTraits) + { + // placement new on this class using mParameterizedTraits + + void* newPtr = paramTraits->alloc(sizeof(GroundEmitterAssetParameters), GroundEmitterAssetParameters::ClassAlignment); + if (!NvParameterized::IsAligned(newPtr, GroundEmitterAssetParameters::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class GroundEmitterAssetParameters"); + paramTraits->free(newPtr); + return 0; + } + + memset(newPtr, 0, sizeof(GroundEmitterAssetParameters)); // always initialize memory allocated to zero for default values + return NV_PARAM_PLACEMENT_NEW(newPtr, GroundEmitterAssetParameters)(paramTraits); + } + + virtual NvParameterized::Interface* finish(NvParameterized::Traits* paramTraits, void* bufObj, void* bufStart, int32_t* refCount) + { + if (!NvParameterized::IsAligned(bufObj, GroundEmitterAssetParameters::ClassAlignment) + || !NvParameterized::IsAligned(bufStart, GroundEmitterAssetParameters::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class GroundEmitterAssetParameters"); + return 0; + } + + // Init NvParameters-part + // We used to call empty constructor of GroundEmitterAssetParameters here + // but it may call default constructors of members and spoil the data + NV_PARAM_PLACEMENT_NEW(bufObj, NvParameterized::NvParameters)(paramTraits, bufStart, refCount); + + // Init vtable (everything else is already initialized) + *(const char**)bufObj = vptr; + + return (GroundEmitterAssetParameters*)bufObj; + } + + virtual const char* getClassName() + { + return (GroundEmitterAssetParameters::staticClassName()); + } + + virtual uint32_t getVersion() + { + return (GroundEmitterAssetParameters::staticVersion()); + } + + virtual uint32_t getAlignment() + { + return (GroundEmitterAssetParameters::ClassAlignment); + } + + virtual const uint32_t* getChecksum(uint32_t& bits) + { + return (GroundEmitterAssetParameters::staticChecksum(bits)); + } +}; +#endif // NV_PARAMETERIZED_ONLY_LAYOUTS + +} // namespace emitter +} // namespace nvidia + +#if PX_VC +#pragma warning(pop) +#endif + +#endif diff --git a/APEX_1.4/module/emitter/include/autogen/ImpactEmitterActorParameters.h b/APEX_1.4/module/emitter/include/autogen/ImpactEmitterActorParameters.h new file mode 100644 index 00000000..4e76bb85 --- /dev/null +++ b/APEX_1.4/module/emitter/include/autogen/ImpactEmitterActorParameters.h @@ -0,0 +1,230 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#ifndef HEADER_ImpactEmitterActorParameters_h +#define HEADER_ImpactEmitterActorParameters_h + +#include "NvParametersTypes.h" + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +#include "nvparameterized/NvParameterized.h" +#include "nvparameterized/NvParameterizedTraits.h" +#include "NvParameters.h" +#include "NvTraitsInternal.h" +#endif + +namespace nvidia +{ +namespace emitter +{ + +#if PX_VC +#pragma warning(push) +#pragma warning(disable: 4324) // structure was padded due to __declspec(align()) +#endif + +namespace ImpactEmitterActorParametersNS +{ + + + +struct ParametersStruct +{ + + NvParameterized::Interface* explosionEnv; + +}; + +static const uint32_t checksum[] = { 0x6785e5a5, 0x2d0171c3, 0xecd991a6, 0xeebe4e58, }; + +} // namespace ImpactEmitterActorParametersNS + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +class ImpactEmitterActorParameters : public NvParameterized::NvParameters, public ImpactEmitterActorParametersNS::ParametersStruct +{ +public: + ImpactEmitterActorParameters(NvParameterized::Traits* traits, void* buf = 0, int32_t* refCount = 0); + + virtual ~ImpactEmitterActorParameters(); + + virtual void destroy(); + + static const char* staticClassName(void) + { + return("ImpactEmitterActorParameters"); + } + + const char* className(void) const + { + return(staticClassName()); + } + + static const uint32_t ClassVersion = ((uint32_t)0 << 16) + (uint32_t)0; + + static uint32_t staticVersion(void) + { + return ClassVersion; + } + + uint32_t version(void) const + { + return(staticVersion()); + } + + static const uint32_t ClassAlignment = 8; + + static const uint32_t* staticChecksum(uint32_t& bits) + { + bits = 8 * sizeof(ImpactEmitterActorParametersNS::checksum); + return ImpactEmitterActorParametersNS::checksum; + } + + static void freeParameterDefinitionTable(NvParameterized::Traits* traits); + + const uint32_t* checksum(uint32_t& bits) const + { + return staticChecksum(bits); + } + + const ImpactEmitterActorParametersNS::ParametersStruct& parameters(void) const + { + ImpactEmitterActorParameters* tmpThis = const_cast<ImpactEmitterActorParameters*>(this); + return *(static_cast<ImpactEmitterActorParametersNS::ParametersStruct*>(tmpThis)); + } + + ImpactEmitterActorParametersNS::ParametersStruct& parameters(void) + { + return *(static_cast<ImpactEmitterActorParametersNS::ParametersStruct*>(this)); + } + + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle) const; + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle); + + void initDefaults(void); + +protected: + + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void); + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void) const; + + + virtual void getVarPtr(const NvParameterized::Handle& handle, void*& ptr, size_t& offset) const; + +private: + + void buildTree(void); + void initDynamicArrays(void); + void initStrings(void); + void initReferences(void); + void freeDynamicArrays(void); + void freeStrings(void); + void freeReferences(void); + + static bool mBuiltFlag; + static NvParameterized::MutexType mBuiltFlagMutex; +}; + +class ImpactEmitterActorParametersFactory : public NvParameterized::Factory +{ + static const char* const vptr; + +public: + + virtual void freeParameterDefinitionTable(NvParameterized::Traits* traits) + { + ImpactEmitterActorParameters::freeParameterDefinitionTable(traits); + } + + virtual NvParameterized::Interface* create(NvParameterized::Traits* paramTraits) + { + // placement new on this class using mParameterizedTraits + + void* newPtr = paramTraits->alloc(sizeof(ImpactEmitterActorParameters), ImpactEmitterActorParameters::ClassAlignment); + if (!NvParameterized::IsAligned(newPtr, ImpactEmitterActorParameters::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class ImpactEmitterActorParameters"); + paramTraits->free(newPtr); + return 0; + } + + memset(newPtr, 0, sizeof(ImpactEmitterActorParameters)); // always initialize memory allocated to zero for default values + return NV_PARAM_PLACEMENT_NEW(newPtr, ImpactEmitterActorParameters)(paramTraits); + } + + virtual NvParameterized::Interface* finish(NvParameterized::Traits* paramTraits, void* bufObj, void* bufStart, int32_t* refCount) + { + if (!NvParameterized::IsAligned(bufObj, ImpactEmitterActorParameters::ClassAlignment) + || !NvParameterized::IsAligned(bufStart, ImpactEmitterActorParameters::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class ImpactEmitterActorParameters"); + return 0; + } + + // Init NvParameters-part + // We used to call empty constructor of ImpactEmitterActorParameters here + // but it may call default constructors of members and spoil the data + NV_PARAM_PLACEMENT_NEW(bufObj, NvParameterized::NvParameters)(paramTraits, bufStart, refCount); + + // Init vtable (everything else is already initialized) + *(const char**)bufObj = vptr; + + return (ImpactEmitterActorParameters*)bufObj; + } + + virtual const char* getClassName() + { + return (ImpactEmitterActorParameters::staticClassName()); + } + + virtual uint32_t getVersion() + { + return (ImpactEmitterActorParameters::staticVersion()); + } + + virtual uint32_t getAlignment() + { + return (ImpactEmitterActorParameters::ClassAlignment); + } + + virtual const uint32_t* getChecksum(uint32_t& bits) + { + return (ImpactEmitterActorParameters::staticChecksum(bits)); + } +}; +#endif // NV_PARAMETERIZED_ONLY_LAYOUTS + +} // namespace emitter +} // namespace nvidia + +#if PX_VC +#pragma warning(pop) +#endif + +#endif diff --git a/APEX_1.4/module/emitter/include/autogen/ImpactEmitterAssetParameters.h b/APEX_1.4/module/emitter/include/autogen/ImpactEmitterAssetParameters.h new file mode 100644 index 00000000..c931713a --- /dev/null +++ b/APEX_1.4/module/emitter/include/autogen/ImpactEmitterAssetParameters.h @@ -0,0 +1,238 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#ifndef HEADER_ImpactEmitterAssetParameters_h +#define HEADER_ImpactEmitterAssetParameters_h + +#include "NvParametersTypes.h" + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +#include "nvparameterized/NvParameterized.h" +#include "nvparameterized/NvParameterizedTraits.h" +#include "NvParameters.h" +#include "NvTraitsInternal.h" +#endif + +namespace nvidia +{ +namespace emitter +{ + +#if PX_VC +#pragma warning(push) +#pragma warning(disable: 4324) // structure was padded due to __declspec(align()) +#endif + +namespace ImpactEmitterAssetParametersNS +{ + + +struct REF_DynamicArray1D_Type +{ + NvParameterized::Interface** buf; + bool isAllocated; + int32_t elementSize; + int32_t arraySizes[1]; +}; + + +struct ParametersStruct +{ + + REF_DynamicArray1D_Type eventSetList; + +}; + +static const uint32_t checksum[] = { 0x5b78e967, 0xd4e18888, 0xaac77873, 0xef2e1cba, }; + +} // namespace ImpactEmitterAssetParametersNS + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +class ImpactEmitterAssetParameters : public NvParameterized::NvParameters, public ImpactEmitterAssetParametersNS::ParametersStruct +{ +public: + ImpactEmitterAssetParameters(NvParameterized::Traits* traits, void* buf = 0, int32_t* refCount = 0); + + virtual ~ImpactEmitterAssetParameters(); + + virtual void destroy(); + + static const char* staticClassName(void) + { + return("ImpactEmitterAssetParameters"); + } + + const char* className(void) const + { + return(staticClassName()); + } + + static const uint32_t ClassVersion = ((uint32_t)0 << 16) + (uint32_t)0; + + static uint32_t staticVersion(void) + { + return ClassVersion; + } + + uint32_t version(void) const + { + return(staticVersion()); + } + + static const uint32_t ClassAlignment = 8; + + static const uint32_t* staticChecksum(uint32_t& bits) + { + bits = 8 * sizeof(ImpactEmitterAssetParametersNS::checksum); + return ImpactEmitterAssetParametersNS::checksum; + } + + static void freeParameterDefinitionTable(NvParameterized::Traits* traits); + + const uint32_t* checksum(uint32_t& bits) const + { + return staticChecksum(bits); + } + + const ImpactEmitterAssetParametersNS::ParametersStruct& parameters(void) const + { + ImpactEmitterAssetParameters* tmpThis = const_cast<ImpactEmitterAssetParameters*>(this); + return *(static_cast<ImpactEmitterAssetParametersNS::ParametersStruct*>(tmpThis)); + } + + ImpactEmitterAssetParametersNS::ParametersStruct& parameters(void) + { + return *(static_cast<ImpactEmitterAssetParametersNS::ParametersStruct*>(this)); + } + + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle) const; + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle); + + void initDefaults(void); + +protected: + + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void); + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void) const; + + + virtual void getVarPtr(const NvParameterized::Handle& handle, void*& ptr, size_t& offset) const; + +private: + + void buildTree(void); + void initDynamicArrays(void); + void initStrings(void); + void initReferences(void); + void freeDynamicArrays(void); + void freeStrings(void); + void freeReferences(void); + + static bool mBuiltFlag; + static NvParameterized::MutexType mBuiltFlagMutex; +}; + +class ImpactEmitterAssetParametersFactory : public NvParameterized::Factory +{ + static const char* const vptr; + +public: + + virtual void freeParameterDefinitionTable(NvParameterized::Traits* traits) + { + ImpactEmitterAssetParameters::freeParameterDefinitionTable(traits); + } + + virtual NvParameterized::Interface* create(NvParameterized::Traits* paramTraits) + { + // placement new on this class using mParameterizedTraits + + void* newPtr = paramTraits->alloc(sizeof(ImpactEmitterAssetParameters), ImpactEmitterAssetParameters::ClassAlignment); + if (!NvParameterized::IsAligned(newPtr, ImpactEmitterAssetParameters::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class ImpactEmitterAssetParameters"); + paramTraits->free(newPtr); + return 0; + } + + memset(newPtr, 0, sizeof(ImpactEmitterAssetParameters)); // always initialize memory allocated to zero for default values + return NV_PARAM_PLACEMENT_NEW(newPtr, ImpactEmitterAssetParameters)(paramTraits); + } + + virtual NvParameterized::Interface* finish(NvParameterized::Traits* paramTraits, void* bufObj, void* bufStart, int32_t* refCount) + { + if (!NvParameterized::IsAligned(bufObj, ImpactEmitterAssetParameters::ClassAlignment) + || !NvParameterized::IsAligned(bufStart, ImpactEmitterAssetParameters::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class ImpactEmitterAssetParameters"); + return 0; + } + + // Init NvParameters-part + // We used to call empty constructor of ImpactEmitterAssetParameters here + // but it may call default constructors of members and spoil the data + NV_PARAM_PLACEMENT_NEW(bufObj, NvParameterized::NvParameters)(paramTraits, bufStart, refCount); + + // Init vtable (everything else is already initialized) + *(const char**)bufObj = vptr; + + return (ImpactEmitterAssetParameters*)bufObj; + } + + virtual const char* getClassName() + { + return (ImpactEmitterAssetParameters::staticClassName()); + } + + virtual uint32_t getVersion() + { + return (ImpactEmitterAssetParameters::staticVersion()); + } + + virtual uint32_t getAlignment() + { + return (ImpactEmitterAssetParameters::ClassAlignment); + } + + virtual const uint32_t* getChecksum(uint32_t& bits) + { + return (ImpactEmitterAssetParameters::staticChecksum(bits)); + } +}; +#endif // NV_PARAMETERIZED_ONLY_LAYOUTS + +} // namespace emitter +} // namespace nvidia + +#if PX_VC +#pragma warning(pop) +#endif + +#endif diff --git a/APEX_1.4/module/emitter/include/autogen/ImpactExplosionEvent.h b/APEX_1.4/module/emitter/include/autogen/ImpactExplosionEvent.h new file mode 100644 index 00000000..44025781 --- /dev/null +++ b/APEX_1.4/module/emitter/include/autogen/ImpactExplosionEvent.h @@ -0,0 +1,233 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#ifndef HEADER_ImpactExplosionEvent_h +#define HEADER_ImpactExplosionEvent_h + +#include "NvParametersTypes.h" + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +#include "nvparameterized/NvParameterized.h" +#include "nvparameterized/NvParameterizedTraits.h" +#include "NvParameters.h" +#include "NvTraitsInternal.h" +#endif + +namespace nvidia +{ +namespace emitter +{ + +#if PX_VC +#pragma warning(push) +#pragma warning(disable: 4324) // structure was padded due to __declspec(align()) +#endif + +namespace ImpactExplosionEventNS +{ + + + +struct ParametersStruct +{ + + NvParameterized::DummyStringStruct eventSetName; + NvParameterized::Interface* explosionAssetName; + float delay; + float duration; + +}; + +static const uint32_t checksum[] = { 0x74920db4, 0x81c601e1, 0x4eda208e, 0xdc255cd6, }; + +} // namespace ImpactExplosionEventNS + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +class ImpactExplosionEvent : public NvParameterized::NvParameters, public ImpactExplosionEventNS::ParametersStruct +{ +public: + ImpactExplosionEvent(NvParameterized::Traits* traits, void* buf = 0, int32_t* refCount = 0); + + virtual ~ImpactExplosionEvent(); + + virtual void destroy(); + + static const char* staticClassName(void) + { + return("ImpactExplosionEvent"); + } + + const char* className(void) const + { + return(staticClassName()); + } + + static const uint32_t ClassVersion = ((uint32_t)0 << 16) + (uint32_t)0; + + static uint32_t staticVersion(void) + { + return ClassVersion; + } + + uint32_t version(void) const + { + return(staticVersion()); + } + + static const uint32_t ClassAlignment = 8; + + static const uint32_t* staticChecksum(uint32_t& bits) + { + bits = 8 * sizeof(ImpactExplosionEventNS::checksum); + return ImpactExplosionEventNS::checksum; + } + + static void freeParameterDefinitionTable(NvParameterized::Traits* traits); + + const uint32_t* checksum(uint32_t& bits) const + { + return staticChecksum(bits); + } + + const ImpactExplosionEventNS::ParametersStruct& parameters(void) const + { + ImpactExplosionEvent* tmpThis = const_cast<ImpactExplosionEvent*>(this); + return *(static_cast<ImpactExplosionEventNS::ParametersStruct*>(tmpThis)); + } + + ImpactExplosionEventNS::ParametersStruct& parameters(void) + { + return *(static_cast<ImpactExplosionEventNS::ParametersStruct*>(this)); + } + + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle) const; + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle); + + void initDefaults(void); + +protected: + + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void); + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void) const; + + + virtual void getVarPtr(const NvParameterized::Handle& handle, void*& ptr, size_t& offset) const; + +private: + + void buildTree(void); + void initDynamicArrays(void); + void initStrings(void); + void initReferences(void); + void freeDynamicArrays(void); + void freeStrings(void); + void freeReferences(void); + + static bool mBuiltFlag; + static NvParameterized::MutexType mBuiltFlagMutex; +}; + +class ImpactExplosionEventFactory : public NvParameterized::Factory +{ + static const char* const vptr; + +public: + + virtual void freeParameterDefinitionTable(NvParameterized::Traits* traits) + { + ImpactExplosionEvent::freeParameterDefinitionTable(traits); + } + + virtual NvParameterized::Interface* create(NvParameterized::Traits* paramTraits) + { + // placement new on this class using mParameterizedTraits + + void* newPtr = paramTraits->alloc(sizeof(ImpactExplosionEvent), ImpactExplosionEvent::ClassAlignment); + if (!NvParameterized::IsAligned(newPtr, ImpactExplosionEvent::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class ImpactExplosionEvent"); + paramTraits->free(newPtr); + return 0; + } + + memset(newPtr, 0, sizeof(ImpactExplosionEvent)); // always initialize memory allocated to zero for default values + return NV_PARAM_PLACEMENT_NEW(newPtr, ImpactExplosionEvent)(paramTraits); + } + + virtual NvParameterized::Interface* finish(NvParameterized::Traits* paramTraits, void* bufObj, void* bufStart, int32_t* refCount) + { + if (!NvParameterized::IsAligned(bufObj, ImpactExplosionEvent::ClassAlignment) + || !NvParameterized::IsAligned(bufStart, ImpactExplosionEvent::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class ImpactExplosionEvent"); + return 0; + } + + // Init NvParameters-part + // We used to call empty constructor of ImpactExplosionEvent here + // but it may call default constructors of members and spoil the data + NV_PARAM_PLACEMENT_NEW(bufObj, NvParameterized::NvParameters)(paramTraits, bufStart, refCount); + + // Init vtable (everything else is already initialized) + *(const char**)bufObj = vptr; + + return (ImpactExplosionEvent*)bufObj; + } + + virtual const char* getClassName() + { + return (ImpactExplosionEvent::staticClassName()); + } + + virtual uint32_t getVersion() + { + return (ImpactExplosionEvent::staticVersion()); + } + + virtual uint32_t getAlignment() + { + return (ImpactExplosionEvent::ClassAlignment); + } + + virtual const uint32_t* getChecksum(uint32_t& bits) + { + return (ImpactExplosionEvent::staticChecksum(bits)); + } +}; +#endif // NV_PARAMETERIZED_ONLY_LAYOUTS + +} // namespace emitter +} // namespace nvidia + +#if PX_VC +#pragma warning(pop) +#endif + +#endif diff --git a/APEX_1.4/module/emitter/include/autogen/ImpactObjectEvent.h b/APEX_1.4/module/emitter/include/autogen/ImpactObjectEvent.h new file mode 100644 index 00000000..f40c7175 --- /dev/null +++ b/APEX_1.4/module/emitter/include/autogen/ImpactObjectEvent.h @@ -0,0 +1,253 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#ifndef HEADER_ImpactObjectEvent_h +#define HEADER_ImpactObjectEvent_h + +#include "NvParametersTypes.h" + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +#include "nvparameterized/NvParameterized.h" +#include "nvparameterized/NvParameterizedTraits.h" +#include "NvParameters.h" +#include "NvTraitsInternal.h" +#endif + +namespace nvidia +{ +namespace emitter +{ + +#if PX_VC +#pragma warning(push) +#pragma warning(disable: 4324) // structure was padded due to __declspec(align()) +#endif + +namespace ImpactObjectEventNS +{ + +struct emitterLodParamDesc_Type; + +struct emitterLodParamDesc_Type +{ + uint32_t version; + float maxDistance; + float distanceWeight; + float speedWeight; + float lifeWeight; + float separationWeight; + float bias; +}; + +struct ParametersStruct +{ + + NvParameterized::DummyStringStruct eventSetName; + NvParameterized::Interface* iofxAssetName; + NvParameterized::Interface* iosAssetName; + float angleLow; + float angleHigh; + float speedLow; + float speedHigh; + float lifeLow; + float lifeHigh; + float delay; + uint32_t particleSpawnCount; + const char* impactAxis; + emitterLodParamDesc_Type lodParamDesc; + +}; + +static const uint32_t checksum[] = { 0x14e70046, 0x8f02f0ce, 0x13040374, 0x46d00400, }; + +} // namespace ImpactObjectEventNS + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +class ImpactObjectEvent : public NvParameterized::NvParameters, public ImpactObjectEventNS::ParametersStruct +{ +public: + ImpactObjectEvent(NvParameterized::Traits* traits, void* buf = 0, int32_t* refCount = 0); + + virtual ~ImpactObjectEvent(); + + virtual void destroy(); + + static const char* staticClassName(void) + { + return("ImpactObjectEvent"); + } + + const char* className(void) const + { + return(staticClassName()); + } + + static const uint32_t ClassVersion = ((uint32_t)0 << 16) + (uint32_t)2; + + static uint32_t staticVersion(void) + { + return ClassVersion; + } + + uint32_t version(void) const + { + return(staticVersion()); + } + + static const uint32_t ClassAlignment = 8; + + static const uint32_t* staticChecksum(uint32_t& bits) + { + bits = 8 * sizeof(ImpactObjectEventNS::checksum); + return ImpactObjectEventNS::checksum; + } + + static void freeParameterDefinitionTable(NvParameterized::Traits* traits); + + const uint32_t* checksum(uint32_t& bits) const + { + return staticChecksum(bits); + } + + const ImpactObjectEventNS::ParametersStruct& parameters(void) const + { + ImpactObjectEvent* tmpThis = const_cast<ImpactObjectEvent*>(this); + return *(static_cast<ImpactObjectEventNS::ParametersStruct*>(tmpThis)); + } + + ImpactObjectEventNS::ParametersStruct& parameters(void) + { + return *(static_cast<ImpactObjectEventNS::ParametersStruct*>(this)); + } + + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle) const; + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle); + + void initDefaults(void); + +protected: + + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void); + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void) const; + + + virtual void getVarPtr(const NvParameterized::Handle& handle, void*& ptr, size_t& offset) const; + +private: + + void buildTree(void); + void initDynamicArrays(void); + void initStrings(void); + void initReferences(void); + void freeDynamicArrays(void); + void freeStrings(void); + void freeReferences(void); + + static bool mBuiltFlag; + static NvParameterized::MutexType mBuiltFlagMutex; +}; + +class ImpactObjectEventFactory : public NvParameterized::Factory +{ + static const char* const vptr; + +public: + + virtual void freeParameterDefinitionTable(NvParameterized::Traits* traits) + { + ImpactObjectEvent::freeParameterDefinitionTable(traits); + } + + virtual NvParameterized::Interface* create(NvParameterized::Traits* paramTraits) + { + // placement new on this class using mParameterizedTraits + + void* newPtr = paramTraits->alloc(sizeof(ImpactObjectEvent), ImpactObjectEvent::ClassAlignment); + if (!NvParameterized::IsAligned(newPtr, ImpactObjectEvent::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class ImpactObjectEvent"); + paramTraits->free(newPtr); + return 0; + } + + memset(newPtr, 0, sizeof(ImpactObjectEvent)); // always initialize memory allocated to zero for default values + return NV_PARAM_PLACEMENT_NEW(newPtr, ImpactObjectEvent)(paramTraits); + } + + virtual NvParameterized::Interface* finish(NvParameterized::Traits* paramTraits, void* bufObj, void* bufStart, int32_t* refCount) + { + if (!NvParameterized::IsAligned(bufObj, ImpactObjectEvent::ClassAlignment) + || !NvParameterized::IsAligned(bufStart, ImpactObjectEvent::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class ImpactObjectEvent"); + return 0; + } + + // Init NvParameters-part + // We used to call empty constructor of ImpactObjectEvent here + // but it may call default constructors of members and spoil the data + NV_PARAM_PLACEMENT_NEW(bufObj, NvParameterized::NvParameters)(paramTraits, bufStart, refCount); + + // Init vtable (everything else is already initialized) + *(const char**)bufObj = vptr; + + return (ImpactObjectEvent*)bufObj; + } + + virtual const char* getClassName() + { + return (ImpactObjectEvent::staticClassName()); + } + + virtual uint32_t getVersion() + { + return (ImpactObjectEvent::staticVersion()); + } + + virtual uint32_t getAlignment() + { + return (ImpactObjectEvent::ClassAlignment); + } + + virtual const uint32_t* getChecksum(uint32_t& bits) + { + return (ImpactObjectEvent::staticChecksum(bits)); + } +}; +#endif // NV_PARAMETERIZED_ONLY_LAYOUTS + +} // namespace emitter +} // namespace nvidia + +#if PX_VC +#pragma warning(pop) +#endif + +#endif diff --git a/APEX_1.4/module/emitter/include/autogen/ModuleEmitterRegistration.h b/APEX_1.4/module/emitter/include/autogen/ModuleEmitterRegistration.h new file mode 100644 index 00000000..f1a71eee --- /dev/null +++ b/APEX_1.4/module/emitter/include/autogen/ModuleEmitterRegistration.h @@ -0,0 +1,159 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + +#ifndef MODULE_MODULEEMITTERREGISTRATIONH_H +#define MODULE_MODULEEMITTERREGISTRATIONH_H + +#include "PsAllocator.h" +#include "NvRegistrationsForTraitsBase.h" +#include "nvparameterized/NvParameterizedTraits.h" +#include "PxAssert.h" +#include <stdint.h> + +// INCLUDE GENERATED FACTORIES +#include "ApexEmitterAssetParameters.h" +#include "EmitterGeomBoxParams.h" +#include "EmitterGeomExplicitParams.h" +#include "EmitterGeomSphereShellParams.h" +#include "EmitterGeomSphereParams.h" +#include "EmitterGeomCylinderParams.h" +#include "ApexEmitterActorParameters.h" +#include "ImpactEmitterActorParameters.h" +#include "GroundEmitterActorParameters.h" +#include "EmitterAssetPreviewParameters.h" +#include "EmitterDebugRenderParams.h" +#include "GroundEmitterAssetParameters.h" +#include "ImpactEmitterAssetParameters.h" +#include "ImpactExplosionEvent.h" +#include "ImpactObjectEvent.h" +#include "EmitterModuleParameters.h" + + +// INCLUDE GENERATED CONVERSION + + +namespace nvidia { +namespace emitter { + + +class ModuleEmitterRegistration : public NvParameterized::RegistrationsForTraitsBase +{ +public: + static void invokeRegistration(NvParameterized::Traits* parameterizedTraits) + { + if (parameterizedTraits) + { + ModuleEmitterRegistration().registerAll(*parameterizedTraits); + } + } + + static void invokeUnregistration(NvParameterized::Traits* parameterizedTraits) + { + if (parameterizedTraits) + { + ModuleEmitterRegistration().unregisterAll(*parameterizedTraits); + } + } + + void registerAvailableFactories(NvParameterized::Traits& parameterizedTraits) + { + ::NvParameterized::Factory* factoriesToRegister[] = { +// REGISTER GENERATED FACTORIES + new nvidia::emitter::ApexEmitterAssetParametersFactory(), + new nvidia::emitter::EmitterGeomBoxParamsFactory(), + new nvidia::emitter::EmitterGeomExplicitParamsFactory(), + new nvidia::emitter::EmitterGeomSphereShellParamsFactory(), + new nvidia::emitter::EmitterGeomSphereParamsFactory(), + new nvidia::emitter::EmitterGeomCylinderParamsFactory(), + new nvidia::emitter::ApexEmitterActorParametersFactory(), + new nvidia::emitter::ImpactEmitterActorParametersFactory(), + new nvidia::emitter::GroundEmitterActorParametersFactory(), + new nvidia::emitter::EmitterAssetPreviewParametersFactory(), + new nvidia::emitter::EmitterDebugRenderParamsFactory(), + new nvidia::emitter::GroundEmitterAssetParametersFactory(), + new nvidia::emitter::ImpactEmitterAssetParametersFactory(), + new nvidia::emitter::ImpactExplosionEventFactory(), + new nvidia::emitter::ImpactObjectEventFactory(), + new nvidia::emitter::EmitterModuleParametersFactory(), + + }; + + for (size_t i = 0; i < sizeof(factoriesToRegister)/sizeof(factoriesToRegister[0]); ++i) + { + parameterizedTraits.registerFactory(*factoriesToRegister[i]); + } + } + + virtual void registerAvailableConverters(NvParameterized::Traits& parameterizedTraits) + { +// REGISTER GENERATED CONVERSION +PX_UNUSED(parameterizedTraits); + + } + + void unregisterAvailableFactories(NvParameterized::Traits& parameterizedTraits) + { + struct FactoryDesc + { + const char* name; + uint32_t version; + }; + + ::NvParameterized::Factory* factoriesToUnregister[] = { +// UNREGISTER GENERATED FACTORIES + new nvidia::emitter::ApexEmitterAssetParametersFactory(), + new nvidia::emitter::EmitterGeomBoxParamsFactory(), + new nvidia::emitter::EmitterGeomExplicitParamsFactory(), + new nvidia::emitter::EmitterGeomSphereShellParamsFactory(), + new nvidia::emitter::EmitterGeomSphereParamsFactory(), + new nvidia::emitter::EmitterGeomCylinderParamsFactory(), + new nvidia::emitter::ApexEmitterActorParametersFactory(), + new nvidia::emitter::ImpactEmitterActorParametersFactory(), + new nvidia::emitter::GroundEmitterActorParametersFactory(), + new nvidia::emitter::EmitterAssetPreviewParametersFactory(), + new nvidia::emitter::EmitterDebugRenderParamsFactory(), + new nvidia::emitter::GroundEmitterAssetParametersFactory(), + new nvidia::emitter::ImpactEmitterAssetParametersFactory(), + new nvidia::emitter::ImpactExplosionEventFactory(), + new nvidia::emitter::ImpactObjectEventFactory(), + new nvidia::emitter::EmitterModuleParametersFactory(), + + }; + + for (size_t i = 0; i < sizeof(factoriesToUnregister)/sizeof(factoriesToUnregister[0]); ++i) + { + ::NvParameterized::Factory* removedFactory = parameterizedTraits.removeFactory(factoriesToUnregister[i]->getClassName(), factoriesToUnregister[i]->getVersion()); + if (!removedFactory) + { + PX_ASSERT_WITH_MESSAGE(0, "Factory can not be removed!"); + } + else + { + removedFactory->freeParameterDefinitionTable(¶meterizedTraits); + delete removedFactory; + delete factoriesToUnregister[i]; + } + } + } + + virtual void unregisterAvailableConverters(NvParameterized::Traits& parameterizedTraits) + { +// UNREGISTER GENERATED CONVERSION +PX_UNUSED(parameterizedTraits); + + } + +}; + + +} +} //nvidia::emitter + +#endif |