aboutsummaryrefslogtreecommitdiff
path: root/docs/api_docs/files/pageextphysx.html
diff options
context:
space:
mode:
authorAnton Novoselov <[email protected]>2017-08-14 16:41:28 +0300
committerAnton Novoselov <[email protected]>2017-08-14 16:41:28 +0300
commit9a1c1d814f3fa0b54b49d90b43130c02bc280f44 (patch)
treeeae6ead883173c66619c30b6a1ed085f3cb70f4d /docs/api_docs/files/pageextphysx.html
parentUpdated to CL 22627414: (diff)
downloadblast-9a1c1d814f3fa0b54b49d90b43130c02bc280f44.tar.xz
blast-9a1c1d814f3fa0b54b49d90b43130c02bc280f44.zip
Updated to CL 22661993:
* docs updates * authoring fixes * asset view in sample fix * latest blast_tools_and_samples-windows.zip
Diffstat (limited to 'docs/api_docs/files/pageextphysx.html')
-rw-r--r--docs/api_docs/files/pageextphysx.html67
1 files changed, 63 insertions, 4 deletions
diff --git a/docs/api_docs/files/pageextphysx.html b/docs/api_docs/files/pageextphysx.html
index 85ee427..d88f68d 100644
--- a/docs/api_docs/files/pageextphysx.html
+++ b/docs/api_docs/files/pageextphysx.html
@@ -20,11 +20,14 @@
</div>
<!-- Generated by Doxygen 1.5.8 -->
<div class="contents">
-<h1><a class="anchor" name="pageextphysx">PhysX&trade; Extensions (NvBlastExtPhysX) </a></h1>NvBlastExtPhysX contains classes for easier use of Blast&trade; Toolkit with the PhysX&trade; SDK. There are 3 of them:<ul>
-<li><b>ExtPxManager</b>: Manager to keep Blast&trade; actors in sync with PhysX&trade; actors.</li><li><b>ExtImpactDamageManager</b>: Manager to collect and apply impact damage caused by collision in PhysX&trade; scene.</li><li><b>ExtPxStressSolver</b>: Stress Solver to propagate stress through support graph and apply it as damage to Blast&trade; actors.</li></ul>
+<h1><a class="anchor" name="pageextphysx">PhysX&trade; Extensions (NvBlastExtPhysX) </a></h1>NvBlastExtPhysX contains classes for easier use of Blast&trade; Toolkit with the PhysX&trade; SDK. There are three of them:<ul>
+<li><a class="el" href="pageextphysx.html#ExtPxManager">ExtPxManager</a> - Manager to keep Blast&trade; actors in sync with PhysX&trade; actors.</li><li><a class="el" href="pageextphysx.html#ExtImpactDamageManager">ExtImpactDamageManager</a> - Manager to collect and apply impact damage caused by collision in PhysX&trade; scene.</li><li><a class="el" href="pageextphysx.html#ExtPxStressSolver">ExtPxStressSolver</a> - Stress Solver to propagate stress through support graph and apply it as damage to Blast&trade; actors.</li></ul>
<p>
This library also contains an extension for synchronizing Blast&trade; state:<ul>
-<li><b>ExtSync</b> - Utility for writing Blast&trade; state to a buffer, to be read by a client. This may be used for networking, for example.</li></ul>
+<li><a class="el" href="pageextphysx.html#ExtSync">ExtSync</a> - Utility for writing Blast&trade; state to a buffer, to be read by a client. This may be used for networking, for example.</li></ul>
+<p>
+It also provides classes for utilizing PhysX&trade; SDK Foundation capabilities:<ul>
+<li><a class="el" href="pageextphysx.html#ExtGroupTaskManager">ExtGroupTaskManager</a> - Multithreaded TkGroup processing using PxTask.</li><li><a class="el" href="pageextphysx.html#ExtCustomProfiler">ExtCustomProfiler</a> - Serves Blast&trade; profiling zones to PxFoundation profiler (e.g. PVD) and platform specific profilers.</li></ul>
<p>
<br>
<h2><a class="anchor" name="ExtPxManager">
@@ -105,7 +108,7 @@ Call <em>applyDamage()</em> when you want the buffered damage to be applied:<p>
sceneDesc.filterShader = ExtImpactDamageManager::FilterShader;
</pre></div><p>
<br>
- <h2><a class="anchor" name="extpxstresssolver">
+ <h2><a class="anchor" name="ExtPxStressSolver">
ExtPxStressSolver</a></h2>
<b>Stress Solver</b> - this wrapper class uses <a class="el" href="pageextstress.html">Stress Solver Extension (NvBlastExtStress)</a> to apply stress calculations to an ExtPxFamily. See <a class="el" href="pageextstress.html">Stress Solver Extension (NvBlastExtStress)</a> for the details of the underlying stress solver.<h3><a class="anchor" name="pxstresssolverusage">
Usage</a></h3>
@@ -165,6 +168,62 @@ On the client you can then apply this buffer:<p>
</pre></div><p>
ExtPxManager is required only if sync buffer contains ExtSyncEventType::Physics events.<p>
<br>
+<h2><a class="anchor" name="ExtGroupTaskManager">
+ExtGroupTaskManager</a></h2>
+This class provides a basic implementation for multithreaded TkGroup processing using PxTask and a PxTaskManager from PxFoundation.<p>
+In the simplest use case, all worker threads provided by PxTaskManager are used to process the group.<p>
+<div class="fragment"><pre class="fragment"><span class="comment">// creating ExtGroupTaskManager from existing taskManager and tkGroup</span>
+ExtGroupTaskManager* gtm = ExtGroupTaskManager::create(*taskManager, tkGroup);
+
+<span class="keywordflow">while</span> (running)
+{
+ <span class="comment">// ... add TkActors to TkGroup and damage ...</span>
+
+ <span class="comment">// start processing on all worker threads provided</span>
+ gtm-&gt;process();
+
+ <span class="comment">// ... do something else ...</span>
+
+ <span class="comment">// wait for the group processing to finish</span>
+ gtm-&gt;wait();
+}
+
+<span class="comment">// after use, release the ExtGroupTaskManager</span>
+gtm-&gt;release();
+</pre></div><p>
+<br>
+<p>
+Groups can be processed concurrently as well as follows.<p>
+<div class="fragment"><pre class="fragment"><span class="comment">// creating ExtGroupTaskManager from existing taskManager and groups</span>
+
+ExtGroupTaskManager* gtm0 = ExtGroupTaskManager::create(*taskManager, tkGroup0);
+ExtGroupTaskManager* gtm1 = ExtGroupTaskManager::create(*taskManager, tkGroup1);
+</pre></div><p>
+TkActors are added to TkGroups and damaged as usual.<p>
+The PxTaskManager used in this example provides four worker threads of which each ExtGroupTaskManager uses two for its group.<p>
+<div class="fragment"><pre class="fragment">uint32_t started = 0;
+<span class="keywordflow">if</span> (gtm0-&gt;process(2) &gt; 0) { started++; }
+<span class="keywordflow">if</span> (gtm1-&gt;process(2) &gt; 0) { started++; }
+</pre></div><p>
+Note that ExtGroupTaskManager::wait() never returns true if no processing has started, as reported by ExtGroupTaskManager::process(). The illustrative busy loop is not recomended for actual use.<p>
+<div class="fragment"><pre class="fragment">uint32_t completed = 0;
+<span class="keywordflow">while</span> (completed &lt; started)
+{
+ <span class="keywordflow">if</span> (gtm0-&gt;wait(<span class="keyword">false</span>)) { completed++; }
+ <span class="keywordflow">if</span> (gtm1-&gt;wait(<span class="keyword">false</span>)) { completed++; }
+}
+</pre></div><p>
+<br>
+<h2><a class="anchor" name="ExtCustomProfiler">
+ExtCustomProfiler</a></h2>
+This Nv::Blast::ProfileCallback implementation forwards Blast&trade; profile events to the PxProfilerCallback attached to PxFoundation, typically a PhysX&trade; Visual Debugger (PVD) instance. To use it, simply attach one to Blast&trade;.<p>
+<div class="fragment"><pre class="fragment"><span class="keyword">static</span> <a class="code" href="class_nv_1_1_blast_1_1_ext_custom_profiler.html">Nv::Blast::ExtCustomProfiler</a> gBlastProfiler;
+<a class="code" href="_nv_blast_profiler_8h.html#fba345e0f5a9689ded425622ea9a659b">NvBlastProfilerSetCallback</a>(&amp;gBlastProfiler);
+</pre></div><p>
+For convenience, it also provides sending profile events to platform specific profilers. These are disabled by default.<p>
+<div class="fragment"><pre class="fragment">gBlastProfiler.<a class="code" href="class_nv_1_1_blast_1_1_ext_custom_profiler.html#326703192c1cef7196f271e6dd47bd94">setPlatformEnabled</a>(<span class="keyword">true</span>);
+</pre></div><p>
+<br>
</div>
<!-- start footer part -->
<div class="footer">