<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Maratis forum - problems with ray using c ++]]></title>
		<link>http://forum.maratis3d.com/viewtopic.php?id=1116</link>
		<description><![CDATA[The most recent posts in problems with ray using c ++.]]></description>
		<lastBuildDate>Sun, 29 Mar 2015 01:19:56 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: problems with ray using c ++]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=7488#p7488</link>
			<description><![CDATA[<p>collision objects are created during MScene::begin automatically,<br />to add collision objects later on, you need to do it manually.</p><p>Normally you can call this to create the collision object of an entity if it was not done at scene begin (call it only once, it is not checking if it was already done) :</p><div class="codebox"><pre><code>scene-&gt;prepareCollisionShape(entity);
scene-&gt;prepareCollisionObject(entity);
scene-&gt;prepareConstraints(entity);</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (anael)]]></author>
			<pubDate>Sun, 29 Mar 2015 01:19:56 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=7488#p7488</guid>
		</item>
		<item>
			<title><![CDATA[Re: problems with ray using c ++]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=7487#p7487</link>
			<description><![CDATA[<p>Thanks for your help Anael. I have other question: why doesn´t work the object’s physical simulation when I active their physical properties after the scene is loaded in the Update () function?</p>]]></description>
			<author><![CDATA[dummy@example.com (ArielRiv)]]></author>
			<pubDate>Fri, 27 Mar 2015 20:06:12 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=7487#p7487</guid>
		</item>
		<item>
			<title><![CDATA[Re: problems with ray using c ++]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=7485#p7485</link>
			<description><![CDATA[<p>Hi,</p><p>getUnProjectedPoint is low level, you need to give exact pixel position in viewport space.<br />If you are in full screen, by multiplying by the screen size + reversing y coordinates :</p><div class="codebox"><pre><code>MSystemContext * system = engine-&gt;getSystemContext();
    
unsigned int width = 0;
unsigned int height = 0;
system-&gt;getScreenSize(&amp;width, &amp;height);

x = x * width;
y = (1.0f - y) * height;</code></pre></div><p>In lua it&#039;s done transparently.</p>]]></description>
			<author><![CDATA[dummy@example.com (anael)]]></author>
			<pubDate>Fri, 27 Mar 2015 14:33:23 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=7485#p7485</guid>
		</item>
		<item>
			<title><![CDATA[problems with ray using c ++]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=7484#p7484</link>
			<description><![CDATA[<p>I wanna work with maratis SDK following the example of the engine manual use, I&#039;m trying to make a ray to know on top of which object is the mouse placed regarding what IsRayHit() function does which always returns false instead of detecting the object, I leave you the code&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; float x = input-&gt;getAxis(&quot;MOUSE_X&quot;);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; float y = input-&gt;getAxis(&quot;MOUSE_Y&quot;);</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MVector3 vi = camera-&gt;getUnProjectedPoint(MVector3(x,y,0));<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MVector3 vo = camera-&gt;getUnProjectedPoint(MVector3(x,y,1));</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //cout&lt;&lt;&quot; &quot;&lt;&lt;vo.x&lt;&lt;&quot; &quot;&lt;&lt;vo.y&lt;&lt;&quot; &quot;&lt;&lt;vo.z&lt;&lt;endl;</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(physics-&gt;isRayHit(vi, vo, &amp;collisionObjId, &amp;point)){<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; exit(0);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //cout&lt;&lt;point.x&lt;&lt;&quot;&nbsp; &quot;&lt;&lt;point.y&lt;&lt;&quot;&nbsp; &nbsp;&quot;&lt;&lt;point.z&lt;&lt;endl;</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MOEntity * entity = scene-&gt;getEntityByName(&quot;monkey&quot;);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MPhysicsProperties * phyProps = entity-&gt;getPhysicsProperties();</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cout&lt;&lt;phyProps-&gt;getCollisionObjectId()&lt;&lt;endl;</p><p>The object has a physical property active, but the ray is not detecting it</p>]]></description>
			<author><![CDATA[dummy@example.com (ArielRiv)]]></author>
			<pubDate>Thu, 26 Mar 2015 16:41:30 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=7484#p7484</guid>
		</item>
	</channel>
</rss>
