Manual joints update and dependent on fps [No Bug]

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
Nadro
Posts: 1648
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Manual joints update and dependent on fps [No Bug]

Post by Nadro »

Hi, I found problem with manual joints update. When FPS is high all works good, but with smaller FPS effect is worse. In my example I connect joint to wheel and I update joint position to wheel position.
This is result:
Image
Small FPS, and wheel is in motion - joint isn't in center of wheel.

Image
High FPS (or wheel isn't in motion) - joint is in center of wheel so all works good.

I think, problem is cause by updateAbsolutePosition() function.
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
Nadro
Posts: 1648
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Post by Nadro »

Hi, I found this problem. It was caused by wrong absoluteTransformation, because I wasn't call updateAbsoluteTransformation for each bone parents, this is very important when we manual update position, rotation etc. (eg. when we use this infos from physic engine) node (parent of each bones) between drawAll() function. This is preview solution for it:

Code: Select all

// Here manual update Node position by setPosition...

IBoneSceneNode* Bone = Node->getJointNode("our_bone_eg_head");

ISceneNode* tempNode = Bone;
std::vector<ISceneNode*> Parents;

while(Node != tempNode)
{
tempNode = tempNode->getParent();
Parents.push_back(tempNode);
}

for(int i = Parents.size() - 1; i >= 0; i--)
Parents[i]->updateAbsolutePosition();

Parents.clear();

// Here manual update Bone position by setPosition...
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
Post Reply