_SIO2parent child movement problem.
2 posters
_SIO2parent child movement problem.
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
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
Re: _SIO2parent child movement problem.
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.
Re: _SIO2parent child movement problem.
Thanks for the quick reply; that solved the problem!
Thanks,
Fish
Thanks,
Fish
Fish- Posts : 9
Join date : 2009-04-30
![-](https://2img.net/i/empty.gif)
» Player Object Movement Tutorial 09
» How to set an object in the opposite direction movement?
» Passing Through Static Object (Beating my iPod seems to help)
» Camera / object movement
» Constrain Movement to Path
» How to set an object in the opposite direction movement?
» Passing Through Static Object (Beating my iPod seems to help)
» Camera / object movement
» Constrain Movement to Path
Permissions in this forum:
You cannot reply to topics in this forum