Ball and platform

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
Rademanc
Posts: 16
Joined: Sat Apr 25, 2009 4:21 pm

Ball and platform

Post by Rademanc »

Hi there.

I want to do the following:

|-----------|
OO
OOOOO
OOO

I want a to have a rolling sphere as a wheel, with a platform that is attached to that wheel. The ball must be able to roll in any direction, but the platform must stay in the same place on top of the wheel. I have forces that
work on the corners of the platform to keep it level, but of course the sphere and plaform is connected with a ballsocket joint so it won't roll.
Any ideas?
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Ball and platform

Post by Norbo »

Try connecting your wheel to the platform with three different distance constraints.

This could be done like so:

Code: Select all

DistanceConstraint c1 = new DistanceConstraint(platform, wheel, platformAnchor1, wheel.internalCenterOfMass, 0, .2f, 0);
DistanceConstraint c2 = new DistanceConstraint(platform, wheel, platformAnchor2, wheel.internalCenterOfMass, 0, .2f, 0);
DistanceConstraint c3 = new DistanceConstraint(platform, wheel, platformAnchor3, wheel.internalCenterOfMass, 0, .2f, 0);
where platformAnchor1, 2, and 3 are three different locations on the platform.

Since the distance constraints all connect to the same spot on the wheel, its angular motion will be unaffected. The three separate platform connections restrict unwanted relative linear motion.
Post Reply