Re[2]: [ODE] always diabled body
Nate W
coding at natew.com
Wed Oct 9 11:59:02 2002
On Wed, 9 Oct 2002, slipch wrote:
> I want to hook enabled body to some point and drag it during
> simulation simply setting the point position.
I am doing something like that in my application. I create a
"fixed" joint, and use it to attach the body to "the static
environment" (as Russ puts it in the documentation).
// code
m_TackJoint = dJointCreateFixed (m_pWorld->m_WorldID, 0);
if (m_TackJoint)
{
dJointAttach (m_TackJoint, m_BodyID, null);
dJointSetFixed (m_TackJoint);
}
As for moving things around, I'm not sure but I think you could try
dBodySetPosition followed by another call to dJointSetFixed... moving
things around in that way seems to me like it would destabilize the
simulation, but it's worth a try.
Or, don't create that "disabled" body at all... think about whatever other
body it will be connected to, and connect THAT body with a fixed joint,
and move that body around. That might be a little bit simpler.
--
Nate Waddoups
Redmond WA USA
http://www.natew.com