Hi all,
I just implemented bullet into my game. Everything is working well but now i have problems with constraints.
Code:
{
dragging=ncakt;
btVector3 pivA(0, 0, 0);
btVector3 pivB(0, sT->polomer+2.3, 0);
btVector3 axisa(0., 0., 1.);
btVector3 axisb(0., 0., 1.);
dragging->m_body->setAngularFactor(btVector3(0,0,0));
dragging->m_body->clearForces();
m_const = new btHingeConstraint(*m_body, *dragging->m_body,
pivA, pivB, axisa, axisb);
m_const->setLimit(-0.2,0.2);
dynamicsWorld->addConstraint(m_const, true);
}
{
dragginguwi=uwip;
btVector3 pivA(0., 0., 0.);
btVector3 pivB(0, sT->polomer+2.3, 0);
btVector3 axisa(0., 0., 1.);
btVector3 axisb(0., 0., 1.);
dragginguwi->m_body->setAngularFactor(btVector3(0,0,0));
dragginguwi->m_body->clearForces();
m_const = new btHingeConstraint(*m_body, *dragginguwi->m_body,
pivA, pivB, axisa, axisb);
m_const->setLimit(-0.2,0.2);
dynamicsWorld->addConstraint(m_const, true);
}
Destroyed dragged npc should be right beneath player but instead it is rotating around (click on the video) and item is also not under player but it appears to be somewhere at place (-2, 2, -0.5) by player (not in video). Constraint creation is basd on demo App_SliderConstraintDemo. I alredy tried
different constraint types but none of them worked correckt.
http://youtu.be/uaBgzVRmm0ICould somebody please tell me what am i doing wrong?