aboutsummaryrefslogtreecommitdiff
path: root/docs/api_docs/files/pageextpxserialization.html
blob: 3fb284385470992e11257ee81488fe5ebd1330ff (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<html>
	<head>
		<title>NVIDIA(R) Blast(R) SDK 1.1 API Reference: ExtPhysX Serialization (NvBlastExtPxSerialization)</title>
		<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
		<LINK HREF="NVIDIA.css" REL="stylesheet" TYPE="text/css">
	</head>

	<body bgcolor="#FFFFFF">
		<div id="header">
			<hr class="first">
			<img alt="" src="blast_logo.png">
			<br>
			<center>
				<a class="qindex" href="main.html">Main Page</a> &nbsp; 
				<!-- <a class="qindex" href="hierarchy.html">Class Hierarchy</a> &nbsp; //-->
				<a class="qindex" href="annotated.html">Class List</a> &nbsp; 
				<a class="qindex" href="functions.html">Class Members</a> &nbsp;  
			</center>
			<hr class="second">
		</div>
<!-- Generated by Doxygen 1.5.8 -->
<div class="contents">
<h1><a class="anchor" name="pageextpxserialization">ExtPhysX Serialization (NvBlastExtPxSerialization) </a></h1>This extension contains serializers which can be loaded into the ExtSerialization manager defined in <a class="el" href="pageextserialization.html">Serialization (NvBlastExtSerialization)</a>.<p>
To use this extension, you must also load the ExtSerialization extension and create a serialization manager as described in <a class="el" href="pageextserialization.html">Serialization (NvBlastExtSerialization)</a>.<p>
We repeat this here (again, assuming we are in the <a class="el" href="namespace_nv_1_1_blast.html">Nv::Blast</a> namespace):<p>
<div class="fragment"><pre class="fragment">ExtSerialization* ser = <a class="code" href="_nv_blast_ext_serialization_8h.html#9dad7f69d7a72d402c99238ed3c34bfc">NvBlastExtSerializationCreate</a>();
</pre></div><p>
Then, call the function NvBlastExtPxSerializerLoadSet, declared in <b><a class="el" href="_nv_blast_ext_px_serialization_8h.html">NvBlastExtPxSerialization.h</a></b>, passing in your TkFramework (required by ExtPhysX), along with your physx::PxPhysics and physx::PxCooking pointers:<p>
<div class="fragment"><pre class="fragment">TkFramework* framework = ... <span class="comment">// We must have created a TkFramework</span>
physx::PxPhysics* physics = ... <span class="comment">// and PxPhysics</span>
physx::PxCooking* cooking = ... <span class="comment">// and PxCooking</span>

<a class="code" href="_nv_blast_ext_px_serialization_8h.html#8c896467357e07261de122d4006c9bef">NvBlastExtPxSerializerLoadSet</a>(*framework, *physics, *cooking *ser);
</pre></div><p>
Now your serialization manager will have the serializers provided by this extension. Currently only ExtPxAsset serializers exist, with object type ID given by<p>
<br>
 <b>ExtPxObjectTypeID::Asset</b> <br>
<p>
As with low-level assets, you can serialize using the serialization manager directly:<p>
<div class="fragment"><pre class="fragment"><span class="keyword">const</span> ExtPxAsset* asset = ... <span class="comment">// Given pointer to an Nv::Blast::ExtPxAsset</span>

<span class="keywordtype">void</span>* buffer;
uint64_t size = ser-&gt;serializeIntoBuffer(buffer, asset, ExtPxObjectTypeID::Asset);
</pre></div><p>
or use the wrapper function defined in <b><a class="el" href="_nv_blast_ext_px_serialization_8h.html">NvBlastExtPxSerialization.h</a></b>:<p>
<div class="fragment"><pre class="fragment"><span class="keywordtype">void</span>* buffer;
uint64_t size = <a class="code" href="_nv_blast_ext_px_serialization_8h.html#023b377cc39c27e2ae2fc3237a0aec1e">NvBlastExtSerializationSerializeExtPxAssetIntoBuffer</a>(buffer, *ser, asset);
</pre></div><p>
<br>
 </div>
<!-- start footer part -->
<div class="footer">
Copyright &copy; 2015-2017 NVIDIA Corporation, 2701 San Tomas Expressway, Santa Clara, CA 95050 U.S.A. All rights reserved. <a href="http://www.nvidia.com ">www.nvidia.com</a>
</div>
</body>
</html>