Virtools脚本语言(VSL)教程 - 使用 GUID

Virtools脚本语言(VSL)教程 - 使用 GUID

<p>在VSL中,为了获取 GUID,你得使用 GetGUID 函数:</p>
<table border="1" cellspacing="2" cellpadding="2"><tbody>
<tr>
<th>返回值</th>
<th>函数</th>
<th>参数</th>

</tr>
<tr>
<td>
<a href="http://sites.google.com/site/x3dofcn/SDKBindingTables/vsl_classes.html#GUID">GUID</a>
</td>
<td>GetGUID</td>
<td>iGuidEnum (<a href="http://sites.google.com/site/x3dofcn/SDKBindingTables/vsl_enums.html#PGUID">PGUID</a>
)
</td>
</tr>
</tbody></table>
<p>以下为枚举PGUID的描述:</p>
<h3>
<a name="TOC-PGUID"></a>
PGUID</h3>
<p></p>
<ul>
GUID_DIRECTION<br>
GUID_NONE<br>
GUID_FLOAT<br>
GUID_ANGLE<br>
GUID_PERCENTAGE<br>
GUID_INT<br>
GUID_KEY<br>
GUID_BOOL<br>
GUID_STRING<br>
GUID_RECT<br>
GUID_VECTOR<br>
GUID_2DVECTOR<br>
GUID_QUATERNION<br>
GUID_EULERANGLES<br>
GUID_MATRIX<br>
GUID_COLOR<br>
GUID_BOX<br>
GUID_OBJECTARRAY<br>
GUID_OBJECT<br>
GUID_BEOBJECT<br>
GUID_MESH<br>
GUID_MATERIAL<br>
GUID_TEXTURE<br>
GUID_SPRITE<br>
GUID_3DENTITY<br>
GUID_CURVEPOINT<br>
GUID_LIGHT<br>
GUID_TARGETLIGHT<br>
GUID_ID<br>
GUID_CAMERA<br>
GUID_TARGETCAMERA<br>
GUID_SPRITE3D<br>
GUID_OBJECT3D<br>
GUID_BODYPART<br>
GUID_CHARACTER<br>
GUID_CURVE<br>
GUID_2DCURVE<br>
GUID_LEVEL<br>
GUID_PLACE<br>
GUID_GROUP<br>
GUID_2DENTITY<br>
GUID_RENDEROBJECT<br>
GUID_SPRITETEXT<br>
GUID_SOUND<br>
GUID_WAVESOUND<br>
GUID_MIDISOUND<br>
GUID_OBJECTANIMATION<br>
GUID_ANIMATION<br>
GUID_KINEMATICCHAIN<br>
GUID_SCENE<br>
GUID_BEHAVIOR<br>
GUID_MESSAGE<br>
GUID_SYNCHRO<br>
GUID_CRITICALSECTION<br>
GUID_STATE<br>
GUID_ATTRIBUTE<br>
GUID_CLASSID<br>
GUID_VOIDBUF<br>
GUID_BLENDMODE<br>
GUID_FILTERMODE<br>
GUID_BLENDFACTOR<br>
GUID_FILLMODE<br>
GUID_LITMODE<br>
GUID_SHADEMODE<br>
GUID_GLOBALEXMODE<br>
GUID_ZFUNC<br>
GUID_ADDRESSMODE<br>
GUID_WRAPMODE<br>
GUID_3DSPRITEMODE<br>
GUID_FOGMODE<br>
GUID_LIGHTTYPE<br>
GUID_SPRITEALIGN<br>
GUID_SCRIPT<br>
GUID_LAYERTYPE<br>
GUID_STATECHUNK<br>
GUID_DATAARRAY<br>
GUID_COMPOPERATOR<br>
GUID_BINARYOPERATOR<br>
GUID_SETOPERATOR<br>
GUID_SPRITETEXTALIGNMENT<br>
GUID_OBSTACLEPRECISION<br>
GUID_OBSTACLEPRECISIONBEH<br>
GUID_OBSTACLE<br>
GUID_PATCHMESH<br>
GUID_POINTER<br>
GUID_ENUMS<br>
GUID_STRUCTS<br>
GUID_FLAGS<br>
GUID_FILTER<br>
GUID_TIME<br>
GUID_OLDTIME<br>
GUID_COPYDEPENDENCIES<br>
GUID_DELETEDEPENDENCIES<br>
GUID_SAVEDEPENDENCIES<br>
GUID_REPLACEDEPENDENCIES<br>
GUID_SCENEACTIVITYFLAGS<br>
GUID_SCENEOBJECT<br>
GUID_SCENERESETFLAGS<br>
GUID_ARRAYTYPE<br>
GUID_RENDEROPTIONS<br>
GUID_PARAMETERTYPE<br>
GUID_MATERIALEFFECT<br>
GUID_TEXGENEFFECT<br>
GUID_TEXGENREFEFFECT<br>
GUID_COMBINE2TEX<br>
GUID_COMBINE3TEX<br>
GUID_BUMPMAPPARAM<br>
GUID_TEXCOMBINE<br>
GUID_PIXELFORMAT<br>
GUID_AXIS<br>
GUID_SUPPORT<br>
GUID_BITMAP_SYSTEMCACHING<br>
GUID_OLDMESSAGE<br>
GUID_OLDATTRIBUTE<br>
</ul>
<p>实例:</p>
<pre>void main()<br>

{<br><span>// Create an array.</span>

<br>

Array myArray = bc.CreateArray("MyArray", false, true);<br><br><span>/// Then we add some columns.<br>

//</span>

<br><br><span>// Add an Entity3D column.</span>

<br>

myArray.InsertColumn(-1, CKARRAYTYPE_OBJECT, "entity", <strong>GetGUID(GUID_3DENTITY)</strong>

);<br><br><span>// Add an int column.</span>

<br>

myArray.InsertColumn(-1, CKARRAYTYPE_INT, "age", <strong>GetGUID(GUID_INT)</strong>

);<br><br><span>// Add 10 Vector columns.</span>

<br><strong>GUID guid_vector</strong>

= <strong>GetGUID(GUID_VECTOR)</strong>

;<br>

String columnName;<br>

for (int i = 0; i < 10; ++i) {<br>

columnName = "vector";<br>

columnName += i;<br>

myArray.InsertColumn(-1, CKARRAYTYPE_PARAMETER, columnName.Str(), <strong>guid_vector</strong>

);<br>

}<br>

}
</pre>