Topic: [Plugin] LookAt for Entity
We gonna take the "How to create a game plugin" as base.
http://www.maratis3d.org/?p=500
In your visual c++ project, add these two files (they are in maratis source code folder) :
../Maratis/Common/MBehaviors/MBLookAt.cpp
../Maratis/Common/MBehaviors/MBLookAt.h
Then, in SimpleGamePlugin.cpp, add :
#inculde "MBLookAt.h"
And after the line
behaviorManager->addBehavior(MyBehavior::getStaticName(), M_OBJECT3D, MyBehavior::getNew);
Add
behaviorManager->addBehavior(MBLookAt::getStaticName(), M_OBJECT3D_ENTITY, MBLookAt::getNew);
Compile, Generate & Enjoy
(Thanks anael for this )
Edit : i screwed up a step when i last edited, corrected now
Last edited by Vegas (2011-09-12 10:35:47)