Hinge Joint

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Hinge Joint

Postby FSA » Thu Dec 20, 2012 3:02 pm

Hi. I want to make a hinge joint with newton 3.xx and jointlibary. I create the joint like this:
Code: Select all
Matrix tt = MatrixTranslation(Vector3(0.0f,-9.0f,55.0f));
CustomHinge ch((dMatrix)tt, g_pP, NULL);
ch.EnableLimits (true);
ch.SetLimis (0, 0.5f * 3.1416f);

But the joint was not create. The body behaves like normal dynamic body with no joint attached.
Have I forgot something?
User avatar
FSA
 
Posts: 322
Joined: Wed Dec 21, 2011 9:47 am

Re: Hinge Joint

Postby PJani » Thu Dec 20, 2012 4:53 pm

letter123 wrote:Hi. I want to make a hinge joint with newton 3.xx and jointlibary. I create the joint like this:
Code: Select all
Matrix tt = MatrixTranslation(Vector3(0.0f,-9.0f,55.0f));
CustomHinge ch((dMatrix)tt, g_pP, NULL);
ch.EnableLimits (true);
ch.SetLimis (0, 0.5f * 3.1416f);

But the joint was not create. The body behaves like normal dynamic body with no joint attached.
Have I forgot something?


u created joint on stack...it will be destroyed when scope ends...u need to create it on heap.

like this.
Code: Select all
Matrix tt = MatrixTranslation(Vector3(0.0f,-9.0f,55.0f));
CustomHinge* ch = new CustomHinge((dMatrix)tt, g_pP, NULL);
ch->EnableLimits (true);
ch->SetLimis (0, 0.5f * 3.1416f);
| i7-5930k@4.2Ghz, EVGA 980Ti FTW, 32GB RAM@3000 |
| Dell XPS 13 9370, i7-8550U, 16GB RAM |
| Ogre 1.7.4 | VC++ 9 | custom OgreNewt, Newton 300 |
| C/C++, C# |
User avatar
PJani
 
Posts: 448
Joined: Mon Feb 02, 2009 7:18 pm
Location: Slovenia


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest