[SOLVED]Need a help with joint (door and door frame)

mamairaja

12-10-2010 20:11:45

Hi
I am trying to implement a revolute joint for a door. But haven't succeeded yet.
This is my code.
NxOgre::Mesh* gateFrameMesh = NxOgre::MeshManager::getSingleton()->load("media:GateFrame.nxs");
NxOgre::Mesh* gateMesh = NxOgre::MeshManager::getSingleton()->load("media:Gate.nxs");

NxOgre::TriangleGeometry* gateFrameTg = new NxOgre::TriangleGeometry(gateFrameMesh);
NxOgre::TriangleGeometry* gateTg = new NxOgre::TriangleGeometry(gateMesh);

OGRE3DKinematicBody* gateFrameBody = mRenderSystem->createKinematicBody(gateFrameTg, NxOgre::Vec3(560,33,560), "GateFrame.mesh");
OGRE3DBody* gateBody = mRenderSystem->createBody(gateTg, NxOgre::Vec3(575,50,560), "Gate.mesh");

NxOgre::RevoluteJointDescription descr;
descr.mLocalAxis[1] = NxOgre::Vec3(0, 1, 0);

mScene->createRevoluteJoint(gateFrameBody, gateBody, descr);


Here I can see some kind of joint. But the gate rotates around the gate frame continously.

Could you please help me with this?

spacegaier

20-10-2010 15:51:34

Here I can see some kind of joint. But the gate rotates around the gate frame continously.
Rotating around itself ;) ?

Never really worked with joints so far, but I remeber that you can put some sort of limiter / constraints on them, only allowing movements in a special radian / area. And you presumably can also apply some friction so gradually slow down the swinging door.

mamairaja

20-10-2010 18:55:14

Hello Spacegaier,
Thanks for the help.
Yes I stole some of your code from https://www.ogre3d.org/addonforums/view ... =6&t=10502
:D

And Betajaen well explained the revolute joint viewtopic.php?f=6&t=13506

Thank you

spacegaier

20-10-2010 19:39:08

Nice, my code actually helped someone :) .