Hello everyone
I'm new to orx. I got a little puzzle when I read the 3rd tutorial (Frame).
Somewhere call a function called orxObject_GetWorldPositon, and there is another function called orxObject_Position in orx, what's the difference between them, anybody can help me?
Comments
orxObject_GetWorldPosition() get object position in the world instead of orxObject_GetPosition that get object position relatively to its parent (in the parent coord space).
If your object has no parent, the result is the same.
To understand, maybe take a look at the file CreationTemplate.ini.
In the section ObjectTemplate, you will see that orx manage a properties called "ChildList".
Look at this example (here is a stupid example of a head with two eyes ..., sorry, I don't want to take time to search a better one ^^) :
So, if you call orxObject_GetPosition() on the left eyes object, you will get a vector like (-20,-10,0) => it is the position in its parent space. If you call orxObject_GetWorldPosition() on the left eyes, you will have (-20,90,0) => it is its position in the world.
Note: the orx's frame (one by object), contains informations like scale/rotation/position. If you move an object, all its child will be automatically moved. In my example, if you move the head then the eyes will follow the same move.
Hope this can help !
As faistoiplaisir already replied with all details and a nice example, I'll simply write this post to welcome you here.
Don't hesitate to ask if you have any other questions!