Hi all,
I feel like a right beginner with this question. So apologies. I have had a real hard time finding concrete examples or documentation flow to learn the basics, so thus far I have struggled by - by using copy and paste from the samples and lots of trial and error.
So I am trying to register this object method
class TransformObject
{
public:
virtual const Vector4& GetPosition() const;
}
The only way I have been successful in registering this method is as such...
RegisterObjectMethod("TransformObject", "Vector4 GetPostion() const", asMETHOD(TransformObject, GetPosition), asCALL_THISCALL); ASSERT(r>=0, "Error");
Vector4 is a class and is registered as an object type like so...
RegisterObjectType("Vector4", sizeof(Vector4), asOBJ_APP_CLASS_ALLFLOATS | asOBJ_VALUE | asOBJ_POD | asOBJ_APP_CLASS_CAK); ASSERT(r>=0, "Error");
Using scriptBuilder to build the script containing this line...
Vector4 position = self.GetPosition();
the following errors are output
movabletest.as (18, 30) : ERR : No matching signatures to 'TransformObject::GetPosition()'
movabletest.as (18, 25) : ERR : Can't implicitly convert from 'const int' to 'Vector4'.
Can anyone point me to my error please. Really perplexed.
Cheers!!