aboutsummaryrefslogtreecommitdiff
path: root/APEX_1.4/include/Module.h
diff options
context:
space:
mode:
authorgit perforce import user <a@b>2016-10-25 12:29:14 -0600
committerSheikh Dawood Abdul Ajees <Sheikh Dawood Abdul Ajees>2016-10-25 18:56:37 -0500
commit3dfe2108cfab31ba3ee5527e217d0d8e99a51162 (patch)
treefa6485c169e50d7415a651bf838f5bcd0fd3bfbd /APEX_1.4/include/Module.h
downloadphysx-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/include/Module.h')
-rw-r--r--APEX_1.4/include/Module.h166
1 files changed, 166 insertions, 0 deletions
diff --git a/APEX_1.4/include/Module.h b/APEX_1.4/include/Module.h
new file mode 100644
index 00000000..7b754137
--- /dev/null
+++ b/APEX_1.4/include/Module.h
@@ -0,0 +1,166 @@
+/*
+ * 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_H
+#define MODULE_H
+
+/*!
+\file
+\brief APEX Module API
+*/
+
+#include "ApexInterface.h"
+#include "ApexSDK.h"
+#include "foundation/PxSimpleTypes.h"
+
+namespace nvidia
+{
+namespace apex
+{
+
+PX_PUSH_PACK_DEFAULT
+
+class RenderableIterator;
+
+/**
+\brief Render lock modes. These are used per-module to determine how render locking is done.
+*/
+struct RenderLockMode
+{
+ /**
+ \brief Enum of render lock modes
+ */
+ enum Enum
+ {
+ /**
+ \brief Disables render locking in the module scene.
+ */
+ NO_RENDER_LOCK = 0,
+
+ /**
+ \brief Locks all apex actors in the module scene individually.
+ */
+ PER_ACTOR_RENDER_LOCK = 1,
+
+ /**
+ \brief Locks an entire module scene with one lock.
+ */
+ PER_MODULE_SCENE_RENDER_LOCK = 2,
+ };
+};
+
+/**
+\brief A structure that holds two templated values, a min and a max
+*/
+template <typename T>
+struct Range
+{
+ Range() {};
+ /**
+ \brief Constructor, sets min amd max values
+ */
+ Range(T inMin, T inMax) : minimum(inMin), maximum(inMax) {};
+
+ /**
+ \brief operator ==
+ */
+ bool operator== (const Range& r) const
+ {
+ return minimum == r.minimum && maximum == r.maximum;
+ }
+
+ /**
+ \brief Minimal value
+ */
+ T minimum;
+ /**
+ \brief Maximal value
+ */
+ T maximum;
+};
+
+
+
+/**
+\brief base class of all APEX modules
+
+It describes the LODParameters and weights defined by the module.
+*/
+class Module : public ApexInterface
+{
+public:
+ /**
+ \brief Initialize the module
+ \param[in] desc use Module::getDefaultModuleDesc() to get the descriptor necessary for initializing the module
+ */
+ virtual void init(::NvParameterized::Interface& desc) = 0;
+
+ /**
+ \brief Returns the name of the module
+ */
+ virtual const char* getName() const = 0;
+
+ /**
+ \brief Returns the unique ID of the module
+ */
+ virtual AuthObjTypeID getModuleID() const = 0;
+
+ /**
+ \brief Returns the NvParameterized interface that contains module initialization parameters
+ \note The module itself owns this object, so there's no need for the application to destroy it
+ */
+ virtual ::NvParameterized::Interface* getDefaultModuleDesc()
+ {
+ return NULL;
+ }
+
+ /**
+ \brief Allocate a renderable iterator
+
+ Returns an Renderable iterator instance for the specified Scene. The iterator
+ will return pointers to renderables in this scene that were generated by this module. This
+ is the preferred method for rendering IOFX actors.
+ */
+ virtual RenderableIterator* createRenderableIterator(const Scene&) = 0;
+
+ /**
+ \brief Choose the locking mode for the module scene. See RenderLockMode.
+
+ Returns true if successful.
+ */
+ virtual bool setRenderLockMode(RenderLockMode::Enum, Scene&) { return false; }
+
+ /**
+ \brief Returns the current render lock mode for the module scene.
+ */
+ virtual RenderLockMode::Enum getRenderLockMode(const Scene&) const { return RenderLockMode::NO_RENDER_LOCK; }
+
+ /**
+ \brief Sets a render lock for the module scene. Used when the SDK render lock mode is RenderLockMode::PER_MODULE_SCENE_RENDER_LOCK. See ApexSDK::setRenderLockMode().
+
+ Returns true iff successful.
+ */
+ virtual bool lockModuleSceneRenderLock(Scene&) { return false; }
+
+ /**
+ \brief Releases the render lock for the module scene. See lockModuleSceneRenderLock().
+
+ Returns true iff successful.
+ */
+ virtual bool unlockModuleSceneRenderLock(Scene&) { return false; }
+};
+
+PX_POP_PACK
+
+}
+} // end namespace nvidia::apex
+
+#endif // MODULE_H