Tractor Beam using Generic6DofConstraint

User avatar
JohnHardy
Posts: 18
Joined: Mon Mar 05, 2012 11:39 pm
Location: Lancaster, UK

Tractor Beam using Generic6DofConstraint

Post by JohnHardy »

I've been using the Generic6DofConstraint to simulate a tractor beam style effect from Star Trek but am not sure how best to configure the joint to achieve this towing behaviour.

I'm a little confused by the documentation and was hoping someone could suggest a better implementation strategy.

Here is my code so far:

Code: Select all

mFrameA = App.Matrix.Translation(0, 0, 5); # point on the ship where the tractor beam originates
mFrameB = App.Matrix.Identity # point on the ship we are pulling at

joint = BulletSharp.Generic6DofSpringConstraint(bodya, bodyb, mFrameA, mFrameB, True);

joint.EnableSpring(2, True)
joint.SetStiffness(2, 0.1)
joint.SetDamping(2, 0.5)

joint.LinearLowerLimit = App.Vector3(0, 0, 10)
joint.LinearUpperLimit = App.Vector3(0, 0, 50)

world..AddConstraint(joint);
Cheers
User avatar
JohnHardy
Posts: 18
Joined: Mon Mar 05, 2012 11:39 pm
Location: Lancaster, UK

Re: Tractor Beam using Generic6DofConstraint

Post by JohnHardy »

Any ideas folks?