Planet demo extension

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
sergiusz308
Posts: 49
Joined: Mon Oct 08, 2012 4:57 pm

Planet demo extension

Post by sergiusz308 »

Hi Norbo, I trying to get entity (satellite) spinning around other, on elliptical, parametrized orbit, as physically correct as possible.

Simplest, I think, approach would be just to apply LinearVelocity to the satellite on each update to keep it on the orbit of the parent entity - is this would work?

Another option is to modify Planet Demo code but I'm struggling getting it right.

As I understand the demo: GravitationalField counters gravitation force that influences boxes and pulls them back, to the center of planet entity making them orbiting around planet.

How I would parametrized GravitationFiled to spin them around arbitrary axis, i.e. Worlds Y?

Thanks,
S.
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Planet demo extension

Post by Norbo »

Simplest, I think, approach would be just to apply LinearVelocity to the satellite on each update to keep it on the orbit of the parent entity - is this would work?
That would work, though it isn't 'physically correct'. If there's a specific path you want, then something like this is probably the right choice. An actual simulation would tend to diverge after a while- especially if something happened to slam into it.
As I understand the demo: GravitationalField counters gravitation force that influences boxes and pulls them back, to the center of planet entity making them orbiting around planet.
There is no gravity to counter in that particular demo, it's just set to 0. The GravitationalField is just pulling objects toward the center. The thing that makes them orbit rather than just fall is their starting velocity.
How I would parametrized GravitationFiled to spin them around arbitrary axis, i.e. Worlds Y?
No change would be required in the GravitationalField; just give them a different starting position/velocity. Right now they start at the top and move to the right. If you instead spawned them at the front (near the camera) and sent them towards the right, they would form a horizontal ring instead.
Post Reply