I'm trying to pass a pointer to a derived class to a function that takes a pointer to a base class. It doesn't work through script though.
Error:
No matching signatures to 'attachObject(BillboardSet@&)
Script Code:
SceneNode parent = this.getSceneNode();
BillboardSet @billboardSet = createBillboardSet("Blah", 20);
billboardSet.setMaterialName("PhotonGunMaterial");
parent.attachObject(cast<MovableObject>(billboardSet));
C++ Script registration:
ScriptManager::engine->RegisterGlobalFunction("BillboardSet@ createBillboardSet(const string& in, int)", asFUNCTION(ScriptSceneManager::CreateBillboardSet), asCALL_CDECL);
...
ScriptManager::engine->RegisterObjectMethod("SceneNode", "void attachObject(MovableObject@)", asMETHOD(SceneNode, attachObject),asCALL_THISCALL);
Actual C++:
Ogre::BillboardSet* ScriptSceneManager::CreateBillboardSet(std::string &name)
{
return sm->createBillboardSet(name);
}
...
class _OgreExport BillboardSet : public MovableObject, public Renderable
{
protected: