Yeah true, but if you needed all three co-ordniates, you would be calling six function in theory.
Just to clarify, in the code snippet below I'm not suggesting that the MyObject.GetPositionX() functions return a pointer to a GDK object, which you then call. I have written it like this to show that within the GetPositionX() functions you will be calling the GDK function and returning the value.
float x = MyObject.GetPositionX(1)->dbGetObjectPositionX(1);
float y = MyObject.GetPositionY(1)->dbGetObjectPositionY(1);
float z = MyObject.GetPositionZ(1)->dbGetObjectPositionZ(1);
As opposed to:
vector3f v = MyObject.GetPosition(1);
//function definition
vector3f Object::GetPosition( int ObjectNum )
{
return new vector3f( dbGetObjectPositionX( ObjectNum ), dbGetObjectPositionY( ObjectNum ), dbGetObjectPositionXZ( ObjectNum );
}
So it would be faster to use the individual get functions if you only need one of the co-ordinates, but to get all of the co-ordinates the second would be faster.
So it would probably be best if you added both of the variants to allow the coder to choose which is best.
Who is your Daddy, and what does he do?