I've tried various things but I keep getting compile errors. Here is my setup:
Code: Select all
...
mMovableObject->setUserAny(Ogre::Any(mGameObject));
...
Code: Select all
...
Ogre::Any any = entity->getUserAny();
rc.hitGameObject = any<GameObject*>();
...
Code: Select all
1>d:\game_dev\gaia\src\gaiascene.cpp(702) : error C2059: syntax error : '>'
Code: Select all
1>d:\game_dev\gaia\src\gaiascene.cpp(702) : error C2783: 'ValueType Ogre::Any::operator ()(void) const' : could not deduce template argument for 'ValueType'
1> d:\game_dev\dependencies\include\ogre\ogreany.h(190) : see declaration of 'Ogre::Any::operator ()'
Code: Select all
00181 public:
00182
00183 template<typename ValueType>
00184 ValueType operator()() const
00185 {
00186 if (!mContent)
00187 {
00188 OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
00189 "Bad cast from uninitialised Any",
00190 "Any::operator()");
00191 }
00192 else if(getType() == typeid(ValueType))
00193 {
00194 return static_cast<Any::holder<ValueType> *>(mContent)->held;
00195 }
00196 else
00197 {
00198 StringUtil::StrStreamType str;
00199 str << "Bad cast from type '" << getType().name() << "' "
00200 << "to '" << typeid(ValueType).name() << "'";
00201 OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
00202 str.str(),
00203 "Any::operator()");
00204 }
00205 }
Thanks for any help.