Thanks, I've tried that, but the same symptom, as when I used "node->updateAbsolutePosition();". Also, not sure removing the collision when I want to move it going to help, as I put it there to check for collisions
when moving the character.
I don't know what to do next. Perhaps doing my own small character collision system. I'm thinking of something really basic right now (getting the bounding box to get the radius of the object, then check then all objects for a distance), but I still think it's overkill for something that I don't understand.)
EDIT:
Here is the current code:
Code: Select all
void setPosition(vector3df pos)
{
core::list<ISceneNodeAnimator*>::ConstIterator begin = node->getAnimators().begin();
core::list<ISceneNodeAnimator*>::ConstIterator end = node->getAnimators().end();
for(int it=0; begin != end; ++it )
{
ISceneNodeAnimator* pAnim = *begin;
if( pAnim->getType() == ESNAT_COLLISION_RESPONSE )
{
node->removeAnimator(pAnim);
node->setPosition(pos);
node->updateAbsolutePosition();
node->addAnimator(pAnim);
break;
}
}
}
This does the same problem. So Im sure im doing something wrong because I don't understant the thing. I've tried with and without the "updateAbsolutePosition". Would I need to set a flag to put back the animator on the next render?
This seem to be subtle (jerky movement) and seem to affect more when the nodes that were scaled. If the animator is not present, the node movement is ok, but I need it so characters don't overlap.
Here is what happen when the collision is on a animated scene node and i move that node with a setPosition command:
If you look at the picture, all characters should stand on their Y at 0. This one is really set at 0 but at each iteration of the setPosition command, it goes below. Retrieving the absolutePosition reveal the problem and I'm unable to fix it. (The only "fix" is to remove the animator (collision response), then everything is ok, except that the "NPCS" will cross each other with no way to detect if they collide.
Is there a way to fix this or I need to use another collision detection? (creating my own?)