<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Maratis forum - How to add an object Behavior in C ++?]]></title>
		<link>http://forum.maratis3d.com/viewtopic.php?id=1169</link>
		<description><![CDATA[The most recent posts in How to add an object Behavior in C ++?.]]></description>
		<lastBuildDate>Tue, 26 Jul 2016 07:48:50 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: How to add an object Behavior in C ++?]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=7651#p7651</link>
			<description><![CDATA[<p>If you just want to add a behavior to an object in c++.</p><p>You can use the behavior manager if you don&#039;t have access to the behavior code directly:</p><div class="codebox"><pre><code>MEngine *engine = MEngine::getInstance();
MBehaviorManager * bManager = engine-&gt;getBehaviorManager();

MBehaviorCreator * bCreator = bManager-&gt;getBehaviorByName(&quot;LookAt&quot;);

MBehavior *behavior = bCreator-&gt;getNewBehavior(object);
object-&gt;addBehavior(behavior);

MVariable var0 = behavior-&gt;getVariable(0); // var 0 is &quot;target&quot;
MString *targetName = (MString *)var0.getPointer();
*targetName = &quot;objetNameToLookAt&quot;;</code></pre></div><p>If you have access to the behavior class you can do this directly:</p><div class="codebox"><pre><code>MBLookAt *behavior = MBLookAt::getNew(object);
object-&gt;addBehavior(behavior);</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (anael)]]></author>
			<pubDate>Tue, 26 Jul 2016 07:48:50 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=7651#p7651</guid>
		</item>
		<item>
			<title><![CDATA[Re: How to add an object Behavior in C ++?]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=7650#p7650</link>
			<description><![CDATA[<p>Hi, start with this tutorial :<br /><a href="http://www.maratis3d.org/?p=500">http://www.maratis3d.org/?p=500</a></p>]]></description>
			<author><![CDATA[dummy@example.com (anael)]]></author>
			<pubDate>Tue, 26 Jul 2016 07:34:19 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=7650#p7650</guid>
		</item>
		<item>
			<title><![CDATA[How to add an object Behavior in C ++?]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=7648#p7648</link>
			<description><![CDATA[<p>I have tried many ways to add Behavior LookAt a camera but no way it works, how it is done?</p>]]></description>
			<author><![CDATA[dummy@example.com (ArielRiv)]]></author>
			<pubDate>Fri, 22 Jul 2016 22:53:17 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=7648#p7648</guid>
		</item>
	</channel>
</rss>
