FORUM CLOSED, PLEASE REGISTER AT FORUM.SIO2INTERACTIVE.COM
Would you like to react to this message? Create an account in a few clicks or log in to continue.

_SIO2parent child movement problem.

2 posters

Go down

_SIO2parent child movement problem. Empty _SIO2parent child movement problem.

Post  Fish Fri Jul 10, 2009 5:48 am

Hi,

I have come across a problem when trying to move a parent object: the child disappears when the parent moves out of a certain range.

I have taken tutorial 9 as a basis. I have set the coordinates of the player and peacock objects to 0,0,0 then 'centered new' both of them.

I then attach the peacock object as a child to the player object

ie-
SIO2object *objectPlayer= ( SIO2object * )sio2ResourceGet( sio2->_SIO2resource, "object/player");

SIO2object *objectPeacock = ( SIO2object * )sio2ResourceGet( sio2->_SIO2resource, SIO2_OBJECT, "object/peacock" ); // Get the handle of our "player" entity.

objectPeacock->_SIO2transform->_SIO2parent = objectPlayer->_SIO2transform;
sio2TransformBindMatrix(objectPeacock->_SIO2transform);

The peacock object now follows the player object as expected. This works until the player object reaches a certain distance away and then the peacock object will no longer appear. I presume it has somehow 'gone out of range' and is no longer drawn.

Has anyone else come across this problem and found a solution?

Thanks,
Paul

Fish

Posts : 9
Join date : 2009-04-30

Back to top Go down

_SIO2parent child movement problem. Empty Re: _SIO2parent child movement problem.

Post  sio2interactive Fri Jul 10, 2009 3:02 pm

No it is caused by the clipping... you need to update the child _SIO2transform->loc to be in world coordinates and use the matrix as the relative coordinate.
sio2interactive
sio2interactive

Posts : 1526
Join date : 2008-08-26
Age : 45
Location : Shanghai

http://sio2interactive.com

Back to top Go down

_SIO2parent child movement problem. Empty Re: _SIO2parent child movement problem.

Post  Fish Mon Jul 13, 2009 9:21 am

Thanks for the quick reply; that solved the problem!

Thanks,
Fish

Fish

Posts : 9
Join date : 2009-04-30

Back to top Go down

_SIO2parent child movement problem. Empty Re: _SIO2parent child movement problem.

Post  Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum