Aug 5, 2009 at 1:40 AM
Edited Aug 5, 2009 at 3:34 AM
I have looked through the threads and some of the simple tutorials and I have noticed there really is not to much on how the planetary gravity works. As it stands right now me and a friend are developing a game with the farseer engine. We managed
to get the planetary force working, but there seem to be something off. In order to get the gravity to actually work our strength value has to be upwards of 500000, which seems a bit extreme to me. I thought I would raise a quesiton to see if this
Besides this I was wondering if there was a way to make it so that the planetary force only be exerted on select objects. For instance I have the player object which is supposed to be pulled in by the gravity and another object "a bat the
players companion" which floats around him but does not collide with anything or have gravity enabled. Well the bat does not collide with the gravity orb object but it is pulled in by the force. So would there be a way to just shut off the
planetary gravity for just the bat object.
As well as I'm going to just throw up my code for how I got it working so that incase anyone else is looking for how to get it to work, cause had to hunt for a couple hours to find everything I needed. this code is for xna:
gravity = ComplexFactory.Instance.CreateGravityController(World.Instance.PhysicsSimulator, bodyList, FarseerGames.FarseerPhysics.GravityType.Linear, 750000, 300);
bodyList is a list of type body.
One other thing the guy I'm working with said he couldn't get the distanceSquared function to work instead of the Linear. Not sure if its a glitch, but any heads up would be nice. thnx