<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[GMan's Mods & Stuff — easier way to "cast" into subtypes]]></title>
	<link rel="self" href="https://gprogs.com/extern.php?action=feed&amp;tid=10&amp;type=atom" />
	<updated>2006-01-05T13:20:53Z</updated>
	<generator>PunBB</generator>
	<id>https://gprogs.com/viewtopic.php?id=10</id>
		<entry>
			<title type="html"><![CDATA[easier way to "cast" into subtypes]]></title>
			<link rel="alternate" href="https://gprogs.com/viewtopic.php?pid=14#p14" />
			<content type="html"><![CDATA[<p>since all type instances are essentially stored in &quot;C&quot;, the only way to cast into a subtype is a bit manual.&nbsp; for example, casting from T_irrIAnimatedMesh into T_irrIAnimatedMeshX would take the following code:<br /></p><div class="codebox"><pre><code>Local xmesh:T_irrIAnimatedMeshX=T_irrIAnimatedMeshX.createFromHandle(animmesh.handle,False)</code></pre></div><p>this would be much cleaner with something like:<br /></p><div class="codebox"><pre><code>Local xmesh:T_irrIAnimatedMeshX=T_irrIAnimatedMeshX.createFromMesh(animmesh)</code></pre></div><p>an alternative, which may actually be the best solution now that i think about it, would be to have the getMesh() method of T_irrISceneManager return the proper subtype cast as the base type.&nbsp; this way casting would work as it should so to cast would then simply become:<br /></p><div class="codebox"><pre><code>T_irrIAnimatedMeshX(animmesh).getJointName(&quot;hand&quot;)</code></pre></div><p>this is the cleanest and most understandable.&nbsp; need to look into where else this might need to be done.&nbsp; DO IT! <img src="https://gprogs.com/img/smilies/smile.png" width="15" height="15" alt="smile" /></p>]]></content>
			<author>
				<name><![CDATA[gman]]></name>
				<uri>https://gprogs.com/profile.php?id=2</uri>
			</author>
			<updated>2006-01-05T13:20:53Z</updated>
			<id>https://gprogs.com/viewtopic.php?pid=14#p14</id>
		</entry>
</feed>
