Tutorial: Creating an advanced 3D Visualization
#include <OGRE/OgreSceneManager.h>
{
("Name", "Point")
("Category", "Geomtery")
("Description", "Visualizes a point."))
public:
Point3Visualization() :
mPoint(NULL),
mNode(NULL)
{
mPointChannel.setDataChangedCallback(boost::bind(&Point3Visualization::dataChanged, this, _1));
}
virtual ~Point3Visualization()
{
delete mPoint;
if(getSite()==NULL)
return;
getSite()->getSceneManager()->destroySceneNode(mNode);
}
template <typename Reflector>
{
channelProperty(r, "Point", mPointChannel, "The point channel to visualize");
}
{
mNode = sceneManager->getRootSceneNode()->createChildSceneNode();
mPoint =
new MeshObject(
"Sphere.mesh", sceneManager, mNode);
}
{
mPoint->setPosition(p);
mFrameID =
read->frameID;
mDataTimestamp =
read->timestamp;
}
virtual DataConnection getDataConnection()
{
return DataConnection(mPointChannel);
}
protected:
{
if (!mPointChannel.isValid())
return;
mFrameID, mDataTimestamp,
getSite()->getFixedFrame());
}
protected:
Ogre::SceneNode* mNode;
std::string mFrameID;
};