<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Maratis forum - Problem with multiple sceneLayers]]></title>
	<link rel="self" href="http://forum.maratis3d.com/extern.php?action=feed&amp;tid=1277&amp;type=atom"/>
	<updated>2017-11-14T04:45:31Z</updated>
	<generator>PunBB</generator>
	<id>http://forum.maratis3d.com/viewtopic.php?id=1277</id>
		<entry>
			<title type="html"><![CDATA[Re: Problem with multiple sceneLayers]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=8165#p8165"/>
			<content type="html"><![CDATA[<p>Thanks, it worked perfectly <img src="http://forum.maratis3d.com/img/smilies/smile.png" width="15" height="15" alt="smile" /></p>]]></content>
			<author>
				<name><![CDATA[ArielRiv]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=2860</uri>
			</author>
			<updated>2017-11-14T04:45:31Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=8165#p8165</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Problem with multiple sceneLayers]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=8164#p8164"/>
			<content type="html"><![CDATA[<p>Hi,</p><p>In a c++ plugin you can customize MGame::update() and MGame::draw() to handle multiple scenes.</p><div class="codebox"><pre><code>MScene *scenes[3]
scenes[0] = getSceneByName(&quot;Sky&quot;);
scenes[1] = getSceneByName(&quot;World&quot;);
scenes[2] = getSceneByName(&quot;GUI&quot;);</code></pre></div><p>in update replace current scene update by:</p><div class="codebox"><pre><code>for (i = 0; i &lt; 3; i++) {
   scenes[i]-&gt;updateObjectsBehaviors();
   scenes[i]-&gt;update();
   if (i == 1) scenes[i]-&gt;updatePhysics();
   scenes[i]-&gt;updateObjectsMatrices();
}</code></pre></div><p>in draw something like:<br /></p><div class="codebox"><pre><code>for (i = 0; i &lt; 3; i++) {
   MOCamera * camera = scenes[i]-&gt;getCurrentCamera();

   render-&gt;setClearColor(camera-&gt;getClearColor());

   if (i == 0)
      render-&gt;clear(M_BUFFER_COLOR | M_BUFFER_DEPTH);
   else
      render-&gt;clear(M_BUFFER_DEPTH);

   camera-&gt;enable();
   if (i == 1) camera-&gt;updateListener();
   scenes[i]-&gt;draw(camera);
   scenes[i]-&gt;drawObjectsBehaviors();
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[anael]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=2</uri>
			</author>
			<updated>2017-11-13T10:21:14Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=8164#p8164</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Problem with multiple sceneLayers]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=8163#p8163"/>
			<content type="html"><![CDATA[<p>I have three scenes:<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;-Sky<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;-World<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;-GUI</p><p>I need the three scenes to be shown as layers at once in this way: World is the Sky layer and GUI is the World layer, meaning Sky is in the background, World in the middle and GUI is in front. but the engine only allows the rendering of two layers, what can I do?</p>]]></content>
			<author>
				<name><![CDATA[ArielRiv]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=2860</uri>
			</author>
			<updated>2017-11-13T02:43:27Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=8163#p8163</id>
		</entry>
</feed>
