# Physics Simulation Forum

 All times are UTC

 Page 1 of 1 [ 5 posts ]
 Print view Previous topic | Next topic
Author Message
 Post subject: Pulling one object to anotherPosted: Sun Jun 19, 2011 3:23 am

Joined: Wed Nov 11, 2009 9:09 pm
Posts: 29
I'm trying to create a "cargo hook" a sort of a line that one object (a space station or a ship) uses to pull another object (a cargo pod, or another ship)

What's a sensible way of doing this?

I've tried constraints, did some experiments, but i'm not even sure I'm using the right one.
I experimented with the 6 degree of freedom constraint, enabled motors, etc, this gives me a pull, but often not in the correct direction, and it seems to be affected by the pulling ship's orientation, which is baffling me.

Summary:
Are constraints the way to go to achieve a pull effect? Is the 6 degree of freedom constaint the one to use?

thanks for any help

Top

 Post subject: Re: Pulling one object to anotherPosted: Sun Jun 19, 2011 6:01 pm

Joined: Wed Nov 11, 2009 9:09 pm
Posts: 29
This post is something closer to what I'm looking for: http://bulletphysics.org/Bullet/phpBB3/viewtopic.php?f=4&t=4864&p=17937&hilit=btPoint2PointConstraint#p17937

It shows a distance constraint, I changed it a bit to add a ->setDistance(float newDistance) if the newDistance is smaller than the old then it will use the new distance meaning that the objects can get closer.

Now I need to figure out how to do the pulling force.

If object a and object b

if object a is larger pull object b to it, if object b is larger pull object a to it

but with actual physics

Top

 Post subject: Re: Pulling one object to anotherPosted: Mon Jun 20, 2011 2:25 am

Joined: Wed Nov 11, 2009 9:09 pm
Posts: 29
The set distance thing to get the distance between the two objects to shrink but not expand worked in debug mode but not release

dammit, it tricked me into thinking that I found a loop hole, debug mode worked since the physics step was slower thus less precise

Funny thing I discovered while playing around is that I can sort of create a motor by doing this:

Code:
info->m_constraintError[0] = 5; // Positive to get closer, negative to get further apart

Although the pull/push force is constant and not dependent on the entities, this may work in some way in my project as a tractor beam/repulsor ray.

Top

 Post subject: Re: Pulling one object to anotherPosted: Mon Jun 20, 2011 2:42 am

Joined: Tue Jun 29, 2010 10:27 pm
Posts: 237
One option besides constraints would be a soft body chain. There is at least one example in the bullet demos of this, where a large block is swinging from an anchored point, connected by one or two chains of soft body nodes connected by links. The effect is fairly nice. You could also change the link resting length to retract/extend the chains, however this feature is not yet officially implemented (though you could do it manually with a little work). But, there is some code posted on the issue tracker that does this. See: http://code.google.com/p/bullet/issues/detail?id=470, which I integrated into issue 503, which has some additional soft body fixes.

Top

 Post subject: Re: Pulling one object to anotherPosted: Mon Jun 20, 2011 3:04 pm

Joined: Wed Nov 11, 2009 9:09 pm
Posts: 29
thanks! I'll look into that, a soft body would show a neat visual effect.

Top

 Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending
 Page 1 of 1 [ 5 posts ]

 All times are UTC

#### Who is online

Users browsing this forum: Bing [Bot], thegeneralsolution, Xenoprimate and 5 guests

 You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum

Search for:
 Jump to:  Select a forum ------------------ BULLET PHYSICS LIBRARY USERS    General Bullet Physics Support and Feedback    Release Announcements    Applications, Games, Demos or Movies using Bullet PHYSICS AUTHORING TOOLS, SERIALIZATION AND STANDARDS    Physics authoring tools, serialization, standards and related topics RESEARCH AND DEVELOPMENT IN COLLISION DETECTION & PHYSICS. Don't post Bullet support questions here!    Research and development discussion about Collision Detection and Physics Simulation    Links, Papers, Libraries, Demos, Movies, Comparisons       Non-technical forum and license/patent discussion    Career Opportunities
Powered by phpBB® Forum Software © phpBB Group