<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Maratis forum - How to add an object Behavior in C ++?]]></title>
	<link rel="self" href="http://forum.maratis3d.com/extern.php?action=feed&amp;tid=1169&amp;type=atom"/>
	<updated>2016-07-26T07:48:50Z</updated>
	<generator>PunBB</generator>
	<id>http://forum.maratis3d.com/viewtopic.php?id=1169</id>
		<entry>
			<title type="html"><![CDATA[Re: How to add an object Behavior in C ++?]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=7651#p7651"/>
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[anael]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=2</uri>
			</author>
			<updated>2016-07-26T07:48:50Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=7651#p7651</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: How to add an object Behavior in C ++?]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=7650#p7650"/>
			<content type="html"><![CDATA[<p>Hi, start with this tutorial :<br /><a href="http://www.maratis3d.org/?p=500">http://www.maratis3d.org/?p=500</a></p>]]></content>
			<author>
				<name><![CDATA[anael]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=2</uri>
			</author>
			<updated>2016-07-26T07:34:19Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=7650#p7650</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[How to add an object Behavior in C ++?]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=7648#p7648"/>
			<content type="html"><![CDATA[<p>I have tried many ways to add Behavior LookAt a camera but no way it works, how it is done?</p>]]></content>
			<author>
				<name><![CDATA[ArielRiv]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=2860</uri>
			</author>
			<updated>2016-07-22T22:53:17Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=7648#p7648</id>
		</entry>
</feed>
